PDA

View Full Version : [ANNOUNCE] headset-control : Make the headset button actually manipulate tracks.


qwerty12
06-22-2008, 03:09 AM
This daemon monitors when the button on the headset is pressed and makes the media player pause the playing song.

Download: Attached. (http://www.internettablettalk.com/forums/attachment.php?attachmentid=1890&d=1214147420)

Install instructions :

Install deb.
Run Media player or Canola.
Play a track.
Press headset button.
Enjoy as song pauses.
If you wish, edit /usr/lib/hsetctrl/hsetctrl.py to change the program it runs.



Credits:

Brendan Smithyman for the original python code to do this with a Bluetooth headset and the xte binary. (http://www.internettablettalk.com/forums/showthread.php?p=168236)
koos_ for providing a sample dbus_send for osso_media_server which I changed heavily to match the pause event
The kagu guys who already have this implemented in their brilliant media player. (I took some code from there :/): http://kagumedia.com/projects/kagu/browser/trunk/src/kagu/maemo.py
jgallen23 for SlideLock (some files/installer stuff taken from there): http://www.internettablettalk.com/forums/showthread.php?t=19386
/me for putting all this together and finding the dbus stuff (ok some) and fixing little bugs and using dbus instead of xte ;)


Media players supported by the default configuration:

The built-in, included media player with OS2008.
Canola*


"Configurations" available:
Default - This config uses dbus-send to send a pause message to the osso-media-server. So this config would only work with those players that use osso-media-server.
MPlayer - This one uses key-presses sent via xte to manipulate mplayer. Pressing the headset button will send a Return key press and pause the playing video.

Your Own. - Make your own command run when you press the button. If your program can be controlled by dbus, run dbus-monitor and make a dbus-send command. Or if by key presses, find out which one and make xte send that key press. Also, for example, on the bitsmithy website, there is a command to run flite to speak the time.

The original script to do this with a Bluetooth headset used xte to control the built in media player. I replaced that xte command with the dbus one as it didn't require focus to be on the media player window.
I don't really have an easy way to switch so edit /usr/bin/hsetctrl.py as root, manually. I've put comments in the file.

*For canola, it only works for playing/pausing the music by default as that uses osso-media-server. Movies won't work for example because that uses mplayer. But it wouldn't be hard to find the key press event and make the headset-control app run that instead.

(BTW. If anyone is into headset modding, grab the kernel source and look at retu-headset.c)

(If you get unable to install (it probably won't say that but for me it does (with EVERY program that adds something to init), do this:
sudo gainroot
mv /etc/rc2.d/S99hsetctrl /etc/rc2.d/S99hsetctrl1
apt-get -f install
mv /etc/rc2.d/S99hsetctrl1 /etc/rc2.d/S99hsetctrl
)

EDIT: Version 0.2 uploaded. Little bugs fixed.

tz1
07-12-2008, 05:21 PM
I needed the python-dbus support installed.

Also, it doesn't seem to work. I have an aliph jawbone on an n810 with diablo. I get:

signal sender=:1.0 -> dest=(null destination) path=/com/nokia/osso_hp_ls_controller; interface=com.nokia.osso_hp_ls_controller.headset; member=button_pressed
signal sender=:1.0 -> dest=(null destination) path=/com/nokia/osso_hp_ls_controller; interface=com.nokia.osso_hp_ls_controller.headset; member=button_released

when I press and release, not the hal events.

qwerty12
07-12-2008, 05:25 PM
Well, this is for the wired headset. (My bad, I should have mentioned that). if you want to use a bluetooth headset, check out www.bitsmithy.net

tz1
07-13-2008, 12:11 PM
I forgot the original headset had that button. Actually this might be even better.

Laughing Man
07-13-2008, 09:48 PM
I always wondered what that even did by default (I never figured it out).

sakamoto
07-13-2008, 10:19 PM
That's great!! Working fine with the bundle headset, Thanks!:)

But seem like can't work with my another headset, which is come with my N81 phone :(

Saka

Saturn
07-26-2008, 07:20 PM
I always wondered what that even did by default (I never figured it out).

one thing it does by default is to answer or end a call in the 'internet call' application.

ericcmi
07-27-2008, 04:39 PM
Would it be possible to make this compatible with both bluetooth headset button as well as wired button?

That would be much appreciated among the community.

Or even dream up a way that makes it possible for people to easily change the event of the button press from a seprate file so that the function of the button can be changed easily simply by overwriting a file.

but really, the community has been waiting for a way to pause canola with a bluetooth headset button for a very very long time.

Thanks for the work.

ericcmi
07-28-2008, 02:09 AM
I tried to hack this together myself.
But its not working.
I used the deb installer and replaced /usr/lib/hsetvtrl/hsetctrl.py with the below script which used dbus to start and stop canola/mplayer.

If i run just 'dbus-send --dest=com.nokia.osso_media_server /com/nokia/osso_media_server com.nokia.osso_media_server.music.pause' in the terminal while canola is running I get a working play/pause system. However this does not work when trying to use it in the script below.


Here's the script I am using:
#!/usr/bin/env python2.5
from dbus.mainloop.glib import DBusGMainLoop
DBusGMainLoop(set_as_default=True)

import dbus
import gobject
import os

def main():

dbus_loop = gobject.MainLoop()
bus = dbus.SystemBus()


def on_button_pressed (sender=None):
os.system('run-standalone.sh dbus-send --dest=com.nokia.osso_media_server /com/nokia/osso_media_server com.nokia.osso_media_server.music.pause 2> /dev/null 1> /dev/null')


headset = bus.get_object('com.nokia.osso_hp_ls_controller', '/com/nokia/osso_hp_ls_controller')
headset_iface = dbus.Interface(headset, dbus_interface='com.nokia.osso_hp_ls_controller.he adset')
headset_iface.connect_to_signal('button_pressed', on_button_pressed, sender_keyword='sender')

dbus_loop.run()

if __name__ == "__main__":
main()


Do you see any flaws? Why does my bluetooth button not calling the dbus command properly? I'm not to certian what all is done by the deb installer, and im a python newb. so, any comments are welsome.

Nif
10-14-2008, 02:54 AM
Hi

I see there has been no activity for some time on this thread but I will still give my question a try:

What are the commands to put into the code to enable play/pause while having Canola configured with mplayer for the music?

Background is that I want to use mplayer in stead of oms in Canola to boost the volume. I also want the play/pause functionality described here which works very nicely with oms running for music. So I now just want best of both worlds ;-)

McLightning
09-17-2009, 09:34 AM
i need to remove it
everytime i try to install something on terminal
it says
The package headsetcontrol needs to be reinstalled but i cant find an archive for it

gazza_d
10-12-2009, 08:25 AM
This is great! Cannot believe I have missed this before now.

Thanks

aboaboit
11-04-2009, 07:50 AM
This daemon monitors when the button on the headset is pressed and makes the media player pause the playing song.

Great idea, I rushed to install it on my N900 then... nada. I tried closing mediaplayer and restarting, no-go. Considering the date of your post, this is probably someting for Diablo, right?

qwerty12
11-04-2009, 10:34 AM
Yes.

I may make a MAFW-utilizing version, but I do rather hate MAFW. :-)

qwerty12
11-08-2009, 07:38 AM
I may make a MAFW-utilizing version, but I do rather hate MAFW. :-)

Hmm: Pressing the button on my headset does not make HAL emit any signals on DBus' system/session busses. :/

DaSilva
01-01-2010, 11:07 AM
I have a controller for the wired headset from the Nokia 5800 with Play/Pause/Next/Previous/Stop/Louder/Lower and it doesn't work with the N900. Could you make it work with this script? It is called AD-54 (http://www.nokia.com.au/MEDIA_BANK_100/R6Accessories/H/HS45,_AD-54/hs45-ad54_312X312.jpg)

Bec
01-11-2010, 12:06 PM
I suggested we would create a control panel applet that could recognize the input from various headsets,
please check my brainstorm here:

http://maemo.org/community/brainstorm/view/headset_button_input_reader

Thanks

peio
01-11-2010, 12:14 PM
Hello

For those who use hifi headphones without buttons, would it be possible to use the camera key to control music playback when the device is locked?

For example:
- half press => play/pause
- entire press => next
(- double entire press => previous)

I don't have the skills to do that, but it would work with every headphones

Bec
01-11-2010, 12:35 PM
Hello

For those who use hifi headphones without buttons, would it be possible to use the camera key to control music playback when the device is locked?

For example:
- half press => play/pause
- entire press => next
(- double entire press => previous)

I don't have the skills to do that, but it would work with every headphones

Or long volume press - next/previous track.

@peio
You could submit a new brainstorm, just click one(first 3) from my status to get there faster since loading the first page of brainstorm takes ages and then post your idea.

Just put it in your status like me so people can notice it.

P.M. if you take my advice, Ill vote for it :D

peio
01-11-2010, 12:50 PM
Thanks, I submitted a brainstorm but it's short because I'm not good in english. I also put your idea but I prefer mine ;)

See here:
http://maemo.org/community/brainstorm/view/control_music_playback_with_the_camera_key/

OVK
01-18-2010, 10:18 AM
Hmm: Pressing the button on my headset does not make HAL emit any signals on DBus' system/session busses. :/

Is this on N900 and with default headset?

If so, does this mean that N900 does not sense the button press when the N900 is on default state, but it needs an incoming call to trigger something so that the call can be answered with a headset button press?

andrei1089
01-18-2010, 10:20 AM
Is this on N900 and with default headset?

If so, does this mean that N900 does not sense the button press when the N900 is on default state, but it needs an incoming call to trigger something so that the call can be answered with a headset button press?
I have tried with the default headset and there's no Dbus signal emitted when the button is pressed.

Bec
01-18-2010, 10:29 AM
Would it be possible to test other headsets or create a special Dbus state to sniff out any inputs?

If you tell me how I can test Hs-43 (N82 headset) and the headset that 5800 comes with.

