Sound card Driver Alsa Installation Guide (third edition)

Source: Internet
Author: User
Tags bz2

Recently in Linux to do the program, a long time did not listen to music, only to find that my Linux system has been no sound, just installed sound card driver, installed a long time to find information on the Internet, feel that this is a more authoritative

ALSA, i.e. advanced Linux Sound architecture. It is a good sound card driver, can drive most of the sound card, but also support multiple audio streaming, support multiple sound card and so on. So that we can enjoy the wonderful music under Linux.

Current ALSA latest version is 0.9.4. Can be downloaded from the official website of Alsa www.alsa-project.org. This paper takes alsa-0.9.4 as an example.

Prepare before installation. If you have installed OSS business drivers, you will need to stop OSS services before installing ALSA.
Execution: NTSYSV queries the OSS service and cancels it in the terminal graphics configuration interface that appears.
The/etc/modules.conf is then edited to remove the portion of the OSS. (Can be renamed/etc/modules.conf, as a backup.) Another will be renamed/etc/modules.conf.pre-oss to modules.conf.
If any other devices can not be loaded after renaming, please refer to the original modules.conf to modify the new modules.conf.
Save the reboot.

ALSA Installation steps:

A ALSA installation requires Linux kernel support and a Linux kernel source pack.
In fact, the installation of ALSA is easy, but the key is the configuration of the Linux source package. Some friends install Alsa is not successful, most of the problems in the Linux source code package settings. I suggest that friends take this step seriously.

1. Confirm that there is no kernel source code package
Go to the/USR/SRC directory to see if there is a directory with a name similar to Linux-2.x.x-x, more than 100 MB. If not, you have to install one yourself. Release CD with.

2. Make a link to a source code package.
Ln-s linux-2.x.x-x Linux (where linux-2.x.x-x is the directory name for the source package)
Note: Friends who have upgraded the kernel should note that the link should point to the source code for the kernel you are currently using.

3. Confirm Kernel configuration. ALSA requires a kernel-supported sound card. Most of the current distributions have been configured to do so, they do not need to do.
Confirm method: Execute: Modinfo soundcore
If the return message indicates that the file is Soundcore, then the current kernel has been configured accordingly. Can be installed for ALSA.
In addition, a few Linux distributions may require. Configure files when installing ALSA, please make the following confirmation
Executive: Cd/usr/src/linux
Ls-a See if there is a. config file. (Currently popular Rh8, RH9, and other versions of Linux do not need it.) )

The following actions are available only to the kernel that does not have the appropriate set of friends to open.
Enter the kernel source package directory, execute: Make Xconfig
The sound card support under the sound key needs to be selected as a module. (Sound options Please decide for yourself)
After saving exit, execute: Make DEP
It's OK to finish this step generally. However, after the compilation Alsa is unsuccessful, it may be necessary to formally compile a new Linux kernel to support ALSA installation.

Note: Questions about the Redhat release 2.4.20-XX series kernel.
In the Rehat release, if you are using the latest 2.4.20-XX kernel and its source code package, such as REDHAT9, you should install the alsa-0.9.4 version, which 0.9.x is not available for installation. Although ALSA can be compiled successfully, the ALSA module is loaded with errors and cannot be used.


Two go to www.alsa-project.org download alsa-0.9.4 source Package

ftp://ftp.alsa-project.org/pub/driv...r-0.9.4.tar.bz2
ftp://ftp.alsa-project.org/pub/lib/...b-0.9.4.tar.bz2
ftp://ftp.alsa-project.org/pub/util...s-0.9.4.tar.bz2
ftp://ftp.alsa-project.org/pub/tool...s-0.9.4.tar.bz2
Ftp://ftp.alsa-project.org/pub/oss-... s-0.9.4.tar.bz2

Put the package into a directory, and all subsequent operations are performed in that directory.
Decompression, execution:

Tar jxvf alsa-driver-0.9.4.tar.bz2
Tar jxvf alsa-lib-0.9.4.tar.bz2
Tar jxvf alsa-utils-0.9.4.tar.bz2

The other two I do not use much, there is a need to try their own.

Three compile Alsa execution:

CD alsa-driver-0.9.4
./configure

Note: If you know the module name of your sound card, you can use:./configure--with-cards= Module name like mine is a 8235-chip soft sound card, then:./configure--with-cards=via82xx But if it's not clear, or please use./congfigure to compile the driver for all sound cards supported by ALSA.
If your sound card is an ISA PnP sound card, use the./configure--with-isapnp=yes
The detailed parameters of the./configure can be queried by executing:./configure–help.

After:
Make
Make install
./snddevices
CD Utils
/alsaconf after the appearance of a terminal graphics configuration interface, all the way back to configure the sound card.
If alsaconf does not automatically configure your sound card, then you may need to manually configure the/etc/modules.conf file.
Please refer to the following fields:

# ISA PnP Support (don ' t use IRQs 9,10,11,12,13)
Options Isapnp isapnp_reserve_irq=9,10,11,12,13

# ALSA Native Device support
Alias char-major-116 snd
Options snd major=116 cards_limit=1
Alias snd-card-0 snd-sound card module name
Options snd-sound card module name index=0

