OSS

Resources

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.

Installation

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

Kernel

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

Ebuild

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

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

root #layman -a angelos

or

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

Install

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

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

Configuration

General configuration after install.

Compatibility

  • 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.

Note
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

CMI878x

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.

<syntaxhighlight lang="bash">#!/bin/sh
# $ID: /usr/lib/oss/soundon.user, 2012/07/27 12:57:40 -tclover Exp $
modprobe -a oss_{cmi878x,hdaudio}
/usr/sbin/ossdetect -diu
/usr/sbin/ossdevlinks 
# 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
else
	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
fi
# vim:fenc=utf-8:ft=sh:ci:pi:sts=0:sw=2:ts=2:</syntaxhighlight>

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.

Note
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
<syntaxhighlight lang="bash">/usr/sbin/soundon
/root/.scripts/soundon.user
/usr/sbin/savemixer -L</syntaxhighlight>

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.

Usage

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

osstest

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

user $osstest

ossxmix

ossxmix is the graphical tool to configure devices:

Troubleshooting

External Resources

This article is issued from Gentoo. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.