Patience required, I'm quite new with linux/dbus and might not understand what I have to do from the first attempt.

andrei1089
01-18-2010, 10:34 AM
Would it be possible to test other headsets or create a special Dbus state to sniff out any inputs?

If you tell me how I can test Hs-43 (N82 headset) and the headset that 5800 comes with.

Patience required, I'm quite new with linux/dbus and might not understand what I have to do from the first attempt.
You can sniff dbus by running dbus-monitor (for session bus) and dbus-monitor --system (for system bus).

OVK
01-18-2010, 10:39 AM
Would it be possible to test other headsets or create a special Dbus state to sniff out any inputs?

If you tell me how I can test Hs-43 (N82 headset) and the headset that 5800 comes with.

I could try to test Nokia AD-54 remote.

Although I am quite sure that nothing will be recognized by N900: if the default headset does not generate any Dbus events the same is probably true also for other headsets.

EDIT: AD-54 seems to be the remote that comes with Nokia 5800 so you probably also have that one.

Wimmert
01-18-2010, 03:41 PM
the ad-54 comes with the 5800 and it is the best remote nokia made.
It has:
Volume control
Play/pause
Next/previus.
Microphone
answer key for in comming calls.
a lock key
And 3,5 mm jack fot your headset.
It is also a fm antenna

The best thing is that you can leave n900 in your jacket an control you music player.
And you can answer the phone and talk handsfree.

So i realy hope that someone can make it work.
I am not a programmer but i was i would make work of it!


I post it also on the nokia forum but it gets pused away by people who can not:confused::mad: rtfm :mad:and ask questions that are answered bij the manual!

Bec
01-18-2010, 04:08 PM
@ Wimmert
Don't forget to also vote it: http://maemo.org/community/brainstorm/view/headset_button_input_reader/

Bec
01-18-2010, 04:36 PM
You can sniff dbus by running dbus-monitor (for session bus) and dbus-monitor --system (for system bus).

Ok, and how do I do that? didn't find any apps for this...

HtheB
01-18-2010, 05:00 PM
I also have the AD-54 headphones...

Hope this will work soon and will find it in the repos :D

buxz777
01-18-2010, 05:08 PM
has anyone used the ad-54 with their n900

when i plug mine in with my sony ex 300 headphones , it will only play out of the right ear bud

anyone else noticed this or is my ad-54 broken :-) thanks

shadowjk
01-18-2010, 05:43 PM
my ad-54 gives audio from both earbuds for me, but obviously the buttons do nothing.

Bec
01-18-2010, 05:46 PM
d-bus tutorial... anyone???

OVK
01-19-2010, 03:34 AM
d-bus tutorial... anyone???

I am not an expert, this is just something that I found from the Google:
http://linux.die.net/man/1/dbus-monitor

So it seems that you just need to open xterm and type dbus-monitor (and you can also give some more specific attributes to this command). Works for me (although I don't know how to exit the dbus-monitor), I just don't understand most of the output... I also don't know if it would be better to run this as root.

Unfortunately I could not find my AD-54 for testing.

Bec
01-19-2010, 05:06 AM
I've done some tests with the music lpayer and the phone in the background:

Default headset:
string "group"
variant string "alarm"
}
struct {
string "limit"
variant int32 100
}
]
array [
struct {
string "group"
variant string "event"
}
struct {
string "limit"
variant int32 100
}
]
array [
struct {
string "group"
variant string "inputsound"
}
struct {
string "limit"
variant int32 0
}
]
array [
struct {
string "group"
variant string "systemsound"
}
struct {
string "limit"
variant int32 0
}
]
array [
struct {
string "group"
variant string "background"
}
struct {
string "limit"
variant int32 100
}
]
array [
struct {
string "group"
variant string "idle"
}
struct {
string "limit"
variant int32 100
}
]
]
)
dict entry(
string "com.nokia.policy.context"
array [
array [
struct {
string "variable"
variant string "call_audio_type"
}
struct {
string "value"
variant string "none"
}
]
array [
struct {
string "variable"
variant string "call"
}
struct {
string "value"
variant string "inactive"
}
]
array [
struct {
string "variable"
variant string "mode"
}
struct {
string "value"
variant string "media"
}
]
]
)
dict entry(
string "com.nokia.policy.audio_route"
array [
array [
struct {
string "type"
variant string "sink"
}
struct {
string "device"
variant string "headset"
}
struct {
string "mode"
variant string "hs"
}
struct {
string "hwid"
variant string "na"
}
]
array [
struct {
string "type"
variant string "source"
}
struct {
string "device"
variant string "headset"
}
struct {
string "mode"
variant string "na"
}
struct {
string "hwid"
variant string "na"
}
]
]
)
]
signal sender=:1.10 -> dest=(null destination) serial=5023 path=/org/freedesktop/Hal/Manager; interface=org.freedesktop.Hal.Manager; member=DeviceAdded
string "/org/freedesktop/Hal/devices/computer_logicaldev_input_1"
HS-43
string "limit"
variant int32 0
}
]
array [
struct {
string "group"
variant string "fmradio"
}
struct {
string "limit"
variant int32 0
}
]
array [
struct {
string "group"
variant string "othermedia"
}
struct {
string "limit"
variant int32 0
}
]
array [
struct {
string "group"
variant string "alarm"
}
struct {
string "limit"
variant int32 100
}
]
array [
struct {
string "group"
variant string "event"
}
struct {
string "limit"
variant int32 100
}
]
array [
struct {
string "group"
variant string "inputsound"
}
struct {
string "limit"
variant int32 0
}
]
array [
struct {
string "group"
variant string "systemsound"
}
struct {
string "limit"
variant int32 0
}
]
array [
struct {
string "group"
variant string "background"
}
struct {
string "limit"
variant int32 100
}
]
array [
struct {
string "group"
variant string "idle"
}
struct {
string "limit"
variant int32 100
}
]
]
)
dict entry(
string "com.nokia.policy.context"
array [
array [
struct {
string "variable"
variant string "call_audio_type"
}
struct {
string "value"
variant string "none"
}
]
array [
struct {
string "variable"
variant string "call"
}
struct {
string "value"
variant string "inactive"
}
]
array [
struct {
string "variable"
variant string "mode"
}
struct {
string "value"
variant string "media"
}
]
]
)
dict entry(
string "com.nokia.policy.audio_route"
array [
array [
struct {
string "type"
variant string "sink"
}
struct {
string "device"
variant string "headset"
}
struct {
string "mode"
variant string "hs"
}
struct {
string "hwid"
variant string "na"
}
]
array [
struct {
string "type"
variant string "source"
}
struct {
string "device"
variant string "headset"
}
struct {
string "mode"
variant string "na"
}
struct {
string "hwid"
variant string "na"
}
]
]
)
]
signal sender=:1.10 -> dest=(null destination) serial=5135 path=/org/freedesktop/Hal/Manager; interface=org.freedesktop.Hal.Manager; member=DeviceAdded
string "/org/freedesktop/Hal/devices/computer_logicaldev_input_1"


And shutting down a call with the default headset:
signal sender=:1.9 -> dest=(null destination) serial=745 path=/com/nokia/mce/signal; interface=com.nokia.mce.signal; member=sig_call_state_ind
string "none"
string "normal"
signal sender=:1.16 -> dest=(null destination) serial=21 path=/com/nokia/policy/decision; interface=com.nokia.policy; member=status
uint32 37
uint32 1
signal sender=:1.22 -> dest=(null destination) serial=57 path=/com/nokia/policy/decision; interface=com.nokia.policy; member=status
uint32 37
uint32 1
signal sender=:1.10 -> dest=(null destination) serial=5234 path=/org/freedesktop/Hal/devices/bme; interface=org.freedesktop.Hal.Device; member=PropertyModified
int32 2
array [
struct {
string "battery.voltage.current"
boolean false
boolean false
}
struct {
string "battery.reporting.current"
boolean false
boolean false
}
]
signal sender=:1.17 -> dest=(null destination) serial=1006 path=/com/nokia/phone/net; interface=Phone.Net; member=registration_status_change
byte 0
uint16 1610
uint32 1015399
uint32 10
uint32 226
byte 0
byte 3
signal sender=:1.17 -> dest=(null destination) serial=1007 path=/com/nokia/phone/net; interface=Phone.Net; member=operator_name_change
byte 0
string "RO ORANGE"
string ""
uint32 10
uint32 226
signal sender=:1.17 -> dest=(null destination) serial=1008 path=/com/nokia/phone/net; interface=Phone.Net; member=cell_info_change
byte 2
uint16 1610
uint32 1015399
uint32 10
uint32 226
byte 0
byte 0


On my previous Nokia there were two input reader programs (eg.magickey) that were allowing you to change the action of a specific key either on a global profile, for the entire device, or for certain applications, chosen by you.

However none of these programs could "sniff out" the headset input.
The only guys to almost master this function were the guys at mobifactor.ru - 4 out of 5 buttons.
CorePlayer could recognize one aswell... but those are ol' symbian times

OVK
01-19-2010, 06:12 AM
I also ran it but I had no Idea what to do once it started... didn't seem like it was reading or waiting for signals...

It does show at least some signals. Try plugging in a headset, it definatively makes an effect.

andrei1089
01-19-2010, 06:18 AM
I am not an expert, this is just something that I found from the Google:
http://linux.die.net/man/1/dbus-monitor