# Oss/free Setup
Alias Char-major-14 Soundcore
Alias sound-slot-0 snd-card-0
Alias sound-service-0-0 Snd-mixer-oss
Alias Sound-service-0-1 Snd-seq-oss
Alias Sound-service-0-3 Snd-pcm-oss
Alias Sound-service-0-8 Snd-seq-oss
Alias Sound-service-0-12 Snd-pcm-oss

Add the above paragraphs to/etc/modules.conf.
After execution: Modprobe snd-the sound card module name.

Note: Sometimes after the first execution of the ALSA module load operation, there will be some error messages, you can restart the system at this time, and then load a module to see if the problem can be solved.

If it is a dual sound card, manually edit the/etc/modules.conf file. Refer to the following fields:
# ISA PnP Support (don ' t use IRQs 9,10,11,12,13)
# it ' s only a example to reserve some IRQs for another hardware
Options Isapnp isapnp_reserve_irq=9,10,11,12,13

# ALSA Native Device support
Alias char-major-116 snd
Options snd major=116 cards_limit=2
Alias snd-card-0 snd-first sound card module name
Alias Snd-card-1 snd-second sound card module name
Options snd-first piece of sound card module name index=0
Options snd-second block of sound card module name Index=1

# Oss/free Setup
Alias Char-major-14 Soundcore
Alias sound-slot-0 snd-card-0
Alias sound-service-0-0 Snd-mixer-oss
Alias Sound-service-0-1 Snd-seq-oss
Alias Sound-service-0-3 Snd-pcm-oss
Alias Sound-service-0-8 Snd-seq-oss
Alias Sound-service-0-12 Snd-pcm-oss
Alias Sound-slot-1 Snd-card-1
Alias sound-service-1-0 Snd-mixer-oss
Alias Sound-service-1-3 Snd-pcm-oss
Alias Sound-service-1-12 Snd-pcm-oss

Add the above fields to/etc/modules.conf
Then execute separately: modprobe snd-first sound card module name
Modprobe snd-second piece of sound card module name

Four configurations
Because Linux defaults to mute, you need to configure the volume, save the settings, and load each time you start.

1. Configure Volume
The recommended use of alsactl+alsamixer or alsactl+gamix adjustment options is rich. The method is as follows:
A. Enter the alsa-lib-0.9.4 directory and execute:
./configure
Make
Make install
The above installation alsalib.

B. Enter the alsa-utils-0.9.4 directory and execute:
./configure
Make
Make install
The above installation Alsactl, Alsamixer, Amixer, Aplay tools.

C. Download Gamix
Http://www1.tcnet.ne.jp/fmurata/linux/down/gamix-1.99.p14.tar.gz
Decompression: Tar zxvf gamix-1.99.p14.tar.gz
CD GAMIX-1.99.P14
./configure
Make
Make install
Above installation Gamix

D. Take Alsactl+gamix as an example:
Executive: Gamix
Adjust the appropriate volume, and then exit.
Note: When you adjust the volume, if the CD is silent, check that the CD audio cable is properly connected to the sound card or motherboard.
As for the inability to play mp3 or silent, and the system for Rh8, RH9, you should go to www.xmms.org download a MP3 playback plug-in to support MP3 playback. It is recommended that you use a WAV file to adjust the volume to avoid the above situation.
In addition, you need to correctly select the sound open/Guan Xian item.

2. Save current volume configuration
Executive: Alsactl Store

3. Each boot load
provides three ways.
The first method: (The simplest, to the system to join the Alsasound service, using the script of the ALSA itself to control, first recommended)
Executive: Chkconfig--add Alsasound
Then reboot.

The second method: (also very simple)
Edit/etc/rc.d/rc.local
Add this line: alsactl restore
Save the reboot.

The third method: (first thought, so also put up)
GNOME Desktop
Starting here-preferences-more preferences-sessions
In the session panel, select the Start program, click Add, enter in the startup Command box: Alsactl restore, then OK, close.
KDE Desktop
Run the mixer (kmix), file-saves the current volume as the default value-exits.
Then reboot.

4. Note: With KDE friends, you may need to turn off the arts service.
Run the control center, sound and multimedia-sound system-arts, and cancel the start of the ARTs sound server at KDE startup.

Some additional Notes
1.ALSA installation is generally not difficult, but if there is an error, please do more lsmod, because the ALSA is loaded in the form of modules, through the LSMOD output information to know ALSA loading, so as to determine the cause of the error.
which
SND is the core module of ALSA, which is invoked for the sound card driver module and other ALSA modules, and is first loaded. Without it, ALSA would not be able to work.
Soundcore is a Linux kernel voice support module. SND needs it.
2. If the ALSA successfully compiled, the module successfully loaded, the volume adjustment is correct, so the steps are correctly executed but still silent, please refer to the ALSA documentation to see if the sound card needs to attach specific parameters. For example, the es1988 chip's sound card may need to add certain parameters to be audible. Notebook users need to pay special attention to this point.
3. As for ALSA related applications, such as multiple audio streaming support, multiple sound card work at the same time, sound quality enhancement, etc., will be introduced in another article.

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.