Not logged in
Log in now
Create an account
Subscribe to LWN
LWN.net Weekly Edition for June 20, 2013
Pencil, Pencil, and Pencil
Dividing the Linux desktop
LWN.net Weekly Edition for June 13, 2013
A report from pgCon 2013
For solving pulse (but also alsa) oss compatibility problems, I have high hopes on this project:
If it can provide near-100% emulation it would be a silver bullet for PA voes, because many Alsa apps also support OSS.
LPC: Linux audio: it's a mess
Posted Sep 20, 2008 13:16 UTC (Sat) by cortana (subscriber, #24596)
Posted Sep 20, 2008 20:43 UTC (Sat) by adamgundy (subscriber, #5418)
as you said, if you use ALSA's built in OSS emulation, that's a kernel module, and competes with any other ALSA source for the sound device. most newer sound devices (consumer, at least) only support a single playback channel, and expect software mixing to be done... but dmix (ALSA's mixer) is a userspace mixer using the ALSA drivers, which means the ALSA-OSS kernel module can't use it, hence blocking audio (it also means no mixing is available for OSS users, so only one at a time can use OSS)
CUSE is a way of providing /dev/dsp and friends for OSS emulation from userspace, so of course a userspace OSS emulator can use dmix, pulseaudio, or whatever and play nicely with other apps.
CUSE lets a userspace program catch the full range of operations on the /dev/dsp device, so it can be a full emulation, unlike tools like aoss which hack into glibc's open calls and try to detect opens of /dev/dsp and do the emulation there (they can't catch everything, so some stuff works with aoss, other stuff doesn't).
Posted Sep 21, 2008 8:27 UTC (Sun) by mlankhorst (subscriber, #52260)
Posted Sep 21, 2008 22:20 UTC (Sun) by adamgundy (subscriber, #5418)
also, aoss is a pain for most users, because they have to start the program they want to 'emulate' under aoss, typically from a command line. CUSE just sits there as a daemon, waiting for any process to attempt to use /dev/dsp.
Posted Sep 21, 2008 23:03 UTC (Sun) by mezcalero (subscriber, #45103)
However, this kind of virtualization is always imperfect, won't work for more complex applications that use mmap, or make assumptions about timing and hardware that a software sound server cannot meet.
Doing emulation with LD_PRELOAD is always hacky, incomplete, and can only be a temporary solution that only works in very specific cases.
Posted Sep 21, 2008 23:07 UTC (Sun) by mezcalero (subscriber, #45103)
So again. Regardless which approach we use: 100% compat won't happen.
LD_PRELOAD is good for some things, CUSE for others. But in the end, 100% OSS compat that works for everyone and always will stay a dream.
OSS as and API needs to go away.
Posted Sep 21, 2008 22:59 UTC (Sun) by mezcalero (subscriber, #45103)
Also, note that the OSS compat ALSA in the kernel provides is far from perfect. Doesn't support userspace plugins -- it hence is incompatible with userspace plugins, such as dmix, and everything else.
Also, OSS as an API is broken in the timing model. The timing model is so broken that it desn't really work properly on USB audio.
Copyright © 2013, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds