Difference between revisions of "Configuring Applications for OSSv4"

From Open Sound System
Jump to: navigation, search
(openal, including openal based like Quake4: add openalsoft)
(Add herrie. Formatting changes.)
Line 1: Line 1:
Most applications should work with OSSv4 out of the box. However, some distributions separate the OSS output plugins, or patch the software to use another sound API. 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.
+
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.
  
 
== General issues ==
 
== General issues ==
Line 27: Line 27:
  
 
=== esd/esound ===
 
=== esd/esound ===
** Debian: install libesd0 instead of libesd0-alsa.
+
* Debian: install libesd0 instead of libesd0-alsa.
  
 
=== Adobe Flash  ===
 
=== Adobe Flash  ===
 
<span id="Flash version 9"></span>
 
<span id="Flash version 9"></span>
** Flash V7 should be using OSS natively.
+
* 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 V9 and V10 require libflashsupport to output sound via OSS. Typically a 32-bit version of the library is required.
 
==== getting libflashsupport ====
 
==== getting libflashsupport ====
** Debian/Ubuntu:
+
* Debian/Ubuntu:
*** Do not install libflashsupport package from apt-get. That packages only supports Pulseaudio, and should be removed if you have it.
+
** Do not install libflashsupport package from apt-get. That packages only supports Pulseaudio, and should be removed if you have it.
*** You may wish to Install flashplugin-nonfree-extrasound if it is available for your version, but the version offered below offers better support (The version from the package misses some fixes for OSS [http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=491454]).
+
** You may wish to Install flashplugin-nonfree-extrasound if it is available for your version, but the version offered below offers better support (The version from the package misses some fixes for OSS [http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=491454]).
** Gentoo: you just need to add net-www/libflashsupport in /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.
+
* Gentoo: you just need to add net-www/libflashsupport in /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 already included in the oss-linux-free package on the i686 platform. Otherwise, follow the instructions.
+
* Arch: libflashsupport should be already included in the oss-linux-free package on the i686 platform. Otherwise, follow the instructions.
** Lastly, there is a precompiled 32-bit .so for Linux/glibc at [http://www.fileupyours.com/view/77985/libflashsupport.so]. If you decide to use this version, download it and skip to "installing libflashsupport" below.
+
* Lastly, there is a precompiled 32-bit .so for Linux/glibc at [http://www.fileupyours.com/view/77985/libflashsupport.so]. 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.
+
* If none of the above applies/works for you should try to follow the instructions below.
  
 
==== compiling libflashsupport ====
 
==== compiling libflashsupport ====
Line 69: Line 69:
  
 
=== Gnome Volume Applet ===
 
=== Gnome Volume Applet ===
** OSS already supplies a native GTK mixer - ossxmix.
+
* OSS already supplies a native GTK mixer - ossxmix.
** Install a new version ( >= 0.10.7 ) of gst-plugins-bad:
+
* Install a new version ( >= 0.10.7 ) of gst-plugins-bad:
*** Debian: apt-get install gstreamer0.10-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).
+
** The command above won't work on Ubuntu Hardy - it uses an older version (0.10.6).
*** Gentoo: emerge ebuild from [http://bugs.gentoo.org/show_bug.cgi?id=232109 #232109].
+
** Gentoo: emerge ebuild from [http://bugs.gentoo.org/show_bug.cgi?id=232109 #232109].
** Or use precompiled patched gstreamer oss module:
+
* Or use precompiled patched gstreamer oss module:
*** 32 bit libgstossaudio.so version available from [http://homepage.ntlworld.com/clive_wright/download/gstreamer-ossv4.tar.gz]
+
** 32 bit libgstossaudio.so version available from [http://homepage.ntlworld.com/clive_wright/download/gstreamer-ossv4.tar.gz]
*** 64 bit version available from [http://ubuntuforums.org/attachment.php?attachmentid=55770&d=1199848927] (login required).
+
** 64 bit version available from [http://ubuntuforums.org/attachment.php?attachmentid=55770&d=1199848927] (login required).
*** Follow installation instructions in README file.
+
** Follow installation instructions in README file.
 +
 
 +
== herrie ==
 +
* Sound backend is selected before compilation, so fetch the source and do "./configure oss".
  
 
=== libao, including libao based like mpg321 ===
 
=== libao, including libao based like mpg321 ===
** Add the following line to ~/.libao
+
* Add the following line to ~/.libao
**: default_driver=oss
+
*: default_driver=oss
  
 
=== mpg123 ===
 
=== mpg123 ===
** Debian: install mpg123 instead of mpg123-alsa
+
* Debian: install mpg123 instead of mpg123-alsa
  
 
=== MPlayer ===
 
=== MPlayer ===
** write the following line to ~/.mplayer/config
+
* write the following line to ~/.mplayer/config
**: ao = oss
+
*: ao = oss
  
 
=== openal, including openal based like Quake4 ===
 
=== openal, including openal based like Quake4 ===
Line 98: Line 101:
  
 
=== recordmydesktop ===
 
=== recordmydesktop ===
** This software supports either OSS or ALSA (set at compile time). Some packages set ALSA at compile time.
+
* This software supports either OSS or ALSA (set at compile time). Some packages set ALSA at compile time.
** Debian:
+
* Debian:
**# Get the source of the package (apt-get source recordmydesktop) and the build dependencies (apt-get build-dep recordmydesktop).
+
*# Get the source of the package (apt-get source recordmydesktop) and the build dependencies (apt-get build-dep recordmydesktop).
**# Edit debian/rules to provide --enable-oss=yes to configure.
+
*# Edit debian/rules to provide --enable-oss=yes to configure.
**# Build package with dpkg-buildpackage and (re)install it.
+
*# Build package with dpkg-buildpackage and (re)install it.
**# You may wish to prevent upgrades from overwriting the package with the ALSA version: echo recordmydesktop hold | dpkg --set-selections (as root).
+
*# 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). See [[Tips And Tricks#Recording_sound_output_of_a_program]].
+
* Note that the used recording source should be set to 'vol' (if available). See [[Tips And Tricks#Recording_sound_output_of_a_program]].
  
 
=== scummvm - MIDI music ===
 
=== scummvm - MIDI music ===
** scummvm 0.11.0 supports midi output via timidity and also via fluidsynth.
+
* 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.
+
* 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 .
+
* 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 ===
 
=== SDL, including SDL-based like frozenbubble ===
** Debian: install libsdl1.2debian-oss or libsdl1.2debian-all
+
* Debian: install libsdl1.2debian-oss or libsdl1.2debian-all
** set SDL_AUDIODRIVER=dsp in the environment
+
* set SDL_AUDIODRIVER=dsp in the environment
  
 
=== skype ===
 
=== skype ===
** From 1.4 onward, Skype supports OSS using a separate OSS-enabled binary. The regular binary will not work!
+
* From 1.4 onward, Skype supports OSS using a separate OSS-enabled binary. The regular binary will not work!
** Arch: install skype-oss
+
* Arch: install skype-oss
** install static OSS version from skype [http://www.skype.com/intl/en/download/skype/linux/choose/] (Direct link to latest static OSS version: [http://www.skype.com/go/getskype-linux-oss])
+
* install static OSS version from skype [http://www.skype.com/intl/en/download/skype/linux/choose/] (Direct link to latest static OSS version: [http://www.skype.com/go/getskype-linux-oss])
  
 
=== sox ===
 
=== sox ===
** Debian: install libsox-fmt-oss
+
* Debian: install libsox-fmt-oss
  
 
=== wine ===
 
=== wine ===
** Debian: install libwine-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).
+
* Select OSS driver in winecfg - audio tab. (In some cases winecfg will output ALSA lib errors - they can be ignored).
  
 
=== vlc ===
 
=== vlc ===
** Write the following line to ~/.vlc/vlcrc
+
* Write the following line to ~/.vlc/vlcrc
**: aout=oss  
+
*: aout=oss  
  
 
=== xine ===
 
=== xine ===
** Write the following line to ~/.xine/config
+
* Write the following line to ~/.xine/config
**: audio.driver:oss
+
*: audio.driver:oss

Revision as of 14:13, 29 July 2008

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.

General issues

libasound.so.2 errors

  • Some apps refuse to start with libasound.so.2: undefined symbol errors. This is because OSS's ALSA emulation method (libsalsa) is based on a version of libasound which is too different from the (likely newer) version the apps were compiled with.
    • Often, applications link to libasound.so.2 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).
    • 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/libsalsa.so.2.0.0 /usr/lib/oss/lib/libsalsa.so.2.0.0.bak
      • ldconfig
      • Note that upgrading or reinstalling oss4 will recreate libsalsa, so if you removed it you may wish to do this again.

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).
  • Gnome: Select "OSS - Open Sound System" in "Sound Preferences" (under "Devices" tab). Some distros compile gnome without support for OSS. In that case, install esound (e.g. apt-get install libesd0 esound on Ubuntu), and restart Gnome. Select "ESD - Enlightened sound daemon" in sound menu.
  • All the quoted names may be different on other systems due to localization.

Multimedia Keys

Specific applications

Enemy Territory - Quake Wars

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

esd/esound

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

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 may wish to Install flashplugin-nonfree-extrasound if it is available for your version, but the version offered below offers better support (The version from the package misses some fixes for OSS [1]).
  • Gentoo: you just need to add net-www/libflashsupport in /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 already included in the oss-linux-free package on the i686 platform. Otherwise, follow the instructions.
  • Lastly, there is a precompiled 32-bit .so for Linux/glibc at [2]. 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
    2. Comment out "#define OPENSSL" by placing a '//' in front of that line.
      • 64 bit users will require gcc multilib support.
      • In Debian/Ubuntu - sudo apt-get install gcc-multilib
    3. To compile: cc -shared -m32 -O2 -Wall -Werror flashsupport.c -o /tmp/libflashsupport.so
    4. Continue at "installing libflashsupport" below.

installing libflashsupport

    1. sudo install -s /tmp/libflashsupport.so /usr/lib/oss/lib
    2. sudo install -s /tmp/libflashsupport.so /usr/lib
    3. sudo ldconfig
    4. Restart browser
    5. Sometimes getting flash to work requires getting rid of libsalsa. see [3] for how to do this.

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
  • swfdec is another option.
    • Debian: apt-get install swfdec-mozilla

fluidsynth

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

Gnome Volume Applet

  • OSS already supplies a native GTK mixer - ossxmix.
  • 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 #232109.
  • Or use precompiled patched gstreamer oss module:
    • 32 bit libgstossaudio.so version available from [4]
    • 64 bit version available from [5] (login required).
    • Follow installation instructions in README file.

herrie

  • Sound backend is selected before compilation, so fetch the source and do "./configure oss".

libao, including libao based like mpg321

  • Add the following line to ~/.libao
    default_driver=oss

mpg123

  • Debian: install mpg123 instead of mpg123-alsa

MPlayer

  • 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:
    [general]
    drivers = oss

recordmydesktop

  • This software supports either OSS or ALSA (set at compile time). Some packages 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). See Tips And Tricks#Recording_sound_output_of_a_program.

scummvm - MIDI music

  • 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

skype

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

sox

  • Debian: install libsox-fmt-oss

wine

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

vlc

  • Write the following line to ~/.vlc/vlcrc
    aout=oss

xine

  • Write the following line to ~/.xine/config
    audio.driver:oss