Canonical/Ubuntu has chosen to disable OSS support in their kernels and ignore any bugs filed against OSS4 packages. If you're considering using OSS4, you should probably use another Linux distro like Arch Linux. This page remains for historical/reference reasons.
The Open Sound System (OSS) project provides low-level audio drivers for users and a common Application Programming Interface (API) for developers. By default, Ubuntu uses the Advanced Linux Sound Architecture (ALSA) to provide audio drivers. This document will guide you in replacing ALSA with the latest version of OSS. It is written with Ubuntu 9.10 in mind, but hints for older versions will be provided where possible. To begin, open up a terminal interface (Applications -> Accessories -> Terminal). You can paste the commands found in this guide into the terminal with a Ctrl+Shift+v keystroke. Note: You may hear some people (e.g. Linux kernel developers) refer to OSS as "deprecated" or "replaced with ALSA". This is referring to OSS 3.x. Development of OSS 4.x is alive and well. Many applications use the OSS API for sound because it is well-documented and portable across several platforms (Linux, Solaris, BSD, etc.).
Does OSS Support My Hardware?
Check the list here. Some devices may not have full functionality (e.g. the X-fi module is limited to stereo output at the time of this writing, and jack sensing may not work on Azalia-compliant "High-Definition" devices, which are very common on motherboards and laptops today). If you're in doubt, consult the "Additional Support" sources found towards the end of this document.
It is possible to run PulseAudio with OSS4, but this is outside the scope of this document.
sudo apt-get purge pulseaudio gstreamer0.10-pulseaudio
Removing ALSA packages
sudo /etc/init.d/alsa-utils stop sudo apt-get remove alsa-base alsa-utils
Note: You can't remove alsa-base in Hardy, or it will try and remove gdm.
Blacklisting ALSA Kernel Modules
sudo dpkg-reconfigure linux-sound-base
You will be greeted with an explanatory message. Press [Enter]. You will now be prompted to select the default sound output for Ubuntu. Use the arrow keys to select OSS, and press the Tab key to highlight 'OK'. Press [Enter]. This will blacklist the ALSA driver modules on Ubuntu >= 9.04. On earlier versions of Ubuntu, it may be necessary to manually blacklist at least the snd and soundcore modules by creating a file in /etc/modprobe.d. See the manpage of modprobe.conf for help.
Configure ALSA Apps to Use OSS (OPTIONAL)
In general, it's better to have applications use the OSS API or a higher level sound API/library with OSS4, but if you have the libasound2-plugins package (it's pre-installed on standard Ubuntu installs), it is possible to have ALSA applications output to OSS with this workaround (the first method).
Installing Prerequisite Packages
The second command is only necessary when building OSS4 from source. The third command contains some recommended packages.
sudo apt-get install -y binutils libgtk2.0-0 sed gcc libc6 sudo apt-get install -y build-essential linux-headers-`uname -r` gawk libtool libgtk2.0-dev sudo apt-get install -y libesd0 libsdl1.2debian-oss
Ubuntu Hardy/GNOME 2.22 (and older)
If you want the ability to hear system sounds (such as the login/logout jingle) with OSS, you'll need to install the Enlightenment Sound Daemon (ESD)
sudo apt-get install -y esound esound-clients esound-common libesd0
Ubuntu Intrepid/GNOME 2.24 (and later)
Starting with v2.24, GNOME uses libcanberra for system sounds. Ubuntu builds the libcanberra packages to use ALSA output by default. See this page to use libcanberra with OSS.
System Sounds on KDE 3.x
Make sure you have the aRts system installed:
sudo apt-get install -y arts
System Sounds on KDE 4.x
Enter the sound control panel and set the default outputs to OSS. Phonon's xine backend (probably what you have installed by default) should work with recent KDE4 versions. If you have issues with system sounds or other xine programs, try installing phonon-backend-gstreamer and setting gstreamer as the preferred Phonon backend in the KDE control panel. If using gstreamer, you may also need additional gstreamer packages to support all media formats.
Installing from DEB File
Download the OSS deb file from the 4front website. Select the (DEB) packages, with the architecture you have in parenthesis. e.g. 64 bit use (amd64), and 32 bit use (x86). Click submit and download the package. Before you install OSS, Reboot your system so that the ALSA modules will not load or interfere with it. When you log back in, use the terminal to install the OSS deb file (GDebi fails to install this .deb for some reason)
sudo dpkg -i oss-linux*.deb
Building from Source
Instead of using the .deb file, you can also build OSS4 from soure. We'll use the commands below to obtain and build OSS4 source code . Before you build, Reboot your system so that the ALSA modules will not load or interfere with it. When you log back in, go back to the terminal and proceed:
Obtaining the OSS Source
You can obtain the latest OSS source via a testing tarball, or via the mercurial repository. The repository is updated more frequently, but may temporarily be broken as a result.
Obtaining the OSS Source using latest testing tarball
wget -A '*.bz2' -nd -r -l 1 http://www.4front-tech.com/developer/sources/testing/gpl/ sudo tar xf oss-v4.2*.tar.bz2 -C /opt sudo mv /opt/oss-v4.2* /opt/oss-devel
Obtaining the OSS Source using Mercurial
sudo apt-get install -y mercurial cd /opt sudo hg clone http://opensound.hg.sourceforge.net:8000/hgroot/opensound/opensound oss-devel
Creating a Build Directory
OSS needs an empty directory to build in. Using the example below will create a directory in your /home folder (~)
cd ~/ sudo rm -rf oss42build mkdir oss42build cd oss42build/
Build & Install
NO_WARNING_CHECKS=yes /opt/oss-devel/configure --enable-libsalsa=NO make sudo make deb sudo dpkg -i oss*.deb
But if you receive an ugly error message on sudo dpkg -i oss*.deb, try
NO_WARNING_CHECKS=yes /opt/oss-devel/configure --enable-libsalsa=NO make sudo make install
Updating Your OSS Build
This only works if you fetched the source using mercurial rather than the testing tarball. Check <http://mercurial.opensound.com> to see if any changes have been added that could affect you. At this point you should uninstall any oss-linux .debs you already have installed.
cd /opt/oss-devel sudo hg pull sudo hg update cd ~/ sudo rm -rf oss42build mkdir oss42build cd oss42build
Now follow the "Build and Install" section's directions again to use your updated OSS.
Configuring Applications to Use OSS
See the OSS wiki for help with this. I've listed procedures for common apps below.
Add a new custom application launcher to the panel that runs the command: ossxmix - (That's ossxmix, not ossmix), Name the launcher whatever you want and pick an icon. I named mine "Mixer" and chose /usr/share/icons/gnome/32x32/status/stock_volume-med.png as my icon. If you're new to Ubuntu/GNOME, this primer will help for this task. You can add an ossxmix launcher to a KDE or Xfce panels too.
sudo apt-get install -y gstreamer0.10-plugins-bad
Then you will need to select oss or oss4 outputs in the following dialogs.
Ubuntu <= 9.04
System -> Preferences -> Sound
GNOME Volume Control
The gstreamer-based volume control in Ubuntu 8.04.x is incompatible with OSS, because it uses an older version of gstreamer-plugins, which means your mouse wheel won't control the volume as is. To remedy the issue, try Clive Wright's patch. 32-bit version - gstreamer-ossv4-x86-32bit.tar.gz , 64-bit version - gstreamer-ossv4-amd64.tar.gz. Make sure to read the instructions; the patch is already applied to the included library file (libgstoss.so), but is included in the archive as a reference and to satisfy the terms of the General Public License (GPL).
Ubuntu 8.10 and 9.04
The GNOME volume will work if you have gstreamer0.10-plugins-bad installed. Note that gstreamer and OSS define the 'mute' condition differently.
kmix on KDE 3.5.x
Thanks to "cesium" for this explanation: "The patch has been integrated into kmix: https://bugs.kde.org/show_bug.cgi?id=166591#5 and https://bugs.kde.org/show_bug.cgi?id=166591#13. The commiter would like to have this tested more. For that, you'll have to fetch kdemultimedia from the SVN branch for KDE 3.5, replace /usr/include/sys/soundcard.h with the file /usr/lib/oss/include/sys/soundcard.h, and (try to) use kmix from the complied kdemultimedia."
kmix on KDE 4.x
kmix does not work on KDE4 at this time. Use ossxmix or, if you'd prefer to map commands to your shortcut keys, here are some scripts to use. A patch has recently been proposed, but will require compiling kdemultimedia from source to test it.
OSS v4.1 or later should automatically install the necessary support library. Note to 64-bit users: If you're running a 32-bit Flash plugin (such as the flashplugin-nonfree package) through nspluginwrapper, you'll need a 32-bit version of libflashsupport.so in /usr/lib32
Build your own copy of libflashsupport.so: (See this)
If you run into problems, follow these steps first:
Recovering From a Failed .deb Install
If you use the .deb package and it fails to install completely, use this procedure to remove it.
Consult the OSS wiki
The wiki's Troubleshooting page may already have an answer to the problems you have.
If you have OSS installed properly, but still have issues, the OpenSound project has free user support forums and an IRC channel. Be sure to include the output from these commands so the experts don't have to prompt you for them
ossmix ossinfo -v3
Also, you'll want to note if the osstest command works and plays sound.
You can make a thread on the OpenSound user forums.
Reverting to ALSA
NOTE: I've tested this procedure (on an Intrepid install) and was successful, but some people are complaining that it does not work. If you see any errors, please respond to the forum post. Some users wish to revert back to ALSA to try Creative's X-fi drivers or maintain complete Ubuntu compatibility. Click here for the procedure.
Contributing to OSS
If you wish to contribute to OSS developement there are several ways:
Order an OSS license. In this way you will also get free technical support for two years.
Contribute code via the developers' community. To subscribe to the OSS developers' list, Click Here
Add content to the OSS wiki
Help other OSS4 users on the OpenSound forums and/or at the #oss Freenode channel.
- Spread the word about OSS4 on the Ubuntu forums when you see a user having problems with ALSA
<http://www.opensound.com/> - The homepage of the OpenSound System project.
<http://4front-tech.com/hannublog/?p=5> - An entry in Hannu's blog giving a succinct history of sound drivers in UNIX and Linux.
<http://www.opensound.com/wiki/index.php/Main_Page> - OSS wiki.