Skip to content

failed to register callback for PulseAudio signal #44

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
r10r opened this issue May 1, 2013 · 6 comments
Closed

failed to register callback for PulseAudio signal #44

r10r opened this issue May 1, 2013 · 6 comments

Comments

@r10r
Copy link

r10r commented May 1, 2013

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.
@mvidner
Copy link
Owner

mvidner commented May 2, 2013

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

@r10r
Copy link
Author

r10r commented May 2, 2013

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 ...

mvidner added a commit that referenced this issue May 2, 2013
PulseAudio uses a connection outside the well known buses:
http://www.freedesktop.org/wiki/Software/PulseAudio/Documentation/Developer/Clients/DBus

This is a dirty hack and should be cleaned up by separating
BusConnection from Connection.
@mvidner
Copy link
Owner

mvidner commented May 2, 2013

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.

@r10r
Copy link
Author

r10r commented May 2, 2013

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
Copy link
Author

r10r commented May 2, 2013

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?

@mvidner mvidner changed the title failed to register callback for signal failed to register callback for PulseAudio signal May 24, 2015
stefano-m added a commit to stefano-m/lua-ldbus_api that referenced this issue Aug 14, 2016
DBus connections that are not session nor system buses do not implement
`AddMatch`. So, trying to add a match in `ldbus.api.watch` results in
the following error being returned by DBus:

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

To fix the issue, simply skip the step to add a match.

Manually verified to work with PulseAudio. Adding tests for this seems
too painful compared with the benefit received.

References:

* mvidner/ruby-dbus#44
mvidner added a commit that referenced this issue Jun 13, 2023
the fix is dirty, will move code to PeerConnection
mvidner added a commit that referenced this issue Jun 13, 2023
These are:
- unique_name
- proxy
- service
- []
- send_hello

Split these up for a better fix of #44, signals on peer connections:
- add_match
- remove_match
@mvidner
Copy link
Owner

mvidner commented Jun 13, 2023

Fixed now

@mvidner mvidner closed this as completed Jun 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants