Configuring Applications for OSSv4

From Open Sound System
Revision as of 04:07, 12 August 2009 by Cesium (Talk | contribs)

Jump to: navigation, search

Most applications should work with OSSv4 out of the box. However, sometimes distributions separate the OSS output plugins to another package, patch the software to use another sound API or neglect to compile OSS output support. This page will show how to tell some common applications to use the OSS API. There's no need to use any of these tips unless there's a problem. Headings prefixed with a distro name(s) are meant only for the named distro(s), though it may help other cases as well (e.g. most of the Debian advice is applicable to Ubuntu as well).


General issues

Getting system sounds

  • KDE 3.x: Open the "Contol Center". Select "Sound & MultiMedia", "Sound System" and set up arts to use "Open Sound System".
    Alternatively, Open the "Contol Center". Select "Sound & MultiMedia", "System Notifications" and "Player Settings". Check "Use an external player", and select an OSS supporting player which support ogg files (ogg123 for example).
  • KDE 4.x: See instructions for Phonon below.
  • Gnome: This depends on version. First, select "OSS - Open Sound System" whenever possible under "Sound Preferences"(under "Devices" tab).
    • Older Gnomes output system sounds via esd, so install esound (e.g. apt-get install libesd0 esound on Ubuntu), and restart Gnome.
    • Newer Gnome use libcanberra. Typically libcanberra's Pulseaudio output module is already installed, so see Pulseaudio instructions. Once Pulseaudio is set up, system sounds should work. Alternatively, you can get/compile the libcanberra-gstreamer module, and follow gstreamer instructions.
    • In Ubuntu 8.10, the desktop manager (gdm) uses an ALSA-only player (aplay) to play the startup/failed login sound. To fix this, edit /usr/lib/gdmplay and replace "aplay -N" with ossplay. For example:
 /usr/bin/ossplay -q $@ 2> /dev/null
  • All the quoted names may be different on other systems due to localization.