So it seems that you just need to open xterm and type dbus-monitor (and you can also give some more specific attributes to this command). Works for me (although I don't know how to exit the dbus-monitor), I just don't understand most of the output... I also don't know if it would be better to run this as root.

Unfortunately I could not find my AD-54 for testing.

you can exit dbus-monitor with Ctrl+C

mankir
01-19-2010, 06:25 AM
AD-54 is recognized as a headset, when plugged in. dmesg gives a message, input: headset button as /class/input/inputX. When i plug out and in again, the Number X is increased by 1. I think this is a bug...

Would be nice to get the other buttons working!

Bec
01-19-2010, 06:27 AM
Edited my previous post, added headset behaviors.

OVK
01-19-2010, 06:56 AM
On my previous Nokia there were two input reader programs (eg.magickey) that were allowing you to change the action of a specific key either on a global profile, for the entire device, or for certain applications, chosen by you.

However none of these programs could "sniff out" the headset input.
The only guys to almost master this function were the guys at mobifactor.ru - 4 out of 5 buttons.
CorePlayer could recognize one aswell... but those are ol' symbian times

What do you think, could it be possible to use the headphoned-app as a base for building this functionality in Maemo 5?

I mean this one: http://talk.maemo.org/showthread.php?t=33215

It sends a pause command to Mediaplayer when the headphones are unplugged. I think it could probably be useful to install the headphoned and test if/how the dbus-monitor output changes compared to your previous trials. Also the code is open so it could give a hint on how to make this type of functionality.

Bec
01-19-2010, 07:57 AM
Honestly, no. What was working in symbian programs like "MagicKey" was probably the dependency on a dbus-like feature in symbian.

Simply expecting an input in dbus doesn't work without a special application, like in our case the phone application.

But the most authorized person on this matter, is obviously qwerty12 (see first post) so you should ask him.

OVK
01-19-2010, 08:05 AM
Honestly, no. What was working in symbian programs like "MagicKey" was probably the dependency on a dbus-like feature in symbian.

Simply expecting an input in dbus doesn't work without a special application, like in our case the phone application.

But the most authorized person on this matter, is obviously qwerty12 (see first post) so you should ask him.

Did you check the headphoned app that I linked? It is for Maemo 5 and already sends one command (pause) to Mediaplayer.

andrei1089
01-19-2010, 08:24 AM
Did you check the headphoned app that I linked? It is for Maemo 5 and already sends one command (pause) to Mediaplayer.

The problem is not to send a pause message to Mediaplayer, but to catch the signal emitted when the button on the headset is pressed.

OVK
01-19-2010, 08:31 AM
The problem is not to send a pause message to Mediaplayer, but to catch the signal emitted when the button on the headset is pressed.

Yes. I was just thinking that because headphoned is already listening to the headphone state it could probably also be used (after some modifications) also to see if some signals are emitted from headphones.

If I am correct the phone app is listening (or the incoming/outgoing call awakes something that is listening) to the signals from the AV connector (it has to be, otherwise the call ending button would not work). I think it should be possible to make also other apps to sense the button presses. I thought that headphoned would have been a logical place to start the investigations/additions.

I asked thp, the author of the headphoned, in other thread if I have understood his app correctly.

OVK
01-19-2010, 09:31 AM
OK, I thought this a bit more and I think that I probably should clarify my thinking so that there is no misunderstandings.

As I see this, there are two things that are needed:
1. Button presses need to sensed by N900
2. Presses need to be translated to commands for Mediaplayer

For the requirement number 1:
As we now from dbus-monitor, in the normal state N900 does not sense the button presses from the headset. However, the call can be ended by the button press of the default headset. Now: what is awake and listening to the AV plug in this state? What awakes it (phone app or just incoming/outgoing call) How do we awake it without turning on the Phone app?

For the requirement number 2:
The headphoned also sends commands to Mediaplayer. I think that it would be relatively easy to expand the functionality to also send other commands. First we just need to find out what kind of signals different headsets send to N900. If I am correct, this could be probably found out with dbus-monitor when we first find out how to make the N900 aware of the button presses.

Does this make any sense to you more experienced users? Is there something that simply just cannot be done for some reason (technical limitation, I am suggesting wrong methods...). :confused:

After all, I am not a programmer, just a typical end user. :o

thp
01-19-2010, 01:35 PM
At least on Maemo 5 the headset button was exposed as a hal input device at /org/freedesktop/Hal/devices/platform_retu_headset_logicaldev_input

Check out the Panucci source for how it's used there (search for headset_button):

http://nikosapi.org/git/panucci/tree/src/panucci/dbusinterface.py
http://nikosapi.org/git/panucci/tree/src/panucci/panucci.py

Edit: After reading the whole thread, it seems like this is not working anymore on the N900..

Arif
01-19-2010, 01:40 PM
I haven't read the whole thread....but is it possible to write a driver for the remote included with the N95 ? :p

Bec
01-26-2010, 01:51 PM
We would like to address any headset model. Unfortunately receiving the signal from the headset is quite complicated.

Vote for this (see the link in my signature) to give this request more priority for developing.

lstoll
01-28-2010, 03:51 PM
Judging by Bec's dumps and having a quick look at the original code, it looks like the HID device for the headset changed from platform_retu_headset_logicaldev_input on pre N900 to computer_logicaldev_input_1 , which would stop the original code working.

Running something like this python script hacked from the code in kagu[1] would confirm this change, and what to listen for in an updated version of headset-control, or some new app: http://gist.github.com/289070

I also don't see any button messages in the dbus-monitor dump, however I'm not sure how dbus works - maybe items like this which are 'watched' won't show there?

Note this is just a theory, and untested - I don't have access to a N900 or know anything about dbus, just interested in buying one and concerned about getting the button to work with the media player!

([1] http://kagumedia.com/projects/kagu/browser/trunk/src/kagu/maemo.py)

andrei1089
01-29-2010, 06:24 AM
Judging by Bec's dumps and having a quick look at the original code, it looks like the HID device for the headset changed from platform_retu_headset_logicaldev_input on pre N900 to computer_logicaldev_input_1 , which would stop the original code working.

Running something like this python script hacked from the code in kagu[1] would confirm this change, and what to listen for in an updated version of headset-control, or some new app: http://gist.github.com/289070

I also don't see any button messages in the dbus-monitor dump, however I'm not sure how dbus works - maybe items like this which are 'watched' won't show there?

Note this is just a theory, and untested - I don't have access to a N900 or know anything about dbus, just interested in buying one and concerned about getting the button to work with the media player!

([1] http://kagumedia.com/projects/kagu/browser/trunk/src/kagu/maemo.py)

I've tried something similar with your code but didn't work. In fact it worked only during a phone call, so the phone application somehow activates the button.

lstoll
01-29-2010, 08:43 AM
I've tried something similar with your code but didn't work. In fact it worked only during a phone call, so the phone application somehow activates the button.

Interesting, so you received the click messages on dbus when the phone app was running? Did you have to be in a call for them to show up, or was just the app running sufficient?

Also, can anyone confirm if the button works to end skype and gtalk calls as well?

Trying to work out which part of the comm stack this is all happening..

Oh and lastly, what package does the phone ui app belong to? I've poked around in the repository an managed to find the translations, but not the binary itself.

Maybe I should just go down and buy one, will make this much easier.

andrei1089
01-29-2010, 09:48 AM
Interesting, so you received the click messages on dbus when the phone app was running? Did you have to be in a call for them to show up, or was just the app running sufficient?

Also, can anyone confirm if the button works to end skype and gtalk calls as well?

Trying to work out which part of the comm stack this is all happening..

Oh and lastly, what package does the phone ui app belong to? I've poked around in the repository an managed to find the translations, but not the binary itself.

Maybe I should just go down and buy one, will make this much easier.

Only during a phone call. Haven't tried with a Skype call.

andrei1089
02-01-2010, 09:43 AM
I've just tried with a Skype call, the signal is emitted.

qwerty12
02-09-2010, 08:47 AM
This is due to Nokia's policy system through OHM. Not much information is available on it and Nokia's plugins implementing the policies are closed source (as usual). The phone app switches the policy to phone mode which allows the D-Bus signal of the button being pressed to be broadcast and, AFAIK, blocks other sources of sound etc. so it wouldn't make sense to have the "phone" policy always activated...

All that I know about it is, policy changes are broadcast over D-Bus; some of the plugins have configuration settings in /usr/share/policy and the plugins themselves are closed source so if they can't be configured to allow broadcasting of the ButtonPressed signal all the time, we're SOL. Personally, I'd like to know if there is a sysfs entry that is changed when the button is pressed so that we can do what thp did: monitor the file. This way, we avoid ****ing with the undocumented and closed-source components of the Policy system.

OK, /usr/lib/ohm/libohm_buttons.so is the library responsible, AFAIK.

Perhaps not: "stop ohmd" doesn't result in anything... Still, I'd like to know if it has a sysfs entry :)

El Amir
03-01-2010, 12:34 AM
Does this mean that THIS (http://cgi.ebay.com/Nokia-AD-54-HS-45-Remote-Headphone-N900-/150391712721) is fake advertising ? :confused:

Bec
03-03-2010, 12:07 PM
Most probably.

shadowjk
03-04-2010, 03:04 PM
I have AD-54 as in the above ebay ad. The headphone passthrough works, and it gets recognized as headset instead of headphones. None of the buttons work. I'd assume the mic in ad-54 works but I have not tested.

gazza_d
03-09-2010, 06:55 PM
Don't suppose anyone has managed to get any information on or if the buttons on an AD-54 generate any useable signals on Maemo especially OS2008.

I've managed to trash my original headset which the button did work on, and am now going to use a spare AD-54. I can pause using headphoned, but unplugging is a bit clunky.

If anyone has any ideas, I am happy to test and have a play about. dbus-monitor, dbus-monitor --system, and dmesg all do not seem to register anything except plug/unplug events

sygys
03-30-2010, 06:47 AM
i contacted the maker of headphoned directly via message. but dont have any respons yet about if its possible to make it fix.

I dont understand it really... How is it possible with this amount of wizkids surfing around here that no one took this oppertunity to make it work.

Whats wrong with all these guys... do they ever listen to the none programmers? This is a feature many people want. i know there must be something possible. because the call button works when being in a call!

Instead people make garbage like n900fly.... im getting anoyed! i know its possible someone please make it!

andrei1089
03-30-2010, 07:12 AM
Instead people make garbage like n900fly.... im getting anoyed! i know its possible someone please make it!

It's not developers fault that there's no documentation on how to activate the headset button. You really shouldn't use those kind of words for an opensource application voluntarily developed.

Laughing Man
03-30-2010, 08:06 PM
i contacted the maker of headphoned directly via message. but dont have any respons yet about if its possible to make it fix.

I dont understand it really... How is it possible with this amount of wizkids surfing around here that no one took this oppertunity to make it work.

Whats wrong with all these guys... do they ever listen to the none programmers? This is a feature many people want. i know there must be something possible. because the call button works when being in a call!

Instead people make garbage like n900fly.... im getting anoyed! i know its possible someone please make it!

You want a certain feature? Find a developer willing to do it on their spare time. Most projects are the results of their interests. Can't? Then try paying them, I'm sure if you pay enough money you'll find someone willing to do it.

Just because people want it doesn't mean the developers on the forum is going work on it. For one thing the developers have a variety of skill, different code backgrounds, knowledge of the internal maemo OS, etc. Secondly, what they work on is from their own interest and often using their own time. Nokia isn't paying them. And I doubt they get alot of donations from people for the existing work they do. God knows I should probably get around to donating to the people I have on the Maepad list.

Bec
03-30-2010, 11:58 PM
I don't have anything against paying - as far as I'm concerned make it a paid app...

But the thing seems to be... we don't know what has to be activated so that the phone can recive commands from the headset via d-bus... things seem to have come to a halt...

Laughing Man
03-31-2010, 09:02 PM
I don't have anything against paying - as far as I'm concerned make it a paid app...

But the thing seems to be... we don't know what has to be activated so that the phone can recive commands from the headset via d-bus... things seem to have come to a halt...

The point wasn't that it should be a paid app or not. It was more that the developer works on this in his/her free time. Thus it's unreasonable to demand features or insult developers.

I do wish the N900 had more documentation of its more closed features though.

cb22
04-02-2010, 11:30 PM
I do wish the N900 had more documentation of its more closed features though.

I made a post about this at http://talk.maemo.org/showthread.php?p=589071

As you can see there are lots of replies :(
Perhaps filing a bug would be the correct thing to do?

cb22
04-02-2010, 11:50 PM
Cancel that above post, it seems I've found a way to do it :)
cat /sys/devices/platform/nokia-av/detect will give 4 when the button is not pressed, and 2 when it is pressed!

EDIT: Unfortunately, this seems to be useless, unless you feel like polling a file repeatedly for changes.

MrWeasel
04-03-2010, 03:17 AM
Considering how much CPU usage is generated by mediaplayer, indeed I feel like constantly polling a file rather than pulling out my n900 everytime I'd like to change the song (especially on the bike).

Besides: there is a program that does exactly the same for the proximity sensor (proximityd). I guess it would be quite easy to change the file and the dbus interface it generates.

Bec
04-03-2010, 03:20 AM
I'm sure there have to be more ingenious ways but if nothing else is at hand polling is excellent for me :D

qwerty12
04-03-2010, 03:48 AM
EDIT: Unfortunately, this seems to be useless, unless you feel like polling a file repeatedly for changes.

That's why you have inotify and the lovely GIOChannels. :)

If no one else wishes to have a go, I can give thp a patch for headphoned. No point in running two daemons...

Bec
04-03-2010, 03:58 AM
that would be great!

jaeezzy
04-03-2010, 04:22 AM
That's why you have inotify and the lovely GIOChannels. :)

If no one else wishes to have a go, I can give thp a patch for headphoned. No point in running two daemons...

that would be great also, if possible, i would love to have double clicking action to go to previous or sth.

andrei1089
04-03-2010, 04:27 AM
That's why you have inotify and the lovely GIOChannels. :)

If no one else wishes to have a go, I can give thp a patch for headphoned. No point in running two daemons...

Unfortunately, I don't think you can use inotify with sysfs

qwerty12
04-03-2010, 04:36 AM
Unfortunately, I don't think you can use inotify with sysfs

That would explain why my usage of inotify-tools didn't help much...

thp uses a GIOChannel to monitor /sys/devices/platform/gpio-switch/headphone/state and headphoned sleeps for most of the time so I guess using one to monitor the file cb42 told us about wouldn't do any harm...

@jaeezzy, that's a good idea. Will come up with logical ways to handle that one

Bec
04-03-2010, 04:45 AM
that would be great also, if possible, i would love to have double clicking action to go to previous or sth.

There's a brainstorm about this also: http://maemo.org/community/brainstorm/view/headset_button_input_reader/

-support input gestures such as double tap and long press

andrei1089
04-03-2010, 06:09 AM
That would explain why my usage of inotify-tools didn't help much...

thp uses a GIOChannel to monitor /sys/devices/platform/gpio-switch/headphone/state and headphoned sleeps for most of the time so I guess using one to monitor the file cb42 told us about wouldn't do any harm...

@jaeezzy, that's a good idea. Will come up with logical ways to handle that one

I hacked a bit on the headphoned code adding another watch for the file /sys/devices/platform/nokia-av/detect but it doesn't detect any change

Then I've tried with inotifywait for both files /sys/devices/platform/nokia-av/detect and /sys/devices/platform/gpio-switch/headphone/state
I've been surprised to see that a change is detected only for the latter. So I think there's no other way than polling the file.

qwerty12
04-03-2010, 06:21 AM
So I think there's no other way than polling the file.

Indeed. Nokia's ****ish behaviour regarding this is pissing me off. I'm tempted to upload a nokia-av.ko file that doesn't disable the button.

--

I've figured out what happens: When inserting a headset, /usr/lib/ohm/libohm_accessories.so will register it to the system as plain headphones. Plain headphones do not have a button, so why would pressing it do anything? When the policy changes to "phone", this file will re-register the headset as a - *gasp* - headset; this is why (if you monitor HAL) you "see" the headphones being "removed and reinserted".

Making a replacement /usr/lib/ohm/libohm_accessories.so that would register the headset in the first place as a headset wouldn't be hard work (riiiight...) thanks to IDA Pro and the examples of plugins found in the OHM package but there's no point when you can just modify nokia-av.ko to not disable the button, which is what I will be doing soon. **** you, Nokia, and your stupid decisions.

cb22
04-04-2010, 12:37 PM
I hacked a bit on the headphoned code adding another watch for the file /sys/devices/platform/nokia-av/detect but it doesn't detect any change

Then I've tried with inotifywait for both files /sys/devices/platform/nokia-av/detect and /sys/devices/platform/gpio-switch/headphone/state
I've been surprised to see that a change is detected only for the latter. So I think there's no other way than polling the file.

Yeah, that's what I thought of doing originally, but then after playing around a bit more (my kernel hacking knowledge is pretty much limited to printk's) I realized that all sysfs does is call a relevant piece of code in the driver, that value doesn't exist until you actually read it.


Making a replacement /usr/lib/ohm/libohm_accessories.so that would register the headset in the first place as a headset wouldn't be hard work (riiiight...) thanks to IDA Pro and the examples of plugins found in the OHM package but there's no point when you can just modify nokia-av.ko to not disable the button, which is what I will be doing soon. **** you, Nokia, and your stupid decisions.

I looked over nokia-av.c and I probably missed the code that actually handles the disabling... I ended up wading through twl-madc before eventually going to bed. It would be awesome to finally be able to use the damn button... Good luck :)

rojicha07
04-04-2010, 02:17 PM
Hi:

I am completely new at this, but I would like that when I press the button of the headset, the song changes (instead of pause it)... how can I do this?

Any help would be appreciated...

Thanks!

cb22
04-04-2010, 03:47 PM
Hi:

I am completely new at this, but I would like that when I press the button of the headset, the song changes (instead of pause it)... how can I do this?

Any help would be appreciated...

Thanks!

At the moment, it is impossible to even get events from pressing the button, so it can't be done at the moment (not even pausing). Unless you have an N810 / N800.

NLChris
04-07-2010, 12:43 PM
Cancel that above post, it seems I've found a way to do it :)
cat /sys/devices/platform/nokia-av/detect will give 4 when the button is not pressed, and 2 when it is pressed!

EDIT: Unfortunately, this seems to be useless, unless you feel like polling a file repeatedly for changes.

This only works on the standard black inear headset (with the white plugs)

It does not work with the AD-43 & HS-45 Stereo Headset, then it returns 0 :confused: I'd do anything to help with this issue. Unfortunately i have no experience in linux kernel programming. :(

e0x
04-19-2010, 09:53 AM
Indeed. Nokia's ****ish behaviour regarding this is pissing me off. I'm tempted to upload a nokia-av.ko file that doesn't disable the button.

--

I've figured out what happens: When inserting a headset, /usr/lib/ohm/libohm_accessories.so will register it to the system as plain headphones. Plain headphones do not have a button, so why would pressing it do anything? When the policy changes to "phone", this file will re-register the headset as a - *gasp* - headset; this is why (if you monitor HAL) you "see" the headphones being "removed and reinserted".

Making a replacement /usr/lib/ohm/libohm_accessories.so that would register the headset in the first place as a headset wouldn't be hard work (riiiight...) thanks to IDA Pro and the examples of plugins found in the OHM package but there's no point when you can just modify nokia-av.ko to not disable the button, which is what I will be doing soon. **** you, Nokia, and your stupid decisions.

any luck with this ?

qwerty12
05-15-2010, 09:32 AM
Oh, yes, baby; you bet your *** there's progress!

Here's how to enable it:
Open the file /usr/share/policy/etc/current/alsaped.conf and replace "jackbias-off = jack-bias: off" with "jackbias-off = jack-bias: on"; reboot and watch the System bus.

I will be uploading an "enabler" package to extras-devel later on today along with a quick daemon that pauses/plays a track in the Media Player. Ultimately, if thp allows it, I'd like to get it into headphoned but thp uses libdbus and I like dbus-glib...

cb22
05-15-2010, 09:38 AM
Awesome work, might I ask how you managed to figure it out? I was searching high and low for what the phone app did, but didn't manage to find anything... Actually, I think I even recall taking a snapshot using alsa-ctl, then restoring it after hanging up, but I still didn't notice a change.

qwerty12
05-15-2010, 09:52 AM
Well, I figured it was time to come good on my promise so I grabbed the kernel source and started reading Nokia's Kernel Guide.
Anyway, after making unsuccessful modifications to drivers/misc/nokia-av.c and sound/soc/rx51.c to try and force it to enable the button even if "a normal pair of headphones" are plugged in (my understanding of electronics is even worse than my coding skills), I realised that having the mic enabled along with the button are mutually exclusive (this "bias" stuff).

Since my attempts at hackihg the driver failed, I looked at what was actually doing the disabling on the users' side: the Policy system. Did a grep in /usr/share/policy for "bias" and found a text file that could be exited. Made disabling the bias the same thing as enabling it and rebooted it in hope.

rajil.s
05-16-2010, 06:22 AM
I will be uploading an "enabler" package to extras-devel later on today along with a quick daemon that pauses/plays a track in the Media Player. Ultimately, if thp allows it, I'd like to get it into headphoned but thp uses libdbus and I like dbus-glib...

any luck with the 'enabler' package?

Cheers

qwerty12
05-16-2010, 06:29 AM
any luck with the 'enabler' package?

Cheers

It's in -devel. It's rather useless without anything utilizing it, however, so I'm still in the process of porting of Headset Control to C (MAFW-only ATM) :)

tym81
05-16-2010, 02:06 PM
Oh, yes, baby; you bet your *** there's progress!

Here's how to enable it:
Open the file /usr/share/policy/etc/current/alsaped.conf and replace "jackbias-off = jack-bias: off" with "jackbias-off = jack-bias: on"; reboot and watch the System bus.

I will be uploading an "enabler" package to extras-devel later on today along with a quick daemon that pauses/plays a track in the Media Player. Ultimately, if thp allows it, I'd like to get it into headphoned but thp uses libdbus and I like dbus-glib...

Hello,
I have a Maemo 5/PR1.1 :

Nokia-N900-51-1:~# uname -a
Linux Nokia-N900-51-1 2.6.28.10power-omap1 #1 PREEMPT Thu Apr 15 00:30:53 EEST 2010 armv7l unknown


I have not found "bias" in "/usr/share/policy" :confused:

I have just add to /usr/share/policy/etc/current/alsaped.conf this line :

jackbias-off = jack-bias: on

and reboot, but the dmesg or dbus-monitor command don't detect headphone buttons.

Any idea ?

Thanks in advance.

tym.

qwerty12
05-17-2010, 01:46 PM
I have not found "bias" in "/usr/share/policy" :confused:


Hello,

You sure? I have it here and the only thing that differs is that I'm using LPR 1.2.

Anyway, just pushed Headset Control 0.2 to Extras (http://repository.maemo.org/extras-devel/dists/fremantle/install/headset-control.install)-devel (http://repository.maemo.org/extras-devel/pool/fremantle/free/source/h/headset-control/).

[Insert standard, usual Extras-devel warning]

By default - when pressing the button - it tells MAFW to pause/play the track.
If you set the GConf key /apps/headset-control/next-mode to true, a press will result in it skipping to the next track in whatever state the Media Player is currently in (Paused/Stopped/Playing etc.)

Implementing a "if button held" functionality would've been nice, but the only time a signal gets emitted is when the button is depressed.
A "delay between presses" functionality would've also been nice, but it seems the nokia-av module enforces a mandatory delay before you can press the button again. It's too long, IMO, for any sort of delay in the program for sending different commands.

Also, because the ability for a signal to be emitted when pressing the signal was intermittent, Headset Control will force the button to be enabled (if a Nokia headset is plugged in, of course) on startup and 5 seconds after a call is ended. (Code snippet here: http://slexy.org/view/s21Wl6YqxI)

Best regards.

MohammadAG
05-17-2010, 02:04 PM
Hello,

You sure? I have it here and the only thing that differs is that I'm using LPR 1.2.

Anyway, just pushed Headset Control 0.2 to Extras (http://repository.maemo.org/extras-devel/dists/fremantle/install/headset-control.install)-devel (http://repository.maemo.org/extras-devel/pool/fremantle/free/source/h/headset-control/).

[Insert standard, usual Extras-devel warning]

By default - when pressing the button - it tells MAFW to pause/play the track.
If you set the GConf key /apps/headset-control/next-mode to true, a press will result in it skipping to the next track in whatever state the Media Player is currently in (Paused/Stopped/Playing etc.)

Implementing a "if button held" functionality would've been nice, but the only time a signal gets emitted is when the button is depressed.
A "delay between presses" functionality would've also been nice, but it seems the nokia-av module enforces a mandatory delay before you can press the button again. It's too long, IMO, for any sort of delay in the program for sending different commands.

Also, because the ability for a signal to be emitted when pressing the signal was intermittent, Headset Control will force the button to be enabled (if a Nokia headset is plugged in, of course) on startup and 5 seconds after a call is ended. (Code snippet here: http://slexy.org/view/s21Wl6YqxI)

Best regards.

Not working here, dmesg doesn't show anything about a button press.
[ 3669.544677] wlan0: no IPv6 routers present
[ 4989.052886] headphone (GPIO 177) is now connected
[ 4990.585937] input: headset button as /class/input/input4
[ 4990.896972] kb_lock (GPIO 113) is now closed
[ 4991.083923] kb_lock (GPIO 113) is now open
[ 4992.263610] slide (GPIO 71) is now open
[ 5003.388519] slide (GPIO 71) is now closed
[ 5076.966796] headphone (GPIO 177) is now disconnected
[ 5084.677673] headphone (GPIO 177) is now connected
[ 5085.795196] input: headset button as /class/input/input5
MohammadAG-N900:~#

qwerty12
05-17-2010, 02:26 PM
Not working here, dmesg doesn't show anything about a button press.
[ 3669.544677] wlan0: no IPv6 routers present
[ 4989.052886] headphone (GPIO 177) is now connected
[ 4990.585937] input: headset button as /class/input/input4
[ 4990.896972] kb_lock (GPIO 113) is now closed
[ 4991.083923] kb_lock (GPIO 113) is now open
[ 4992.263610] slide (GPIO 71) is now open
[ 5003.388519] slide (GPIO 71) is now closed
[ 5076.966796] headphone (GPIO 177) is now disconnected
[ 5084.677673] headphone (GPIO 177) is now connected
[ 5085.795196] input: headset button as /class/input/input5
MohammadAG-N900:~#


What about "dbus-monitor --system"?
Also, what does "cat /sys/devices/platform/nokia-av/type" return? With the HS-48's I have, it returns 4.
Is it actually running (sorry, I'm not used to writing Upstart scripts)?
If you have ltrace installed, you can check what it's doing - a press of the headset button should lead it into the function that gets called when the button gets pressed; you should see it calling "mafw_renderer_*".
If you have syslog running, messages emited by the object will be sent there.
Also, you may need to start playing from the desktop widget initially to populate the playlist (I don't know enough about MAFW to attempt it myself, alas).

Finally, if it still doesn't work, maybe Nokia added the jackbias stuff in PR 1.2 :confused:

gazza_d
05-17-2010, 02:35 PM
It's in -devel. It's rather useless without anything utilizing it, however, so I'm still in the process of porting of Headset Control to C (MAFW-only ATM) :)

MAFW-only? I don't suppose that means OS2008 at some point does it? Or have I got more chance of a date with Paris??

not expecting anything btw!

qwerty12
05-17-2010, 02:37 PM
MAFW-only? I don't suppose that means OS2008 at some point does it? Or have I got more chance of a date with Paris??

not expecting anything btw!

No, but what's wrong with the deb in #1?

On OS2008, it's only possible to pause/play tracks unless you work for Nokia...

MohammadAG
05-17-2010, 02:49 PM
http://pastebin.com/DDwUjEQT

Headset type is also 4 here.

MohammadAG-N900:~# ps x | grep headset
2119 user 5504 S /usr/bin/headset-control
2199 root 2088 S grep headset
MohammadAG-N900:~#

E: bah, it worked just to make me look like an idiot :p

gazza_d
05-17-2010, 02:50 PM
Nothing, and it works very well, although my headset is bolxed, and all of the replacements I can lay my hands on are AD-54s on which the button doesn't do anything.. I kinda gathered that this patch worked with them. apologies if I misunderstood.

manavs
05-17-2010, 03:25 PM
Thanks!! Works great. Would it be possible to support HS-45 in the future? That would really make this sweet.

Biga
05-18-2010, 05:11 AM
I've installed headset-control 0.2, but it doesn't work. File /usr/share/policy/etc/current/alsaped.conf doesn't have the jackbias-off line.

At what point should I insert this line? There are a lot of sections.

manavs
05-18-2010, 05:22 AM
I've installed headset-control 0.2, but it doesn't work. File /usr/share/policy/etc/current/alsaped.conf doesn't have the jackbias-off line.

At what point should I insert this line? There are a lot of sections.

If you install the application, you don't need to edit any files. Just plug in your headset, play music and use the button to play/pause.

Biga
05-18-2010, 05:52 AM
It doesn't work.

/sys/devices/platform/nokia-av/type is 4,

dbus-monitor --system doesn't show anything on button press.

/usr/bin/headset-control is running.

grep jack /usr/share/policy/etc/current/alsaped.conf gives nothing,

uname -a
Linux Nokia-N900-42-11

MohammadAG
05-18-2010, 05:56 AM
Hmm, it might be related to 1.2 then (I'm not running the leaked release but I'm using 1.2 packages ['twas a painful install])

manavs
05-18-2010, 05:58 AM
Possibly, running the leaked fw here.

qwerty12
05-18-2010, 06:18 AM
Thanks!! Works great. Would it be possible to support HS-45 in the future? That would really make this sweet.

The nokia-av module would have to be modified for this, I guess (no idea if the N900 supports it hardware-wise). Since I don't have said headset and I had trouble figuring out the relevant sections in the module when trying to figure it out with one headset, I'm not the person to ask.

I've installed headset-control 0.2, but it doesn't work. File /usr/share/policy/etc/current/alsaped.conf doesn't have the jackbias-off line.

At what point should I insert this line? There are a lot of sections.

As mentioned, this could be (leaked-) PR 1.2 only. I don't have the inclination to downgrade and test; sorry.

Though, while you're at it, could you try this:

Issue "killall headset-control";
Plug in your headphones; and
run "headset-control", all from X Terminal?


If that works, then I can work around it by making Headset Control automatically enable the microphone when the headset is plugged in. (Yes, you'd have thought it would be common sense for me to have done this already...)
If not, then I guess this is really PR 1.2-only (unless someone running PR 1.1 figures out a way :)).

There's a logic fail in Headset Control; it only enables the microphone upon startup if it's already plugged in. With PR 1.2, this was done for me by the modification in alsaped.conf, but I made the assumption that PR 1.1 also had it.

Biga
05-18-2010, 06:29 AM
Though, while you're at it, could you try this:
Issue "killall headset-control";
Plug in your headphones; and
run "headset-control", all from X Terminal?

No, it doesn't help.
So, well, Iooking forward to official fw update.

gavinmitchell
05-18-2010, 07:01 AM
Quick query ... do you think this functionality would work in reverse ?

i.e. could you send a dbus command to close the switch on the phone side, thereby triggering something in the outside world ?

I'm thinking that it could be used to code a timelapse trigger app for my DSLR ?

Thanks

tym81
05-18-2010, 03:34 PM
Hello


I have not found "bias" in "/usr/share/policy" :confused:



You sure? I have it here and the only thing that differs is that I'm using LPR 1.2.

Yes :rolleyes:, maybe this thing is available from PR1.2


Anyway, just pushed Headset Control 0.2 to Extras (http://repository.maemo.org/extras-devel/dists/fremantle/install/headset-control.install)-devel (http://repository.maemo.org/extras-devel/pool/fremantle/free/source/h/headset-control/).


I have install "headset-control" (thank you :) for it).

So, I don't work in a normal way, I have do the following step :

Though, while you're at it, could you try this:

Issue "killall headset-control";
Plug in your headphones; and
run "headset-control", all from X Terminal?



and it work now for WH-205 but not for AD-54.

Thanks,

tym.

qwerty12
05-18-2010, 03:44 PM
Hello,


Yes :rolleyes:, maybe this thing is available from PR1.2


Seems like it :)


So, I don't work in a normal way, I have do the following step :


and it work now for WH-205 but not for AD-54.


Yes, this was explained previously by me. In short: I'm too stupid to get it working for AD-54s.

Though, if that works, install this deb and you shouldn't have to do it manually anymore:
https://garage.maemo.org/builder/fremantle/headset-control_0.3/results/headset-control_0.3_armel.deb

(It should've been in Extras-devel, but the Autobuilder ****ed up :rolleyes:)

Best regards.

toxaris
05-19-2010, 02:20 AM
A script that makes BH-903 full functional, would be cool.
If someone got the time.

F2thaK
05-19-2010, 02:43 AM
the app wont install on my n900

lpr1.2, in app manager it d/l's but while installing I get error: unable to install

tym81
05-19-2010, 02:58 AM
Hello,



Though, if that works, install this deb and you shouldn't have to do it manually anymore:
https://garage.maemo.org/builder/fremantle/headset-control_0.3/results/headset-control_0.3_armel.deb



I have install it and it work very well :), thanks ;).

So, I have not understand how to configure the headset button :


By default - when pressing the button - it tells MAFW to pause/play the track.
If you set the GConf key /apps/headset-control/next-mode to true, a press will result in it skipping to the next track in whatever state the Media Player is currently in (Paused/Stopped/Playing etc.)


Sorry :rolleyes:, can you explain more please ?

Best regards.

Biga
05-19-2010, 05:00 AM
I guess,
gconftool-2 --set /apps/headset-control/next-mode --type bool true

Maybe it would be better to make this default behavior?

F2thaK
05-19-2010, 05:06 AM
wouldnt install thru app manager, but got it installed thru xterm, had to apt-get upgrade.... anyway, works great! thanks

qwerty12
05-19-2010, 05:55 AM
the app wont install on my n900

lpr1.2, in app manager it d/l's but while installing I get error: unable to install

Sorry, I ****ed up in one for the scripts. It should've been fixed, but I'll have to check when I get home to verify

A script that makes BH-903 full functional, would be cool.
If someone got the time.

It'll take a lot more than a script, believe me...

I guess,
gconftool-2 --set /apps/headset-control/next-mode --type bool true

Maybe it would be better to make this default behavior?

Meh, I was sticking to what the original Headset Control does. I have no inclination of changing the default behaviour.

Anyway, Headset Control will only install in PR 1.2. It's probably possible to install it under PR 1.1 as Headset Control will do the enabling by itself but you will have to force an install of the 0.3 version (http://repository.maemo.org/extras-devel/pool/fremantle/free/h/headset-button-enabler/headset-button-enabler_0.3_all.deb)of headset-button-enabler as the latest version checks to see if jackbias is actually in alsaped.conf.

F2thaK
05-19-2010, 06:05 AM
sorry but I have to say this for 2 reasons,

GET IN MY BELLY!

because:

of your avatar
and Im starving!! dinner time!

tym81
05-19-2010, 11:48 AM
Hello,

I guess,
gconftool-2 --set /apps/headset-control/next-mode --type bool true


Thanks :)

Biga
05-27-2010, 01:14 PM
Dear developer,
It may be possible to add sort of "double click" functionality. Just check /sys/devices/platform/nokia-av/detect state in a second after receiving "button release" event. The only problem is that the second click should be long enough, so it should be "short press + long press" combination. What do you think?

rx7
05-30-2010, 05:39 PM
Hi to all

Is there any posibility to make N900 volume buttons, works as SE's walkmans? I mean when you keep pressed one of those buttons skip tracks... if some1 can do that would be really nice!
thanks in advance

Alex Atkin UK
05-30-2010, 06:27 PM
Hi to all

Is there any posibility to make N900 volume buttons, works as SE's walkmans? I mean when you keep pressed one of those buttons skip tracks... if some1 can do that would be really nice!
thanks in advance

I was thinking perhaps make the camera button skip tracks if the shutter is closed. Quick click to skip back, long to skip forward. That way I can quickly repeat the current track by pressing shutter, skip back by double press and forwards by holding it down.

rx7
06-02-2010, 03:41 PM
Bump! some linux guru! help plz! =)

Bec
06-02-2010, 04:23 PM
I was thinking perhaps make the camera button skip tracks if the shutter is closed. Quick click to skip back, long to skip forward. That way I can quickly repeat the current track by pressing shutter, skip back by double press and forwards by holding it down.

Long press of volume buttons would be nicer IMHO.

rx7
06-02-2010, 07:30 PM
yes yes, skip tracks with long pressing volume buttons... same as Sony ericsson's walkmans... no mattering if phone is locked or not....
lets hope some Linux guru read this post and helps =)

James_Littler
06-12-2010, 07:03 AM
does anyone know if anything is arround to get the ad54 media keys working? Nokia really let themselves down with the quality of the headphones included with the n900, I had the n86 previously and the ability to plug my seinheiser headphones into the ad54 and control the media player will be sorely missed.

I've read through this thread and realise headphone control 0.2 wont do what I want, I've endlessly googled and come up with nothing but a few rather pissed off individuals in the same boat as me.

cheers

hassan_badredin
06-12-2010, 09:59 AM
yes pleeeease someone that can do it do it pleasseeeee!!!!
support for remote control headset !!!
i still have the one from my N95 8Gb and i would really like to use it!!!

bchliu
06-15-2010, 09:34 AM
yes pleeeease someone that can do it do it pleasseeeee!!!!
support for remote control headset !!!
i still have the one from my N95 8Gb and i would really like to use it!!!

+1 on that.. :)

A bit disappointed that it doesnt work out of the box with the N900 since I thought it works on them all (worked on the N97!!)..

rnb89
06-30-2010, 02:03 AM
The new Mediabox uses osso-media-player but headset control fails to send "next track" signal to it.. any ideas on how to fix it.?

HomesIckAlien
07-09-2010, 07:51 AM
bump.....is anyone still engaged in this?

There are a lot of audiophiles out there....

Sam

pursueky
07-09-2010, 07:56 AM
mine has the same problem

bchliu
07-10-2010, 11:51 PM
Dunno why the wired headphones dont have this by default. I've started to use a Philips BT one and the controls work fine (pause, play, next, back, volume etc). The same routines should be used for the wired!!

msa
07-19-2010, 11:15 AM
Dunno why the wired headphones dont have this by default. I've started to use a Philips BT one and the controls work fine (pause, play, next, back, volume etc). The same routines should be used for the wired!!

the problem is, the standard headset that comes with the n900 only has 1 button.

@ topic: would it be possible to assign 2 actions to the button? 1 short click for play/pause and long-click for skip song for example?

James_Littler
07-19-2010, 11:21 AM
@ topic: would it be possible to assign 2 actions to the button? 1 short click for play/pause and long-click for skip song for example?


There's already an app for that in extras-devel, can't remember the exact name, something like headphone-control daemon.

What we need is for the AD-54 to work.

sph
08-09-2010, 03:26 PM
What we need is for the AD-54 to work.

Does AD-54 work for you with n900 at all? I've got some older HS-45 + AD-43 headset and neither button works. I wonder if it's the headset broken or "headset-control" problem. I was planning to buy a new HS-45 + AD-54, but now I see no point.

shadowjk
08-10-2010, 01:28 PM
AD-54 does not work. It's not listed as compatible with N900 either.

sph
08-12-2010, 07:11 AM
I know that, I was asking if there any luck using it with headset-control.

AgogData
08-14-2010, 03:48 AM
how can i reach the (GConf key/apps/headset-control) ??

Breathoffire
08-14-2010, 10:35 PM
how can i reach the (GConf key/apps/headset-control) ??

That's what i'm trying to figure out too :/

AgogData
08-15-2010, 02:18 PM
i've been going everywhere in the root and didn't found out
i guess neither the creator of the application knows

techie
08-16-2010, 04:13 AM
how can i reach the (GConf key/apps/headset-control) ??

That's what i'm trying to figure out too :/
You are supposed to type the following command as is in terminal

I guess,
gconftool-2 --set /apps/headset-control/next-mode --type bool true

Maybe it would be better to make this default behavior?

To set it back put false instead of true.You can also use a gconf editor (risky if you don't know what you are doing) from repos to do the above.

HtheB
08-16-2010, 07:14 AM
AD-54 does not work. It's not listed as compatible with N900 either.

Is it possible to get this to work? (Maybe in a future release?)

shadowjk
08-16-2010, 08:35 AM
Well nobody knows how it actually works, or if N900 is able to energize whatever microcontroller sits in it. Heck, we don't even know if it actually transmits commands over the cable or if it sneakily creates a bluetooth connection.

AgogData
08-17-2010, 02:26 AM
You are supposed to type the following command as is in terminal



To set it back put false instead of true.You can also use a gconf editor (risky if you don't know what you are doing) from repos to do the above.

i've tried (gconftool-2 --set /apps/headset-control/next-mode --type bool true) in terminal but didn't get me anywhere i guess it was "wrong input"

techie
08-17-2010, 03:20 PM
i've tried (gconftool-2 --set /apps/headset-control/next-mode --type bool true) in terminal but didn't get me anywhere i guess it was "wrong input"
Didn't take you anywhere?? where did you think it will take you. Where do u wanna go? The command simply changes the behavior of the headset button to switch to next track instead of pausing.The value "false" makes the button pause/play the song again.It isn't going to take you anywhere:rolleyes:

AgogData
08-17-2010, 07:11 PM
Didn't take you anywhere?? where did you think it will take you. Where do u wanna go? The command simply changes the behavior of the headset button to switch to next track instead of pausing.The value "false" makes the button pause/play the song again.It isn't going to take you anywhere:rolleyes:

by not taking me anywhere i meant leads to nothing and leads to nothing is not like i'm in the road and i took the wrong way so it lead to nothing its just expression
anyway in the terminal it says "gconftool-2 --set is not a command type gconftool-2 --help for help" and in help didn't really help me

did u do it and worked ?

joerg_rw
08-26-2010, 09:20 AM
all multi button wired headsets won't work with N900 without massive wizardry to the AV detection drivers. Maybe hardware is completely incapable of dealing with them.
A usual one button headset simply shorts the mic ring to ground on button push, that's why mic ceases to record during button hold, and that's also the reason mic(-bias) has to be enabled for button to work.
I probed on one of those multi button wired Nokia headsets, and found no reasonable behaviour of mic, by using a voltmeter for resistance probing. As I got no N95 or similar, I wasn't able to probe the thing in action, so protocol used to signal button press is unknown (maybe it's really BT as shadowjk suggested :-P). Without one of a) headset schematics, b) N95 (or similar) schematics, c) protocol specs, the only way to find out is somebody with N95 and MB headset and scope does some probing.
Until then, no luck with multi button, positively

[edit] meanwhile somebody allowed me to have a look at N95 schematics, and it seems the *hardware* isn't that much different to N900 for AV. Means it might be actually feasible to implement proper support for multibutton wired headsets, by patching the kernel drivers. Still missing is a proper analysis or spec of the protocol

/j

vivmak
09-10-2010, 07:40 AM
all multi button wired headsets won't work with N900 without massive wizardry to the AV detection drivers. Maybe hardware is completely incapable of dealing with them.
A usual one button headset simply shorts the mic ring to ground on button push, that's why mic ceases to record during button hold, and that's also the reason mic(-bias) has to be enabled for button to work.
I probed on one of those multi button wired Nokia headsets, and found no reasonable behaviour of mic, by using a voltmeter for resistance probing. As I got no N95 or similar, I wasn't able to probe the thing in action, so protocol used to signal button press is unknown (maybe it's really BT as shadowjk suggested :-P). Without one of a) headset schematics, b) N95 (or similar) schematics, c) protocol specs, the only way to find out is somebody with N95 and MB headset and scope does some probing.
Until then, no luck with multi button, positively
/j

