maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Multimedia (https://talk.maemo.org/forumdisplay.php?f=32)
-   -   [ANNOUNCE] headset-control : Make the headset button actually manipulate tracks. (https://talk.maemo.org/showthread.php?t=21182)

cb22 2010-05-15 13:38

Re: [ANNOUNCE] headset-control : Make the headset button actually manipulate tracks.
 
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 2010-05-15 13:52

Re: [ANNOUNCE] headset-control : Make the headset button actually manipulate tracks.
 
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 2010-05-16 10:22

Re: [ANNOUNCE] headset-control : Make the headset button actually manipulate tracks.
 
Quote:

Originally Posted by qwerty12 (Post 659580)

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 2010-05-16 10:29

Re: [ANNOUNCE] headset-control : Make the headset button actually manipulate tracks.
 
Quote:

Originally Posted by rajil.s (Post 660609)
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 2010-05-16 18:06

Re: [ANNOUNCE] headset-control : Make the headset button actually manipulate tracks.
 
Quote:

Originally Posted by qwerty12 (Post 659580)
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 :
Code:

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 :

Code:

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 2010-05-17 17:46

Re: [ANNOUNCE] headset-control : Make the headset button actually manipulate tracks.
 
Quote:

Originally Posted by tym81 (Post 661147)
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-devel.

[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 2010-05-17 18:04

Re: [ANNOUNCE] headset-control : Make the headset button actually manipulate tracks.
 
Quote:

Originally Posted by qwerty12 (Post 662802)
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-devel.

[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.
Code:

[ 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 2010-05-17 18:26

Re: [ANNOUNCE] headset-control : Make the headset button actually manipulate tracks.
 
Quote:

Originally Posted by MohammadAG (Post 662829)
Not working here, dmesg doesn't show anything about a button press.
Code:

[ 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 2010-05-17 18:35

Re: [ANNOUNCE] headset-control : Make the headset button actually manipulate tracks.
 
Quote:

Originally Posted by qwerty12 (Post 660617)
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 2010-05-17 18:37

Re: [ANNOUNCE] headset-control : Make the headset button actually manipulate tracks.
 
Quote:

Originally Posted by gazza_d (Post 662879)
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 2010-05-17 18:49

Re: [ANNOUNCE] headset-control : Make the headset button actually manipulate tracks.
 
http://pastebin.com/DDwUjEQT

Headset type is also 4 here.

Code:

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 2010-05-17 18:50

Re: [ANNOUNCE] headset-control : Make the headset button actually manipulate tracks.
 
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 2010-05-17 19:25

Re: [ANNOUNCE] headset-control : Make the headset button actually manipulate tracks.
 
Thanks!! Works great. Would it be possible to support HS-45 in the future? That would really make this sweet.

Biga 2010-05-18 09:11

Re: [ANNOUNCE] headset-control : Make the headset button actually manipulate tracks.
 
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 2010-05-18 09:22

Re: [ANNOUNCE] headset-control : Make the headset button actually manipulate tracks.
 
Quote:

Originally Posted by Biga (Post 663723)
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 2010-05-18 09:52

Re: [ANNOUNCE] headset-control : Make the headset button actually manipulate tracks.
 
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 2010-05-18 09:56

Re: [ANNOUNCE] headset-control : Make the headset button actually manipulate tracks.
 
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 2010-05-18 09:58

Re: [ANNOUNCE] headset-control : Make the headset button actually manipulate tracks.
 
Possibly, running the leaked fw here.

qwerty12 2010-05-18 10:18

Re: [ANNOUNCE] headset-control : Make the headset button actually manipulate tracks.
 
Quote:

Originally Posted by manavs (Post 662962)
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.

Quote:

Originally Posted by Biga (Post 663723)
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 2010-05-18 10:29

Re: [ANNOUNCE] headset-control : Make the headset button actually manipulate tracks.
 
Quote:

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 2010-05-18 11:01

Re: [ANNOUNCE] headset-control : Make the headset button actually manipulate tracks.
 
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 2010-05-18 19:34

Re: [ANNOUNCE] headset-control : Make the headset button actually manipulate tracks.
 
Hello

Quote:

Originally Posted by tym81 (Post 661147)
I have not found "bias" in "/usr/share/policy" :confused:

Quote:

Originally Posted by qwerty12 (Post 663834)
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

Quote:

Originally Posted by qwerty12 (Post 663834)
Anyway, just pushed Headset Control 0.2 to Extras-devel.

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

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

Originally Posted by qwerty12 (Post 663834)
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 2010-05-18 19:44

Re: [ANNOUNCE] headset-control : Make the headset button actually manipulate tracks.
 
Hello,

Quote:

Originally Posted by tym81 (Post 664720)
Yes :rolleyes:, maybe this thing is available from PR1.2

Seems like it :)

Quote:

Originally Posted by tym81 (Post 664720)
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/fre..._0.3_armel.deb

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

Best regards.

toxaris 2010-05-19 06:20

Re: [ANNOUNCE] headset-control : Make the headset button actually manipulate tracks.
 
A script that makes BH-903 full functional, would be cool.
If someone got the time.

F2thaK 2010-05-19 06:43

Re: [ANNOUNCE] headset-control : Make the headset button actually manipulate tracks.
 
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 2010-05-19 06:58

Re: [ANNOUNCE] headset-control : Make the headset button actually manipulate tracks.
 
Hello,

Quote:

Originally Posted by qwerty12 (Post 664729)

Though, if that works, install this deb and you shouldn't have to do it manually anymore:
https://garage.maemo.org/builder/fre..._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 :

Quote:

Originally Posted by qwerty12 (Post 664729)
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 2010-05-19 09:00

Re: [ANNOUNCE] headset-control : Make the headset button actually manipulate tracks.
 
I guess,
gconftool-2 --set /apps/headset-control/next-mode --type bool true

Maybe it would be better to make this default behavior?

F2thaK 2010-05-19 09:06

Re: [ANNOUNCE] headset-control : Make the headset button actually manipulate tracks.
 
wouldnt install thru app manager, but got it installed thru xterm, had to apt-get upgrade.... anyway, works great! thanks

qwerty12 2010-05-19 09:55

Re: [ANNOUNCE] headset-control : Make the headset button actually manipulate tracks.
 
Quote:

Originally Posted by f2thak (Post 665410)
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

Quote:

Originally Posted by toxaris (Post 665378)
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...

Quote:

Originally Posted by Biga (Post 665684)
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 of headset-button-enabler as the latest version checks to see if jackbias is actually in alsaped.conf.

F2thaK 2010-05-19 10:05

Re: [ANNOUNCE] headset-control : Make the headset button actually manipulate tracks.
 
sorry but I have to say this for 2 reasons,

GET IN MY BELLY!

because:

of your avatar
and Im starving!! dinner time!

tym81 2010-05-19 15:48

Re: [ANNOUNCE] headset-control : Make the headset button actually manipulate tracks.
 
Hello,

Quote:

Originally Posted by Biga (Post 665684)
I guess,
gconftool-2 --set /apps/headset-control/next-mode --type bool true

Thanks :)

Biga 2010-05-27 17:14

Re: [ANNOUNCE] headset-control : Make the headset button actually manipulate tracks.
 
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 2010-05-30 21:39

Re: [ANNOUNCE] headset-control : Make the headset button actually manipulate tracks.
 
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 2010-05-30 22:27

Re: [ANNOUNCE] headset-control : Make the headset button actually manipulate tracks.
 
Quote:

Originally Posted by rx7 (Post 690641)
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 2010-06-02 19:41

Re: [ANNOUNCE] headset-control : Make the headset button actually manipulate tracks.
 
Bump! some linux guru! help plz! =)

Bec 2010-06-02 20:23

Re: [ANNOUNCE] headset-control : Make the headset button actually manipulate tracks.
 
Quote:

Originally Posted by Alex Atkin UK (Post 690717)
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 2010-06-02 23:30

Re: [ANNOUNCE] headset-control : Make the headset button actually manipulate tracks.
 
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 2010-06-12 11:03

Re: [ANNOUNCE] headset-control : Make the headset button actually manipulate tracks.
 
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 2010-06-12 13:59

Re: [ANNOUNCE] headset-control : Make the headset button actually manipulate tracks.
 
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 2010-06-15 13:34

Re: [ANNOUNCE] headset-control : Make the headset button actually manipulate tracks.
 
Quote:

Originally Posted by hassan_badredin (Post 711981)
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!!)..


All times are GMT. The time now is 00:47.

vBulletin® Version 3.8.8