hw.snd.default_unit invalid argument

Kalero

Member

Reaction score: 8
Messages: 93

Hi,

I'm trying to set my default sound device in FreeBSD 10.3 and, according to the handbook, the variable hw.snd.default_unit needs to be set pointing to the correct pcm (in my case, and according to /dev/sndstat, it's pcm6). So, I add
Code:
hw.snd.default_unit=6
in /etc/sysctl.conf but, when system boots, I see a line saying:
Code:
hw.snd.default_unit=6 invalid argument
, even though the sound device at pcm6 seems to be set up correctly and my sound is working fine. Anybody has idea why I'm seeing that line saying "hw.snd.default_unit=6 invalid argument"? I have an Edirol UA-25, working with snd_uaudio(4) driver. Many thanks :)
 

cpm@

Moderator
Staff member
Moderator
Developer

Reaction score: 936
Messages: 2,134

Can you show the following output?

cat /dev/sndstat
 

wblock@

Administrator
Staff member
Administrator
Moderator
Developer

Reaction score: 3,640
Messages: 13,850

Probably the value is set before the USB device appears. I see the same thing with my motherboard audio.
 

wblock@

Administrator
Staff member
Administrator
Moderator
Developer

Reaction score: 3,640
Messages: 13,850

Hmm. Well, I have seen it, but it's not in the logs of either the desktop or notebook right now.
 

cpm@

Moderator
Staff member
Moderator
Developer

Reaction score: 936
Messages: 2,134

Probably, this knob will be useful here.
Code:
% sysctl -d hw.snd.default_auto
hw.snd.default_auto: assign default unit to a newly attached device
This means that enabling the hw.snd.default_auto knob will automatically assign hw.snd.default_unit to newly-attached devices.
 
OP
OP
Kalero

Kalero

Member

Reaction score: 8
Messages: 93

Well, it's solved. Although snd_uaudio(4) driver was loaded when the system had completely booted up and sound was working fine, it seems the reason of that message was because sysctl attempted to set the default sound device before its driver was loaded and, consequently, before the device was recognised. To solve the issue, I just needed to load the driver at boot time adding
Code:
snd_uaudio_load="YES"
in loader.conf(5). Many thanks.
 
Top