Really usefull, should have read this first !:)

ejasmudar
09-21-2010, 12:53 PM
This is kind of like a feature request. What I want is that after pausing, when we press the button again, instead of directly playing, I want the media player to start slightly, say 2 secs, early.

This way, when I am listening to podcasts, i don't lose the thread of what i was listening to. I was looking through the source but my experience in c is only rudimentary, Any help is greatly appreciated.

msa
09-21-2010, 03:13 PM
what if i'm listening to music and i receive a call?
afair, music stops when a call comes in. when if i then use the button to accept the call? does the call have a higher priority in detecting the button-push?

slender
09-21-2010, 03:24 PM
@msa
Well on factory default n900 camera shutter button doesn´t answer phone so what are you asking?

msa
09-21-2010, 03:28 PM
@msa
Well on factory default n900 camera shutter button doesn´t answer phone so what are you asking?

-.-

i'm not asking about the camera-button, but the headset-button.

slender
09-21-2010, 03:30 PM
wups. Thought that this is another thread. Sorry. My mistake.

vivmak
10-13-2010, 08:10 AM
Can anyone help in using the following commands to control the media player from the Nokia headphone as shown in the picture below
--mp-play [/path/file] Open the file specified in the media player.
--mp-pause Pause media player playback
--mp-stop Stop media player playback
--mp-resume Resume media player playback
--mp-next Skip to the next track
--mp-prev Skip to the previous track
--notify [message] Show a one-line notification
--dialog [message]

