Next Previous Contents

3. How to install ALSA sound drivers

3.1 What you need

If you have a PnP card, you will also need: The INSTALL text in the driver directory suggests that for some cards, PnP support is native. I also received a suggestion from Jaroslav about this. When I get further information about this topic I will add it to this mini-HOWTO.

Please note that you should not have any sound drivers active when you want to use the ALSA drivers. If you have a kernel with sound drivers compiled in, you'll need a kernel recompilation. If you have the old "sound.o" module active, you need to deactivate it. If you use kerneld, this probably means deleting sound.o from the /lib/modules/<kernel_version>/misc directory. Newer RedHat systems have a different sound approach, with several sound modules active. You need to deactivate them all.

The 2.2 series kernel has a new approach to sound. You should include sound support here ! Yep, that's right: you add sound support to the kernel, but do not include any sound card. Then compile and install the kernel and after that, compile the ALSA-drivers.

3.2 Getting the drivers

The ALSA drivers are available from ftp://ftp.alsa-project.org/pub/ and there is a mirror at ftp://linux.a2000.nl/alsa For a fully functional ALSA-installation, you will need the driver, the libs and the utilities; e.g if you chose the mirror you would get ftp://linux.a2000.nl/alsa/driver/alsa-driver-0.3.0-pre4.tar.gz, ftp://linux.a2000.nl/alsa/lib/alsa-lib-0.3.0pre4.tar.gz and ftp://linux.a2000.nl/alsa/utils/alsa-utils-0.3.0-pre4.tar.gz (and NO these are not full links, you'd better look at the original place if there are newer versions available, simply get the last one).

3.3 Extracting

You extract the drivers by some reasonable command, like the all-time tar -zxf <file>. For newbies and for those with amnesia:

cd /usr/src

tar -zxf ~/alsa-driver-0.3.0-pre4.tar.gz
(If this worked you are either logged in as root always, which is the wrong way, stop here and read the DOS/Win95-to-Linux-HOWTO, or you already thought this would be the administrative thing you needed superuser/rootprivs for. So: for this you need rootprivs, type a "su" and the password).
tar -zxf ~/alsa-lib-0.3.0pre4.tar.gz

tar -zxf ~/alsa-utils-0.3.0-pre4.tar.gz
Also working and more fun: find ~ -name alsa* -exec tar -zxf {} \; (Don't try this at home kids, it's just an example). Note that when downloading the drivers with Netscape, you may accidentally get unpacked drivers with a ".tgz" extension. If tar complains about the file format, you may get better results by leaving off the "z" in the tar options.

3.4 Compiling

You need the drivers before you can compile and use the libs. You need the libs before you can compile or use the utils. So let's begin:

cd alsa-driver-0.3.0-pre4
(and for those not so experienced: try typing a <tab> (the "tab"-key) after "alsa-d". That's called command line completion.)
./configure

make
Now you need to be 'root' to install the stuff (you probably were "root" already)
make install
If this tells you that something like ``version.h'' cannot be found, then you probably do not have a proper kernel source tree. You need a couple of files of your kernel source to be able to compile the ALSA-drivers. Unpack your favorite linux-2.x.y.tar.gz in /usr/src, and issue a make menuconfig. (Actually, make symlinks may be enough). Now compile the libraries:
cd ../alsa-lib-0.3.0-pre4

./configure

make

make install
OK, you're getting it, the utilities:
cd ../alsa-utils-0.3.0-pre4

./configure

make

make install
Note: you can leave out the "make install" for the utilities at first. You could even leave out the whole library-making and utility-making, just to check if the driver works.

3.5 Preparing the devices

There is a script in the driver-directory that will install the ALSA-sound-devices in your /dev directory. Type

./snddevices
from the driver-directory. There should be a /dev/snd subdirectory now (test if it is there. If you are not familiar with even the "ls" command, please consider reading other HOWTO's first. You should have some basic Linux knowledge to install these drivers).

Now you're ready to insert the driver, so please turn over to the next paragraph.


Next Previous Contents