# snd_hda issues with ICH9 and FreeBSD 8-STABLE



## Shuny (Mar 21, 2010)

Hello,

I just compiled and installed a FreeBSD 8-STABLE on my HP Elitebook 8530w. I do not have a lot of experience on FreeBSD and Unix system, so please excuse me if my post is not complete.

I got a problem with the snd_hda driver. I wrote snd_hda_load="YES" into my /boot/loader.conf, the driver seems to load properly, my hardware is detected properly too, but I don't have any sound.

Here is what I get at boot :


```
FreeBSD Audio Driver (newpcm: 32bit 2009061500/i386)
Installed devices:
pcm0: <HDA ATI R6xx HDMI PCM #0 HDMI> (play) default
pcm1: <HDA Analog Devices AD1984A PCM #0 Analog> (play/rec)
pcm2: <HDA Analog Devices AD1984A PCM #1 Analog> (rec)
```

`cat /dev/sndstat`


```
FreeBSD Audio Driver (newpcm: 32bit 2009061500/i386)
Installed devices:
pcm0: <HDA ATI R6xx HDMI PCM #0 HDMI> (play) default
pcm1: <HDA Analog Devices AD1984A PCM #0 Analog> (play/rec)
pcm2: <HDA Analog Devices AD1984A PCM #1 Analog> (rec)
```

List of devices (`ls /dev/dsp*`)


```
crw-rw-rw-  1 root  wheel       0, 128 Mar 21 15:22 dsp0.0     
crw-rw-rw-  1 root  wheel       0, 127 Mar 21 15:20 dsp1.0     
crw-rw-rw-  1 root  wheel       0, 134 Mar 21 15:22 dsp1.1     
crw-rw-rw-  1 root  wheel       0, 104 Mar 21 15:20 dsp2.0     
crw-rw-rw-  1 root  wheel       0, 135 Mar 21 15:22 dsp2.1
```

As you can see my sound card is detected but I cannot obtain any sound : `cat /dev/urandom > any_dsp` doesn't make any little noise :/

In fact I once managed to get a very loud noise by installing OSS (pkg_add -r oss) but I never got a proper sound out of my computer 

Regards,

Shuny

PS : Please excuse my lame english


----------



## Shuny (Mar 21, 2010)

I could not find a button for editing my post :/

Here is what is REALLY get a boot  :


```
hdac1: <Intel 82801I High Definition Audio Controller> mem 0xd8420000-0xd8423fff irq 17 at device 27.0 on pci0                                                                                    
hdac1: HDA Driver Revision: 20100226_0142                                                        
hdac1: [ITHREAD]
```


----------



## thuglife (Mar 21, 2010)

Change the default output device to something else than your hdmi.


```
# sysctl hw.snd.default_unit=1
```


----------



## Shuny (Mar 21, 2010)

Hello and thank you for your fast answer,

I typed your command (told me the value was changed from 0 to 1) and restarted KDE4, but still no sound. I also tried `cat /dev/urandom > /dev/any_dsp` without success.

Anyway thank you. I must have failed somewhere in the config but can't see where :\


----------



## thuglife (Mar 21, 2010)

Ensure that your mixer(8) values are set correctly.

If you are still having trouble, enable verbose output

`# echo "-v" > /boot.config`

reboot and post the output of

`# dmesg | grep hdac`


----------



## Shuny (Mar 21, 2010)

thuglife said:
			
		

> Ensure that your mixer(8) values are set correctly.
> 
> If you are still having trouble, enable verbose output
> 
> ...



Hello,

The mixer values were set correctly (75:75 which should be enough to hear sound). I made a verbose boot using your command and it was really verbose (662 lines outputed) so I put it on pastebin (impossible to post it here because of the forum limitations)

http://pastebin.com/uvYFrzim

Thank you for your help,

Regards,

Shuny


----------



## mav@ (Mar 21, 2010)

Your codec configuration looks a bit strange, which seems confused the driver.
Try to add to the /boot/loader.conf lines:

```
hint.hdac.1.cad0.nid18.config="seq=15"
hint.hdac.1.cad0.nid22.config="seq=0"
```
If it doesn't help - upload new verbose logs, including also pcmX lines.


----------



## Shuny (Mar 21, 2010)

Hello and thank you for your answer,

I added these lines but it didn't work at first, but then I used the hw.snd.default_unit=1 and now the sound seems to work perfectly  Thank you again 

May I ask you what do these lines do ?

Also, what is the best option to set the hw.snd.default_unit to 1 forever ?

Regards


----------



## mav@ (Mar 21, 2010)

Shuny said:
			
		

> May I ask you what do these lines do ?


They change codec configuration on-flight, fixing strange one written by BIOS. You may read snd_hda(4) for details.



			
				Shuny said:
			
		

> Also, what is the best option to set the hw.snd.default_unit to 1 forever ?


Put it into the /etc/sysctl.conf.


----------



## Shuny (Mar 21, 2010)

Again thank you


----------



## vermaden (Jul 4, 2011)

thuglife said:
			
		

> Change the default output device to something else than your hdmi.
> 
> 
> ```
> ...



Thanks, also 'hit me' after upgrade to more recent STABLE


----------

