The Advanced Linux Sound Architecture (ALSA) is a project to improve the Linux sound subsystem by rewriting large chunks of it. It is anticipated that ALSA will make it into Linux kernel 2.6.x (or 3.x.x -- whichever comes first) as it becomes ready.
ALSA provides audio and MIDI functionality for Linux.
Quoted from
If your soundcard is supported by the Linux kernel sound system or the commercial OSS/4Front sound driver system,
which can be found in all 2.4.x Linux kernels, you could just aswell build
However, those OSS/4Front drivers have some limitations -- being commercial is one. ALSA is an attempt to go beyond these limitations and to do so in an open source fashion. ALSA is a fully GPL and LGPL'ed sound driver system, that provides a professional quality system for recording, playback, and MIDI sequencing.
ALSA tries to support as many (new) cards as possible by providing open-source drivers. However, some vendors may provide binary-only packages.
To know if your card is supported, you can find a Soundcard Matrix of supported and not-supported cards here:
Since we're still using 2.4.x kernel sources, we'll have to compile kernel modules and ALSA modules separately. People who are using a 2.5.x kernel can do this from within their kernel configuration, since the ALSA modules are included in the kernel sources and should be built there.
First we'll make sure that our kernel configuration is ready for use with ALSA.
All you need in your kernel configuration is having Sound Card Support set to be built as a module (M).
This will build
If you already have a working kernel configuration, make sure you remove all sound drivers (except for Sound Card Support). If you wish to do this without having to reboot, you could do like this:
#cd /usr/src/linux #cp .config ~/ #make mrproper #cp ~/.config . #make menuconfig
Now select
#make dep clean #make modules modules_install
Before installing your new modules, this last line will delete all your previous modules, even the ones from a previous ALSA installation.
Now it's time to install the ALSA drivers for your soundcard(s). If your soundcard is PCI, you can find out the name and type of your soundcard by looking at the output of /proc/pci
#grep audio /proc/pci
We could simply do an
However, to save some time, lookup the
#env ALSA_CARDS='emu10k1' emerge alsa-driver
After this, the ALSA modules should be installed on your system.
Let's start configuring now to get ALSA working properly. We'll need to edit some files, to let our system know about the freshly installed ALSA modules.
First, install
# emerge alsa-utils
Hereafter, we need to edit
Check the ALSA portion
# Set this to the correct number of cards.options snd cards_limit=1
Now we'll specify the sounddriver(s) ALSA should use. In the same file, edit like this:
## and then run `modules-update' command. ## Read alsa-driver's INSTALL file in /usr/share/doc for more info. ## ## ALSA portionalias snd-card-0 snd-emu10k1 ## If you have more than one, add: ## alias snd-card-1 snd-intel8x0 ## alias snd-card-2 snd-ens1370 ## OSS/Free portion ## alias sound-slot-0 snd-card-0 ## alias sound-slot-1 snd-card-1 ##
Last thing to do in this file, almost at the end, check if these lines are there and uncommented:
alias /dev/mixer snd-mixer-oss alias /dev/dsp snd-pcm-oss alias /dev/midi snd-seq-oss
Now double-check the file
# modules-update
You should also verify that /etc/devfsd.conf has the alsa devices and permissions correctly registered.
# ALSA/OSS stuff # Comment/change these if you want to change the permissions on # the audio devices LOOKUP snd MODLOAD ACTION snd LOOKUP dsp MODLOAD LOOKUP mixer MODLOAD LOOKUP midi MODLOAD REGISTER sound/.* PERMISSIONS root.audio 660 REGISTER snd/.* PERMISSIONS root.audio 660
First thing to do now, is to make ALSA startup at boottime. Like this:
#rc-update add alsasound boot
Since we're Linux users, we don't want to reboot. So we'll start the alsasound script manually.
#/etc/init.d/alsasound start
ALSA is running now. If everything is ok, you should be able to see the ALSA modules loaded when running
# amixer
#insmod snd-mixer-oss #insmod snd-pcm-oss #amixer
If you got this far, now unmute Master and PCM channels. Some hardware even requires you to unmute the center channel or even the surround channel.
# amixer set Master 100 unmute # amixer set PCM 100 unmuteWe check to see if sound is working by using the aplay (alsa play) command. If you hear a pop, then sound is indeed working. Then, adjust the volume settings to your liking; the ncurses-basedOnly if the above doesn't succeed on its own: # amixer set Center 100 unmute # amixer set Surround 100 unmuteTest the sound: # aplay $KDEDIR/share/sounds/pop.wav(pop.wav is part of KDE)
You may want to emerge
When you ever rebuild your kernel, or upgrade to another kernel, you'll have to rebuild the ALSA modules.
Although you might have installed
#emerge alsa-driver
You won't have to edit this file for use with ALSA. After our
It's not necessary to add
You could check these for additional info: