# [HOW-TO] Installing ALSA (Kernel 2.6)

## deadaim

Since I've only seen scattered information on how to install ALSA, I decided to reorganize all the information into this HOW-TO.

To install ALSA in a 2.6 kernel, do the following (I am getting this from https://forums.gentoo.org/viewtopic.php?t=97157&highlight=alsa+minihowto , so credit goes there, especially to Helena and agent_jdh):

```
<M> Advanced Linux Sound Architecture 

<M> Sequencer support

< >  Sequencer dummy client

<*> OSS API emulation 

<M> OSS Mixer API 

<M> OSS PCM (digital audio) API 

<*> OSS Sequencer API

[ ]   Verbose printk

[ ]   Debug

       Generic devices  --->

       PCI devices  --->

       ALSA USB devices  --->
```

Configure your kernel as shown above.

Now you will need to compile your kernel.

```
make && make modules_install

mount /boot

cp /usr/src/linux/arch/i386/boot/bzImage /boot/KERNEL_NAME_HERE

cp System.map /boot/SYSTEM_MAP_NAME_HERE

umount /boot

```

Reboot your computer.

```
emerge alsa-lib alsa-utils
```

"Edit /etc/modules.d/alsa for your card (see the Gentoo ALSA guide and also the individual card pages on the ALSA website for how to do this)"

```
update-modules

rc-update add alsasound boot

alsamixer
```

"Unmute what you need and set your levels."

```
alsactl store

/etc/init.d/alsasound start
```

Check if your sound works by playing some music or something.  If it doesn't work, make sure you unmuted your card:

```
# amixer set Master 100 unmute

# amixer set PCM 100 unmute

Only if the above doesn't succeed on its own:

# amixer set Center 100 unmute

# amixer set Surround 100 unmute
```

If it still doesn't work, here are some tips on what to check for (yes they may sound stupid, but people still don't notice):

-Make sure your speakers/headphones are plugged in.

-If you are using xmms or any other media application, make sure you set the volume there.  Usually default is the minimum.

Good luck!

----------

## andrewy

thanks!

If only I had this a few weeks ago when I switched to the 2.6 kernel and ALSA..

----------

## Artem

thnx man, i really needed this! perfect timing too  :Smile: 

----------

## serge

Hi

I compiled the kernel-2.6.5-gentoo-r1.

I did i think all the possibilities to get my audigy card work [alsa compiled in the kernel, as modules] but it was unsuccessful.

Then i went back to my "old" 2.6.4-ck-r2 kernel. Before alsa was compiled in the kernel, this time i decided to use modules instead. The both ways alsa works...

```

"Edit /etc/modules.d/alsa for your card (see the Gentoo ALSA guide and also the individual card pages on the ALSA website for how to do this)" 

```

