Hi Ryan, hi Matt!

I read your discussion. I thought quite a while about possible
options, so here are my thoughts:

(1) Start a global system esd.

 - esound was designed as a per-user process, not system-wide. Every
   user can and should be able to use her own default device, which is
   not possible with one instance.

 - Users cannot send signals to processes they don't own, so they
   cannot change the default device by sending SIGUSR1 (see the
   previous patch I sent you), nor restart the daemon, at least if
   you don't use some nasty setuid wrapper tricks.
  
 - This completely prohibits working with multiple sound cards.

(2) Reuse an already existing esd.

 - First, the socket permissions are already 777, esd checks the owner
   of the file. With the -trust parameter this check can be disabled.

 - However, this breaks if the first user suddenly logs off and/or
   kills his esd.

 - Same problems as in (1), so this is even more nasty.

(3) Don't use esd at all.
 
 - That's what Ryan suggested:
   Ryan Murray [2005-08-18 17:16 -0700]:
   > I think the best solution looks like this:
   >    - fix dmix to work for everyone
   >    - change libesd to play directly to the sound device (the code is
   >      already there for the fallback case).
   >    - stop starting/using the esound daemon.
  
 - We did this change for a while, we didn't use esd at all and had
   gstreamer output to ALSA directly. Nowadays, dmix is enabled by
   default on most cards, but it still breaks on too many cards. Also,
   dmix' mixing quality is way below what esd/polypaudio offer. We
   want to provide a working sound environment for everybody, so
   currently we cannot do without a sound daemon yet.
  
 - ALSA does not allow different users to open the sound device
   simultaneously. So you need to check every application that it
   releases the sound device if it doesn't need it.

(4) Allow multiple esds with per-user sockets.

 - This is the solution I proposed in the patch I sent, and which is
   currently in Ubuntu. It is symmetric, every user has her own
   private esd instance, can signal, kill, and configure it.

 - Ryan said it may break commercial apps. I'm really not too worried
   about that. First, if an app uses the socket directly instead of
   using libesd, it is broken by design. Second, most commercial apps
   I know use OSS and/or ALSA; I doubt that there are many commercial
   apps which can *only* output to esd's raw socket; frankly, I don't
   care about them in Ubuntu.
 
 - The biggest disadvantage of this approach is the same mentioned in
   (3) (ALSA does not allow different users to open the sound device
   simultaneously). (1) and (2) solve this, but are differently
   broken. To mitigate this, I added the -as 5 parameter; if several
   users use the same default card, only one can use the soundcard at
   any given time, but -as 5 will make sure that the card is not
   blocked unnecessarily.
 
 - This works flawlessly if several users use different sound cards,
   which is not supported by (1) and (2).

So after considering all the pros and cons, I decided for (4) since it
adds some benefits without breaking anything existing. Your choice for
Debian of course, I only want to offer what we have. :-)

Thanks,

Martin

-- 
Martin Pitt        http://www.piware.de
Ubuntu Developer   http://www.ubuntu.com
Debian Developer   http://www.debian.org

Attachment: signature.asc
Description: Digital signature

Reply via email to