Re: Connecting to DBus socket without specifying bus_name



On 03/02/16 01:31, Gerlof Fokkema wrote:
Hello mailing list,

I'm trying to use the glibmm interface to connect to the PulseAudio DBus socket. So far, I've managed to connect to the DBus Session bus and retrieve the socket address, and I've also managed to set up a connection to that DBus socket.

Source is here:
https://github.com/gfokkema/equalizer/blob/master/src/pa-equalizer.cpp

I'm having trouble calling DBus methods on the PulseAudio DBus socket,
because of what I think is a bug in the glibmm bindings.

https://github.com/gfokkema/equalizer/blob/master/src/pa-equalizer.cpp#L52
---------------------------------------------------------------------------------------------------
auto sinks_result = this->conn->call_sync (
"/org/pulseaudio/equalizing1",
"org.freedesktop.DBus.Properties",
"Get",
parameters,
"org.PulseAudio"
);

There is a QTPython application that also connects to this socket, but it leaves the busname empty (link: https://github.com/mkbosmans/pulseaudio/blob/master/src/utils/qpaeq#L229). Calling this method without specifying bus_name also works when using glib, allowing the result to be converted glibmm.
See branch develop on the same git repository for example.

Am I correct in my understanding that because this is a standalone DBus socket,
the busname can be empty?
And if so, why doesn't glibmm allow the busname to be 0 or NULL, while the documentation does say that is acceptable input?

When I change the bus_name, "org.PulseAudio" to NULL, my program crashes with:
# ./project
> terminate called after throwing an instance of 'std::logic_error'
> what(): basic_string::_M_construct null not valid
> Aborted (core dumped)


Thanks in advance,

Gerlof Fokkema

This looks similar to the DBus::Connection::signal_describe problem from last September which required a patch from Murray to fix...

https://git.gnome.org/browse/glibmm/commit/?id=ece1463f6d796c7c74da1e9d37a4e69904a9706e

Regards,
Ian.


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]