Sponsored Link

After upgrading to Ubuntu 10.4 LTS, I was happy to notice that audio in all applications (including Skype) was finally working perfectly! However, I was less happy to notice that Pulseaudio was using quite a lot of CPU-time, and that the sound quality was absolutely awful... So I decided to give OSS4 a try. After some googling, installing a few packages and some minor configuration, OSS4 was up and running, and I must admit the improvement in sound quality is rather significant!

In a terminal, run sudo dpkg-reconfigure linux-sound-base
Choose OSS. This should, among other things, prevent the ALSA modules from loading. Reboot.

There are (at least) three ways to install OSS4:

Install from the Ubuntu repositories:sudo apt-get install oss4-base oss4-dkms oss4-source oss4-gtk
This will automatically rebuild the OSS modules when your kernel is updated, and is the preferred way of installing third-party kernel modules. However, the oss4-dkms package is currently broken for Ubuntu (bug #519577), so for the time being use the package from the Opensound website (recommended, see below) or from this PPA (not recommended as it currently breaks sound in the Adobe Flash plugin).

Download the OSS4 binaries as a DEB package from http://www.opensound.com/download.cgi and install it. This is currently the easiest way, but you'll manually need to reinstall the package every time your kernel is updated. Also, this package is not GPL but has a commercial one-year license.

If you get errors about snd_pcm being in use, try rebooting and running sudo soundon. If the problem persists, use lsmod to check if any ALSA modules are still loaded. If so, blacklist them manually. For instance, I had to blacklist the saa7134_alsa module by creating a configuration file /etc/modprobe.d/blacklist-saa7134_alsa.conf with the line blacklist saa7134_alsa

Add the following PPA to your Software Sources and run update-manager: https://launchpad.net/~dtl131/+archive/ppa
This will enable Gnome audio output and volume management to use Gstreamer instead of Pulseaudio.

Right-click over your panel, select "Add to panel" and add the volume control applet. Alternatively, you can add a button to your panel or menu to start the OSS4 mixer (/usr/bin/ossxmix) instead of the normal Gnome volume manager.

Configure applications that natively support it (e.g. Audacious, Audacity, Kdenlive, SMPlayer, VLC, Wine, etc.) to use OSS output. Many applications don't (or no longer) have native support for OSS. This is no problem, these should continue to work fine through Gstreamer or ALSA emulation (or Pulseaudio if you decide to keep it).

After removing Pulseaudio, it could be that Rhythmbox or Movie Player start to complain about missing audiosink plugins. In that case you'll need to manually change some Gconf-keys. Start gconf-editor. Open system/gstreamer/0.10/audio/default. Check if any keys (e.g. musicaudiosink and chataudiosink) are still set to "pulsesink". If so, change them to "osssink".

Reverse back your changes

In a terminal, run sudo dpkg-reconfigure linux-sound-base
Choose ALSA. Reboot.

PulseAudio uses a high quality resampling algorithm by default. ALSA supports only one, a simple linear resampler. If, like most people, you can’t hear a difference anyways, you can configure PulseAudio to use a linear algorithm too by adding “resample-method = src-linear” in /etc/pulse/daemon.conf. CPU usage will drop…

OSS was kicked out of Linux after the makers tried to monetize on it. They changed their license and tried to force everybody to pay for something they had been saying a long time it’s for free. This has lead to ALSA, which has a better independence and, licence agreements(it’s free) and architecture but is still not completely developed although it’s getting there(it’s pretty good already and sufficient for most users)

I think this article is dangerous in that it invites confused individuals (and to get confused in Linux audio is normal) to dig deeper in the mess that is Linu audio. I have used it for so many years that I can tell you that we don’t need OSS4, we already got two sound systems too many. ALSA should have been enough, but does not allow sharing of the soundcard (at least not in any configuration that I have seen), so they pulled pulseaudio out of the hat. I would have been happier if they used jackd, as it is the most powerful of them all and would have sufficed for any application.

So why is OSS4 bad in my eyes? Well, Linux audio is just stabilizing after having sent so many users screaming back to windows, since they JUST COULD NOT GET THAT GODDAMN soundsystem to work and who can blame them? You need weeks and moths and years to just know what is what. A standard for audio? Linux does not have it.

Now we are at the point, where Ubuntu is leading the way with Pulseaudio and Alsa and the idea is that ALL programs will work with it and I think we are getting there. Now at this point, we need less choice, not more. Coming from a time where choice was no problem, lots of it existed, but getting a program to produce any sound at all was and the different sound systems messing eachother up.

So you might not agree with me, that choice here is a bad thing, but I speak for the linux community at large, especially the desktop one, where users don’t want to spend hours and days getting audio to work or having to edit config files with that or this.

I tried your writeup and it trashed my sound system, I had to remove alsa, pulseaudio, oss, and the settings in /etc/pulse/default.pa and then completely re-install alsa pluseaudio and the ubuntu desktop in order to get things going again I think you may need to update your removal instructions.

I got this to work for me and had no choice it seemed since I could not get sound through anything else. But, here is the problem. I still have no sound when going on the internet. Also, when playing movies the sound is so freaking low that I might as well be watching a silent film or turning on subtitles. If anyone know the how-to on this, your help is appreciative.

I see the negative responses, and wonder, “Why?” I’m no guru, by any means – but I’ve used all the methods outlined above, and they work. Downloading the commercial .deb package is easiest, but the other methods are almost painless. Come on people – whatever OSS’ faults in the past, they now make the best sound system available. It “just works” with Virtualbox, whereas nothing else works with Virtualbox!

I think this article is dangerous in that it invites confused individuals (and to get confused in Linux audio is normal) to dig deeper in the mess that is Linu audio.

That’s exactly why OSS4 should be used. ALSA is Linux only, while OSS follows UNIX principles (low level API, does well what it’s supposed to) and is default sound system on BSDs and all other *NIXes excluding OS X.

Even today much of software is written to use OSS APIs (as it’s lot simpler, better documented and doesn’t restrict developer to Linux only) so now we have OSS, ALSA and even Pulseaudio at same time. Such a mess makes no sense.

Now we are at the point, where Ubuntu is leading the way with Pulseaudio and Alsa and the idea is that ALL programs will work with it and I think we are getting there. Now at this point, we need less choice, not more. Coming from a time where choice was no problem, lots of it existed, but getting a program to produce any sound at all was and the different sound systems messing eachother up.

I’ve had lot of problems when using Pulseaudio (which I have no need for anyway). On some machines I can get sound only through ALSA, but pa stays silent. When I get sound it’s often low quality (crackles) and pa seems to also be CPU hog.

So far I’ve been using ALSA only, which has worked fine for me. But I realize it is also unnecessarily complex and can be cryptic to configure.

Now that OSS4 is under GPL it would be answer to solve this complexity and get back to using OSS as default.

“OSS was kicked out of Linux after the makers tried to monetize on it. They changed their license and tried to force everybody to pay for something they had been saying a long time it’s for free.”

Linux audio folks could have just forked OSS and develop it onwards. Instead they decided to build abstraction layer above another and thus we are in the mess we are. User shouldn’t need to know about anything of this (but sadly with ALSA and Pulseaudio they often have to). Sound should just work.

Just a short note: in essence, this method also works for Quantal Quetzal (12.10). I’m not sure I have the Gnome volume control redirected to GStreamer, but audio is now playing OK including from Flash. One small note: the GUI volume control for OSS/OSS4 is /usr/bin/ossxmix, not /usr/bin/ossmix which is the terminal-only mixer.