# My sound works with these commands, but how do I configure sound on startup?



## BLuFeNiX (Dec 17, 2012)

Hi,

I've been struggling with my sound for a few hours now, and I'm really close to a solution.

If I enter these commands, my sound will work until I reboot.

```
sysctl hw.usb.uaudio.default_channels=6
(then I unplug and replug the USB speakers)
sysctl hw.snd.default_unit=8
```

This is my /boot/loader.conf

```
nvidia_load="YES"
linux_enable="YES"
snd_driver_load="YES"
```

this is my /etc/rc.conf:

```
hostname="decibel"
ifconfig_em0="DHCP"
ifconfig_em0_ipv6="inet6 accept_rtadv"
sshd_enable="YES"
powerd_enable="YES"
# Set dumpdev to "AUTO" to enable crash dumps, "NO" to disable
dumpdev="NO"

hald_enable="YES"
dbus_enable="YES"

gdm_enable="YES"
gnome_enable="YES"
```

They are Bose Companion 5 USB speakers. How can I automate this?

Thanks!


----------



## BLuFeNiX (Dec 17, 2012)

Okay, now I've added this to my /boot/loader.conf

```
hw.usb.uaudio.default_channels=6
sysctl hw.snd.default_unit=8
```

but I get a buzzing sound while booting up. The buzzing stops when I log in to GDM.


----------



## BLuFeNiX (Dec 17, 2012)

alright, I got it!


```
nvidia_load="YES"
linux_enable="YES"
hw.usb.uaudio.default_channels=6
hw.snd.default_unit=8
snd_driver_load="YES"
```

I had to load the sound driver after I configured the other stuff, otherwise I got a buzzing noise. This configuration works flawlessly.


----------



## SirDice (Dec 17, 2012)

Don't use *snd_driver*. It's just a convenience thing, it simply loads all available drivers. Find out which one you need and load only that one.


----------



## joel@ (Dec 17, 2012)

You should probably use

```
snd_uaudio_load="YES"
```
Instead of

```
snd_driver_load="YES"
```


----------



## xibo (Dec 17, 2012)

You can also write those sysctls into /etc/sysctl.conf which only loads them after the system enters multi-user-mode.


----------



## BLuFeNiX (Dec 18, 2012)

SirDice said:
			
		

> Don't use *snd_driver*. It's just a convenience thing, it simply loads all available drivers. Find out which one you need and load only that one.



Oh, alright. Thanks.



			
				joel@ said:
			
		

> You should probably use
> 
> ```
> snd_uaudio_load="YES"
> ...



I'm going to assume that this is what SirDice is talking about, I'll try it. Thanks.



			
				xibo said:
			
		

> You can also write those sysctls into /etc/sysctl.conf which only loads them after the system enters multi-user-mode.



Does that provide any speed increase or benefit if I'm booting straight into my DE? Thanks.


----------

