[pulseaudio-discuss] Proper way for a server to spawn Pulseaudio?

Espen J├╝rgensen espen at gyfgafguf.dk
Thu Sep 1 20:14:41 UTC 2016

> I think starting pulseaudio at boot in the system mode makes most
> sense for headless systems. I don't think another server-type
> application should spawn it.
> When your server runs under a dedicated user, autospawning should work,
> but then you'll probably run into problems with not having access to
> the audio hardware, because typically the device permissions are
> handled dynamically so that only the currently-active login session has
> access. Trying to "fix" this by making the device permissions static
> will cause breakage, because your music server will then hog the
> hardware so that regular users can't access it anymore. It's probably
> best if you use the PA_CONTEXT_NOAUTOSPAWN flag in your application
> when connecting to pulseaudio, unless your application runs inside a
> regular user login session.

Thanks for the swift advice, I really appreciate that!

Maybe this info would be good to have in the wiki? Could add it myself,
once I get it working.

An extra question, hope you don't mind. What is the explanation of the
following behavior? (Raspbian, no desktop, just straight ssh terminal)

pi at jessie ~ $ ps ax | grep pulse
25504 pts/0    S+     0:00 grep --color=auto pulse
pi at jessie ~ $ paplay test.wav
(audio plays)
pi at jessie ~ $ sudo su -
root at jessie:~# killall pulseaudio
root at jessie:~# paplay test.wav
Connection failure: Connection refused
pa_context_connect() failed: Connection refused

Seems regular user can spawn Pulseaudio, but root can't?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/pulseaudio-discuss/attachments/20160901/80ea14bd/attachment.html>

More information about the pulseaudio-discuss mailing list