But what i noticed is that my /etc/modules.d/alsa file is actualy empty. [eveything is commented (with a # before each line)].

Then even compiled as modules alsa works without this configuration file...

Serge

----------

## deadaim

I had a little trouble understanding you, so I'm going to break down what you said and what I understood.

 *serge wrote:*   

> Hi
> 
> I compiled the kernel-2.6.5-gentoo-r1.
> 
> I did i think all the possibilities to get my audigy card work [alsa compiled in the kernel, as modules] but it was unsuccessful.

 

ALSA didn't work when you tried kernel-2.6.5-gentoo-r1 and compiled alsa into the kernel as modules.

 *serge wrote:*   

> Then i went back to my "old" 2.6.4-ck-r2 kernel. Before alsa was compiled in the kernel, this time i decided to use modules instead.

 

ALSA does work on your "old" 2.6.4-ck-r2 and you went ahead and compiled alsa as modules again.

 *serge wrote:*   

> The both ways alsa works...

 

Here I get confused.  Both ways worked for you?  I'm going to ignore this statement.

 *serge wrote:*   

> 
> 
> ```
> 
> "Edit /etc/modules.d/alsa for your card (see the Gentoo ALSA guide and also the individual card pages on the ALSA website for how to do this)" 
> ...

 

As for a proposed solution, try re-emerging alsa-lib and alsa-utils after you have reconfigured your kernel.  If /etc/modules.d/alsa exists, then just edit it.

You said when you looked at /etc/modules.d/alsa, everything was commented.  Are you sure everything was commented, because a large percentage of the file is originally commented.  Anyways, if everything is commented, I've included my /etc/modules.d/alsa below, so you can try and create your own.  Right now I don't have internet on gentoo, so I had to copy /etc/modules.d/alsa down on paper, and then go to Windows XP and write it down.  For this reason, I did not include any commented lines from the line.

```

alias char-major-116 snd

alias char-major-14 soundcore

alias snd-card-0 snd-intel8x0 (change according to your card)

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

alias /dev/mixer snd-mixer-oss

alias /dev/dsp snd-pcm-oss

alias /dev/midi snd-seq-oss

options snd cards_limit=1

```

----------

## serge

Hi Deadaim.

I did a fresh install of gentoo. And i chose the 2.6.4-ck2 kernel. I installed it and alsa was compiled inside [not as modules]. The sound was ok but in kde there was a kind of echo, delay as if i had 2 cards working together.

Then i compiled the 2.6.5-gentoo-r1 kernel. But i could not get alsa [my emu10k1] card work, neither alsa compiled in the kernel. nor alsa as modules [in kernel configuration].

Then i went back to the 2.6.4-ck2 kernel. I followed this how-to and alsa is compiled as modules and not in the kernel.[to be clear M and not Y in the kernel config].

I noticed then i did not edit my alsa config file. As i have the hotplug stuff i supposed it knows what modules to load according to the card i have.

I hope it is a bit clear...

Serge

----------

## deadaim

I'm not quite sure what error you are getting.  I understand that you followed this how-to.  Did it work?  Are you getting any problems with sound?  Does it give you any errors?  Does your /etc/modules.d/alsa file exist?  Is everything commented in the file?

You must edit your /etc/modules.d/alsa file according to your sound card.

----------

## serge

Hi Deadaim

My sound works. In kde i get a kind of annoying echo, or rather the second part of the sound gets higher for instance in opening a window. I did not have it in 2.4 kernels. Maybe it comes from kde itself. 

Anyway, i wanted to install then the 2.6.5 kernel. There, no matter what i chose [build in the kernel or as modules ( M or Y)], i could not load alsa/emu10k1 because i had errors at boot.

Then i went back to the 2.6.4 kernel and instead of building alsa in the kernel like the first time, i followed this how-to and built alsa as modules.

I forgot to re-adapt the /etc/modules.d/alsa , so this file was all commented [meaning it was as empty], and alsa still works. I kept my alsa file as it and the sound works.

But i have this "echo" in kde yet so i suppose it is a kde problem.

I just wanted to share this experience [not using an alsa file config].

I would like to know if someone has been succesful by compiling the 2.6.5-gentoo-r1 kernel, with alsa and emu10k1..

Serge

----------

## wrxjunkie

Great guide for alsa and nforce2: http://www.wlug.org.nz/NForce2Notes

----------

## deadaim

wrxjunkie: Thanks for sharing!

serge: I think that the sound echo is being caused by arts and not because of ALSA.  Try disabling arts and see if the echo goes away.

----------

## Gogiel

There's always 2nd way to compile in kernel just 'Sound support' and then download alsa-driver for alsa-project.org and compile it as before on 2.4.

----------

## Kerjo

Okay, I'm having some trouble getting sound going on my Dell 600m laptop.

I followed this guide as best I could, and here's my  /etc/modules.d/alsa file:

```

# Alsa 0.9.X kernel modules' configuration file.

# $Header: /var/cvsroot/gentoo-x86/media-sound/alsa-utils/files/alsa-modules.conf-rc$

# ALSA portion

alias char-major-116 snd

# OSS/Free portion

alias char-major-14 soundcore

##

## IMPORTANT:

## You need to customise this section for your specific sound card(s)

## and then run `update-modules' command.

## Read alsa-driver's INSTALL file in /usr/share/doc for more info.

##

##  ALSA portion

alias snd-card-0 snd-intel8x0

## alias snd-card-1 snd-ens1371

##  OSS/Free portion

alias sound-slot-0 snd-card-0

## alias sound-slot-1 snd-card-1

##

# OSS/Free portion - 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

##  OSS/Free portion - card #2

## alias sound-service-1-0 snd-mixer-oss

## alias sound-service-1-3 snd-pcm-oss

## alias sound-service-1-12 snd-pcm-oss

alias /dev/mixer snd-mixer-oss

alias /dev/dsp snd-pcm-oss

alias /dev/midi snd-seq-oss

# Set this to the correct number of cards.

options snd cards_limit=1

```

Running "amixer" gives me:

```
amixer: Mixer attach default error: No such device
```

and running "alsamixer" gives me:

```
alsamixer: function snd_ctl_open failed for default: No such device
```

Any ideas?

----------

## deadaim

Kerjo, I apologize for the delay, but I just read the message.

Go into your kernel and compile the following:

```
Device Drivers -->

    Sound -->

        Advanced Linux Sound Architecture -->

            PCI Devices -->

                <*> Intel i8x0/MX440, SiS 7012; Ali 5455; NForce Audio; AMD768/8111

```

Then go ahead and recompile your kernel and copy it to /boot (remember to mount /boot).

----------

## ravloony

Hi all,

So I have got alsa working I think, no probs. I can get static out of the speakers, so I presume it should work (I haven't finished compiling amarok just yet)

There is one thing however: how do I get the midi emulator thing (emu401k?) working? I can't seem to understand where to add it in, or in which configuration file to activate it.

I have alsa compiled into the kernel, and the oss stats are as follows:

```
hoshi ~ # cat /proc/asound/oss/sndstat 

Sound Driver:3.8.1a-980706 (ALSA v1.0.9b emulation code)

Kernel: Linux hoshi 2.6.13-gentoo-r3 #2 SMP Sun Oct 16 14:16:24 CEST 2005 i686

Config options: 0

Installed drivers: 

Type 10: ALSA emulation

Card config: 

NVidia nForce2 with ALC650E at 0xe6002000, irq 18

Audio devices:

0: NVidia nForce2 (DUPLEX)

Synth devices: NOT ENABLED IN CONFIG

Midi devices: NOT ENABLED IN CONFIG

Timers:

7: system timer

Mixers:

0: Realtek ALC650E

```

In all probability I'll never use the midi functionality but I'd like to have it working just in case.

Thanks in advance

ravloony out.

----------

