I install package dbus-scripts-settings 1.1 and set when my BT headphone connected start /usr/bin/kagu. When I connect headphone kagu doesn't start. How can I debug why?
I know that it is possible to connect headphone using script.
Can anybody show me how.
Sorry for stupid questions.
I accidentlly kill dbus daemon. IT rebooted and know everything wokr
One more question.
Is it possible to execute script via dbus-script on headphone button press?
Now I use python script to pause kagu when button press.
I have to start it from xterm each time when I start kagu.
Will be nice if need only start BT on IT and nothing more
#!/usr/bin/env python2.5
from dbus.mainloop.glib import DBusGMainLoop
DBusGMainLoop(set_as_default=True)
import dbus
import gobject
import os
dbus_loop = gobject.MainLoop()
bus = dbus.SessionBus()
I mean something like this in /etc/dbus-scripts.d/dbus-scripts-settings
...
/usr/local/bin/pause-kagu * * com.nokia.osso_hp_ls_controller.headset button_pressed 00:0D:3C:A6:CC:13
or
/usr/local/bin/pause-kagu * * org.bluez.audio.Headset AnswerRequested 00:0D:3C:A6:CC:13
You seem to have both scripts running on connect. The on_disconnect (kagu_stop) should have RemoteDeviceDisconnect, not RemoteDeviceConnect.
As far as I can tell this is not a dbus-scripts-setting bug. Are you sure you selected disconnect for the second line?
About getting the same dbus signal for connect/disconnect - there are other such events, such as keyboard slide (same signal when openned and closed) USB device connect/disconnect. In such cases you need to have the script running on both events, and the script should use some other method for finding out which event actually happened (and be really careful of race conditions).
About getting the same dbus signal for connect/disconnect - there are other such events, such as keyboard slide (same signal when openned and closed) USB device connect/disconnect. In such cases you need to have the script running on both events, and the script should use some other method for finding out which event actually happened (and be really careful of race conditions).
I know that, but how can I find out if the headphone is connected?
There is a file /sys/devices/platform/retu-headset/hookdet which apprently gives the value of retu adc 5. Values of less than 80 appear to indicate headset connected, while values of more, appear to indicate not connected.
It was mistake. I changed second line to disconnect.
I think the should be way to extend the program and add headphone button monitor.
Now I have one script to monitor connect/disconnect BT and one for monitor BT button.