From Gentoo Wiki
Jump to:navigation Jump to:search

Open Sound System (OSS) v4 is an alternative to ALSA as a layer between programs and sound hardware. Users of v3 are encouraged to use the not so maintained v4 version which has a BSD and GPL-2 licences.


Currently there is no maintained ebuild in portage for this software.


KERNEL Sound card support
Device Drivers  --->
        <M> Sound card support  --->
             --- Sound card support
             < >   Advanced Linux Sound Architecture --->
             < >   Open Sound System (DEPRECATED)  --->


The information in this section is probably outdated. You can help the Gentoo community by verifying and updating this section.

There are many more or less active overlays for ebuilds. Most of them require layman to have git or mercurial support:

root #echo 'app-portage/layman git mercurial' >> /etc/portage/package.use
root #emerge layman

Alternatively, repositories that use git can benefit from Portage's native git sync support and the eselect repository command:

root #emerge --ask dev-vcs/git app-eselect/eselect-repository


angelos-overlay seems pretty up to date and maintained by a Gentoo developer. <3 Christoph
To use it:

root #layman -a angelos


root #eselect repository enable angelos

bug report

Ebuilds can also be found in bug #184123, which would need to be added to the local overlay


Build the modules and add /etc/init.d/oss to the default runlevel:

root #emerge oss
root #rc-update add oss default


General configuration after install.


  • Many application only provide support for ALSA, therefore it is a good idea to keep both USE flags
FILE /etc/portage/make.conf
USE="... alsa oss ..."

OSS will create ALSA devices for those applications.

in the current ebuilds, this feature can be disabled using a USE flag like salsa or libalsa
  • to be able to use OSS4 with GNOME or other gstreamer dependent desktop environments like xfce4. Once again, media-plugins/gst-plugins-oss4 which is included in media-libs/gst-plugins-good! was dropped from the official tree, so you will have to make your own ebuild (quite easy for this one) or else grab one somewhere (bar-overlay, for example).
root #emerge --ask media-plugins/gst-plugins-oss4


Unlike ALSA, OSS4 has fewer complex options to configure, so you won't need any `soundon.user'. Especially if your setup isn't complex or are using more than one sound card. In the latter case, you may want to keep a `soundon.user' file to be able to choose your first card (default card). And then, insert a few lines correcting devices nodes which can be problematic.

# $ID: /usr/lib/oss/soundon.user, 2012/07/27 12:57:40 -tclover Exp $
modprobe -a oss_{cmi878x,hdaudio}
/usr/sbin/ossdetect -diu
# Remapping ossdevlinks links
if [ -d /dev/oss/oss_cmi878x ]; then
	ln -sf /dev/oss/oss_cmi878x0/pcm1 /dev/dsp
	ln -sf /dev/oss/oss_cmi878x0/pcm1 /dev/dsp_ac3
	ln -sf /dev/oss/oss_cmi878x0/pcm1 /dev/dsp_in
	ln -sf /dev/oss/oss_cmi878x0/pcm1 /dev/dsp_mmap
	ln -sf /dev/oss/oss_cmi878x0/pcm1 /dev/dsp_multich
	ln -sf /dev/oss/oss_cmi878x0/pcm1 /dev/dsp_out
	vmixctl attach /dev/oss/oss_cmi878x0/pcm1 /dev/oss/oss_cmi878x0/pcm1
	ln -sf /dev/oss/oss_hdaudio0/pcm0 /dev/dsp
	ln -sf /dev/oss/oss_hdaudio0/pcmin0 /dev/dsp_in
#	ln -sf /dev/oss/oss_hdaudio0/spdout0 /dev/dsp
	ln -sf /dev/oss/oss_hdaudio0/spdout0 /dev/dsp_ac3
#	ln -sf /dev/oss/oss_hdaudio0/spdin0 /dev/dsp_in
	ln -sf /dev/oss/oss_hdaudio0/spdout0 /dev/dsp_mmap
	ln -sf /dev/oss/oss_hdaudio0/spdout0 /dev/dsp_multich
	ln -sf /dev/oss/oss_hdaudio0/spdout0 /dev/dsp_out
#	vmixctl attach /dev/oss/oss_hdaudio0/pcm0 /dev/oss/oss_hdaudio0/pcmin0
# vim:fenc=utf-8:ft=sh:ci:pi:sts=0:sw=2:ts=2:

The previous script will check if there are devices nodes, so a sound card, with CMI878x driver and then relink almost everything to it or else use HDAudio.

Notice that, that file will be overridden whenever media-sound/oss is updated so you will have to add that file to:
FILE /etc/portage/make.conf
CONFIG_PROTECT="... /usr/lib/oss/soundon.user ..."

Or else, create a file like `~/.scripts/soundon.user' and edit `/etc/init.d/oss' to your liking.

FILE /etc/init.d/oss
/usr/sbin/savemixer -L

Now you can enjoy Open Sound System. I found the sound with OSS4 to be better than what I can get with ALSA. There was a time when my CMI878x sound works only with OSS4 but a few things changed.

OSS4 has its own mixer so using extra sound daemons like pulseaudio, esd etc. is not necessary.


OSS4 has several comandline tools and one gtk-GUI to configure the devices.


Maybe it just works, test all audio devices with the following command:

user $osstest


ossxmix is the graphical tool to configure devices:

Oss ossxmix.png


External Resources