Bug 234794 - snd_uaudio: Quirks for Edirol UA-25EX in advanced driver mode
Summary: snd_uaudio: Quirks for Edirol UA-25EX in advanced driver mode
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: usb (show other bugs)
Version: CURRENT
Hardware: Any Any
: --- Affects Only Me
Assignee: Hans Petter Selasky
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-01-09 17:52 UTC by Florian Walpen
Modified: 2019-01-12 18:14 UTC (History)
1 user (show)

See Also:


Attachments
Add vendor class quirk and ignore missing Audio Control header. (3.03 KB, patch)
2019-01-09 17:52 UTC, Florian Walpen
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Florian Walpen 2019-01-09 17:52:31 UTC
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.

Analysis:
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.

Patch:
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
Control header.
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?
Comment 1 Hans Petter Selasky freebsd_committer 2019-01-12 11:06:20 UTC
> 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.

--HPS
Comment 2 Hans Petter Selasky freebsd_committer 2019-01-12 11:14:09 UTC
Modified your patch a bit. Please check that the committed version works still. Thank you!
Comment 3 commit-hook freebsd_committer 2019-01-12 11:16:01 UTC
A commit references this bug:

Author: hselasky
Date: Sat Jan 12 11:15:01 UTC 2019
New revision: 342961
URL: https://svnweb.freebsd.org/changeset/base/342961

Log:
  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.

  PR:			234794
  MFC after:		1 week
  Sponsored by:		Mellanox Technologies

Changes:
  head/sys/dev/sound/usb/uaudio.c
  head/sys/dev/sound/usb/uaudioreg.h
  head/sys/dev/usb/quirk/usb_quirk.c
  head/sys/dev/usb/usbdevs
Comment 4 Florian Walpen 2019-01-12 18:14:31 UTC
(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!