Re: [opensuse] Trying to make audio play under a different user, with pulse? Solved.
On Tuesday 29 October 2019, Carlos E. R. wrote:
Hi,
I bumped into this post from 2014 that says how to do the above:
<http://billauer.co.il/blog/2014/01/pa-multiple-users/>
basically, he says to:
cp /etc/pulse/default.pa ~/.pulse/
and then edit ~/.pulse/default.pa and add this line:
load-module module-native-protocol-tcp auth-ip-acl=127.0.0.1
And on the second user, edit ./-pulse/client.conf and add:
default-server = 127.0.0.1
The comments say of some modifications. It is now not directory .pulse, but "/.config/pulse/", and I assume file "default.pa". And on the other user, it is /.config/pulse/client.conf
So now I have (two users; cer has the desktop):
cer@Isengard:~> cat .config/pulse/default.pa | grep 127 load-module module-native-protocol-tcp auth-ip-acl=127.0.0.1 cer@Isengard:~>
cer-g@Isengard:~> cat .config/pulse/client.conf default-server = 127.0.0.1 cer-g@Isengard:~>
I logout, login, and try - does not work:
cer-g@Isengard:~> paplay /usr/share/sounds/purple/login.wav Connection failure: Connection refused pa_context_connect() failed: Connection refused cer-g@Isengard:~>
(paplay is the pulseaudio command to play sounds)
(paplay does work as "cer" - but not via ssh)
I was going to ask here for ideas, then found this comment from 2016:
+++--------------- Note that you can also set network access using paprefs (Debian package of same name). In paprefs, choose Network server => Enable network access to local sound devices & Don’t require authentication. There’s no need to copy/edit default.pa or to create a client.conf for the secondary user(s).
Paprefs uses gconf and stores its config in ~/.gconf/system/pulseaudio/modules/remote-access/\%gconf.xml (you’d better remember this if you also use a default.pa and are wondering why something doesn’t work). ---------------+++
So I undid what I had done so far (delete those two new config files), installed paprefs, did that change, tested, and it works! I can play "kodi" as another user :-)
(I want kodi as another user as a trick to test a different kodi config)
The worry now is that any user (local, I hope) can play sound. No security control.
I have some notes I wrote up when I last wanted to do this on Leap and it still seems to be working on tumbleweed. Your devices will differ, but maybe the rest would apply. - Sound, remote sound use UNIX sockets - server user /home/michael/.pulse/default.pa .include /etc/pulse/default.pa # Share this server load-module module-native-protocol-unix auth-anonymous=1 socket=/tmp/share-pulse # Default output to analog onboard sound and usb fiio load-module module-combine-sink sink_name=combined slaves=alsa_output.pci-0000_00_14.2.analog-stereo,alsa_output.usb-FiiO_DigiHug_USB_Audio-01.analog-stereo set-default-sink combined KDE default order of outputs Settings->hardware->audio and video Select audio-playback (to configure all playback sources) Reorder Prefer/Defer to put devices in prefered order. X11 client shared audio Find prefered sink name: pactl list short sources Put in /home/clientuser/.pulse/client.conf default-server = unix:/tmp/share-pulse default-sink = alsa_output.usb-FiiO_DigiHug_USB_Audio-01.analog-stereo Set alsa to use pulse in /home/clientuser/.asoundrc (but need to figure out how to avoid looping if logged in locally - perhaps define alsa fallbacks) pcm.!default { type pulse device "alsa_output.usb-FiiO_DigiHug_USB_Audio-01.analog-stereo" } ctl.!default { type pulse } I hope this helps. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
participants (1)
-
Michael Hamilton