View Single Post
Posts: 82 | Thanked: 214 times | Joined on Jan 2010 @ Cape town
#1
I've been fiddling around with writing something along the lines of an iPod shuffle daemon for the N900, basically along the lines of press the headset button twice, and it will skip to the next song. Press it three times and it will go back. However, getting events out of the button on the headset seems to be almost impossible.

I've read through http://talk.maemo.org/showthread.php?t=21182 and tried it, which doesn't work. I've also used dbus-monitor, and no events are generated when pressing the button.

Digging a bit deeper, watching /dev/input/event4 using evtest also showed nothing, however, when a call was made an event was indeed registered by evtest. Rather interesting.

It seems as if the phone somehow enables the headset button. Looking through /sys/devices/platform/nokia-av and nokia-av.c it appears that "madc" holds some sort of voltage value. Anyhow, when the button is not "magically activated" by the phone app, this value hovers around 2 - 4. It stays like this regardless of music playing or button pressing. When a call is made however, this value jumps to ~800 or so, and pressing down the button drops it to ~22.

Kernel hacking isn't exactly my strength, so the solution to activate the button is probably sitting there in nokia-av.c glaring at me. I've also tried strace'ing a few processes, but none of them seem to reveal anything interesting...
 

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