site  contact  subhomenews

Pulseaudio support multiple users with TCP

November 04, 2021 — BarryK

I posted very early this morning how to support multiple users by using a Unix Domain Socket. Now considering an alternative, the TCP network protocol. Here is the previous blog post, using Unix Domain Socket:

It turns out that the TCP method is very simple. In /etc/pulse/, I loaded both Unix Domain socket and TCP:

load-module module-native-protocol-unix
load-module module-native-protocol-tcp auth-ip-acl=

The first one means there will be the usual socket /run/pulse/native, so apps like pavucontrol run happily.

The second one makes pulseaudio available anywhere in the local system, regardless of username or group. So, for example, /home/firefox/.config/pulse/client.conf:

default-server =

And for firefox running in a container, /mnt/wkg/containers/firefox/root/.config/pulse/client.conf:

default-server =

That's it, sound works for both of them.

The problem is, I don't know how to disable sound in a non-root client, or in a container. I really want to have individual control. For example, in the 'firefox' container, be able to enable or disable audio, without affecting other containers and non-root clients.

Documentation on pulseaudio modules is here:    

Tags: easy