[pulseaudio-discuss] About PulseAudio DBUS service

Zheng, Huan huan.zheng at intel.com
Mon Jun 6 16:03:24 PDT 2011


Hi,
I want to use the server look up service of PulseAudio to find the dbus-socket address, below is the *correct* python script, I copied below just want to let you know what exactly I want

bus = dbus.SessionBus()
server_lookup = bus.get_object("org.PulseAudio1", "/org/pulseaudio/server_lookup1")
address = server_lookup.Get("org.PulseAudio.ServerLookup1", "Address", dbus_interface="org.freedesktop.DBus.Properties")

But I'm finding an issue on my system.
After system boot up, I can not access org.PulseAudio1 service, error "org.freedesktop.DBus.Error.ServiceUnknown" is reported.
This could be proved by using the following command:
dbus-send --session --print-reply --reply-timeout=2000 --type=method_call --dest=org.freedesktop.DBus /org/freedesktop/DBus org.freedesktop.DBus.ListNames

the output is
method return sender=org.freedesktop.DBus -> dest=:1.0 reply_serial=2
   array [
      string "org.freedesktop.DBus"
      string ":1.0"
   ]
Apparently, org.PulseAudio1 service is not available.

Here comes the weird thing, if I kill pulseaudio and restart it. org.PulseAudio1 service becomes available, and I could get address using previous python script.
The output is:
method return sender=org.freedesktop.DBus -> dest=:1.2 reply_serial=2
   array [
      string "org.freedesktop.DBus"
      string "org.freedesktop.ReserveDevice1.Audio0"
      string "org.pulseaudio.Server"
      string "org.PulseAudio1"
      string ":1.1"
      string ":1.2"
   ]

FYI:
1, When system boot up, pulseaudio start up is invoked in XDG autostart folder.
2, The log indicates "D: main.c: Got org.PulseAudio1!" "D: main.c: Got org.pulseaudio.Server!", which means, register_dbus_name(c, DBUS_BUS_SESSION, "org.PulseAudio1") and register_dbus_name(c, conf->system_instance ? DBUS_BUS_SYSTEM : DBUS_BUS_SESSION, "org.pulseaudio.Server") all succeeded.
3, before pulseaudio start, dbus-daemon already started. There's a "dbus-daemon --fork --session --print-pid 9 --print-address 11" running in system which has a pid number less than pulseaudio

Question: the root cause on the surface is that if we start pulseaudio after system fully boot up, then there's no problem. But what's the real root cause?
And normal user has no capability to restart pulse. I need to make this service available when system boot up.

If you reached here, thanks a lot for your patience, please give me some hints.
Thanks!

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/pulseaudio-discuss/attachments/20110607/ba6e8fdc/attachment.htm>


More information about the pulseaudio-discuss mailing list