LWN.net Logo

Software Mixing

Software Mixing

Posted Jun 6, 2006 0:22 UTC (Tue) by fanopanic (guest, #27958)
Parent article: Polypaudio, a networked sound server

Why is FreeBSD the only free OS that managed to do software mixing right? I mean, with all the ambitious plans to make Linux desktops a veritable alternative to Windows/MacOSX, both of which support painfree software mixing, this should be a number one priority.

I can live without windows-only applications and fancy games, but I do not understand why I should play around with starting/stopping/restarting applications because the sound device is already in use. The alternatives, sound servers or meticulously fiddling with asound.conf in order to get dmix running, are not fun and not acceptable, especially considering that FreeBSD simply does it in-kernel, without any hassle for the user at all.


(Log in to post comments)

Software Mixing

Posted Jun 6, 2006 7:17 UTC (Tue) by drag (subscriber, #31333) [Link]

It's due to legacy support of OSS driver system. It's a bit funky and designed to be used with ancient-style sound cards.

If, on very modern linux systems, if you disable OSS compatability stuff (make sure the oss modules for alsa don't get loaded) then everything should be software mixed by default by dmix. Although disabling OSS will break some maladjusted applications.. most can be configured to use alsa though. This is relatively new with the past 2 kernels or so. Not sure how hot it works though, I still have to mess around with my asoundrc, but then again I have multiple sound cards. :)

Software Mixing

Posted Jun 9, 2006 18:20 UTC (Fri) by tialaramex (subscriber, #21167) [Link]

It took a while, but today's distros get this right. Fedora Core 5 had dmix settings up out of the box and I was able to run as many ALSA apps together sharing the single sound card as I pleased. As far as I can see it detects at runtime if you have hardware mixing on your card (from a list) and if not it uses dmix to simulate it.

Of course dmix doesn't fix OSS applications, but OSS hasn't been anything but a legacy API on Linux for many years now. Might as well complain that SELinux doesn't work with your Minix root filesystem...

"FreeBSD simply does it in-kernel"

The consequence is that your OS kernel is doing resampling, an expensive operation that would ideally be done with FP math, except of course trampling on the FP registers, especially on x86, is too nasty to be worth doing in the OS kernel, so you have some even more complicated integer maths to "kludge" it, and/or you get nasty artifacts depending on which applications you run in which order...

The comparison to Windows (which also does this kernel mixing for run of the mill applications) fails to mention that Vista moves away from that model due to reliability problems. Did I mention the kernel bugs found in the BSD mixer? Found and fixed of course... until next time.

Copyright © 2008, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds
Powered by Rackspace Managed Hosting.