[pulseaudio-discuss] [PATCH v2] core-util: Fail if XDG_RUNTIME_DIR belongs to someone else

David Henningsson david.henningsson at canonical.com
Mon Sep 8 06:22:22 PDT 2014



On 2014-09-08 14:17, Glenn Golden wrote:
> Tanu,
>
> This isn't directly releated to this thread, but something that David mentioned
> here worries me vis a vis our ongoing discssions about "which server are we
> talking to?":
>
> David Henningsson <david.henningsson at canonical.com> [2014-09-08 13:32:45 +0200]:
>>
>> Usually, PA will use the PULSE_SERVER X11 property instead of using
>> XDG_RUNTIME_DIR, so this environment variable does not matter.
>>
>
> This X11 PULSE_SERVER property hasn't been mentined before in our discussions
> on the Travis Bickle question.  It seems to add a new wrinkle.  How does this
> property fit in to the big picture of server determination?  From what David
> said above, it sounds like the PULSE_SERVER property has priority over the
> XDG_RUNTIME_DIR envar...(????)

If I read the code correctly, here's the server priority order:

(Unless otherwise specified, anything in all caps is an environment 
variable.)

  1) Specified server(s) in the call to the pa_context_connect API.
  2) Specified server(s) in PULSE_SERVER
  3) Specified server(s) in PULSE_SERVER, where PULSE_SERVER is an X11 
property
  4) Specified server(s) as in client.conf (the "default-server" key)

If none of the above is present, all of the list below will be is tried, 
in this priority order:

  5) Per-user instance:
  5a) based on PULSE_RUNTIME_PATH
  5b) based on XDG_CONFIG_DIR (if no PULSE_RUNTIME_PATH)
  5c) based on ~/.pulse (if no XDG_CONFIG_DIR)
  5d) based on XDG_CONFIG_HOME (if ~/.pulse does not already exist)
  5e) based on ~/.config/pulse (if no XDG_CONFIG_HOME)

  6) System-wide instance, based on /var/run/pulse
  7) If auto-connect-localhost is set in client.conf, also try 
tcp4:127.0.0.1
  8) If auto-connect-localhost is set in client.conf, also try tcp6:[::1]
  9) If auto-connect-display is set in client.conf, also try DISPLAY

Phew! Unless I missed something, I think that's all methods. [1] I bet 
someone really really wants you to connect to a PulseAudio server!

-- 
David Henningsson, Canonical Ltd.
https://launchpad.net/~diwic

[1] And given the code, it wouldn't surprise me if I actually did miss a 
method or two...


More information about the pulseaudio-discuss mailing list