# Trouble getting sound to work...



## bigtoque (Jul 19, 2010)

When I load the snd_hda driver manually, I get working sound. If I add 
	
	



```
"snd_hda_enable="YES"
```
 to my loader.conf, I don't get any sound, and opening any kind of media causes the file to be played really quickly (4 minute song gets played in ~15 seconds (no sound when this is happening)).

When I load the driver manually, I see this:

```
$ cat /dev/sndstat
FreeBSD Audio Driver (newpcm: 64bit 2009061500/amd64)
Installed devices:
pcm0: <HDA Realtek ALC888 PCM #0 Analog> (play/rec) default
pcm1: <HDA Realtek ALC888 PCM #1 Analog> (play/rec)
pcm2: <HDA Realtek ALC888 PCM #2 Digital> (play)
pcm3: <HDA Realtek ALC888 PCM #3 Digital> (play)
pcm4: <HDA ATI R6xx HDMI PCM #0 HDMI> (play)
$
```

When I load the driver automatically, I see this:

```
$ cat /dev/sndstat
FreeBSD Audio Driver (newpcm: 64bit 2009061500/amd64)
Installed devices:
pcm0: <HDA ATI R6xx HDMI PCM #0 HDMI> (play) default
pcm1: <HDA Realtek ALC888 PCM #0 Analog> (play/rec)
pcm2: <HDA Realtek ALC888 PCM #1 Analog> (play/rec)
pcm3: <HDA Realtek ALC888 PCM #2 Digital> (play)
pcm4: <HDA Realtek ALC888 PCM #3 Digital> (play)
$
```

What was pcm0 when loaded manually, is pcm1 when loaded automatically.

How can I fix this?


----------



## wblock@ (Jul 19, 2010)

pcm(4) shows a hw.snd.default_unit for runtime configuration.

Set that to 1 in /etc/sysctl.conf.

The different numbering is probably due to when the device drivers attach.


----------

