个人工具

“UbuntuHelp:OpenSound”的版本间的差异

来自Ubuntu中文

跳转至: 导航, 搜索
第7行: 第7行:
 
Probably. Check the list here - [[UbuntuHelp:attachment:devices.list|attachment:devices.list]] Note that onboard audio chips are listed by their south bridge, and not the codec. For example, ICH9 includes codecs from Realtek, Sigmatel, ADI, Conexant, etc. Also, some devices may not have full functionality (e.g. the X-fi module is limited to stereo output at the time of this writing). If you're in doubt, consult the "Additional Support" sources found towards the end of this document.
 
Probably. Check the list here - [[UbuntuHelp:attachment:devices.list|attachment:devices.list]] Note that onboard audio chips are listed by their south bridge, and not the codec. For example, ICH9 includes codecs from Realtek, Sigmatel, ADI, Conexant, etc. Also, some devices may not have full functionality (e.g. the X-fi module is limited to stereo output at the time of this writing). If you're in doubt, consult the "Additional Support" sources found towards the end of this document.
 
== Stopping ALSA ==
 
== Stopping ALSA ==
 +
Note: To run the commands below in Ubuntu 9.04 (Jaunty), replace "/etc/modprobe.d/blacklist" with "/etc/modprobe.d/blacklist.conf".
 
<pre><nowiki>
 
<pre><nowiki>
 
sudo chmod 776 /etc/modprobe.d/blacklist
 
sudo chmod 776 /etc/modprobe.d/blacklist
第53行: 第54行:
 
And make it the "preferred" one via the sound control panel.
 
And make it the "preferred" one via the sound control panel.
 
== Installing OSS ==
 
== Installing OSS ==
We can get the OSS deb from the [http://www.opensound.com/download.cgi 4front website]. Select the (DEB) packages, with the architecture you have in parthensis. 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, go back to the terminal and proceed: Do 'dpkg -i oss-linux*.deb' to install OSS (GDebi fails to install this .deb for some reason).
+
=== Installing from DEB File ===
=== Building OSS ===
+
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>
 +
sudo dpkg -i oss-linux*.deb
 +
</nowiki></pre>
 +
=== Building from Source ===
 
Instead of using the deb file, you can also try building a newer, but experimental version of OSS and installing it. We'll use the commands below to obtain and build the latest OSS 4.2 release candidate source. Before you build OSS, '''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:
 
Instead of using the deb file, you can also try building a newer, but experimental version of OSS and installing it. We'll use the commands below to obtain and build the latest OSS 4.2 release candidate source. Before you build OSS, '''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 ====
 
==== Obtaining the OSS Source ====

2009年5月18日 (一) 17:20的版本

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

Probably. Check the list here - attachment:devices.list Note that onboard audio chips are listed by their south bridge, and not the codec. For example, ICH9 includes codecs from Realtek, Sigmatel, ADI, Conexant, etc. Also, some devices may not have full functionality (e.g. the X-fi module is limited to stereo output at the time of this writing). If you're in doubt, consult the "Additional Support" sources found towards the end of this document.

Stopping ALSA

Note: To run the commands below in Ubuntu 9.04 (Jaunty), replace "/etc/modprobe.d/blacklist" with "/etc/modprobe.d/blacklist.conf".

sudo chmod 776 /etc/modprobe.d/blacklist
sudo cat /lib/linux-sound-base/noALSA.modprobe.conf >> /etc/modprobe.d/blacklist

The block of text that follows is one command! (copy and paste the entire cell):

sudo echo "blacklist snd_hda_intel 
blacklist snd_mixer_oss 
blacklist snd_pcm
blacklist snd_timer
blacklist snd_page_alloc
blacklist snd_hwdep
blacklist snd
blacklist soundcore" >> /etc/modprobe.d/blacklist

Configuring linux-sound-base

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

Installing Prerequisite Packages

The second command isn't strictly necessary, but practically every system using OSS will have those packages installed.

sudo apt-get install -y build-essential binutils linux-headers-`uname -r` gawk libtool libgtk2.0-dev
sudo apt-get install -y libesd0 libsdl1.2debian-oss

System Sounds on GNOME

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. At the time of this writing, Ubuntu Intrepid uses a version of libcanberra that is only compatible with ALSA/PulseAudio. More recent versions of libcanberra have an OSS and/or gstreamer backend, but it is not clear whether these work properly yet.

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

Install the KDE Phonon GStreamer backend:

sudo apt-get install -y phonon-backend-gstreamer

And make it the "preferred" one via the sound control panel.

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 try building a newer, but experimental version of OSS and installing it. We'll use the commands below to obtain and build the latest OSS 4.2 release candidate source. Before you build OSS, 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 /usr/src
sudo mv /usr/src/oss-v4.2* /usr/src/oss-devel
Obtaining the OSS Source using Mercurial
sudo apt-get install -y mercurial
cd /usr/src
sudo hg clone http://mercurial.opensound.com/ 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 /usr/src/oss-devel/configure
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 /usr/src/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

You'll have to tell applications to use OSS output instead of ALSA. Some applications (like Audacious) have user-friendly controls for this. Others require command line input or configuring a text file. See the OSS wiki for help with this. I've listed procedures for common apps below.

Mixers

The OSS Mixer App

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. I'm sure you can add an ossxmix launcher to the KDE or Xfce panel too.

The GNOME Mixer/Volume Control

The gstreamer-based volume control in Ubuntu 8.04.x is incompatible with OSS, because it uses an older version of gstreamer-plugins (Ubuntu 8.10 is compatible), 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). Alternatively, if you're comfortable with building software, you can build the latest version of the gstreamer plugins (at least base, good, bad).

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 at this time. Use ossxmix or, if you'd prefer to map commands to your shortcut keys, here are some scripts to use.

Flash

OSS v4.1 should automatically install the neccesary support library. If flash doesn't work (or you're using OSSv4.0), you can get the library using the procedure below:

Getting libflashsupport

Make sure you remove existing versions of libflashsupport.so, including the Ubuntu repository package, which is for PulseAudio.

sudo apt-get remove libflashsupport

Save attachment:libflashsupport.so.gz to your Desktop, and then:

cd ~/Desktop
gunzip libflashsupport.so.gz
sudo mv libflashsupport.so /usr/lib
sudo ln -s /usr/lib/libflashsupport.so /usr/lib/firefox/plugins
sudo ln -s /usr/lib/libflashsupport.so /usr/lib/mozilla/plugins
sudo ln -s /usr/lib/libflashsupport.so /usr/lib/firefox-addons/plugins
sudo ldconfig
64-bit users

Follow the directions in the Flash section and execute these commands:

sudo cp /usr/lib/libflashsupport.so /usr/lib32/
sudo ldconfig
Advanced

Build your own copy of libflashsupport.c (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 or e-mail the page maintainer. 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

OSS has been recently open-sourced, so a community of developers and knowledgeable Linux users is just starting to grow around the project. While the creators of OSS are grateful for the extra technical support, they are essentially giving away something that they used to charge for. Theoretically, the hardware manufacturers should financially and/or technically support their products. Unfortunately, the PC audio aftermarket is dominated by an extremely litigious, proprietary company (name starts with a 'C') that minimally supports open-source development. If you happen to own a card from that company, I suggest you send an e-mail to them and demand more backing for Linux. 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

Page Maintainer(s)

dtl131 (Dave Lentz)