How to make pulseaudio working with multiple users at the same time

Multiple users?

As you know in Elive it is very easy to use multiple users at the same time, you need just to hit the launcher and type "user switch" and you will find this feature. After that you can switch between them in a faster way using "Ctrl + Alt + F8" and other numbers like F7, F9, etc. for each user

Unfortunately, pulsaudio only works for a single (first) user by default, this is probably due to security reasons (other users listening what is happening in the other users running the same machine), to make it correctly working with different users at the same time you need to configure pulseaudio to use the same socket for all the users.

Files to edit

Run this command

~ ❯❯❯ sudo scite /etc/pulse/default.pa

And change the line which says

load-module module-native-protocol-unix

with:

load-module module-native-protocol-unix auth-group=audio socket=/tmp/pulse-server


Also, edit this file:

~ ❯❯❯ sudo scite /etc/pulse/client.conf

And in the end of it, add these lines:

autospawn = no
default-server = unix:/tmp/pulse-server
enable-memfd = yes

Now, just run from each user

~ ❯❯❯ pulseaudio -k ; pulseaudio -D

Yepeee! :dance:


Question: do you think this option should be set by default in Elive? :thinking:

Considering both users would be on the same machine ...... I'm not quite in the clear what the actual use would be unless it's a server for multiple connected consoles or such. :thinking:

OTOH Considering 'user-switch': ..... Yes, it would be good to have that by default.

Can you make this audio option default in Elive.
It will make it easier for support reasons.

:cheerleader: Implemented since the next build :cheerleader:

In case you want to disable this setting, just:

Comment the config lines from these files:

/etc/pulse/default.pa.d/80-elive-multiuser-audio-shared.pa
/etc/pulse/client.conf.d/80-elive-multiuser-audio-shared.conf

This should put back the pulseaudio settings as the original ones (so, no multi-user mode), after that you can reboot the machine and if the audio doesn't works, press "ctrl + alt + del" and pick the option to restart audio configurations

5 posts were merged into an existing topic: Microphone not working (confirmed!)