Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 29 Sep 2024 12:09:24 +0200
From:      Alban Hertroys <haramrae@gmail.com>
To:        freebsd-stable@freebsd.org
Subject:   uaudio device re-attach and persisting dev.pcm.$pcm.bitperfect sysctl
Message-ID:  <F61ECC96-6FCB-4A4E-9EEC-8D6AF31A8A62@gmail.com>

next in thread | raw e-mail | index | archive | help
Hello,

I am generally rather happy with this change in 14.1-RELEASE:

"Audio now supports asynchronous device detach. This greatly simplifies =
hot plugging and unplugging of things such as USB headsets, and eases =
use of PulseAudio in cases that require operating system sleep and wake =
(suspend and resume). d692c314d29a (Sponsored by The FreeBSD =
Foundation)"

It allows me to play music over my USB DAC through musicpd, without =
needing virtual-oss anymore, resulting in lower CPU load and potentially =
higher bit-rates (voss doesn=E2=80=99t go beyond 192kHz). Much =
appreciated.


It=E2=80=99s almost perfect now, BUT=E2=80=A6

I have a number of sysctl=E2=80=99s in /etc/sysctl.conf to tune my audio =
output:

hw.snd.default_unit=3D2
hw.snd.maxautovchans=3D0
dev.pcm.2.play.vchans=3D0
dev.pcm.2.bitperfect=3D1

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=20=

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?


Frankly, I am a bit confused about why this apparently wasn=E2=80=99t a =
problem before (14.0-RELEASE with virtual-oss), perhaps I just never =
noticed and this isn=E2=80=99t a new problem with 14.1. I only started =
monitoring this setting relatively recently.


The periodic security run output reports the detach/attach sequence =
quite correctly (as far as I can tell) as:

+ugen0.6: <Topping D90SE> at usbus0 (disconnected)
+uaudio0: at uhub4, port 4, addr 8 (disconnected)
+pcm2: detached
+uaudio0: detached
+uhid3: at uhub4, port 4, addr 8 (disconnected)
+uhid3: detached
+ugen0.6: <Topping D90SE> at usbus0
+uaudio0 on uhub4
+uaudio0: <Topping D90SE, class 239/2, rev 2.00/1.88, addr 9> on usbus0
+uaudio0: Play[0]: 384000 Hz, 2 ch, 32-bit S-LE PCM format, 2x4ms =
buffer. (selected)
+uaudio0: Play[0]: 352800 Hz, 2 ch, 32-bit S-LE PCM format, 2x4ms =
buffer.
+uaudio0: Play[0]: 192000 Hz, 2 ch, 32-bit S-LE PCM format, 2x4ms =
buffer.
+uaudio0: Play[0]: 176400 Hz, 2 ch, 32-bit S-LE PCM format, 2x4ms =
buffer.
+uaudio0: Play[0]: 96000 Hz, 2 ch, 32-bit S-LE PCM format, 2x4ms buffer.
+uaudio0: Play[0]: 88200 Hz, 2 ch, 32-bit S-LE PCM format, 2x4ms buffer.
+uaudio0: Play[0]: 48000 Hz, 2 ch, 32-bit S-LE PCM format, 2x4ms buffer.
+uaudio0: Play[0]: 44100 Hz, 2 ch, 32-bit S-LE PCM format, 2x4ms buffer.
+uaudio0: No recording.
+uaudio0: No MIDI sequencer.
+pcm2 on uaudio0
+uaudio0: No HID volume keys found.
+uhid3 on uhub4
+uhid3: <Topping D90SE, class 239/2, rev 2.00/1.88, addr 9> on usbus0


Regards,
Alban Hertroys
--
There is always an exception to always.







Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?F61ECC96-6FCB-4A4E-9EEC-8D6AF31A8A62>