maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Nokia N900 (https://talk.maemo.org/forumdisplay.php?f=44)
-   -   Getting key presses out of the headset button (https://talk.maemo.org/showthread.php?t=48798)

cb22 2010-03-31 01:30

Getting key presses out of the headset button
 
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...

midi-fighter 2010-04-07 06:49

Re: Getting key presses out of the headset button
 
hi :)

yesterday i had the same idea too and one thing could help us
if we could sync an bluetooth headset by nokia with play and skip buttons we could it see and would be able to copy it to the headset driver in the n900
or to check up which file is used by the headset deamon because with the deamon the n900 recognises if the headset plug is in and if you take it out from the phone it stops the musik like pressing once on the button from the iphone headset you know ?

great work keep it up ;)

im from germany and i know my english language is not the best sry for that :)

have a nice day!

johnel 2010-04-07 07:22

Re: Getting key presses out of the headset button
 
Keep going!

It will be great if you can pull this off.

Generally speaking this type of functionality should have been properly implemented by Nokia to begin with.

Thankfully you guys are giving it a try.

If you can keep updating this thread with your progress.


All times are GMT. The time now is 02:39.

vBulletin® Version 3.8.8