Re: Multiple users sharing the sound card?

On Mon, 25 Jun 2007, POLONKAI Gergely wrote:

Craig S. Kaplan írta:
Hi everyone,

I'm a longtime GNOME user and fan.  My wife and I share a desktop PC at
home.  We run sessions in parallel, switching back and forth via the
user switcher applet.

Everything works great, except for sound.  Ideally, the sound card would
simply be accessible to anyone currently logged into the machine (which,
after all, sits behind a firewall).  That's certainly not the case --
we can't use the sound card from both sessions at the same time.  But
it's worse than that -- we can't seem to reliably switch back and forth
either.  If a process on my wife's session decides to play a sound, it
might take over the sound card, causing my rhythmbox to refuse to play
next time I start it.  I feel like it has to do with esound, but I'm
finding it hard to know for sure.

Perhaps there ought to be some sort of fancy policy system for deciding
which users can access the sound card when.  But I'd be perfectly happy
to have a promiscuous policy where all users can play sounds at the same
time.  I've looked around, but I can't find good documentation on this
subject.  Do I need to adjust ALSA?  Esound?  Gnome?  Can it be done?

For the record, I'm running Ubuntu 6.10 on a machine with an M-Audio
Audiophile 2496 (the ice1712 driver under ALSA).

Thanks for any help lessening my domestic strife!


I'm almost sure that your problem is with esound. AFAIK, esd can be
configured from the control panel (gnome-sound-properties maybe?) to run
esound only if needed; so when gnome wants to play a sound, it starts
esd, or connects to a running esd session. If your wife runs esd just at
the moment when you want to play something in rhythmbox, rhythmbox will
try to connect to esd, which will certainly refused, as your wife is
already running it.

The only option I see under sound properties is "Enable software sound
mixing (ESD)", which seems like too general an option to control
whether ESD starts on demand or tries to own the sound card.  In any
case, this isn't a great solution, since it still only lets one of us
use the sound card at a time.  We should be able to mix freely, so (for
example) my wife can generate a beep while I'm playing music from

In gentoo, there is kinda workaround for this, as you can start esound
at boot time, so (in theory, I haven't tested it yet) every user can
connect to it anytimes. If you need it, I send you this init script, it
can come handy.

Yes, I think that's what I want.  Am I right that root can start ESD
and enable all users to send sound to it?  Your initscript would be
handy; and if anyone has succeeded in carrying out this modification in
Gnome and/or Ubuntu, I'd love to see the sequence of steps they took.

Craig S. Kaplan                         If civilization is to survive,
University of Waterloo                   it must live on the interest,
Cheriton School of Computer Science        not the capital, of nature.                     -- Ronald Wright

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]