Active Topics

 


Reply
Thread Tools
Posts: 355 | Thanked: 598 times | Joined on Sep 2009 @ Nizhny Novgorod, Russia
#121
I'm happy that it's useful for you
 

The Following 2 Users Say Thank You to Mitrandir For This Useful Post:
Posts: 133 | Thanked: 405 times | Joined on Mar 2012 @ Europe
#122
Hey Mitrandir!

I've monitored the state if /dev/input/jack, recorded some sequences that are generated when I plug in/out mic jack and then figured out how simulate these sequences using <linux/input.h>
Which steps have to be done to test it with the AV cable? Just "cat /dev/input/jack"?

Since my device doesn't recognize any connect events, maybe another tmo member can do the test?

Thanks again for the software!
 
Posts: 355 | Thanked: 598 times | Joined on Sep 2009 @ Nizhny Novgorod, Russia
#123
Yep, as far as I remember, I just did cat /dev/input/jack and then decoded received bytes using structs found in <linux/input.h>.

Sorry, but now I have no device for testing If somebody can record bytes from /dev/input/jack when inserting/ejecting TV jack, I can modify headphonefix to support them if needed.
 
wook_sf's Avatar
Posts: 640 | Thanked: 435 times | Joined on Oct 2011 @ rajvoSa BA
#124
I can...but...how to "record"?
__________________
~ # mv /usr/bin/smartsearch /usr/bin/stupidsearch
 
Posts: 355 | Thanked: 598 times | Joined on Sep 2009 @ Nizhny Novgorod, Russia
#125
just type in terminal:
Code:
cat /dev/input/jack >capture.log
(if it will say "Permission denied", then you need to re-run it as root)
then plug TV jack in, wait a couple of seconds and plug it out.
Then press Ctrl+C in terminal to stop capture.

Thank you
 

The Following User Says Thank You to Mitrandir For This Useful Post:
wook_sf's Avatar
Posts: 640 | Thanked: 435 times | Joined on Oct 2011 @ rajvoSa BA
#126
Originally Posted by Mitrandir View Post
just type in terminal:
Code:
cat /dev/input/jack >capture.log
(if it will say "Permission denied", then you need to re-run it as root)
then plug TV jack in, wait a couple of seconds and plug it out.
Then press Ctrl+C in terminal to stop capture.

Thank you
Now I feel little stupid
Code:
url removed
__________________
~ # mv /usr/bin/smartsearch /usr/bin/stupidsearch

Last edited by wook_sf; 2013-09-16 at 17:11.
 
Posts: 355 | Thanked: 598 times | Joined on Sep 2009 @ Nizhny Novgorod, Russia
#127
Thanks!

I've parsed your output and git this:
Code:
1 ev time=27467.292085  type=switch code=lineout value=insert
2 ev time=27486.015107  type=switch code=lineout value=eject 
3 ev time=27489.810884  type=switch code=lineout value=insert
4 ev time=27489.812684  type=switch code=video   value=insert
5 ev time=27497.307130  type=switch code=lineout value=eject 
6 ev time=27497.308015  type=switch code=video   value=eject
So, it seems that when you inserted TV cable, two events were generated: "lineout cable inserted", "video cable inserted" (lines 3, 4).
When you unplugged it, "lineout cable ejected", "video cable ejected" events were sent (lines 5, 6).

But, unfortunately, these are exactly same events headphonefix is sending for TV-Out

So, if current version of headphonefix is not working with TV-Out, then chances are that its impossible to get it working by means of generating such fake events. Sorry
 

The Following User Says Thank You to Mitrandir For This Useful Post:
wook_sf's Avatar
Posts: 640 | Thanked: 435 times | Joined on Oct 2011 @ rajvoSa BA
#128
I haven't tested with tv-out with old phone, unfortunately it's dead now and I can't test it
Mitrandir, how do you parse output? I want to write app that will monitor buttons on headphones to emulate focus and capture...
__________________
~ # mv /usr/bin/smartsearch /usr/bin/stupidsearch
 

The Following User Says Thank You to wook_sf For This Useful Post:
Posts: 355 | Thanked: 598 times | Joined on Sep 2009 @ Nizhny Novgorod, Russia
#129
Here is my simple C program which parses /dev/input/jack output: http://pastie.org/8330979

You will need to look into <linux/input.h> to see which constants might be used for headphone buttons. This program tests only SW_LINEOUT_INSERT and SW_VIDEOOUT_INSERT.

Note that input_event32 struct defined in this code is a copy of input_event defined in <linux/input.h>. I've redefined it here because the size input_event is different on 64-bit host than on 32-bit phone.
 

The Following 2 Users Say Thank You to Mitrandir For This Useful Post:
Posts: 6 | Thanked: 3 times | Joined on Oct 2013
#130
Hello everyone!
I recently found out this amazing thread!
well this problem came to me a month ago and i was desparate for solution as i use alot my n9 as music player in my car..
after that problem came across i found out while trying different kind of things thar rebooting phone with jack already connected was solving the problem..
Tha solution though was really annoying as i had to reatart the device many times ler day..
So here i.am after searching a lot in many forums!
First of all iwant to thanks a lot for the time you spent making this patch!!I really do apreciate this job!!
The power of a community is amazing!
i am crazy fan of N9 and i want to keep it as primary device fo a long time!
According to this topic now ,i will describe my tests and thoughts on it:

chapter I

I bought recently a new full housing for my black 64 Gb .
i went through replacing it carefully and lso did a full restore by reinstalling through ovi suite the os from the start.After job done first thing i did was to try if jack input was working again.
It finally work again and was really happy about that, but suddenly realised that the sound had poor quality and was like giving mono sound instead of.stereo.In fact in my.car's speakers the sound had half of his volume and only left speaker.was working..
I just went.crazy!and was trykng to figutr out what happened.
then after haging tried a lot of things withkut any.result i thought to switch the jack output of the device with the one tha was on my old housing.
So after doing that the problem recognising a jack connected appeared once again.I did a reboot with the wire connected ,it did give sound to the car's speakers normally with rich sound again!
So i kept the old jack output and installed your patch to mnually switch the sound.
And then i came across another problem.

chapter II

After installing your patch and while my device was giving output in my car's speakers i pressed the button to switch to speaker mode it did work and sound was coming from my n9's speaker.
Also tryied the opposite switching back to headphones mode and worked again giving sound to car's speakers!
I was so glad that i solved that weired problem.
So after all i think thats harware problem.itccant be software as when i just changed only the jack of the device it went back recognising headphones automatically regardless it had problem in sound quality(for which i guess its was faulty from factory thats why i found in really low price in ebay and it was 100 genuine like my original one as i bought my n9.i guess those chinaguys have access to factories returned faulty items )

chapter III

Now after i thought i was done with this problem i had a new one once again..
after a reboot i did on my phone today and output was set again, cause if reboot ,automatically on speakers mode i jumped in the car to give it a try and after pressing your patch's button it wasnt switching to headphones mode but keep on saying speakers mode activated every time i tried to switch.
So i went on reboot with jack connected.to car' speakers and worked again.
then after that when i was using the patch it was working like a charm again!
after trying it many times with success i thought to try a reboot without jack connected this time.
So once again patch stoped working with the same error (saying speakers activated every time iuse it.)
Am sorry for the lenght of my postcbut i had to describe.it in details so it get understood what really happens..

Any ideas now with those added information?
i hope a gave you a bit of help.

Last edited by facaldo; 2013-10-27 at 12:50.
 

The Following 2 Users Say Thank You to facaldo For This Useful Post:
Reply


 
Forum Jump


All times are GMT. The time now is 04:09.