Midi applications

  • To merely play MIDI files, software synthesizers (like timidity and fluidsynth) will work fine (They can play MIDI files directory to OSS output.)
  • Other applications wishing to play MIDI which are not synthesizers themselves (like scummvm or tuxguitar) should be set to use (lib)fluidsynth or timidity.
  • You may decide to load ALSA's sequencer modules. As long as modules which touch the hardware or modules which emulate oss (snd-mixer-oss, snd-pcm-oss) are not loaded, this is safe. Than you could load timidity or fluidsynth as ALSA midi sequencers, and have the apps use these. This is not needed to make libfluidsynth or timidity's server mode work though. errors

  • OSSv4.0 replaces with libsalsa, in order to allow some ALSA emulation. This may make some applications refuse to start with an " undefined symbol errors" error. (OSSv4.1 doesn't do this by default, and such errors probably have a different cause there). This can be fixed as follows:
    • Often, applications link to via a sound plugin. Thus, installing the respective OSS compatible plugin for the app may fix this (e.g. libesd0 instead of libesd-alsa0 on Debian/Ubuntu), as the application doesn't depend on libasound anymore.
    • If the method above doesn't help, you could just move libsalsa out of the way. It's rarely needed as the vast majority of apps can use OSS directly. This may require root permissions ("su" or "sudo").
      • mv /usr/lib/oss/lib/ /usr/lib/oss/lib/
      • ldconfig
      • Note that installing OSSv4.0 will recreate libsalsa, so if you removed it you may wish to do this again. This only applies to the v4.0 versions.

ALSA Emulation

  • Another error which may happen is "ALSA lib pcm_hw.c:1240:(_snd_pcm_hw_open) Invalid value for card". This is emanating from the real libasound, and likely means that the program tried to use ALSA on a system with OSS installed. Unsurprisingly, the attempt failed.
  • Making the application use OSS (per instructions in this page) is always the best fix. However, there are ways to emulate ALSA if there's no other choice, see Tips_And_Tricks#ALSA_Emulation.

Multimedia Keys

General OSS problems

Specific applications


  • Cmus' oss output plugin doesn't work with OSSv4, change to libao.
In cmus, type ":" to activate commandline, and "set output_plugin=ao"
Edit ~/libao or /etc/libao.conf to "default_driver=oss"
  • Optional: Enable cmus' software volume control:
Type ":" then "set softvol=true". Use + and - on the keyboard to change volume.


  • Debian: install libpt OSS plugin (e.g. libpt2.6.1-plugins-oss).
  • If Ekiga doesn't display the OSS device in the listing, you can add it manually using gconf-editor. The following keys should be changed:
to a value of the form
'/dev/dsp (PTLIB/OSS)'
/dev/dsp can be replaced by other output nodes.
The following terminal commands can be used to set up Ekiga:
$ gconftool-2 --set /apps/ekiga/devices/audio/input_device --type string "/dev/dsp (PTLIB/OSS)"
$ gconftool-2 --set /apps/ekiga/devices/audio/output_device --type string "/dev/dsp (PTLIB/OSS)"
$ gconftool-2 --set /apps/ekiga/general/sound_events/output_device --type string "/dev/dsp (PTLIB/OSS)"

Enemy Territory - Quake Wars

  • Edit ~/.etqwcl/base/etqwconfig.cfg and change
seta s_driver "alsa"
seta s_driver "oss"


  • Debian: install libesd0 instead of libesd0-alsa.

Adobe Flash

  • Flash V7 should be using OSS natively.
  • Flash V9 and V10 require libflashsupport to output sound via OSS. Typically a 32-bit version of the library is required.
  • Flash V10 has a 64-bit version which requires a 64 bit libflashsupport.
  • OSSv4.1 tries to install a fitting libflashsupport automatically. However, some distros prefer removing libflashsupport from the package, using a separate package for it.

getting libflashsupport

  • Debian/Ubuntu:
    • Do not install libflashsupport package from apt-get. That packages only supports Pulseaudio, and should be removed if you have it.
    • You can Install flashplugin-nonfree-extrasound package and this should work, but that package misses some fixes for OSS [1].
  • Fedora: Versions 8/9 include a libflashsupport package which should be removed. That package only supports PulseAudio.
  • Gentoo: Add net-www/libflashsupport to /etc/portage/package.keywords file and emerge using: USE="oss ssl" emerge libflashsupport . Restart browser and now it should work. You can ignore the other instructions.
  • Arch: libflashsupport should be included in the oss package. If you installed OSS manually or the included libflashsupport fails, read on.
  • There is a precompiled 32-bit library for Linux/glibc [2], and a precompiled 64-bit library for Linux/glibc [3]. If you decide to use this version, download it and skip to "installing libflashsupport" below.
  • If none of the above applies/works for you should try to follow the instructions below.

compiling libflashsupport

    1. flashsupport.c is found in /usr/lib/oss/lib
      • 64 bit users will require gcc multilib support, unless they are compiling a 64bit library.
        • 64 bit Fedora users will not require "multilib" support but will need gcc-devel installed. Command would be, "yum install gcc-devel.i386" for Fedora 8 and above
        • In Debian/Ubuntu - sudo apt-get install gcc-multilib
    2. OSSv4.0: Comment out "#define OPENSSL" by placing a '//' in front of that line.
    3. To compile: cc -shared -fPIC -m32 -O2 -Wall flashsupport.c -o /tmp/
      • For a 64bit libflashsupport, omit "-m32" argument.
    4. Continue at "installing libflashsupport" below.

installing libflashsupport

    1. sudo install -s /tmp/ /usr/lib/oss/lib
    2. sudo install -s /tmp/ /usr/lib
    3. sudo ldconfig
    4. Restart browser
    5. If that above failed, make sure that there aren't any other copies of libflashsupport in the system which happen to be picked up by ldconfig / Flash. 'ldconfig -p | grep libflashsupport' command may prove useful. If you're a 64-bit user, make sure a copy of the file is in your 32-bit library directory (/usr/lib32 on Debian or /usr/lib on Fedora)

Alternatives to Flash

  • If the above fails, than a Flash alternative can be used. This has the added advantage of these alternatives being free.
  • gnash works for many flash videos.
    • Debian: apt-get install apt-get install mozilla-plugin-gnash or apt-get install konqueror-plugin-gnash


  • Use "-a oss" option.
  • fluidsynth may use a fragment size which is too low for the soundcard (256 bytes in one case), which leads to a background crackling when playing. use "-z 1024" (or an other value) to fix this.

Gstreamer, required for Gnome Volume Applet

  • Requires a gstreamer ossv4 compatible backend to be installed:
    • Install a new version ( >= 0.10.7 ) of gst-plugins-bad:
      • Debian: apt-get install gstreamer0.10-plugins-bad
      • The command above won't work on Ubuntu Hardy - it uses an older version (0.10.6).
      • Gentoo: emerge ebuild from unofficial overlay or from #232109.
    • Or use precompiled patched gstreamer oss module:
      • 32 bit version available from [4]
      • 64 bit version available from [5]
      • Follow installation instructions in README file.
  • Alternatively, OSS already supplies a native GTK mixer - ossxmix.


  • Sound backend can only be selected before compilation, so you'll have to build in OSS support yourself. Fetch the source and do "./configure oss", followed by "make && make install".

libao, including libao based like mpg321

  • Add the following line to ~/.libao


  • Debian, Ubuntu: These distros install a /etc/mpd.conf, which overrides ~/.mpdconf contrary to Unix conventions... You need to edit /etc/mpd.conf and uncomment the audio_output of type "oss" section.


  • Debian: install mpg123 instead of mpg123-alsa


  • write the following line to ~/.mplayer/config
    ao = oss

openal, including openal based like Quake4

  • Write the following line to ~/.openalrc
    (define devices '(native oss))
  • OpenAL Soft uses a different configuration method. Write the following to ~/.alsoftrc:
    drivers = oss


  • Phonon should automatically output via OSS. Configuration is different depending which backend is used:
    • Xine backend:
      • Old versions (KDE4.0.x) of the Xine backend didn't work with OSSv4. In that case use the gstreamer backend. In the newer versions, you should be able to prefer "OSS default output" in the KDE multimedia settings.
      • Phonon might mistakenly think the default output has been disconnected - erase ~/.kde/share/config/phonondevicesrc if the OSS option isn't available and recheck multimedia settings again.
    • GStreamer backend:
      • You need the oss or oss4 gstreamer plugin installed. See gstreamer entry.


  • Edit /etc/pulse/ and
    • Remove "module-hal-detect" (it won't detect OSS anyway).
    • Uncomment "module-oss" line and add "mmap=0" at end.
      • If "module-oss" line does not exist add the line below to
      load-module module-oss device="/dev/dsp" sink_name=output source_name=input mmap=0
  • Possibly this needs to be done with /etc/pulse/


  • This software supports either OSS or ALSA (set at compile time). Some distros set ALSA at compile time.
  • Debian:
    1. Get the source of the package (apt-get source recordmydesktop) and the build dependencies (apt-get build-dep recordmydesktop).
    2. Edit debian/rules to provide --enable-oss=yes to configure.
    3. Build package with dpkg-buildpackage and (re)install it.
    4. You may wish to prevent upgrades from overwriting the package with the ALSA version: echo recordmydesktop hold | dpkg --set-selections (as root).
  • Note that the used recording source should be set to 'vol' (if available) or 'loopback' should be activated (if available) in ossmix or ossxmix before starting recordmydesktop. If neither of these is possible, you can set recordmydesktop to use a vmix loopback device. See Tips And Tricks#Recording_sound_output_of_a_program.


  • scummvm works fine, but midi output may need tuning.
  • scummvm 0.11.0 supports midi output via timidity and also via fluidsynth.
  • Start timidity -Od -ir 7777 and then run scummvm. Select "TiMidity" as a music driver.
  • Alternately, if fluidsynth is compiled, you can select it as music driver. You need to add a soundfont entry to ~/.scummvmrc .

SDL, including SDL-based like frozenbubble

  • Debian: install libsdl1.2debian-oss or libsdl1.2debian-all
  • set SDL_AUDIODRIVER=dsp in the environment


  • From 1.4 onward, Skype supports OSS using a separate OSS-enabled binary. The regular binary will not work!
  • Arch: install skype-oss
  • Ubuntu Intrepid: apt-get install skype-static-oss (from the medibuntu/multiverse repository)
  • install static OSS version from skype [6] (Direct link to latest static OSS version: [7])


  • Debian: install libsox-fmt-oss


  • Debian: install libwine-oss.
  • Select OSS driver in winecfg - audio tab. (In some cases winecfg will output ALSA lib errors - they can be ignored).


  • Write the following line to ~/.vlc/vlcrc
  • Alternately:
    From VLC click tools --> preferences --> Audio
    From the "type" menu, select "UNIX OSS audio output"


  • Autodetection doesn't work well with OSSv4. Edit the .vmx file and set
    sound.autodetect: False


  • Write the following line to ~/.xine/config


  • Install the OSS output plugin
    • Ubuntu Intrepid: apt-get install xmms2-plugin-oss
  • Modify the output plugin in the config file
    • Replace alsa with oss in the output plugin configuration entry inside the xmms config file (which should be ~/.config/xmms2/xmms2.conf)
Personal tools