特殊:Badtitle/NS100:OpenSound:修订间差异
小无编辑摘要 |
小无编辑摘要 |
||
(未显示同一用户的5个中间版本) | |||
第2行: | 第2行: | ||
{{Languages|UbuntuHelp:OpenSound}} | {{Languages|UbuntuHelp:OpenSound}} | ||
== Introduction == | == Introduction == | ||
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. 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. | 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.). | '''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? == | == Does OSS Support My Hardware? == | ||
Check the list [http://mercurial.opensound.com/?raw-file/f794ffc6c185/devlists/Linux 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. | |||
== | == Preparation == | ||
=== Removing PulseAudio === | |||
Technically, it is possible to run PulseAudio with OSS4, but this is outside the scope of this document. | |||
<pre><nowiki> | <pre><nowiki> | ||
sudo | sudo killall pulseaudio | ||
sudo | sudo apt-get purge pulseaudio gstreamer0.10-pulseaudio | ||
</nowiki></pre> | </nowiki></pre> | ||
=== Removing ALSA packages === | |||
<pre><nowiki> | <pre><nowiki> | ||
sudo | sudo /etc/init.d/alsa-utils stop | ||
sudo apt-get remove alsa-base alsa-utils | |||
</nowiki></pre> | </nowiki></pre> | ||
=== | Note: You can't remove alsa-base in Hardy, or it will try and remove gdm. | ||
=== Blacklisting ALSA Kernel Modules === | |||
<pre><nowiki> | <pre><nowiki> | ||
sudo dpkg-reconfigure linux-sound-base | sudo dpkg-reconfigure linux-sound-base | ||
</nowiki></pre> | </nowiki></pre> | ||
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]. | 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. | ||
== Installing Prerequisite Packages == | === Configure ALSA Apps to Use OSS (OPTIONAL) === | ||
The second command | 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 [http://www.opensound.com/wiki/index.php/Tips_And_Tricks#ALSA_Emulation 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. | |||
<pre><nowiki> | <pre><nowiki> | ||
sudo apt-get install -y build-essential | 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 | sudo apt-get install -y libesd0 libsdl1.2debian-oss | ||
</nowiki></pre> | </nowiki></pre> | ||
=== | ==== 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) | 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) | ||
<pre><nowiki> | <pre><nowiki> | ||
sudo apt-get install -y esound esound-clients esound-common libesd0 | sudo apt-get install -y esound esound-clients esound-common libesd0 | ||
</nowiki></pre> | </nowiki></pre> | ||
=== System Sounds on KDE === | ==== 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 [http://www.opensound.com/wiki/index.php/Configuring_Applications_for_OSSv4#libcanberra this page] to use libcanberra with OSS. | |||
==== System Sounds on KDE 3.x ==== | |||
Make sure you have the aRts system installed: | Make sure you have the aRts system installed: | ||
<pre><nowiki> | <pre><nowiki> | ||
sudo apt-get install -y arts | sudo apt-get install -y arts | ||
</nowiki></pre> | </nowiki></pre> | ||
== | ==== System Sounds on KDE 4.x ==== | ||
OSS | 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 OSS == | |||
=== Installing from DEB File === | |||
Download the OSS deb file from the [http://www.opensound.com/download.cgi 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) | |||
<pre><nowiki> | <pre><nowiki> | ||
sudo | sudo dpkg -i oss-linux*.deb | ||
</nowiki></pre> | </nowiki></pre> | ||
=== Obtaining the OSS Source using latest testing tarball === | === 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 ===== | |||
<pre><nowiki> | <pre><nowiki> | ||
wget -A '*.bz2' -nd -r -l 1 http://www.4front-tech.com/developer/sources/testing/gpl/ | wget -A '*.bz2' -nd -r -l 1 http://www.4front-tech.com/developer/sources/testing/gpl/ | ||
tar xf oss-v4. | sudo tar xf oss-v4.2*.tar.bz2 -C /opt | ||
mv / | sudo mv /opt/oss-v4.2* /opt/oss-devel | ||
</nowiki></pre> | </nowiki></pre> | ||
=== Obtaining the OSS Source using Mercurial === | ===== Obtaining the OSS Source using Mercurial ===== | ||
<pre><nowiki> | <pre><nowiki> | ||
cd / | sudo apt-get install -y mercurial | ||
sudo hg clone http:// | cd /opt | ||
sudo hg clone http://opensound.hg.sourceforge.net:8000/hgroot/opensound/opensound /oss-devel | |||
</nowiki></pre> | </nowiki></pre> | ||
=== Creating a Build Directory === | ==== Creating a Build Directory ==== | ||
OSS needs an empty directory to build in. Using the example below will create a directory in your /home folder (~) | OSS needs an empty directory to build in. Using the example below will create a directory in your /home folder (~) | ||
<pre><nowiki> | <pre><nowiki> | ||
cd ~/ | cd ~/ | ||
mkdir | sudo rm -rf oss42build | ||
cd | mkdir oss42build | ||
cd oss42build/ | |||
</nowiki></pre> | </nowiki></pre> | ||
=== | ==== Build & Install ==== | ||
<pre><nowiki> | <pre><nowiki> | ||
NO_WARNING_CHECKS=yes /opt/oss-devel/configure --enable-libsalsa=NO | |||
sudo make | make | ||
sudo | sudo make deb | ||
sudo dpkg -i oss*.deb | |||
</nowiki></pre> | </nowiki></pre> | ||
=== Updating Your OSS Build === | ==== Updating Your OSS Build ==== | ||
This only works if you fetched the source using mercurial rather than the testing tarball. | This only works if you fetched the source using mercurial rather than the testing tarball. | ||
Check <http://mercurial.opensound.com | 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. | |||
<pre><nowiki> | <pre><nowiki> | ||
cd / | cd /opt/oss-devel | ||
sudo hg pull | sudo hg pull | ||
sudo hg update | sudo hg update | ||
cd ~/ | cd ~/ | ||
sudo rm -rf | sudo rm -rf oss42build | ||
mkdir oss42build | |||
</nowiki></pre> | </nowiki></pre> | ||
Now follow the " | Now follow the "Build and Install" section's directions again to use your updated OSS. | ||
== Configuring Applications to Use OSS == | == Configuring Applications to Use OSS == | ||
[http://www.4front-tech.com/wiki/index.php/Configuring_Applications_for_OSSv4 See the OSS wiki for help with this]. I've listed procedures for common apps below. | |||
=== | === ossxmix === | ||
Add a new custom application launcher to the panel that runs the command: ossxmix - (That's oss'''x'''mix, 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, [http://library.gnome.org/users/user-guide/stable/gospanel-34.html.en this primer] will help for this task. You can add an ossxmix launcher to a KDE or Xfce panels too. | |||
Add a new custom application launcher to the panel that runs the command: ossxmix - (That's oss'''x'''mix, 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. | === GNOME/gstreamer === | ||
If you're new to Ubuntu/GNOME, [http://library.gnome.org/users/user-guide/stable/gospanel-34.html.en this primer] will help for this task. | First: | ||
=== | |||
<pre><nowiki> | <pre><nowiki> | ||
sudo apt-get | sudo apt-get install -y gstreamer0.10-plugins-bad | ||
</nowiki></pre> | </nowiki></pre> | ||
Then you will need to select oss or oss4 outputs in the following dialogs. | |||
==== Ubuntu <= 9.04 ==== | |||
System -> Preferences -> Sound | |||
==== Ubuntu 9.10 ==== | |||
<pre><nowiki> | <pre><nowiki> | ||
gstreamer-properties | |||
</nowiki></pre> | </nowiki></pre> | ||
=== GNOME Volume Control === | |||
==== Ubuntu 8.04 ==== | |||
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 - [[UbuntuHelp:attachment:gstreamer-ossv4-x86-32bit.tar.gz|attachment:gstreamer-ossv4-x86-32bit.tar.gz]] , 64-bit version - [[UbuntuHelp:attachment:gstreamer-ossv4-amd64.tar.gz|attachment: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. | |||
==== Ubuntu 9.10 ==== | |||
The GNOME volume control in Karmic is PulseAudio-based, so you'll want to use packages from: https://launchpad.net/~dtl131/+archive/ppa | |||
=== 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, [http://www.opensound.com/wiki/index.php/Tips_And_Tricks#Using_multimedia_keys_with_OSS here are some scripts to use.] A [https://bugs.kde.org/show_bug.cgi?id=166591 patch] has recently been proposed, but will require compiling kdemultimedia from source to test it. | |||
=== Flash === | |||
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 | |||
==== Advanced ==== | ==== Advanced ==== | ||
Build your own copy of libflashsupport. | Build your own copy of libflashsupport.so: ([http://ubuntuforums.org/showpost.php?p=5374886&postcount=273 See this]) | ||
== Troubleshooting == | == Troubleshooting == | ||
If you run into problems, follow these steps first: | If you run into problems, follow these steps first: | ||
第137行: | 第139行: | ||
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 | 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 | ||
<pre><nowiki> | <pre><nowiki> | ||
ossmix | ossmix | ||
ossinfo -v3 | ossinfo -v3 | ||
</nowiki></pre> | </nowiki></pre> | ||
Also, you'll want to note if the osstest command works | Also, you'll want to note if the osstest command works and plays sound. | ||
==== Forums ==== | ==== Forums ==== | ||
You can make a thread on [http://www.4front-tech.com/forum/index.php the OpenSound user forums]. | You can make a thread on [http://www.4front-tech.com/forum/index.php the OpenSound user forums]. | ||
第147行: | 第148行: | ||
[http://freenode.net/irc_servers.shtml Freenode] hosts the OSS support channel (#oss). You can paste your support information from the aforementioned commands [http://oss.pastebin.com/ here] | [http://freenode.net/irc_servers.shtml Freenode] hosts the OSS support channel (#oss). You can paste your support information from the aforementioned commands [http://oss.pastebin.com/ here] | ||
=== Reverting to ALSA === | === 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 | 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. [http://ubuntuforums.org/showpost.php?p=5539687&postcount=331 Click here] for the procedure. | ||
Some users wish to revert back to ALSA to try Creative's X-fi drivers or maintain complete Ubuntu compatibility. [http://ubuntuforums.org/showpost.php?p=5539687&postcount=331 Click here] for the procedure. | |||
== Contributing to OSS == | == Contributing to OSS == | ||
If you wish to contribute to OSS developement there are several ways: | 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. | * [http://www.opensound.com/order.html Order] an OSS license. In this way you will also get free technical support for two years. | ||
* Send a PayPal payment (any amount) to [email protected]. | * Send a PayPal payment (any amount) to [email protected]. | ||
* Contribute code via the developers' community. To subscribe to the OSS developers' list, [http://mailman.opensound.com/mailman/listinfo/oss-devel Click Here] | * Contribute code via the developers' community. To subscribe to the OSS developers' list, [http://mailman.opensound.com/mailman/listinfo/oss-devel Click Here] | ||
第162行: | 第161行: | ||
* <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://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. | * <http://www.opensound.com/wiki/index.php/Main_Page> - OSS wiki. | ||
---- | ---- | ||
[[category:CategoryAudio]] | [[category:CategoryAudio]] | ||
[[category:UbuntuHelp]] | [[category:UbuntuHelp]] |
2010年5月19日 (三) 23:48的最新版本
文章出处: |
{{#if: | {{{2}}} | https://help.ubuntu.com/community/OpenSound }} |
点击翻译: |
English {{#ifexist: {{#if: UbuntuHelp:OpenSound | UbuntuHelp:OpenSound | {{#if: | :}}OpenSound}}/af | • {{#if: UbuntuHelp:OpenSound|Afrikaans| [[::OpenSound/af|Afrikaans]]}}|}} {{#ifexist: {{#if: UbuntuHelp:OpenSound | UbuntuHelp:OpenSound | {{#if: | :}}OpenSound}}/ar | • {{#if: UbuntuHelp:OpenSound|العربية| [[::OpenSound/ar|العربية]]}}|}} {{#ifexist: {{#if: UbuntuHelp:OpenSound | UbuntuHelp:OpenSound | {{#if: | :}}OpenSound}}/az | • {{#if: UbuntuHelp:OpenSound|azərbaycanca| [[::OpenSound/az|azərbaycanca]]}}|}} {{#ifexist: {{#if: UbuntuHelp:OpenSound | UbuntuHelp:OpenSound | {{#if: | :}}OpenSound}}/bcc | • {{#if: UbuntuHelp:OpenSound|جهلسری بلوچی| [[::OpenSound/bcc|جهلسری بلوچی]]}}|}} {{#ifexist: {{#if: UbuntuHelp:OpenSound | UbuntuHelp:OpenSound | {{#if: | :}}OpenSound}}/bg | • {{#if: UbuntuHelp:OpenSound|български| [[::OpenSound/bg|български]]}}|}} {{#ifexist: {{#if: UbuntuHelp:OpenSound | UbuntuHelp:OpenSound | {{#if: | :}}OpenSound}}/br | • {{#if: UbuntuHelp:OpenSound|brezhoneg| [[::OpenSound/br|brezhoneg]]}}|}} {{#ifexist: {{#if: UbuntuHelp:OpenSound | UbuntuHelp:OpenSound | {{#if: | :}}OpenSound}}/ca | • {{#if: UbuntuHelp:OpenSound|català| [[::OpenSound/ca|català]]}}|}} {{#ifexist: {{#if: UbuntuHelp:OpenSound | UbuntuHelp:OpenSound | {{#if: | :}}OpenSound}}/cs | • {{#if: UbuntuHelp:OpenSound|čeština| [[::OpenSound/cs|čeština]]}}|}} {{#ifexist: {{#if: UbuntuHelp:OpenSound | UbuntuHelp:OpenSound | {{#if: | :}}OpenSound}}/de | • {{#if: UbuntuHelp:OpenSound|Deutsch| [[::OpenSound/de|Deutsch]]}}|}} {{#ifexist: {{#if: UbuntuHelp:OpenSound | UbuntuHelp:OpenSound | {{#if: | :}}OpenSound}}/el | • {{#if: UbuntuHelp:OpenSound|Ελληνικά| [[::OpenSound/el|Ελληνικά]]}}|}} {{#ifexist: {{#if: UbuntuHelp:OpenSound | UbuntuHelp:OpenSound | {{#if: | :}}OpenSound}}/es | • {{#if: UbuntuHelp:OpenSound|español| [[::OpenSound/es|español]]}}|}} {{#ifexist: {{#if: UbuntuHelp:OpenSound | UbuntuHelp:OpenSound | {{#if: | :}}OpenSound}}/fa | • {{#if: UbuntuHelp:OpenSound|فارسی| [[::OpenSound/fa|فارسی]]}}|}} {{#ifexist: {{#if: UbuntuHelp:OpenSound | UbuntuHelp:OpenSound | {{#if: | :}}OpenSound}}/fi | • {{#if: UbuntuHelp:OpenSound|suomi| [[::OpenSound/fi|suomi]]}}|}} {{#ifexist: {{#if: UbuntuHelp:OpenSound | UbuntuHelp:OpenSound | {{#if: | :}}OpenSound}}/fr | • {{#if: UbuntuHelp:OpenSound|français| [[::OpenSound/fr|français]]}}|}} {{#ifexist: {{#if: UbuntuHelp:OpenSound | UbuntuHelp:OpenSound | {{#if: | :}}OpenSound}}/gu | • {{#if: UbuntuHelp:OpenSound|ગુજરાતી| [[::OpenSound/gu|ગુજરાતી]]}}|}} {{#ifexist: {{#if: UbuntuHelp:OpenSound | UbuntuHelp:OpenSound | {{#if: | :}}OpenSound}}/he | • {{#if: UbuntuHelp:OpenSound|עברית| [[::OpenSound/he|עברית]]}}|}} {{#ifexist: {{#if: UbuntuHelp:OpenSound | UbuntuHelp:OpenSound | {{#if: | :}}OpenSound}}/hu | • {{#if: UbuntuHelp:OpenSound|magyar| [[::OpenSound/hu|magyar]]}}|}} {{#ifexist: {{#if: UbuntuHelp:OpenSound | UbuntuHelp:OpenSound | {{#if: | :}}OpenSound}}/id | • {{#if: UbuntuHelp:OpenSound|Bahasa Indonesia| [[::OpenSound/id|Bahasa Indonesia]]}}|}} {{#ifexist: {{#if: UbuntuHelp:OpenSound | UbuntuHelp:OpenSound | {{#if: | :}}OpenSound}}/it | • {{#if: UbuntuHelp:OpenSound|italiano| [[::OpenSound/it|italiano]]}}|}} {{#ifexist: {{#if: UbuntuHelp:OpenSound | UbuntuHelp:OpenSound | {{#if: | :}}OpenSound}}/ja | • {{#if: UbuntuHelp:OpenSound|日本語| [[::OpenSound/ja|日本語]]}}|}} {{#ifexist: {{#if: UbuntuHelp:OpenSound | UbuntuHelp:OpenSound | {{#if: | :}}OpenSound}}/ko | • {{#if: UbuntuHelp:OpenSound|한국어| [[::OpenSound/ko|한국어]]}}|}} {{#ifexist: {{#if: UbuntuHelp:OpenSound | UbuntuHelp:OpenSound | {{#if: | :}}OpenSound}}/ksh | • {{#if: UbuntuHelp:OpenSound|Ripoarisch| [[::OpenSound/ksh|Ripoarisch]]}}|}} {{#ifexist: {{#if: UbuntuHelp:OpenSound | UbuntuHelp:OpenSound | {{#if: | :}}OpenSound}}/mr | • {{#if: UbuntuHelp:OpenSound|मराठी| [[::OpenSound/mr|मराठी]]}}|}} {{#ifexist: {{#if: UbuntuHelp:OpenSound | UbuntuHelp:OpenSound | {{#if: | :}}OpenSound}}/ms | • {{#if: UbuntuHelp:OpenSound|Bahasa Melayu| [[::OpenSound/ms|Bahasa Melayu]]}}|}} {{#ifexist: {{#if: UbuntuHelp:OpenSound | UbuntuHelp:OpenSound | {{#if: | :}}OpenSound}}/nl | • {{#if: UbuntuHelp:OpenSound|Nederlands| [[::OpenSound/nl|Nederlands]]}}|}} {{#ifexist: {{#if: UbuntuHelp:OpenSound | UbuntuHelp:OpenSound | {{#if: | :}}OpenSound}}/no | • {{#if: UbuntuHelp:OpenSound|norsk| [[::OpenSound/no|norsk]]}}|}} {{#ifexist: {{#if: UbuntuHelp:OpenSound | UbuntuHelp:OpenSound | {{#if: | :}}OpenSound}}/oc | • {{#if: UbuntuHelp:OpenSound|occitan| [[::OpenSound/oc|occitan]]}}|}} {{#ifexist: {{#if: UbuntuHelp:OpenSound | UbuntuHelp:OpenSound | {{#if: | :}}OpenSound}}/pl | • {{#if: UbuntuHelp:OpenSound|polski| [[::OpenSound/pl|polski]]}}|}} {{#ifexist: {{#if: UbuntuHelp:OpenSound | UbuntuHelp:OpenSound | {{#if: | :}}OpenSound}}/pt | • {{#if: UbuntuHelp:OpenSound|português| [[::OpenSound/pt|português]]}}|}} {{#ifexist: {{#if: UbuntuHelp:OpenSound | UbuntuHelp:OpenSound | {{#if: | :}}OpenSound}}/ro | • {{#if: UbuntuHelp:OpenSound|română| [[::OpenSound/ro|română]]}}|}} {{#ifexist: {{#if: UbuntuHelp:OpenSound | UbuntuHelp:OpenSound | {{#if: | :}}OpenSound}}/ru | • {{#if: UbuntuHelp:OpenSound|русский| [[::OpenSound/ru|русский]]}}|}} {{#ifexist: {{#if: UbuntuHelp:OpenSound | UbuntuHelp:OpenSound | {{#if: | :}}OpenSound}}/si | • {{#if: UbuntuHelp:OpenSound|සිංහල| [[::OpenSound/si|සිංහල]]}}|}} {{#ifexist: {{#if: UbuntuHelp:OpenSound | UbuntuHelp:OpenSound | {{#if: | :}}OpenSound}}/sq | • {{#if: UbuntuHelp:OpenSound|shqip| [[::OpenSound/sq|shqip]]}}|}} {{#ifexist: {{#if: UbuntuHelp:OpenSound | UbuntuHelp:OpenSound | {{#if: | :}}OpenSound}}/sr | • {{#if: UbuntuHelp:OpenSound|српски / srpski| [[::OpenSound/sr|српски / srpski]]}}|}} {{#ifexist: {{#if: UbuntuHelp:OpenSound | UbuntuHelp:OpenSound | {{#if: | :}}OpenSound}}/sv | • {{#if: UbuntuHelp:OpenSound|svenska| [[::OpenSound/sv|svenska]]}}|}} {{#ifexist: {{#if: UbuntuHelp:OpenSound | UbuntuHelp:OpenSound | {{#if: | :}}OpenSound}}/th | • {{#if: UbuntuHelp:OpenSound|ไทย| [[::OpenSound/th|ไทย]]}}|}} {{#ifexist: {{#if: UbuntuHelp:OpenSound | UbuntuHelp:OpenSound | {{#if: | :}}OpenSound}}/tr | • {{#if: UbuntuHelp:OpenSound|Türkçe| [[::OpenSound/tr|Türkçe]]}}|}} {{#ifexist: {{#if: UbuntuHelp:OpenSound | UbuntuHelp:OpenSound | {{#if: | :}}OpenSound}}/vi | • {{#if: UbuntuHelp:OpenSound|Tiếng Việt| [[::OpenSound/vi|Tiếng Việt]]}}|}} {{#ifexist: {{#if: UbuntuHelp:OpenSound | UbuntuHelp:OpenSound | {{#if: | :}}OpenSound}}/yue | • {{#if: UbuntuHelp:OpenSound|粵語| [[::OpenSound/yue|粵語]]}}|}} {{#ifexist: {{#if: UbuntuHelp:OpenSound | UbuntuHelp:OpenSound | {{#if: | :}}OpenSound}}/zh | • {{#if: UbuntuHelp:OpenSound|中文| [[::OpenSound/zh|中文]]}}|}} {{#ifexist: {{#if: UbuntuHelp:OpenSound | UbuntuHelp:OpenSound | {{#if: | :}}OpenSound}}/zh-hans | • {{#if: UbuntuHelp:OpenSound|中文(简体)| [[::OpenSound/zh-hans|中文(简体)]]}}|}} {{#ifexist: {{#if: UbuntuHelp:OpenSound | UbuntuHelp:OpenSound | {{#if: | :}}OpenSound}}/zh-hant | • {{#if: UbuntuHelp:OpenSound|中文(繁體)| [[::OpenSound/zh-hant|中文(繁體)]]}}|}} |
{{#ifeq:UbuntuHelp:OpenSound|:OpenSound|请不要直接编辑翻译本页,本页将定期与来源同步。}} |
{{#ifexist: :OpenSound/zh | | {{#ifexist: OpenSound/zh | | {{#ifeq: {{#titleparts:OpenSound|1|-1|}} | zh | | }} }} }} {{#ifeq: {{#titleparts:OpenSound|1|-1|}} | zh | | }}
Introduction
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.
Preparation
Removing PulseAudio
Technically, it is possible to run PulseAudio with OSS4, but this is outside the scope of this document.
sudo killall pulseaudio 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 OSS
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
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
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.
ossxmix
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.
GNOME/gstreamer
First:
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
Ubuntu 9.10
gstreamer-properties
GNOME Volume Control
Ubuntu 8.04
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 - attachment:gstreamer-ossv4-x86-32bit.tar.gz , 64-bit version - attachment: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.
Ubuntu 9.10
The GNOME volume control in Karmic is PulseAudio-based, so you'll want to use packages from: https://launchpad.net/~dtl131/+archive/ppa
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.
Flash
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
Advanced
Build your own copy of libflashsupport.so: (See this)
Troubleshooting
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.
Additional Support
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.
Forums
You can make a thread on the OpenSound user forums.
IRC
Freenode hosts the OSS support channel (#oss). You can paste your support information from the aforementioned commands here
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.
- Send a PayPal payment (any amount) to [email protected].
- 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
External Links
- <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.