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
There's lots more to ALSA however, like support for Full Duplex playback and recording, multiple soundcard support, hardware mixing of streams, extensive mixer capabilities (to support advanced features of new soundcards), ...
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:
To compile programs with ALSA-support, be sure to add
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
# 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 portion alias 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
# 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
# modprobe snd-mixer-oss # modprobe 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 unmuteOnly 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)
We 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-based
You may want to emerge
When you reboot your system, the
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
If your soundcard has a joystick plug, you might be interested in activating
joystick support for your soundcard. If so, start by verifying if your soundcard
driver has a joystick parameter. You can verify this by running
# modinfo snd-via82xx
filename: /lib/modules/2.4.22-ck2/snd-via82xx.o
description: "VIA VT82xx audio"
author: "Jaroslav Kysela <perex@suse.cz>"
license: "GPL"
parm: index int array (min = 1, max = 8), description "Index value for VIA 82xx bridge."
parm: id string array (min = 1, max = 8), description "ID string for VIA 82xx bridge."
parm: enable int array (min = 1, max = 8), description "Enable audio part of VIA 82xx bridge."
parm: mpu_port long array (min = 1, max = 8), description "MPU-401 port. (VT82C686x only)"
parm: joystick int array (min = 1, max = 8), description "Enable joystick. (VT82C686x only)"
parm: ac97_clock int array (min = 1, max = 8), description "AC'97 codec clock (default 48000Hz)."
parm: dxs_support int array (min = 1, max = 8), description "Support for DXS channels
(0 = auto, 1 = enable, 2 = disable, 3 = 48k only, 4 = no VRA)"
If it has the
alias snd-card-0 snd-via82xx options snd-via82xx joystick=1
You could check these for additional info: