[yocto] pulseaudio without x11

Tanu Kaskinen tanu.kaskinen at linux.intel.com
Mon Apr 13 05:16:03 PDT 2015


On Fri, 2015-04-10 at 15:09 -0400, Chris Morgan wrote:

> I am trying to run as a system service, it's for an embedded system
> and without x the normal dbus session per user doesn't make sense.
> 
> 
> I had modified the service file to pass --system and pulse seemed
> happier. Is this the recommended approach? Pulse does complain about
> passing that option and running as root.

When using PulseAudio as a system service, you definitely need to either
give --system and/or set "system-instance=yes"
in /etc/pulse/daemon.conf.

Can you give the exact error or warning that you get? PulseAudio
shouldn't complain about running as root when using --system. In fact,
PulseAudio *must* be run as root when using --system.

> After a few minutes the service did shut down. It may have been due to
> configuring the loop back module though I'm surprised a
> misconfiguration would have resulted in pulse shutting down.

As Erik wrote, this sounds like the "exit on idle" mechanism kicking in,
but when running in the system mode, that mechanism should automatically
get disabled. It really sounds like you're still running without
--system. One theory would be that you're starting pulseaudio with
--system, but clients can't connect to it for some reason, and they then
autospawn the user instance instead, so you get two instances running.
If that's the case, setting "system-instance=yes" in daemon.conf should
prevent this confusing behaviour, because any user instances will then
refuse to start. (Sorry, I should have instructed you to edit
daemon.conf in the first place instead of enabling the system mode via
the command line parameter...)

My understanding is that you're running also the PulseAudio clients as
root, and that's not supported out-of-the box (I should probably fix
that...). By default, only processes in the "audio" group can connect to
the system instance, and root isn't in that group by default. You can
either add root to the audio group, or disable client authentication
altogether by passing "auth-anonymous=yes" to
module-native-protocol-unix in /etc/pulse/system.pa, in which case all
processes in the system can use and control the PulseAudio daemon.

(For people reading this later in the list archives, note that the
upstream default for the access group is "pulse-access", not "audio".
Using "audio" is an OpenEmbedded thing. I hope we can get rid of that
divergence at some point.)

-- 
Tanu




More information about the yocto mailing list