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

From: Dag-Erling_Smørgrav <des_at_FreeBSD.org>
Date: Wed, 02 Oct 2024 11:24:23 UTC
Alban Hertroys <haramrae@gmail.com> writes:
> 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

This only works by accident because your DSP happens to be switched on
and attached to pcm2 when sysctl.conf is processed during boot.  If you
boot your machine with the DSP switched off or unplugged, you will see
errors during boot because these sysctl nodes do not exist until the DSP
is turned on and the driver attaches to it.  You need to set up devd to
run the correct sysctl commands (with the correct device unit numbers,
don't assume your DSP is always pcm2!) when your DSP is attached.

DES
-- 
Dag-Erling Smørgrav - des@FreeBSD.org