[pulseaudio-discuss] My computer thinks I'm schizophrenic, is PA for me?

Tanu Kaskinen tanuk at iki.fi
Sat Apr 17 01:00:34 PDT 2010

On Fri, 2010-04-16 at 21:02 +0200, Jan Braun wrote:
> Hi list,
> and sorry for bringing up this topic again, but I'm another user who
> has difficulties with PA's multi-user policy.
> You see, currently I'm the only person with access to my desktop pc,
> but I have several user accounts on it[1]. And I use them all.
> Simultaneously. As in: several consoles open, often more than 1 xserver
> running, xterms ssh'd to otheruser at localhost .
> *** Now is your chance to say "that's insane, and we don't support it"

I can't say it's insane, otherwise I'd be admitting that I've been
insane in the past :) But we still don't support it. (Well, that depends
on what "support" means, but since you've successfully been using the
system mode, and you think we don't support it, I guess your definition
of "support" means something like "the use case is important to us".)

> So, I want sound. For all of my accounts. Concurrently - I'm logged in
> concurrently, and e.g. email/IM notifications need to work especially
> when the email-account is not "active". And my xmms2d needs to run as
> one (arbitrary, but fixed) user too, me switching between different
> windows/consoles/xservers mustn't prevent it from playing continuously.
> So, how does PA fit in here?
> 1) Currently, I run it in system mode. Only system mode has grown pretty
>    scary warning signs. And you could reasonably break it altogether,
>    say "we told you so", and I'd get to keep the pieces. Not my
>    favourite prospect.
> 2) per-user-pulseaudio on top of dmix. "causes global warming", mixes
>    sound twice, also not a nice solution.
> 3) per-user-pulseaudio, one with access to the hw, other users send to
>    that one via network/localhost. Also mixes twice, and (almost)
>    every sound data is pushed through lo. Unless PA recognzes lo and
>    optimizes for that case? Also needs that one user to be logged in
>    always (that's easily done, however).[2]
> 4) Your suggestion?

My suggestion is basically the same as your option 3, without the double
mixing and tcp overhead (I'm not sure whether using the loopback
interface has much more overhead than unix domain sockets, though - you
still won't be able to use shared memory for audio transport).

Let's say your always-logged-in user, that provides the central
pulseaudio server, has username "albert". Make sure albert belongs in
the "audio" group (that should ensure that albert always has access to
the sound card). Similar to what Marti suggested, copy albert's
~/.pulse-cookie to each user's home directory. Additionally, you'll need
to change the

    load-module module-native-protocol-unix

line in /home/albert/.pulse/default.pa so that it uses a static location
for the socket that clients connect to. (If that file doesn't exist,
copy it from /etc/default.pa.) I think a location under albert's home
directory is the best choice (you'll of course need to chmod the
location to be accessible to all users who need to connect to albert's

    load-module module-native-protocol-unix socket=/home/albert/.pulse/connect-to-me

Then put this to to each user's ~/.pulse/client.conf:

    default-server = unix:/home/albert/.pulse/connect-to-me

That should be it. I didn't test any of this, so this probably doesn't
work, at least at the first try.

> I'm seriously trying to find the proper way to use PA, and would love to
> be able to add accounts for other persons and have security against them
> eavesdropping etc..

Wasn't this supposed to be a single-person system? My suggestion should
be safer than the system wide mode, but my suggestion doesn't work
perfectly with multiple real persons who don't all use albert's
pulseaudio. It may work well enough, though.

>  But my impression is PA is designed for multiple seats
> per computer and for multiple persions per seat (i.e. fast user switching).
> And it's not designed for multiple accounts per person.
> So, do you think my scenario is valid?

At least I don't see your scenario as an important case to support.

> Plus I feel I'm recreating system mode here.. name the user with access
> to the hw "pulse" and optimize the local pa deamons away, and we're
> there.

Yes, this is very similar to the system wide mode. The main difference
is that when creating new users, they by default use their own
pulseaudio instances.

Tanu Kaskinen

More information about the pulseaudio-discuss mailing list