Re: uaudio device re-attach and persisting dev.pcm.$pcm.bitperfect sysctl

From: Christos Margiolis <christos_at_freebsd.org>
Date: Sun, 29 Sep 2024 16:06:53 UTC
Hello Alban,

I am the author of the patches mentioned.

Alban Hertroys wrote:
> I have a number of sysctl’s in /etc/sysctl.conf to tune my audio output:
> 
> hw.snd.default_unit=2
> hw.snd.maxautovchans=0
> dev.pcm.2.play.vchans=0
> dev.pcm.2.bitperfect=1
> 
> These do get set properly after booting the machine, but after I turn
> off my audio equipment (the DAC among them) and turn them back on the
> next day, I see:
> 
> #> sysctl -i dev.pcm.2.%desc dev.pcm.2.play.vchans dev.pcm.2.bitperfect 
> dev.pcm.2.%desc: Topping D90SE
> dev.pcm.2.play.vchans: 0
> dev.pcm.2.bitperfect: 0 <--- Supposed to be 1!
>
> Is there a way to persist those settings when re-attaching the device?

Is there a reboot involved here? If not, then /etc/sysctl.conf is not
read again, so it makes sense that it falls back to the defaults.

Christos