# No sound, cannot set hw.snd.default_unit.



## m4st3r (Jul 23, 2013)

Following the handbook, I loaded snd_driver. But I still get no sound. The driver seems to be loaded successfully:


```
# cat /dev/sndstat
FreeBSD Audio Driver (newpcm: 32bit 2009061500/i386)
Installed devices:
pcm0: <Realtek ALC268 (Analog 2.0+HP/2.0)> (play/rec)
pcm1: <Realtek ALC268 (Front Digital)> (play) default
```

And I think the problem might be the hw.snd.default_unit value referred in the handbook since:


```
# dmesg | grep pcm
pcm0: <Realtek ALC268 (Analog 2.0+HP/2.0)> at nid 21,20 and 24,25,26 on hdaa0
pcm1: <Realtek ALC268 (Front Digital)> at nid 30 on hdaa0
```

So I guess I should set it to 30 or 20,21,24,25,26. But when trying to set it I got an invalid argument error:

```
# sysctl hw.snd.default_unit=30
hw.snd.default_unit: 1
sysctl: hw.snd.default_unit: Invalid argument
```

I get the same output for _any_ value (from -1 to 30) except for the default value (1).


----------



## cpm@ (Jul 28, 2013)

In the sound(4)() man page is explained how to setting properly the hw.snd.default_unit variable.

Add this line in your /etc/sysctl.conf 

```
hw.snd.default_unit=0
```
Reboot.


----------

