Swap the OSS4 sound system on Ubuntu

Source: Internet
Author: User
Tags mercurial gstreamer rhythmbox

http://blogs.gnome.org/happyaron/2011/02/12/ubuntu-oss4-sound/


first, the background, the Linux audio system is very incomplete history: 1. The OSS3 is the older sound system in the Linux kernel, which is now gradually discarded by 2. OSS4 was developed as a closed source software, so the 2002 ALSA was used to replace OSS3 as the voice architecture in the Linux kernel 3. In 2007, 4Front Technologies released the GPL version of OSS4, which ALSA already

about Alsa,oss4,pulseaudio and Jack's scanty version of the introduction (ESD, etc. omitted 10,000 words): 1. ALSA is currently the standard audio framework on the Linux kernel, but only Linux systems are supported and no software reverb is available. Support for all kinds of equipment is very comprehensive. 2. OSS4 missed the opportunity to become part of the official kernel, but its cross-platform is far better than ALSA, supporting Windows, BSD and many UNIX, and its APIs are said to be more suited to development. OSS4 has real-time, low-latency features, supporting the software reverb, all operations in the kernel layer implementation. However, support for USB devices is significantly weaker. 3. PulseAudio is a voice agent designed for the POSIX compliant environment, with built-in software reverb. PulseAudio can send programs to voice system requests to the ALSA, OSS, and so on a variety of backend, can even transmit these messages over the network. 4. Jack is a professional voice service system, Cross-platform, its performance of the kernel real-time requirements higher than PulseAudio, in the general operating system Jack is not the former popular.

Ubuntu defaults to using ALSA as the underlying sound driver, and the program interacts with PulseAudio, which is a good solution. However, occasionally, the author encounters the problem of ALSA being monopolized by other software, only to be fashionable with the OSS4 craze on the #ubuntu-CN.

change OSS4 is to toss, toss is risky, the following is the reason for tossing: 1. The default ALSA does not work on your computer 2. Pure like OSS4, do not like ALSA3. Want to follow the bandwagon

The specific benefits of changing OSS4:
1. Better quality in some cases
2. Low latency, low CPU footprint
3. Self-with software reverb
4. More comprehensive documentation

The specific disadvantages of changing OSS4:
1. Some hardware is not supported
2. Poor support for MIDI
3. USB sound device support is still in the experimental phase
4. It's possible to make the system sound system cross by oneself toss

The

begins by saying the specific method of installing OSS4.
Method A
Download the free commercial version of the,  download page to the OSS4 official website.
Select the appropriate version, such as Linux 2.6 (x86) (DEB), click Submit to get the download link. Note that this version can only be used for one year by license.
Double-click Install (or sudo dpkg-i oss-linux*.deb) After getting the Deb file.
Method Two
Ubuntu 10.10 can be installed directly from the software warehouse version of the slightly older OSS4:
sudo apt-get install oss4-base oss4-dkms oss4-gtk
Ubuntu 10.04 and 11 .04 You can not use this method, there is a packaging problem in the 10.04 warehouse oss4-dkms can not properly build the kernel module, 11.04 because the kernel is new (Linux >= 2.6.36) and OSS4 version is too old to successfully build the kernel module.
Method Three
If you like me as much as open source version, and like toss, then we together to compile the latest version of.
First install mercurial to retrieve the latest version of code:
sudo apt-get install mercurial
Take out code:
CD ~
Hg clone Http://opensound.hg.sourc Eforge.net:8000/hgroot/opensound/opensound oss-devel
Create compilation directory, OSS4 need to compile in empty directory:
CD ~/
sudo rm-rf oss42build
mkdir oss42build
Compile and install, assuming your home directory is/home/aron:
CD oss42build/
no_warning_checks=yes/home/aron/oss-devel/ Configure--enable-libsalsa=no
Make
sudo make Deb
sudo dpkg-i oss*.deb

Install complete, and then start configuration if no errors are encountered:
1. Despite the OSS4 software reverb, I did not delete the PulseAudio, because many parts of Ubuntu's desktop environment only set the PulseAudio back end. I don't want to toss it all, but just try to get the program to use OSS4, after all, the main player and so on support the custom audio output. If you think so, do the following, if you don't want to, skip the paragraph.

A. Modify the PulseAudio setting so that it defaults to use OSS4 output:
Gksu GEDIT/ETC/PULSE/DEFAULT.PA
Add row: Load-module module-oss device= "/DEV/DSP" Sink_name=output source_name=input

B. Configure GStreamer to use OSS4 as the backend:
Install Gstreamer0.10-plugins-bad
sudo apt-get install Gstreamer0.10-plugins-bad
To run the command:
Gstreamer-properties
The input and output are set to OSS.

C. Set Libasound to transfer the voice request passed to ALSA to OSS4:
Gksu gedit/etc/asound.conf
Add the following: Pcm.oss {
Type OSS
Device/dev/dsp
}