http://c5.img.digitalriver.com/gtimages/store-mc-uri/nokia/assets/local/en-GB/product_images/3758575.jpg

ejasmudar
10-13-2010, 09:30 AM
@vivmak, I dont think that is possible. I am not sure but I think I remember reading somewhere on these forums that that type of remote control headphones are not supported.

AgogData
10-13-2010, 12:10 PM
if i wanna make the button to play next track then i should edit /usr/lib/hsetctrl/hsetctrl.py ? edit it by n900's notes ?

tym81
10-24-2010, 11:08 AM
Hello,

I have try to compile nokia-av module source :

http://mxr.maemo.org/fremantle/find?string=nokia-av&tree=fremantle&hint=

on a scratchbox by reading the following guide :

http://wiki.maemo.org/Documentation/Maemo_5_Developer_Guide/Kernel_and_Debugging_Guide/Maemo_Kernel_Guide

I have no problem when I compile the nokia-av module but it don't work when I install it on my N900 device.

I have the following error :

Nokia-N900:/tmp/test# insmod nokia-av.ko
insmod: error inserting 'nokia-av.ko': -1 Unknown symbol in module

and when I check dmesg, I have the following errors :

[106620.456512] nokia_av: Unknown symbol queue_delayed_work
[106620.457611] nokia_av: Unknown symbol platform_driver_unregister
[106620.458923] nokia_av: Unknown symbol __gpio_get_value
[106620.460418] nokia_av: Unknown symbol gpio_free
[106620.464782] nokia_av: Unknown symbol __gpio_to_irq
[106620.466033] nokia_av: Unknown symbol __create_workqueue_key
[106620.467041] nokia_av: Unknown symbol platform_driver_register
[106620.468109] nokia_av: Unknown symbol destroy_workqueue
[106620.469940] nokia_av: Unknown symbol sysfs_create_group
[106620.477264] nokia_av: Unknown symbol gpio_direction_input
[106620.479278] nokia_av: Unknown symbol sysfs_remove_group
[106620.482086] nokia_av: Unknown symbol gpio_request
[106646.095092] nokia-av nokia-av: accessory detect module initialized

