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

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.
Code:
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
Code:
nvidia_load="YES"
linux_enable="YES"
snd_driver_load="YES"

this is my /etc/rc.conf:
Code:
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!
 
Okay, now I've added this to my /boot/loader.conf
Code:
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.
 
alright, I got it!

Code:
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.
 
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.
 
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
Code:
snd_uaudio_load="YES"
Instead of
Code:
snd_driver_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.
 
Back
Top