# configuring snd_hda_intel for ALSA

## mbreith

I think this file should exist, so I am writing it - even though I feel completely unqualified to do so. Basically I am going to gather a bunch of information from several different posts that I used to get my sound working. 

First, the list of sound chipsets that are supported by the snd-hda-intel module:

ATI: SB450, SB600w RS600

VIA: VT8251/VT8237A

SIS966, ULI M5461

There may be others as well, but this is the list that I have been able to find

Since you are still reading this I am going to assume that you need to use the hda-intel driver and that it didn't work 'out of the box'. I am also going to assume that you followed all the other instructions in the ALSA-howto documentation. 

The basic idea is that this kernel module is trying to support a variety of related, but different, soundcards and it doesn't have good enough autodetection to be able to do this well. You will need to give it a hand by passing some options to it when the module is loaded. 

The two main options that need to be specified are the model name and the position fix. The first specifies which flavor of sound card you have, and the second is a bug workaround for poor quality sound. All of the available options are specified in the file 

```
/usr/src/linux-`uname -r`/Documentation/sound/alsa/ALSA-Configuration.txt
```

 Search through there (use / in less) for snd-hda-intel. I'm not going to go into the position fix option other than to list the syntax for it later. 

To find a good model name, first modprobe the snd_hda_intel module and look through dmesg. If the model name is bad, it should give a line such as this one  *Quote:*   

> hda_codec: Unknown model for ALC660VD/ALC861VD, trying auto-probe from BIOS...
> 
> si3054: cannot initialize. EXT MID = 0000

 

Look through the ALSA-configuration.txt file for something that matches. For this it would be   *Quote:*   

> ALC861VD/660VD
> 
>           3stack        3-jack
> 
>           3stack-dig    3-jack with SPDIF OUT
> ...

  At this point, your guess is as good as mine on which is the correct model name. At least it has been narrowed down a bit. Mine happens to need the 3stack.

For drivers compiled as modules (either kernel supplied ALSA or ALSA-driver downloaded modules), add a line to the file 

```
/etc/modules.d/alsa
```

 I don't know if it is important where in the file the line should go. Anyway, the syntax is 

```
options snd-hda-intel model=3stack position_fix=1
```

 Obviously replace the model name and position fix number to the proper settings for your system. After that, run 

```
update-modules
```

 to finalize the changes.

For drivers compiled directly into the kernel, add a boot parameter to the kernel at boot time. Meaning edit your grub or lilo file and add a line such as 

```
snd_hda_intel.model=3stack
```

 You can do something similar for the position fix as well.

There are also reports of ACPI interfering with the sound driver. See here.

----------

## steveL

Nice post mbreith!

----------

## sonicbhoc

Position fix keeps returning unknown argument on my machine with the 3stack-dig model.

----------

## mbreith

Hmmm...   What's the module argument line that you have?

```
grep options /etc/modules.d/alsa
```

Or if you have everything compiled directly

```
cat /boot/grub/grub.conf
```

or similar for lilo.

----------

## PaulBredbury

 *sonicbhoc wrote:*   

> Position fix keeps returning unknown argument

 

So look for it. If using in-kernel alsa:

```
$ find /usr/src/linux/ -type f | xargs grep position_fix

/usr/src/linux/Documentation/sound/alsa/ALSA-Configuration.txt:    position_fix - Fix DMA pointer (0 = auto, 1 = none, 2 = POSBUF, 3 = FIFO size)

...

/usr/src/linux/sound/pci/hda/hda_intel.c:MODULE_PARM_DESC(position_fix, "Fix DMA pointer (0 = auto, 1 = none, 2 = POSBUF, 3 = FIFO size).");
```

----------

## gsoe

Good work mbreith! I'm happy to see you got your hda-intel working. Mine is basically working (with the SB600); only problem is that the volume slider in the kmix panel applet picks up the pc-speaker channel instead of the output. I've searched around a bit, but as far as I can find, kmix is to blame. I'm going to try experimenting with the model settings though. If anybody knows about this problem, please let me know.

----------

## sonicbhoc

```

parm:           index:Index value for Intel HD audio interface. (int)

parm:           id:ID string for Intel HD audio interface. (charp)

parm:           model:Use the given board model. (charp)

parm:           position_fix:Fix DMA pointer (0 = auto, 1 = none, 2 = POSBUF, 3 = FIFO size). (int)

parm:           probe_mask:Bitmask to probe codecs (default = -1). (int)

parm:           single_cmd:Use single command to communicate with codecs (for debugging only). (bool)

parm:           enable_msi:Enable Message Signaled Interrupt (MSI) (int)

parm:           enable:bool

```

That's a snip from modinfo. I got position fix to work somehow. I did it exactly the way I usually do it, which doesn't normally work, and it worked.

However, it doesn't fix my problems with JACK. I can't set -n3 on my card. I always get:

```

ALSA: got smaller periods 2 than 3 for playback

```

The JACK mailing list was no help in solving my problem. Do you guys think you could give me a hand if I start a new thread?

----------

## gerardo

Does anyone know how to split sound output?

I would like my music player (Exaile) to play on side-channels, as these are connected to my stereo set.

Normal sound (like from mplayer, vlc, firefox, ...) should go to my PC-speakers only (=front).

Is this possible?

I presume I have to play with the ~/.asoundrc, but I don't know how to start. Has anyone done that already?

Fyi: I use HDA-intel drivers for ALC883 with 6 jacks on Intel Core 2 Duo with ~amd64.

----------

## PaulBredbury

Use something like this, which duplicates stereo sound to the rear speakers also (for my SoundBlaster Audigy, anyway - the ttable entries might change for other soundcards/configurations):

```
pcm.ch51dup {

         slave.pcm surround51

         slave.channels 6

         type route

         ttable.0.0 0.5

         ttable.1.1 0.5

         ttable.0.2 0.5

         ttable.1.3 0.5

         ttable.0.4 0.25

         ttable.1.4 0.25

         ttable.0.5 0.25

         ttable.1.5 0.25

}
```

Google for "ch51dup" for more info.

----------

## herrzattacke

mbreith you are my HERO!!!

Thanks a lot. This should be referenced in alsa documentation.

THANK YOU, THANK YOU, THANKS A LOT!!!

----------

## pdw_hu

Also to find out what kind of chip you have (and dmesg doesn't help) you can do:

```
grep Codec /proc/asound/card0/codec#0
```

to find out.

----------

