View Single Post
thp's Avatar
Posts: 1,391 | Thanked: 4,272 times | Joined on Sep 2007 @ Vienna, Austria
#513
Originally Posted by xerxes2 View Post
Hmm, isn't it the headphone daemon that does this too? If not we'll have to poke thp ... again. But as Helmuth said, I wouldn't recommend making it a habit of plug/unplug the headophones a gazillion times. Sure the 3.5mm connector is pretty durable but it'll eventually break.
The "play when plugged back in" was a feature of Panucci itself, and it was optional (you could turn it on to have the desired effect, but it was disabled by default). The source tarball panucci_0.3.17.tar.gz contains the necessary code - it's in panucci.py, and you'll find it searching for play_on_headset:

Code:
system_bus = dbus.SystemBus()
def handler_func(device_path):
    if device_path == '/org/freedesktop/Hal/devices/computer_logicaldev_input_1' and settings.play_on_headset and not player.playing:
        player.play()
system_bus.add_signal_receiver(handler_func, 'DeviceAdded', 'org.freedesktop.Hal.Manager', None, '/org/freedesktop/Hal/Manager')
I think this only works for real headsets (i.e. the ones included with the N900 and Bluetooth headsets - not headphones without microphone), but that shouldn't be a problem. It actually makes sense for Bluetooth headsets where you usually connect it manually by pressing a button on the headset.
 

The Following User Says Thank You to thp For This Useful Post: