2

I have two users in a Debian 11 system and I'd like to have both with audio working when switching between them.

But if one of them has audio working the other one hasn't. I could workaround this by killing the audio processes when alternating the users, but hasn't a permanent fix for this?

First time this happened it was that the other user wasn't in the audio group, but now the problem is with one user blocking the audio processes from the other.

Anyone with a more reliable and permanent solution for this?

1
  • Normally when you switch login, the pulse server of the login that is being switched away from will suspend its audio sink, which result in the sound device being released and can then be grabbed by the sink of the pulse server on the login that is being switched away to. Are you not getting the behavior, or do you want to simultaneously play from two login (i.e., their audio streams mixed)?
    – Tom Yan
    Nov 28, 2023 at 5:47

1 Answer 1

2

I had the same problem, and the solution turned out to be somewhat counterintuitive: it requires reducing access to audio devices. To get audio to reliably follow users when switching, you have to ensure that none of the users are in the audio group.

PulseAudio relinquishes audio devices when it loses access to them. Users in the audio group have permanent access to audio devices, so as long as one of their processes is “using” audio, their PulseAudio will keep the audio devices open, preventing other users from gaining access. Users not in the audio group are granted permissions through uaccess, which ensures that they have permissions whenever their desktop session is the active session, and lose them when switching to another user’s session.

2
  • I thought it used to rely on something more proper/direct. Either I was wrong all the time or pulse has changed at some point.
    – Tom Yan
    Nov 28, 2023 at 8:52
  • I thought so too, but it turns out PulseAudio doesn’t. It could use the session switching logind API but it doesn’t (and I don’t think it ever has). Nov 28, 2023 at 13:03

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .