[opensuse] Trying to make audio play under a different user, with pulse? Solved.
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 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. - -- Cheers Carlos E. R. (from 15.1 x86_64 at Telcontar) -----BEGIN PGP SIGNATURE----- iHoEARECADoWIQQZEb51mJKK1KpcU/W1MxgcbY1H1QUCXbdlZBwccm9iaW4ubGlz dGFzQHRlbGVmb25pY2EubmV0AAoJELUzGBxtjUfVpNQAnRBV0aWBK/sZmKBZSUVU /BOf3mQcAJ9LEAnbdMP8QHiIpp73aMV5HRkIJw== =WCOy -----END PGP SIGNATURE-----
On 10/28/2019 05:02 PM, 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
OOF... There have been so many udev and pam changes (and changes to pulseaudio) since that time, you may have to dig into the reference pages to confirm that still holds. For ssh, you may need some type of forwarding enabled like X11Forwarding?? or some type of auth like UsePAM?? in order to have pulseaduio play nicely with different users? I haven't looked at the pulseaudio config since about the time of that post -- since then it has just sort of worked (though I don't rely on it over ssh :) -- David C. Rankin, J.D.,P.E.
On 29/10/2019 01.54, David C. Rankin wrote:
On 10/28/2019 05:02 PM, 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
OOF... There have been so many udev and pam changes (and changes to pulseaudio) since that time, you may have to dig into the reference pages to confirm that still holds. For ssh, you may need some type of forwarding enabled like X11Forwarding?? or some type of auth like UsePAM?? in order to have pulseaduio play nicely with different users? I haven't looked at the pulseaudio config since about the time of that post -- since then it has just sort of worked (though I don't rely on it over ssh :)
It does work, but not by editing those files but by using "paprefs". At least inside the same computer, and not if use ssh on another computer, expecting the sound to play on the server, not the client. I have not investigated further. "paprefs" does have a button for "authentication", but not having any idea how it would do that, I left it disabled. It does what I wanted, be able to use sound as a different user than the one that has the desktop. Another issue is to, somehow, play sound inside a cron script, no matter when it is called. The method is different before the X server starts or before someone logins or after. There is no known way to do something that just plays a sound no matter what. Years ago it was simpler: just belong to the right group. -- Cheers / Saludos, Carlos E. R. (from 15.1 x86_64 at Telcontar)
participants (3)
-
Carlos E. R.
-
Carlos E.R.
-
David C. Rankin