ruby-dbus icon indicating copy to clipboard operation
ruby-dbus copied to clipboard

failed to register callback for PulseAudio signal

Open r10r opened this issue 12 years ago • 5 comments

Hi,

I'm trying to register a callback for a pulseaudio source device on the pulseaudio bus. see https://gist.github.com/r10r/5496667

I get the following error:

DBus::Error: Method "AddMatch" with signature "s" on interface "org.freedesktop.DBus" doesn't exist

    from /var/lib/soundmaster/.gem/ruby/2.0.0/gems/ruby-dbus-0.9.1/lib/dbus/bus.rb:407:in `block in send_sync_or_async'
    from /var/lib/soundmaster/.gem/ruby/2.0.0/gems/ruby-dbus-0.9.1/lib/dbus/bus.rb:633:in `call'
    from /var/lib/soundmaster/.gem/ruby/2.0.0/gems/ruby-dbus-0.9.1/lib/dbus/bus.rb:633:in `process'
    from /var/lib/soundmaster/.gem/ruby/2.0.0/gems/ruby-dbus-0.9.1/lib/dbus/bus.rb:580:in `send_sync'
    from /var/lib/soundmaster/.gem/ruby/2.0.0/gems/ruby-dbus-0.9.1/lib/dbus/bus.rb:405:in `send_sync_or_async'
    from /var/lib/soundmaster/.gem/ruby/2.0.0/gems/ruby-dbus-0.9.1/lib/dbus/introspect.rb:274:in `block (2 levels) in define_method_from_descriptor'
    from /var/lib/soundmaster/.gem/ruby/2.0.0/gems/ruby-dbus-0.9.1/lib/dbus/bus.rb:607:in `add_match'
    from /var/lib/soundmaster/.gem/ruby/2.0.0/gems/ruby-dbus-0.9.1/lib/dbus/introspect.rb:325:in `on_signal'
    from /var/lib/soundmaster/.gem/ruby/2.0.0/gems/ruby-dbus-0.9.1/lib/dbus/introspect.rb:455:in `on_signal'
    from (irb):145
    from /usr/bin/irb:12:in `
'

Any idea what is going wrong here?

[soundmaster@blaubeere ~]$ dbus-daemon --version
D-Bus Message Bus Daemon 1.6.8
Copyright (C) 2002, 2003 Red Hat, Inc., CodeFactory AB, and others
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

r10r avatar May 01 '13 17:05 r10r

Oh, I did not know that Pulseaudio runs a separate bus for itself. That will be fun to debug :)

mvidner avatar May 02 '13 09:05 mvidner

Hmm, yeah. It took me a while to figure that out as well - but it is mentioned at the beginning of the pulse documentation. :) I have a working python example now - see https://gist.github.com/r10r/5501136 - but I definitely prefer the ruby version ;) I've also updated the gist https://gist.github.com/r10r/5496667 - unfortunately the problem still persists ...

r10r avatar May 02 '13 09:05 r10r

I have pushed out a quick fix in the peer-connection branch. A proper fix will follow.

BTW I didn't know how to trigger a StateUpdated signal but fortunately VolumeUpdated is there as well.

mvidner avatar May 02 '13 15:05 mvidner

hey cool, i'll try it out later the evening and will give you feedback. StateUpdated can be triggered by toggling pause/playback on the source. E g. I've connected my phone via bluez and toggle play/pause the media player (spotify)

r10r avatar May 02 '13 15:05 r10r

Works fine now :D - Thanks a lot. Can you give me a short hint why it is not required to call AddMatch on the connection?

r10r avatar May 02 '13 23:05 r10r

Fixed now

mvidner avatar Jun 13 '23 16:06 mvidner