There are two ways of getting Linux drivers to work, you can either compile them into the kernel or build them separately as modules. Read the Kernel-HOWTO for details of how to compile a kernel.
You must turn on the sound support soundcore module. This is in the kernel. Look in the sound drivers directory and it should be the first option. Most people enable the module setting. That way you can load and unload the module manually if you have multiple soundcards/devices or if you intend to debug or use cutting edge software which may cause your drivers to halt sometimes. Of course it also means you have more control of your system.
Most modern distros come with soundcore compiled as a module. You can check this in numerous ways. The easiest way is to type:
If this command returns that you have this module, then you don't need to recompile your kernel.
In the following, you need to replace yourmodule with the name of the module for your soundcard.
The module list links to pages for each module where you can find out more about yourmodule.
Type the following commands in the shell of your choice.
If you are using Hg (Mercurial) then you need to type:
./hgcompile "or" make build
Make a directory to store the alsa source code in:
cd ~/src mkdir ~/src/alsa cd ~/src/alsa cp ~/downloads/alsa-* .
Now unzip and install the alsa-driver package:
bunzip2 alsa-driver-xxx tar -xf alsa-driver-xxx cd alsa-driver-xxx ./configure --with-cards=yourmodule --with-sequencer=yes ; make ; make install
Now unzip and install the alsa-lib package:
cd .. bunzip2 alsa-lib-xxx tar -xf alsa-lib-xxx cd alsa-lib-xxx ./configure ; make ; make install
Now unzip and install the alsa-utils package:
cd .. bunzip2 alsa-utils-xxx tar -xf alsa-utils-xxx cd alsa-utils-xxx ./configure ; make ; make install
Now insert the modules into the kernel:
Now adjust your soundcard's volume levels. All mixer channels are muted by default. You must use a native mixer program to unmute appropriate channels, for example alsamixer from the alsa-utils package. Note that some usb-audio devices do not have internal mixer controls. Run:
You can also look at the utils/alsasound file. This script is designed for the RedHat Linux distribution, but it can also be used with other distributions which use SystemV style rc init scripts. This will allow you to load your modules at boot time. If you don't want to do this you can of course compile them into the kernel instead and save yourself the hassle of coming to terms with the rc init scripts.
Setting up modprobe and kmod support
Before you send a mail complaining that "I don't have /etc/modules.conf, where do I find it ……" ‒ the /etc/conf.modules has been deprecated with a few distro's, but in your case it may still be /etc/conf.modules. Basically they are both the same, but recent version of modutils use /etc/modules.conf instead. Nothing to worry about as such, optionally please update to the latest version of modutils. This should solve your problem.
Here's the example for this card. Copy and paste this to the bottom of your /etc/modules.conf file.
Debian GNU/Linux users need to save this information into a file in the /etc/modutils/ directory (eg. /etc/modutils/alsa) and run update-modules.
# ALSA portion alias char-major-116 snd alias snd-card-0 snd-yourmodule # module options should go here # OSS/Free portion alias char-major-14 soundcore alias sound-slot-0 snd-card-0 # card #1 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
To copy and paste the above to your /etc/modules.conf file follow these instructions.
This is a short explanation of what happens in the /etc/modules.conf file.
After the main multiplexer is loaded, its code automatically requests the top level sound card module. String snd-card-%i is requested for native devices where %i is the sound card number, counted from zero (the first sound card) to seven (the eighth sound card). String sound-slot-%i is requested for native devices where %i is slot number for the corresponding ALSA owner (which is basically the sound card number). The options line allows you to set various configuration options before the module is loaded. String id (or snd_id) lets you set the name of the card which is then returned in the /proc/asound/cards file, i.e. to user space applications. Other options may be available depending on the specific card. Options for these cards are found in the INSTALL file or above.
username@hostname# pico /etc/modules.conf # ALSA portion alias snd-card-0 snd-hda-intel alias snd-card-1 snd-cmipci options snd-cmipci id="first" mpu_port=0x330 # OSS/Free portion alias sound-slot-0 snd-card-0 alias sound-slot-1 snd-card-1
Autoloading OSS/free emulation
At this point we are finished with the configuration for ALSA native devices, but you may also need autoloading for the OSS/Free emulation modules, an ALSA add-on. At this time only one module does not depend on any others, thus must be loaded separately: snd-pcm1-oss. String sound-service-%i-%i is required for OSS/Free service where the first %i is the slot number/sound card number and the second %i is the service number.
username@hostname# pico /etc/modules.conf # OSS/Free portion - card #1 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 # OSS/Free portion - card #2 (cmipci) 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
The alias for snd-seq-oss is not necessary on the second device, because there is only one /dev/sequencer regardless how many devices you have.