lkml.org 
[lkml]   [1999]   [Oct]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: Kernel OSS vs ALSA
From
Date
Paul.Menage@cl.cam.ac.uk (Paul Menage) writes:

> If you're allowing applications to play audio data, then unless you
> have a very cunning mixer daemon, you're trusting them not to drown
> each other out with white noise. In which case, why not map the
> soundcard's DMA buffer into the address space of each application
> that's using the card, and let each application do its own mixing?
> (i.e. the app gets told what volume it's meant to be playing at, scales
> its output accordingly, and just adds each sample to the current
> contents of the next slot in the buffer. On an SMP machine this
> obviously has some drawbacks, but on a UP machine it can work well.
>
> See http://www.cl.cam.ac.uk/~dr10009/audio/ for an implementation of
> this technique.

There are a few issues I see with that proposal (none of which
necessarily bar it from being used on certain machines):

* It requires additional work to clear out the buffer after it is played
(performed by a kernel thread in that paper's software)
* Your argument that you trust your apps to play nicely assumes that they
will always have control over mixing volumes (okay, so it would be very
hard to actually prevent this in a typical setup, but if the app can be
turned down you no longer have to "trust" it so much with your eardrums)
* Restricting yourself to only doing additions on the buffer (as the paper
does to avoid races) restricts you to correct mixing of only 2^N buffers

but most of all:

* Why mix in software in a shared buffer if the hardware can mix from
"enough" buffers by itself?

In my opinion, any replacement (and most enhancement projects) for the
current sound subsystem should provide multiple streams to userspace if
the hardware supports it. Things like 3D support are considerably
harder to devise an API for, but this should not be so hard.

-- Michael

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:54    [W:0.054 / U:1.820 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site