2005/04 Update : This page is completely obsolete by now, and only kept as a reference as to how to install ALSA on old 2.4 kernel-based distributions.
This page describes the few steps needed to install and use ALSA (the Advanced Linux Sound Architecture) with Red Hat Linux or Fedora. As it is still not included by default, and since it contains some kernel modules and device nodes, installing, upgrading and removing ALSA isn't trivial.
Note about the kernel drivers : You will need a "kernel-module-alsa" package that was compiled for your kernel (same version and architecture). You can easily recognize a matching "kernel-module-alsa" package from its name, e.g. "kernel-smp-module-alsa-0.9.3-1.fr_2.4.20_1.athlon.rpm" will work for the SMP 2.4.20-1 athlon kernel. If you do not find a matching package, recompile the source "alsa-driver" rpm while running the kernel you intend to use ALSA with, having the corresponding "kernel-source" package installed and using "--target <arch>" to choose the correct architecture ("i686" for instance). Once this is done, simply install the resulting "kernel-module-alsa" binary rpm with "rpm -ivh". Note that if you do not specify the --target option, the default on x86 will be to recompile for the i386 kernel, which is probably not what you want. For more advanced rebuild options, see further below.
Install instructions :
- Install both "alsa-driver" and "kernel-module-alsa" packages (see above).
- Install "alsa-lib" package and eventually "alsa-lib-devel" if you intend to recompile some applications that can support ALSA natively.
- Install "alsa-utils" which contains useful tools like the "alsamixer".
- Edit your /etc/modules.conf file accordingly to the instructions found on The ALSA Soundcard Matrix for your sound card/chip.
- Remove your current sound module (if any, and closing all applications accessing sound before, including "esd" or "arts"), e.g. "killall esd; modprobe -r maestro3".
- Insert the new ALSA modules, e.g. "modprobe snd-maestro3; modprobe snd-pcm-oss; modprobe snd-mixer-oss; modprobe snd-seq-oss", there should be no output (see the "Install" section about your sound card/chip in The ALSA Soundcard Matrix for your exact module names).
- Run "alsamixer" or the regular "aumix" to unmute the devices by pressing "M" and set the desired volume.
- The alsactl init script (from the alsa-utils package) takes care of saving your mixer settings upon shutdown and reboot, but in order to have them restored at startup, you need to add this to /etc/modules.conf :
post-install snd-card-0 /usr/sbin/alsactl restore >/dev/null 2>&1 || : pre-remove snd-card-0 /usr/sbin/alsactl store >/dev/null 2>&1 || :
Everything should then be configured properly to have you use ALSA natively and also through it's OSS compatibility layer! Normally, all existing applications should still work with no modifications, they just won't take advantage of the nice features ALSA has to offer.
Testing suggestions :
- Install "xmms-alsa" and select it as xmms's output plugin.
- Install "xine" and run "xine -A alsa".
- Install "mplayer" and run "gmplayer -ao alsa9".
- Install "alsaplayer".
Advanced rebuilding of the kernel modules :
- You may recompile the source "alsa-driver" package to get a resulting "kernel-module-alsa" binary package containing only one or more sound modules using a command line similar to this :
$ rpmbuild --rebuild --define 'cards card1 card2 card3'
It should save you time as not *all* modules will be recompiled. To get a list of available modules, run "./configure --help" from the alsa-driver source directory. - You may recompile the source "alsa-driver" package to get a resulting "kernel-module-alsa" binary package for any kernel installed through rpm, as long as its kernel-source package is also installed, by using a command line similar to this :
$ rpmbuild --rebuild --define 'kernel <uname -r output>' - An example of both the above used at the same time would be :
$ rpmbuild --rebuild --target i686 --define 'cards maestro3' --define 'kernel 2.4.18-24.8.0smp' alsa-driver-*.src.rpm
Links :
- http://foolish.digitalinc.info/docs/alsa/ - A more detailed page about installing ALSA on Fedora Core 1
If you have any corrections or suggestions about this document, please contact me.