[linux-audio-dev] Idea: fake OSS passback driver

Paul Davis paul at linuxaudiosystems.com
Sun Feb 1 08:46:12 EST 2004


>Can anyone say why this idea can not, or should not be implemented?

i don't think you can have both (all?) things you want.

either /dev/dsp (the OSS PCM data device) is being emulated by ALSA,
or by something like your idea, or its being handled by native OSS.

if its handled by ALSA, then you just need to (1) use ALSA's
facilities to allow this and (2) assist ALSA developers in debugging
rogue and errant behaviour with certain applications. ALSA can do
this, but its very hard for regular mortals to understand how to
configure it and according to some reports it still has problems,
especially with mmap-based applications (the infamous Quake being the
obvious example).

if its handled by something like your idea, then ALSA apps on the same
machine can't use the device.

if its handled by OSS, then you would still need an LD_PRELOAD hack of
some form (such as ALSA's "aoss" script) to make it work.

the biggest mistake (free) OSS makes it to put all of its functionality into
the kernel without a "shared layer" that all drivers use. this makes
it practically impossible to implement "OSS-wide" features like device
sharing, even if you thought it would be good to put it into the
kernel. why? because you would have to add it to each and every driver
individually. 

ALSA's approach of putting additional functionality in user space
makes it much more flexible, and its internal design within the kernel
means that all drivers share a large blob of common code, enabling
features to be added that extend across all of them.

if you have energy to burn evangelizing this, why don't you instead
lobby freedesktop.org to adopt a system-wide callback-driven API for
audio along the same lines as OS X has with CoreAudio and its
AudioUnits API? then the situation can be dealt with once and for
all, and Linux ends up with a consistent, uniform, efficient and
powerful audio API rather than continuing to push hardware abstraction
layers like OSS and ALSA as the primary programming API for audio.

--p

ps. in case you didn't know, there is already an implementation of 
    such a system, which already runs almost all "music" apps 
    written for Linux and also runs on OS X. it wasn't written
    to be suitable for all kinds of applications, but it probably
    could be made to be so rather easily. http://jackit.sf.net.
    in addition, there is an API that has existed for a long time
    that promotes the callback style, and allows software to be
    ported to all Linux drivers, Mac OS (9 and X) and Windows (ASIO 
    and MME and WDM). its called PortAudio.


More information about the linux-audio-dev mailing list