Created attachment 200961 [details]
Add vendor class quirk and ignore missing Audio Control header.
The Edirol UA-25EX USB 1.1 audio interface has an advanced driver mode which
enables 24 bit operation at up to 96kHz. Unfortunately this mode is not class
compliant and needs some additional quirks to get it running.
How to reproduce:
1. Set the "ADVANCED DRIVER" switch on the back of the device to "ON".
2. Pull out the device and plug it in again (needed when changing switches).
The device will not be detected by snd_uaudio.
There are actually two problems that prevent proper device detection.
a) The USB descriptors indicate a vendor specific implementation.
b) The Audio Control header is completely omitted from the descriptors.
Issue a) is easy to circumvent with the UQ_AU_VENDOR_CLASS quirk. It can be
applied by adding the following line to /boot/loader.conf:
hw.usb.quirk.0="0x0582 0x00e6 0x0000 0xffff UQ_AU_VENDOR_CLASS"
While this will get the MIDI part detected, no audio stream channels are
considered due to the Audio Control header missing.
The patch provided is based on FreeBSD CURRENT. In my basic tests it results in
a fully working device, for all settings of the physical sample rate switch. It
adds both the device quirk for a) and solves the channel detection for issue
b). The latter is achieved by matching the device specifically when being
attached, and setting a flag to make channel detection ignore the missing Audio
Mixer detection is not an issue in this case since mixers are all hardware only.
I'm sure this is not the most elegant way to code it, and I am open for
suggestions. I could probably factor out the changes for issue b) into a
generic quirk, e.g. as UQ_AU_NO_AC_HEADER.
Also some quirks seem to be unimplemented, like UQ_AU_INP_ASYNC and UQ_BAD_ADC.
Did I miss something?
> Also some quirks seem to be unimplemented, like UQ_AU_INP_ASYNC and UQ_BAD_ADC.
> Did I miss something?
This is correct. I'll look into your patch.
Modified your patch a bit. Please check that the committed version works still. Thank you!
A commit references this bug:
Date: Sat Jan 12 11:15:01 UTC 2019
New revision: 342961
snd_uaudio: Add quirks for Edirol UA-25EX in advanced driver mode.
Extend the vendor class USB audio quirk to cover devices without
the USB audio control descriptor.
MFC after: 1 week
Sponsored by: Mellanox Technologies
(In reply to Hans Petter Selasky from comment #2)
Great, thank you!
Your modified commit does work with the UA-25EX - unfortunately I don't have any other device that needs the UQ_AU_VENDOR_CLASS quirk for cross-checking.
Anyway, looks fine to me.
Have a nice weekend!