<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:x="urn:schemas-microsoft-com:office:excel" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type content="text/html; charset=us-ascii"><meta name=Generator content="Microsoft Word 12 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
        {font-family:SimSun;
        panose-1:2 1 6 0 3 1 1 1 1 1;}
@font-face
        {font-family:SimSun;
        panose-1:2 1 6 0 3 1 1 1 1 1;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:SimSun;
        panose-1:2 1 6 0 3 1 1 1 1 1;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        text-align:justify;
        text-justify:inter-ideograph;
        font-size:10.5pt;
        font-family:"Calibri","sans-serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal-compose;
        font-family:"Calibri","sans-serif";
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;}
/* Page Definitions */
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:72.0pt 90.0pt 72.0pt 90.0pt;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=ZH-CN link=blue vlink=purple style='text-justify-trim:punctuation'><div class=WordSection1><p class=MsoNormal><span lang=EN-US>Hi, <o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>I want to use the server look up service of PulseAudio to find the dbus-socket address, below is the *<b>correct</b>* python script, I copied below just want to let you know what exactly I want<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US>bus = dbus.SessionBus()<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>server_lookup = bus.get_object("org.PulseAudio1", "/org/pulseaudio/server_lookup1")<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>address = server_lookup.Get("org.PulseAudio.ServerLookup1", "Address", dbus_interface="org.freedesktop.DBus.Properties")<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US>But I’m finding an issue on my system.<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>After system boot up, I can not access org.PulseAudio1 service, error “org.freedesktop.<em><span style='font-family:"Calibri","sans-serif"'>DBus</span></em>.Error.ServiceUnknown” is reported.<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>This could be proved by using the following command:<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>dbus-send --session --print-reply --reply-timeout=2000 --type=method_call --dest=org.freedesktop.DBus /org/freedesktop/DBus org.freedesktop.DBus.ListNames<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US>the output is<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>method return sender=org.freedesktop.DBus -> dest=:1.0 reply_serial=2<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US> array [<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US> string "org.freedesktop.DBus"<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US> string ":1.0"<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US> ]<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>Apparently, org.PulseAudio1 service is not available.<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US>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.<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>The output is:<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>method return sender=org.freedesktop.DBus -> dest=:1.2 reply_serial=2<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US> array [<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US> string "org.freedesktop.DBus"<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US> string "org.freedesktop.ReserveDevice1.Audio0"<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US> string "org.pulseaudio.Server"<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US> string "org.PulseAudio1"<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US> string ":1.1"<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US> string ":1.2"<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US> ]<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US>FYI: <o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>1, When system boot up, pulseaudio start up is invoked in XDG autostart folder.<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>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.<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>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<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US>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?<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>And normal user has no capability to restart pulse. I need to make this service available when system boot up.<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US>If you reached here, thanks a lot for your patience, please give me some hints.<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>Thanks!<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p></div></body></html>