Can anyone help me to make working my beta nokia-av module please ?

Regards,

dchky
11-02-2010, 10:04 PM
Does anyone have headset-control working in PR1.3?

fuyoh
11-03-2010, 06:44 AM
Does anyone have headset-control working in PR1.3?

works fine here

dchky
11-03-2010, 08:38 AM
works fine here

Thanks - everything looks right, it just doesn't work...

When I kill headset-control I get "Attempt to remove filter function 0x4014a1f8 user data (nil), but no such filter has been added"

stnguyen90
11-24-2010, 07:49 PM
is it possible to add more functionality. It'd be nice to have press once for pause/play and press twice for next track.

AgogData
11-30-2010, 09:07 AM
did any1 make it to 'next track' insted of pause/play ?

Khasis
12-01-2010, 08:08 AM
is it possible to add more functionality. It'd be nice to have press once for pause/play and press twice for next track.

Yes, that would be so great!!


fot make the next track :

Xterminal

sudo gainroot
gconftool-2 --set /apps/headset-control/next-mode --type bool true

AgogData
12-01-2010, 05:46 PM
Yes, that would be so great!!


fot make the next track :

Xterminal

sudo gainroot
gconftool-2 --set /apps/headset-control/next-mode --type bool true

thanks alot :)

gravisrs
12-02-2010, 12:13 PM
Simple idea to improve this app.

