multiuser-soundcards-pulseaudio
Launchpad Entry: multiuser-soundcards-pulseaudio
Created:
Contributors: David Henningsson
Packages affected: PulseAudio, possibly more
Summary
PulseAudio currently assumes all soundcards are of exclusive use to the person logged into the current X session. There are several use cases where this assumption is not valid.
We need to investigate possible solutions to this problem.
User stories
- User Foo has one of his soundcards connected to a long cable that goes to speakers in another room, where it serves as a media player. Foo wants to control what music is being played in that room, even if someone else is sitting in front of the computer.
- User Bar needs to run a program which needs to output a sound, regardless of who currently logged in. It could e g be some kind of alarm.
User Gavitron has a headless PC. X11 has been disabled at boot, and no user logs in at console. Speakers are plugged in to this computer. Users visit a website served from this machine, and select the music they wish to hear. (Currently this scenario appears impossible with PulseAudio.)
Assumptions
Removing PulseAudio is not trivial, so it would be better if we could support these use cases in PA than to throw PA out the window.
Design
Ideas lifted recently in pulseaudio-discuss:
- Write udev rules to change permissions on the audio device(s).
- Make a user part of the "audio" group.
- Reconfigure PA to open up for other users to connect to the currently active PA.
Other ideas (these have been disliked in pulseaudio-discuss though):
- Move the reserve API to the system DBus?
Run PulseAudio as a system-wide daemon?
Run PulseAudio on top of dmix?
Write udev rules
By writing udev rules, one can change the device permissions on the audio device nodes.
- Pros:
PulseAudio follows udev rules / device permission
- "The right way" to configure multi-seat, or that the soundcard does not belong to the logged in user
- Safe and secure
- Cons:
- Writing udev rules is not easily accessible for the newbie Ubuntu user
- Only one at a time can access the audio device - it becomes busy.
- Suitable use cases:
- System-wide media player daemon which has a dedicated soundcard
Adding the user to the audio group
A user added to the audio group can access the audio devices even if not logged in.
- Pros:
- Easy to configure
- Cons:
- Only one at a time can access the audio device - it becomes busy.
- Spy-on-mic possible, but only if the user is not already using the soundcard
- Suitable use cases:
Opening up PulseAudio for other users to use
- Pros:
- Proper mixing between active user and background users
- Easy to configure
- Cons:
- Less secure (spy-on-mic problem)
- Interruptions when user logs in and out
- Suitable use cases:
- When background services need to inform users by making an audio alarm
- When security is not an issue
BluePrints/multiuser-soundcards-pulseaudio (last edited 2010-07-02 05:22:58 by S010600a0c922a5c6)
Release Note
This section should include a paragraph describing the end-user impact of this change. It is meant to be included in the release notes of the first release in which it is implemented. (Not all of these will actually be included in the release notes, at the release manager's discretion; but writing them is a useful exercise.)
It is mandatory.
Rationale
This should cover the _why_: why is this change being proposed, what justifies it, where we see this justified.