# Sound card not working



## dennylin93 (May 28, 2009)

I've changed some things on my system, but the sound card still isn't working.

/boot/loader.conf

```
sound_load="YES"
snd_hda_load="YES"
snd_ich_load="YES"
```

# cat /dev/sndstat

```
FreeBSD Audio Driver (newpcm: 32bit 2007061600/i386)
Installed devices:
pcm0: <HDA Realtek ALC882 PCM #0 Analog> at cad 2 nid 1 on hdac0 kld snd_hda [MPSAFE] (1p:2v/1r:1v channels duplex default)
pcm1: <HDA Realtek ALC882 PCM #1 Analog> at cad 2 nid 1 on hdac0 kld snd_hda [MPSAFE] (1p:1v/0r:0v channels)
pcm2: <HDA Realtek ALC882 PCM #2 Digital> at cad 2 nid 1 on hdac0 kld snd_hda [MPSAFE] (0p:0v/1r:1v channels)
```

Am I missing something that I ought to add?


----------



## joel@ (May 28, 2009)

What version of FreeBSD are you running?

Please post a verbose pcm message from boot.

You could take a look at the snd_hda(4) and sound(4) man pages for some configuration options. There are some things you can tweak to see if you get sound.

Btw, you don't need snd_ich_load="YES" or sound_load="YES".


----------



## mousaka (May 28, 2009)

Try changing the default sound device:

```
sysctl hw.snd.default_unit=X.
```
Where X can be 0 to 2, according to pcm0 to pcm2. 0 is set as default so I would try 1 first, because 2 is a digital output.

If this works, just put the above line in /etc/sysctl.conf

mousaka


----------



## dennylin93 (May 28, 2009)

I tried changing the hw.snd.default_unit, but it didn't seem to work.

#uname -a

```
FreeBSD host.domain.tld 7.2-RELEASE FreeBSD 7.2-RELEASE #0: Sat May 23 14:25:16 CST 2009     root@host.domain.tld:/usr/obj/usr/src/sys/KERNEL  i386
```

dmesg.boot

```
...
hdac0: <Intel 82801G High Definition Audio Controller> mem 0xe8100000-0xe8103fff irq 16 at device 27.0 on pci0
hdac0: HDA Driver Revision: 20090329_0131
hdac0: [ITHREAD]
...
pcm0: <HDA Realtek ALC882 PCM #0 Analog> at cad 2 nid 1 on hdac0
pcm1: <HDA Realtek ALC882 PCM #1 Analog> at cad 2 nid 1 on hdac0
pcm2: <HDA Realtek ALC882 PCM #2 Digital> at cad 2 nid 1 on hdac0
...
```


----------



## donald1000 (May 28, 2009)

I think the syntax changed from older to newer versions. Anyway, at least in version 7 you should add in loader.conf


```
snd_driver_load="YES"
```

That should load any available sound modul during startup.


----------



## DutchDaemon (May 28, 2009)

Make that 
	
	



```
snd_hda_load="YES"
```
 only. Nothing else is needed in /boot/loader.conf for sound (with a HDA card, of course). You could try the detect script at http://forums.freebsd.org/showthread.php?t=290 to make sure (read replies for more detail).


----------



## BuSerD (May 28, 2009)

dennylin93 said:
			
		

> /boot/loader.conf
> 
> ```
> sound_load="YES"
> ...



Get rid of sound and ich, you don't need either of them. The correct module is snd_hda and sound.ko will be loaded along with snd_hda.ko using only snd_hda_load="YES" in loader.conf (see below: my conf)

```
freebsd1% cat /boot/loader.conf 
snd_hda_load="YES"
```

Make sure the sound modules are loaded and check the output of mixer

```
freebsd1# kldstat | grep s
 2    1 0xffffffff80907000 22850    snd_hda.ko
 3    2 0xffffffff8092a000 66440    sound.ko

freebsd1% mixer
Mixer vol      is currently set to 100:100
Mixer pcm      is currently set to 100:100
Mixer speaker  is currently set to  75:75
Mixer mic      is currently set to   0:0
Mixer mix      is currently set to   0:0
Mixer rec      is currently set to   0:0
Recording source: mic
```

If mixer does not give you any output install another mixer from ports and try it instead. Barring any obvious errors go check out the handbook instructions


----------



## dennylin93 (May 30, 2009)

Fixed it now. I just plugged the speaker into a different place, and it worked.


----------

