From: Alexandre Ratchov Subject: Re: uaudio: Handle certain devices with multiple clock domains To: tech@openbsd.org Date: Fri, 14 Nov 2025 09:27:35 +0100 On Thu, Nov 13, 2025 at 08:13:00PM +0000, Zé Loff wrote: > > > On Thu, Nov 13, 2025 at 02:11:18PM +0100, Alexandre Ratchov wrote: > > uaudio(4) doesn't support devices with multiple "clock domains". They > > would be almost multiple independent devices in a single piece of > > hardware. > > > > Physical clocks cost money, so I suspect that most devices have one > > physical clock only, i.e. that the different clocks the device exposes > > are synchronous. If so, uaudio(4) could handle them with the diff > > below. > > > > To test this, first use a know working uaudio(4) device to validate > > your setup (usb host controller, hub etc). Once you feel audio is > > stable, try the device with the multiple clock domains on the same > > port. > > > > I'm insisting on this because there are still usb-related bugs, that > > would prevent understanding the cause of a possible failure. > > Not sure if this is useful, but at least it confirms your patch handles > weird/bad devices properly. > thanks, it's useful, error code-paths need to be correct as well! > Please note that I'm not complaining/asking for anything. This is > *not* supposed to work, since these are not actual audio devices, > AFAICT. I'm sending just to show that the "clock attributes differ" > code path works properly here. > > Context: my mainboard exposes three USB devices that for some reason get > attached as uaudio* devices. I have no idea what they might actually > be, and the mainboard specs offer no clues. There is a "proper" audio > device that attaches as azalia (ATI Van Gogh HD Audio) with no usable > codecs, but no other audio outputs. I'm surprised, if these devices were just garbage usb descriptors, the uaudio driver would blow up much earlier, the clock check is the last initilization step. So, these might be actual audio interfaces. Your dmesg says: > bios0: Gigabyte Technology Co., Ltd. B850I AORUS PRO by searching for above string, I got: https://www.gigabyte.com/fr/Motherboard/B850I-AORUS-PRO-rev-10/sp according to which the board has a "Realtek ALC4080 CODEC", which is a USB chip. https://theretroweb.com/chip/documentation/alc4080-datasheet-1-1-67e79e1650425288346876.pdf Furthermore the HD Audio device: > azalia0 at pci15 dev 0 function 1 "ATI Van Gogh HD Audio" rev 0x00: msi > azalia0: no supported codecs has no analog codecs and might be just a HDMI transmitter, which suggests the audio interfaces should be elsewhere. To confirm that: - in src/sys/dev/usb/uaudio.c, in uaudio_process_ac() delete or comment out the call to uaudio_clock_equiv() to bypass the clock domain checks. - rebuild a kernel with UAUDIO_DEBUG defined - reboot and show thee dmesg output? this should force initialization to complete and attach audio devices. The devices might work partially in play-only and rec-only modes.