<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>&nbsp;</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(&quot;org.PulseAudio1&quot;, &quot;/org/pulseaudio/server_lookup1&quot;)<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>address = server_lookup.Get(&quot;org.PulseAudio.ServerLookup1&quot;, &quot;Address&quot;, dbus_interface=&quot;org.freedesktop.DBus.Properties&quot;)<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US><o:p>&nbsp;</o:p></span></p><p class=MsoNormal><span lang=EN-US>But I&#8217;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 &#8220;org.freedesktop.<em><span style='font-family:"Calibri","sans-serif"'>DBus</span></em>.Error.ServiceUnknown&#8221; 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>&nbsp;</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 -&gt; dest=:1.0 reply_serial=2<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>&nbsp;&nbsp; array [<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; string &quot;org.freedesktop.DBus&quot;<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; string &quot;:1.0&quot;<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>&nbsp;&nbsp; ]<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>&nbsp;</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 -&gt; dest=:1.2 reply_serial=2<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>&nbsp;&nbsp; array [<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; string &quot;org.freedesktop.DBus&quot;<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; string &quot;org.freedesktop.ReserveDevice1.Audio0&quot;<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; string &quot;org.pulseaudio.Server&quot;<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; string &quot;org.PulseAudio1&quot;<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; string &quot;:1.1&quot;<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; string &quot;:1.2&quot;<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>&nbsp;&nbsp; ]<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US><o:p>&nbsp;</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 &#8220;D: main.c: Got org.PulseAudio1!&#8221; &#8220;D: main.c: Got org.pulseaudio.Server!&#8221;, which means, register_dbus_name(c, DBUS_BUS_SESSION, &quot;org.PulseAudio1&quot;) and register_dbus_name(c, conf-&gt;system_instance ? DBUS_BUS_SYSTEM : DBUS_BUS_SESSION, &quot;org.pulseaudio.Server&quot;) all succeeded.<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>3, before pulseaudio start, dbus-daemon already started. There&#8217;s a &#8220;dbus-daemon --fork --session --print-pid 9 --print-address 11&#8221; 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>&nbsp;</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&#8217;s no problem. But what&#8217;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>&nbsp;</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>&nbsp;</o:p></span></p></div></body></html>