How To Enable Sound For Other Users But The One Who Owns The Current Session

Home » CentOS » How To Enable Sound For Other Users But The One Who Owns The Current Session
CentOS 11 Comments

Hello there!

I’m trying to get sound from applications running from other users bug the one who owns the current GNOME sessions.

Typically, my default user is “A” and he’s running the GNOME session, logged in graphically. From this session, I open terminals, su to other users (B or C, non-root) and run mplayer or firefox. No sound for these.

Adding those users to the “audio” group didn’t help. Any idea how to do this?

Regards,

11 thoughts on - How To Enable Sound For Other Users But The One Who Owns The Current Session

  • That is pulse problem, daemon is started with first user as owner. I do not know workaround or fix.

  • some google-fu suggests group ‘pulse-access’ should be used. no idea if thats actually legit.

  • with some semblance of reliability once long ago I can tell you that it involves something around:
    load-module module-native-protocol-tcp auth-ip-acl7.0.0.1

    This implies the pulse server must provide a local network service and the clients must be configured to connect to this server.

    Updating default.pa in .pulse directories and granting access to pulse*
    groups also rings a bell. Sadly I kept few notes on this so can only find this hint at present. There must be better ways to do it and if you get it working I would be keen to know how, so please provide feedback. I also recall murmurs of security issues around shared pulse services, obviously more so if the ip is not localhost, so consider that too.

  • Hendrik Strydom wrote:

    More details about this approach can be found via: (for example)

    <http://billauer.co.il/blog/2014/01/pa-multiple-users/>

    You can also run Pulseaudio in ‘system mode’ – see:

    <http://www.freedesktop.org/wiki/Software/PulseAudio/Documentation/User/SystemWide/>

    I haven’t tried either of these approaches

    You can also by-pass Pulseaudio and use ALSA directly by modifying the central ALSA config files (or overriding them via individual user configs) – I’ve done this for a single user on a workstation – but not for multiple users, but I guess with the correct dev perms this should work as well

    James Pearson

  • Hello Michael,

    I’m sorry Michael, but I don’t get the logic behind your words. User
    ‘A’ logs in a GNOME session, he has sound activated and working by default. This is not a sufficient condition to get sound for applications started by user ‘B’ or ‘C’ in a terminal, via `su` or
    `sudo`.

    Issue fixed anyway, as I reported earlier.

    Regards,

  • Would you please indicate just _where_ you reported your fix? The only posts from you that I can find on this list are included in the quoted text above.

  • Hello Reindl,

    Thanks, that did help.

    I copied /usr/bin/start-pulseaudio-x11 to /usr/bin/start-pulseaudio-x11-system, and in this file, replaced –start with -system.

    Added $MYUSERNAMEHERE ALL=NOPASSWD:/usr/bin/start-pulseaudio-x11-system to /etc/sudoers and modified the startup applications in GNOME prefs to
    `sudo /usr/bin/start-pulseaudio-x11-system` instead of `/usr/bin/start-pulseaudio-x11`. Restarted computer, works.

    Thanks to everyone else too, for your valuable help!

    Regards,

  • Hello Robert,

    Apparently I replied to Harald instead of replying to the ML, by mistake. Now redirected that reply, you should now have received another mail from me to this ML, mentioning the fix.

    Regards,