|
#1
|
||||
|
||||
|
This daemon monitors when the button on the headset is pressed and makes the media player pause the playing song.
Download: Attached. Install instructions :
Credits:
Media players supported by the default configuration:
"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. Last edited by qwerty12; 2008-06-25 at 13:41. |
| The Following 54 Users Say Thank You to qwerty12 For This Useful Post: | ||
absolofdoom, Aisu, alephito, allnameswereout, AlMehdi, Apoc, apollovy, arjunkumar87, attila77, avel, Bec, bongo, bunanson, cheve, choubbi, cipper, conny, Corwin, Dark_Angel85, ericcmi, hoxtonhopper, iKneaDough, jcharpak, jchord, joerg_rw, kevloral, lm2, luso, MaLKaV, MrGrim, mrklaw, mtron, musculus, mveplus, nux, Rider, russo_br, sachin007, sakamoto, slender, smman, spirytsick, stlpaul, tanago, TheGogmagog, thopiekar, thp, tz1, udaychaitanya16, xtian, Yann Benigot, ZogG | ||
|
#2
|
||||
|
||||
|
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: Code:
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 |
| The Following User Says Thank You to tz1 For This Useful Post: | ||
|
#3
|
||||
|
||||
|
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
|
|
#4
|
||||
|
||||
|
I forgot the original headset had that button. Actually this might be even better.
|
|
#5
|
|||
|
|
|||
|
I always wondered what that even did by default (I never figured it out).
__________________
|
|
#6
|
|||
|
|||
|
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 Last edited by sakamoto; 2008-07-25 at 02:52. |
|
#7
|
||||
|
||||
|
one thing it does by default is to answer or end a call in the 'internet call' application.
|
| The Following User Says Thank You to Saturn For This Useful Post: | ||
|
#8
|
|||
|
|||
|
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. |
|
#9
|
|||
|
|||
|
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: Code:
#!/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.headset')
headset_iface.connect_to_signal('button_pressed', on_button_pressed, sender_keyword='sender')
dbus_loop.run()
if __name__ == "__main__":
main()
|
|
#10
|
|||
|
|||
|
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 ;-) |
![]() |
| Tags |
| ad-54/hs-45, headset button |
|
|