Pcm.! Default {
Type OSS
Device/dev/dsp
}

Ctl.oss {
Type OSS
Device/dev/mixer
}

Ctl.! Default {
Type OSS
Device/dev/mixer
}

D. Configure the default enabled OSS4 instead of ALSA at startup:
sudo dpkg-reconfigure linux-sound-base
Select OSS rather than ALSA or default.

Then restart the computer, system-level configuration is basically complete. Software that supports custom audio systems can then be configured to use OSS4, such as AUDACIOUS,WINE,AUDACITY,VLC, (s) mplayer,clementine.

2. If you want to remove PulseAudio, there are ways, but do not guarantee that all programs will be able to correctly output sound. The first is to adjust the settings in B, C, D in the previous configuration method and then operate on the PulseAudio by E and F.

E. Use GStreamer to take over the GNOME sound system and install it as a GStreamer back-end compiled Libcanberra:
sudo add-apt-repository Ppa:dtl131/ppa
sudo apt-get update
sudo apt-get purge PulseAudio
sudo apt-get upgrade

F. Configure Rhythmbox and other programs to use Gstreamer (yes, also need to configure)
Run:
Gconf-editor
Locate the System/gstreamer/0.10/audio/default, and change all keys that are still set to Pulsesink (such as Musicaudiosink and Chataudiosink) to Osssink.
The system default Volume control plugin will fail because it is based on PulseAudio, and you can right-click on the panel and add a GNOME sound control.

Then reboot, and most of the sound systems will be fine. Possible problems:
1.Flash, you need to install Flashplugin-nonfree-extrasound to get support for OSS4 Libflashsupport.
2.firefox,xulrunner cannot compile to support both Alsa and OSS4, so there may be a problem.

FAQ

1. Sound input is not available, or there is noise
To run the command:
Ossxmix
In the display of the interface to the Pink drop-down menu to select Input, check the interface of all Input-mix and Input-mix-mute, and then drag the slider in pink to reduce volume, generally to 80% up or down, otherwise there will be noise.

2. How to see if the OSS4 kernel module has been loaded and what modules my sound card is using.
To run the command:
Lsmod | Grep-i OSS
For example, I am HD Audio, the output is as follows: Oss_usb 104136 1
Oss_hdaudio 144219 3
Osscore 545146 2 Oss_usb,oss_hdaudio

3. How to view my sound card model.
Lspci | Grep-i Audio

4. Is the 64-bit system available?
Can, no problem.

5. KDE4 with Phonon, can you use it?
Phonon should be able to detect OSS4 directly by default. KDE 4.0.x may not be available with xine back end.

6. Adjust the volume with what.
If Pulseauido is retained, the program that uses it can use the original volume control and, if it is Gstreamer, the GNOME volume controller.
Of course, you can also use the Ossxmix tool to adjust directly, or tools such as Xfce-oss, Kmix.

Don't want to use OSS4, how to recover.
I say what I need for the above a B C D E F, respectively.

A. Restore PulseAudio Default Hardware detection
Gksu GEDIT/ETC/PULSE/DEFAULT.PA
Deletes the added row.

B. Configure GStreamer to use PulseAudio as the backend
To run the command:
Gstreamer-properties
Set both input and output to Pulseauido.
If you don't want to Gstreamer0.10-plugins-bad, you can delete it:
sudo apt-get purge Gstreamer0.10-plugins-bad

C. Set Libasound to use ALSA:
Deletes all rows added in the/etc/asound.conf. If you start tossing OSS4 before you make any changes to it, simply delete the line:
sudo rm/etc/asound.conf

D. Configure the default enabled ALSA at startup:
sudo dpkg-reconfigure linux-sound-base
Select ALSA.

E. Change back to support Gstreamer and PulseAudio Libcanberra back end:
To install the necessary software:
sudo apt-get install PulseAudio indicator-sound libcanberra-pulse Libcanberra-gstreamer Pulseaudio-module-bluetooth pulseaudio-module-gconf pulseaudio-module-x11 Ppa-purge
To delete the added PPA:
sudo ppa-purge Ppa:dtl131/ppa
sudo apt-get update
If it's not working properly, demote all the related packages manually (it's disgusting, but there's no other way), and you can use a "local or stale" filter to help you determine which packages are in the new riser.

F. Configure Rhythmbox and other programs to use PulseAudio
Run:
Gconf-editor
Locate the System/gstreamer/0.10/audio/default, and change all of the keys that are still set to Osssink to Pulsesink.

Then replace all previously modified programs using OSS4 to use PulseAudio and reboot the system.

Useful information:
1. Configure oss4:configuring applications for OSSV4 for common applications
2. Fault Handling: OSSV4 troubleshooting
3. OSS page on ArchLinux Wiki: English and Chinese

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.