Installing ALSA Options Warning: The methods shown below are mutually exclusive. You cannot have ALSA compiled in your kernel and use media-sound/alsa-driver. It will fail. The two options are : Use ALSA provided by your kernel. This is the preferred/recommended method. Use Gentoo's media-sound/alsa-driver package. We shall take a peek into both before finally deciding on one. If you were to use ALSA provided by the kernel, the following are the pros and cons : Kernel ALSA Pros and Cons + Pretty stable as drivers are integrated into kernel. + One shot solution, no repeating emerges. - Might be a slightly older version than alsa-driver. And, if you were to use alsa-driver, alsa-driver Pros and Cons + Latest drivers from the ALSA Project. - Every kernel recompile requires a re-emerge of alsa-driver. - Needs certain kernel config options disabled to work correctly. So... The main difference between using alsa-driver and ALSA that comes with the kernel is that alsa-driver is generally more up to date than the version in the kernel. Since this does not make any huge difference as such, you are encouraged to use the ALSA provided by the kernel for ease of use. Before reporting any sound related issues to Gentoo Bugzilla, please try to reproduce them using alsa-driver and file the bug report no matter what the result. Before you proceed Whichever method of install you choose, you need to know what drivers your sound card uses. In most cases, sound cards (onboard and otherwise) are PCI based and lspci will help you in digging out the required information. Please emerge sys-apps/pciutils to get lspci, if you don't have it installed already. In case you have a USB sound card, lsusb from sys-apps/usbutils might be of help. For ISA cards, try using sys-apps/isapnptools. Also, the following pages may help users with ISA based sound cards. The ISAPNPTOOLS Page LinuxJournal PnP Article TLDP Sound HowTo Note: For ease of use/explanation, we assume the user has a PCI based sound card for the remainder of this guide. We now proceed to find out details about the sound card. Code Listing 2.1: Soundcard Details # lspci -v | grep -i audio 0000:00:0a.0 Multimedia audio controller: Creative Labs SB Live! EMU10k1 (rev 06) We now know that the sound card on the machine is a Sound Blaster Live! and the card manufacturer is Creative Labs. Head over to the ALSA Soundcard Matrix page and select Creative Labs from the drop down menu. You will be taken to the Creative Labs matrix page where you can see that the SB Live! uses the emu10k1 module. That is the information we need for now. If you are interested in detailed information, you can click on the link next to the "Details" and that will take you to the emu10k1 specific page. Using ALSA provided by your Kernel If you're a person who likes to keep things simple like I do, then this is the way to go. Note: Since the 2005.0 release, Gentoo Linux uses 2.6 as the default kernel. Unless you are specifically using the 2.4 profile, gentoo-sources will be a 2.6 kernel on most architectures. Please check that your kernel is a 2.6 series kernel. This method will not work on a 2.4 kernel. Let us now configure the kernel to enable ALSA. Important: genkernel users should now run genkernel --menuconfig all and then follow the instructions in Kernel Options for ALSA. Code Listing 2.2: Heading over to the source # cd /usr/src/linux # make menuconfig Note: The above example assumes that /usr/src/linux symlink points to the kernel sources you want to use. Please ensure the same before proceeding. Now we will look at some of the options we will have to enable in the 2.6 kernel to ensure proper ALSA support for our sound card. Please note that for the sake of ease, all examples show ALSA built as modules. It is advisable to follow the same as it then allows the use of alsaconf which is a boon when you want to configure your card. Please do not skip the Configuration section of this document. If you still like to have options built-in, ensure that you make changes to your config accordingly. Code Listing 2.3: Kernel Options for ALSA Device Drivers ---> Sound ---> (This needs to be enabled) Sound card support (Make sure OSS is disabled) Open Sound System ---> < > Open Sound System (DEPRECATED) (Move one step back and enter ALSA) Advanced Linux Sound Architecture ---> Advanced Linux Sound Architecture (Select this if you want MIDI sequencing and routing) Sequencer support (Old style /dev/mixer* and /dev/dsp* support. Recommended.) OSS Mixer API OSS PCM (digital audio) API (You now have a choice of devices to enable support for. Generally, you will have one type of device and not more. If you have more than one sound card, please enable them all here.) (Mostly for testing and development purposes, not needed for normal users unless you know what you are doing.) Generic devices ---> (For ISA Sound cards) ISA devices ---> (IF you had the Gravis, you would select this option) Gravis UltraSound Extreme (Move one level back and into PCI devices. Most sound cards today are PCI devices) PCI devices ---> (We now select the emu10k1 driver for our card) Emu10k1 (SB Live!, Audigy, E-mu APS) (Or an Intel card would be) Intel/SiS/nVidia/AMD/ALi AC97 Controller (Or if you have a VIA Card) VIA 82C686A/B, 8233/8235 AC97 Controller (Move one level back and select in case you have an USB sound card) USB Devices ---> Now that your options are set, you can (re)compile the kernel and ALSA support for your card should be functional once you reboot into the new kernel. Don't forget to update your GRUB configuration to use the newly built kernel. You can now proceed to ALSA Utilities and see if everything is working as it should.