how about implementing 2-clicks, 3-clicks etc. for different controls ?

1-click = play / pause / receive call / terminate call
2-click = next
3-click = prev
4-click = next album/playlist (if possible)
etc..

Such things are quite simple to code even for python beginners.

maverick788us
12-13-2010, 08:25 AM
I recently installed Headset Control but the navigation keys of Nokia WH-500 still does'nt work. Do I have to configure something in X-Terminal?

joerg_rw
12-13-2010, 08:47 AM
I recently installed Headset Control but the navigation keys of Nokia WH-500 still does'nt work. Do I have to configure something in X-Terminal?
N900 does NOT support multibutton headsets.
Please reread the thread.
/j

edit: In an attempt to keep noise low, I'll answer next post in this one: http://talk.maemo.org/showthread.php?p=799047#post799047 READ THAT!
Which part of ""Please reread the thread."" was too complicated?

http://www.albinoblacksheep.com/flash/posting

((@ejasmudar #161: google "off topic" and "signal to noise ratio", muse why I didn't answer your post (though you actually *might* even get thanks on it), then think again if you might figure why I try to keep my thanks ratio high. Ooh the rationale is in my signature as well. And yes, I occasionally delete posts I think are of too little help, to save users from wasting time having to read them))

maverick788us
12-13-2010, 08:51 AM
N900 does NOT support multibutton headsets.
Please reread the thread.
/j

I don't know what you mean by multi-button, but I have'nt seen any nokia headset which does'nt have multiple button.

Just like any other Nokia Headset WH-500 has all those navigation keys, Rewind, fwd, Pause/Play, Volume and call receive/end

ejasmudar
12-13-2010, 11:10 PM
--------------------------------------------------------------------

My thanks/post ratio is dropping to <6, so any post with <=6 thanks is likely to get deleted eventually. If you think a post was useful: click >>[Thanks!]
Otherwise I have no feedback to improve the quality of my answers



Mate, i appreciate your answers and all, but man, that is such a douchebag move. Are you telling me that if less than 6 people thank your post, you will delete and don't want others to benefit from it in the future? Why the heck do you want thanks/post ratio to be > 6???

Don't you know that helping people is ultimately a thankless job and that it is not done for fame/fortune?

djmvt
12-14-2010, 03:19 AM
I don't know what you mean by multi-button, but I have'nt seen any nokia headset which does'nt have multiple button.

Just like any other Nokia Headset WH-500 has all those navigation keys, Rewind, fwd, Pause/Play, Volume and call receive/end

original n900 headset only has one button, this is also the only headset that does work properly with the n900.
All other nokia headsets are not supported by the n900...

joerg_rw
12-14-2010, 04:55 AM
original n900 headset only has one button, this is also the only headset that does work properly with the n900.
All other nokia headsets are not supported by the n900...
That's not exactly correct. N900 supports this kind of headsets only. Any random walkman-compatible headset/headphone should be supported, and if it has a single hold-button then that is supported as well.

N900 is built according to Class OMTP ConA1 in http://members.omtp.org/Lists/ReqPublications/Attachments/36/OMTP_Local_Connectivity_Wired_Analogue_Audio_v1_0. pdf, and the one button we're talking about here works as specified in LC-0080 in that document.

cheers
jOERG

maverick788us
12-14-2010, 05:27 AM
original n900 headset only has one button, this is also the only headset that does work properly with the n900.
All other nokia headsets are not supported by the n900...

I agree that the default headset shipped with N900 has only one button that is used for answering and ending a call.

If I am not wrong Headset-Control is designed for music that he handles mediaplayer functions like pause/play, Revind, fwd etc.

So how is it helpful with N900 which consists of a headset with no Media keys?

mr id
12-14-2010, 08:31 AM
N900 is built according to Class OMTP ConA1 in http://members.omtp.org/Lists/ReqPublications/Attachments/36/OMTP_Local_Connectivity_Wired_Analogue_Audio_v1_0. pdf, and the one button we're talking about here works as specified in LC-0080 in that document.

Thanks joerg_rw, have been looking for a connector reference such as this.

ejasmudar
12-14-2010, 02:11 PM
OK now this is going too far. As the instigator of this off-topic, I apologise. BUT, I humbly ask Mr.Joerg_Rw to please consider changing you policy to the following;
Keep posts for a week/fortnight and delete those posts that have NO thanks. If atleast ONE person appreciates your post, keep it.

Sheesh, what am I doing here? Begging you not to delete your post???

Dancairo
12-14-2010, 02:45 PM
OK now this is going too far. As the instigator of this off-topic, I apologise. BUT, I humbly ask Mr.Joerg_Rw to please consider changing you policy to the following;
Keep posts for a week/fortnight and delete those posts that have NO thanks. If atleast ONE person appreciates your post, keep it.

Sheesh, what am I doing here? Begging you not to delete your post???

I completely agree with you about it going too far, and as such do apologise to others not involved in the off topic and will delete my OT posts so we can get back on.

Edit - Deleted..

sensortk
02-12-2011, 03:25 PM
why cant this package do both at a time, play/pause for single press and next song for long press ???? It'd be awesome
I thought this command would do it: gconftool-2 --set /apps/headset-control/next-mode --type bool true
but i unerstand now what it only does

edoiks
02-19-2011, 06:46 PM
Hi,

I found this:

https://patchwork.kernel.org/patch/450811/

It seems like a kernel patch for using advanced headsets like HS-45/AD-54 maybe someone (more skilled than me) can make it work with n900

joerg_rw
02-20-2011, 01:45 PM
Hi,

I found this:

https://patchwork.kernel.org/patch/450811/

It seems like a kernel patch for using advanced headsets like HS-45/AD-54 maybe someone (more skilled than me) can make it work with n900

Nice find, and indeed this tells us a bit about complexity of data exchange with those multibutton headsets.
Alas this driver is for moorestown platform it seems, and especially it is using a dedicated controller to actually communicate to the AV-jack, while this driver only talks to that controller unknown via I2C-bus. N900 has no such controller, the pity is we wouldn't need it as N95 also doesn't have and can do it - with a hardware rather similar to what we got in N900. But the real physical protocol that would tell us how to wiggle with the bits we have isn't mentioned with a single word in this kernel driver.
That's what I was thinking I found out with a few hours of reading the patch. I *might* be wrong.
Googling 5 min for ECI etc didn't yield any hits for decent specs on how the PHY level works, maybe somebody else is more lucky. With what we got now, we're only halfway there.

cheers
jOERG

[edit, thanks javispedro]

The ECI controller, as I2C device is the variable part of the system.
In this case it's microcontroller in I2C bus, but there are other
versions too.
There is no specification about these controller's internals, and those
are quite different.
It is also possible to use other buses too for connecting controller to
terminal, like SPI.
--> http://thread.gmane.org/gmane.linux.alsa.devel/81629/focus=81630

mr_jrt
02-20-2011, 06:21 PM
I'd love to help, I have a N95 and a variety of nokia headsets (and access to many more) and am happy to test things out for you, but I've not got the skills needed for reverse engineering the controls myself :(

I might also be able to (legitimately) borrow various old models of phone if that would help testing code...

gionni88
05-05-2011, 12:34 PM
I'm trying to use the nokia headphones button in my apps. Button pressed signal is emitted only when "jack bias" is on, so my aim is to set it on at app startup and disable it at app closing. I'm able to unmute it with alsamixer, but i'm not with amixer.

The command I use is:
amixer -qc0 cset iface=MIXER,name='Jack Bias Switch' unmute
but it doesn't activate it.

Phoenix986
07-04-2011, 04:10 PM
hi.. is possible to add support for someplayer?
http://talk.maemo.org/showthread.php?t=71809

trisha02
07-05-2011, 10:36 AM
is it possible for some player? can u make this that if we press it twice den it will play next son..and if we press it thrice it will play the previous song.it will be damn cool:)

trisha02
07-06-2011, 01:31 AM
i am using a sony ericsson headphone..it dint work..will it only work in nokia headphones?

eagle_linux
10-10-2011, 06:48 AM
Hi,

I'm another frustrated (sort of) HS-45 user. Is there anything I could do to further the developement of a kernel module to support the HS-45 (and possibly other headsets)? Wouldn't it be possible just to write a "dumb" module that just creates a device which returns every signal coming from the AV-connector of the N900?
And could a bounty help to develop a module? Or maybe pestering someone at Nokia/its hardware manufacturers to publish the neccessary specs for the hw?

I'd really love to see this thing working...

Regards,
Eagle_Linux

joerg_rw
10-10-2011, 09:06 AM
Hi,

I'm another frustrated (sort of) HS-45 user. Is there anything I could do to further the developement of a kernel module to support the HS-45 (and possibly other headsets)? Wouldn't it be possible just to write a "dumb" module that just creates a device which returns every signal coming from the AV-connector of the N900?

alas that's not the way this works.

And could a bounty help to develop a module? Or maybe pestering someone at Nokia/its hardware manufacturers to publish the neccessary specs for the hw?

I'd really love to see this thing working...

Regards,
Eagle_Linux

Well, recent "investigations" revealed that N9(50) harmattan *has* support for those multibutton wired headsets. So we might be able to backport parts of the driver stack to fremantle and integrate it into powerkernel. I've not yet looked into any harmattan sources for that, just studied the N9 schematics a bit so I learnt that the twl4030 companion chip there directly connects to the relevant pins of the AV-plug. Studying the datasheet of twl4030 was next to learn how all this works and how to adapt it for N900 where the hw is different, as for sure we won't get any support from Nokia for it.
Bounty usually doesn't help much, but donations sometimes improve the interest of devels to look into it ;-D

cheers
jOERG

eagle_linux
10-17-2011, 05:54 AM
Sure, just tell me where to donate ;)

karoltom
10-20-2011, 02:05 PM
not working for me. when i'm pressing headset button nothing happens. only when i've unplugged headphones, player paused the music. but i can't pause song or choose next by pressing headset button. Should i install sth else?

EDIT: I've installed manually headset-button-enabler_0.5_all.deb and headset-control_0.4_armel.deb and it's working now.

karoltom
12-06-2011, 04:51 AM
is it possible to skip forward actually played song, when button is held?

button shuld be pressed for 2 seconds and after that time songs will be forwarded for 10seconds.

It would be a great feature ;)

Also i'd like to report bug. When i'm listening a song and sb call me, then after ending call, button isn't changing song to next (my button is set to change song, not pause). I have to restart the phone to make it working again in that situation