Topping D10s

For a quick sanity check on 14.4-RELEASE. I plugged in a usb dac; then

$ cat /dev/sndstat
Installed devices:
pcm0: <Conexant CX20590 (Analog 2.0+HP/2.0)> (play/rec) default
pcm1: <Intel Cougar Point (HDMI/DP 8ch)> (play)
pcm2: <Intel Cougar Point (HDMI/DP 8ch)> (play)
pcm3: <Intel Cougar Point (HDMI/DP 8ch)> (play)
pcm4: <Shenzhen CBHT Technology Co., Ltd CS43131 HIFI Audio> (play)

The usb dac I plugged in is pcm4, so I need to set that to be the default unit.
$ sysctl hw.snd.default_unit=4
hw.snd.default_unit: 0 -> 4

And audio out through the usb dac now works correctly.

Unfortunately setting hw.snd.default_auto to 1 does not appear to result in assigning the default_unit automatically when I plug the usb dac into the system, despite the description given by:-

$ sysctl -d hw.snd.default_auto
hw.snd.default_auto: assign default unit to a newly attached device

I guess you can't have everything.
 
One little gotcha: if you're not getting any sound out of firefox, you need to set it's backend to 'oss'.
Go to 'about:config' and set the system variable:-
media.cubeb.backend = oss
 
I guess you can't have everything.
Take a look at the devd.conf man page. Then create a file /usr/local/etc/devd/usb_dac.conf with content similar to this:
Code:
notify 100 {
    match "system"      "USB";
    match "subsystem"   "DEVICE";
    match "type"        "ATTACH";
    match "vendor"      "0x....";
    match "product"     "0x....";
    action "sysctl <set default unit when attached>";
};

notify 100 {
    match "system"      "USB";
    match "subsystem"   "DEVICE";
    match "type"        "DETACH";
    match "vendor"      "0x....";
    match "product"     "0x....";
    action "sysctl <reset default unit when detached>";
};

Don't forget to service devd restart after making changes.
 
From "man sound":-

hw.snd.default_auto
Automatically assign the default sound unit. The following
values are supported (default is 1):

0 Do not assign the default sound unit automatically.

1 Use the best available sound device based on playing and
recording capabilities of the device.

2 Use the most recently attached device.

I just tested this. The default after reboot is set to 1, as documented. Setting it to 2 works; if I plug in the usb dac, the default_unit is automatically assigned to the usb dac, and if I pull the dac out, it goes back to 0 which is the onboard sound chip; repeating the sequence obtains the same result.. very good.

Setting the value to 2 in /etc/sysctl.conf works as expected; the default unit is assigned to the onboard souncard after reboot, and then plugging in the usb dac sets it to the usb device. So that works too.

It's a shame that 'sysctl -d hw.snd.default_auto' doesn't give you a hint of what values can be assigned to it, but I guess that would be difficult to generalise to all system variables. It would be good as well to have a way to look up which man page documents any speciific system variable, eg if I could say "man hw.snd.default_auto" and it referred me to the correct manpage, or gave me a specific manpage. But I guess that's work. Anyhow, setting it to 2 appears to work perfectly when plugging in a usb soundcard on 14.4-RELEASE. Great, that was worth knowing! :)
 
I just tested it works across suspend-resume events too. If I plug in the usb dac, suspend, pull the dac out, then resume, I get the default unit correctly set to onboard. And vice versa. Nice.
So now I have working hardware failover between onboard and usb sound, without the need for a devd script, by setting hw.snd.default_auto=2 in /etc/sysctl.conf. Excellent.

Thanks to Tieks for putting me right :-). Now I need to go and read the "sound" manpage all the way though... 😁
 
So for the OP, the recommendation is to set hw.snd.default_auto=2 (and also make that assignment in /etc/sysctl.conf). Then when you plug your usb cable to the D10 dac in, the system should automatically set the D10 to be the currently used sound device, without the need to assign the default_unit manually.
 
Just for interest... D10s looks like a very standard USB DAC. Nice little box.

1773483152057.png
 
So what actually happens? Are there any error messages in dmesg or /var/log/messages? What does "isn't working" mean?
I followed the same protocol as with the BRIK DAC and there's just no sound. According to this website XMOS communication chips might be the reason. Bit-perfect mode has to be turned off in those cases.. which means resampling.. so Linux is much bett...
 
Back
Top