Skip to contentSkip to conversation

snd-usb-audio probe problem (Teac UD-H01)

DISCUSSION bEN 5 participants 7 messages Mar 31, 2012 – Oct 13, 2012 USB

lore
Share & tools
lore

bEN

author
#0 lore raw

Hi all,

the new USB DAC from Teac seems detected as 'Human Interface Device' instead of 'Audio'. Despite the fact it is based on a standard USB Audio class v2 controller (Tenor 8802).

Below is dmesg and lsusb outputs.

Does it need to apply a patch in /sound/usb/quirks-table.h ? If yes, someone could help me to write this patch, please?

Your help would be very much appreciated, Thanks in advance.

bEN

(from Ubuntu 11.04 with Linux 2.6.38-13-generic + Alsa driver 1.0.23)

$ cat /proc/asound/version
Advanced Linux Sound Architecture Driver Version 1.0.23.
$ dmesg
(...)
[34035.000078] usb 2-4: new high speed USB device using ehci_hcd and
address 3
[34035.151753] usb 2-4: config 1 has an invalid interface number: 3 but
max is 2
[34035.151763] usb 2-4: config 1 has an invalid interface number: 3 but
max is 2
[34035.151770] usb 2-4: config 1 has an invalid interface number: 3 but
max is 2
[34035.151777] usb 2-4: config 1 has no interface number 1
[34035.155108] input: TEAC TEAC USB AUDIO DEVICE as
/devices/pci0000:00/0000:00:1d.7/usb2/2-4/2-4:1.0/input/input13
[34035.155328] generic-usb 0003:0644:8038.0002: input,hidraw1: USB HID
v1.00 Device [TEAC TEAC USB AUDIO DEVICE] on usb-0000:00:1d.7-4/input0
[34035.202368] Audio class v2 interfaces need an interface association
[34035.202387] snd-usb-audio: probe of 2-4:1.2 failed with error -5
[34035.202426] usbcore: registered new interface driver snd-usb-audio
$ lsusb -v --> see attachment.

[~] # lsusb -v
(...)

Bus 002 Device 003: ID 0644:8038 TEAC Corp.
Device Descriptor:
bLength 18
bDescriptorType 1
bcdUSB 2.00
bDeviceClass 239 Miscellaneous Device
bDeviceSubClass 2 ?
bDeviceProtocol 1 Interface Association
bMaxPacketSize0 64
idVendor 0x0644 TEAC Corp.
idProduct 0x8038
bcdDevice 0.03

  iManufacturer           1 
  iProduct                2 
  iSerial                 0 
  bNumConfigurations      1

Configuration Descriptor:
bLength 9
bDescriptorType 2
wTotalLength 220
bNumInterfaces 3
bConfigurationValue 1
iConfiguration 0
bmAttributes 0x80
(Bus Powered)
MaxPower 500mA
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 0
bAlternateSetting 0
bNumEndpoints 1
bInterfaceClass 3 Human Interface Device
bInterfaceSubClass 0 No Subclass
bInterfaceProtocol 0 None
iInterface 0
HID Device Descriptor:
bLength 9
bDescriptorType 33
bcdHID 1.00
bCountryCode 0 Not supported
bNumDescriptors 1
bDescriptorType 34 Report
wDescriptorLength 26
Report Descriptors:
** UNAVAILABLE **
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x81 EP 1 IN
bmAttributes 3
Transfer Type Interrupt
Synch Type None
Usage Type Data
wMaxPacketSize 0x0020 1x 32 bytes
bInterval 6
Interface Association:
bLength 8
bDescriptorType 11
bFirstInterface 2
bInterfaceCount 2
bFunctionClass 1 Audio
bFunctionSubClass 0
bFunctionProtocol 32
iFunction 4
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 2
bAlternateSetting 0
bNumEndpoints 0
bInterfaceClass 1 Audio
bInterfaceSubClass 1 Control Device
bInterfaceProtocol 32
iInterface 4
AudioControl Interface Descriptor:
bLength 9
bDescriptorType 36
bDescriptorSubtype 1 (HEADER)
bcdADC 2.00
wTotalLength 13834
bInCollection 0
junk at descriptor end: 00
AudioControl Interface Descriptor:
bLength 8
bDescriptorType 36
bDescriptorSubtype 10 (unknown)
Invalid desc subtype: 0c 07 07 00 00
AudioControl Interface Descriptor:
bLength 8
bDescriptorType 36
bDescriptorSubtype 10 (unknown)
Invalid desc subtype: 0d 07 07 00 00
AudioControl Interface Descriptor:
bLength 17
bDescriptorType 36
bDescriptorSubtype 2 (INPUT_TERMINAL)
bTerminalID 4
wTerminalType 0x0101 USB Streaming
bAssocTerminal 0
bNrChannels 12
wChannelConfig 0x0302
Right Front (R)
Surround (S)
Side Left (SL)
iChannelNames 0
iTerminal 0
junk at descriptor end: 00 00 00 00 00
AudioControl Interface Descriptor:
bLength 12
bDescriptorType 36
bDescriptorSubtype 3 (OUTPUT_TERMINAL)
bTerminalID 3
wTerminalType 0x0605 SPDIF interface
bAssocTerminal 0
bSourceID 4
iTerminal 12
junk at descriptor end: 00 00 00
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 3
bAlternateSetting 0
bNumEndpoints 0
bInterfaceClass 1 Audio
bInterfaceSubClass 2 Streaming
bInterfaceProtocol 32
iInterface 0
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 3
bAlternateSetting 1
bNumEndpoints 2
bInterfaceClass 1 Audio
bInterfaceSubClass 2 Streaming
bInterfaceProtocol 32
iInterface 0
AudioStreaming Interface Descriptor:
bLength 16
bDescriptorType 36
bDescriptorSubtype 1 (AS_GENERAL)
bTerminalLink 4
bDelay 0 frames
wFormatTag 257 undefined
junk at descriptor end: 00 00 00 02 03 00 00 00 00
AudioStreaming Interface Descriptor:
bLength 6
bDescriptorType 36
bDescriptorSubtype 2 (FORMAT_TYPE)
Warning: Descriptor too short
bFormatType 1 (FORMAT_TYPE_I)
Warning: Descriptor too short
bNrChannels 2
bSubframeSize 16
bBitResolution 0
bSamFreqType 0 Continuous
tLowerSamFreq 81
tUpperSamFreq 0
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x03 EP 3 OUT
bmAttributes 5
Transfer Type Isochronous
Synch Type Asynchronous
Usage Type Data
wMaxPacketSize 0x0068 1x 104 bytes
bInterval 1
AudioControl Endpoint Descriptor:
bLength 8
bDescriptorType 37
bDescriptorSubtype 1 (EP_GENERAL)
bmAttributes 0x00
bLockDelayUnits 0 Undefined
wLockDelay 514 Undefined
junk at descriptor end: 00
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x84 EP 4 IN
bmAttributes 17
Transfer Type Isochronous
Synch Type None
Usage Type Feedback
wMaxPacketSize 0x0004 1x 4 bytes
bInterval 4
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 3
bAlternateSetting 2
bNumEndpoints 2
bInterfaceClass 1 Audio
bInterfaceSubClass 2 Streaming
bInterfaceProtocol 32
iInterface 0
AudioStreaming Interface Descriptor:
bLength 16
bDescriptorType 36
bDescriptorSubtype 1 (AS_GENERAL)
bTerminalLink 4
bDelay 0 frames
wFormatTag 257 undefined
junk at descriptor end: 00 00 00 02 03 00 00 00 00
AudioStreaming Interface Descriptor:
bLength 6
bDescriptorType 36
bDescriptorSubtype 2 (FORMAT_TYPE)
Warning: Descriptor too short
bFormatType 1 (FORMAT_TYPE_I)
Warning: Descriptor too short
bNrChannels 3
bSubframeSize 24
bBitResolution 0
bSamFreqType 0 Continuous
tLowerSamFreq 81
tUpperSamFreq 0
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x03 EP 3 OUT
bmAttributes 5
Transfer Type Isochronous
Synch Type Asynchronous
Usage Type Data
wMaxPacketSize 0x009c 1x 156 bytes
bInterval 1
AudioControl Endpoint Descriptor:
bLength 8
bDescriptorType 37
bDescriptorSubtype 1 (EP_GENERAL)
bmAttributes 0x00
bLockDelayUnits 0 Undefined
wLockDelay 514 Undefined
junk at descriptor end: 00
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x84 EP 4 IN
bmAttributes 17
Transfer Type Isochronous
Synch Type None
Usage Type Feedback
wMaxPacketSize 0x0004 1x 4 bytes
bInterval 4
can't get device qualifier: Operation not permitted can't get debug descriptor: Operation not permitted cannot read device status, Operation not permitted (1)

(...)

#1 lore raw

Dne 31.3.2012 20:19, bEN napsal(a):

Quoted 8 lines

Hi all,

the new USB DAC from Teac seems detected as 'Human Interface Device' instead of 'Audio'. Despite the fact it is based on a standard USB Audio class v2 controller (Tenor 8802).

Below is dmesg and lsusb outputs.

Hi, the lsusb shows both HID interface (button?) and audio interface beneath.

Pavel.

#2 lore raw
In reply to bEN
Quoted 2 lines · bEN

the new USB DAC from Teac seems detected as 'Human Interface Device' instead of 'Audio'.

It has both HID and audio interfaces.

Quoted 2 lines

Despite the fact it is based on a standard USB Audio class v2 controller (Tenor 8802).

Which doesn't prevent Teac from writing buggy firmware.

Quoted 4 lines
$ dmesg
usb 2-4: new high speed USB device using ehci_hcd and address 3
usb 2-4: config 1 has an invalid interface number: 3 but max is 2
usb 2-4: config 1 has no interface number 1

This violates the USB spec. But I guess it shouldn't prevent the driver from attaching to the device.

Quoted 1 line

Audio class v2 interfaces need an interface association

This looks like a bug in the driver; there certainly is such an descriptor. Daniel?

Regards,
Clemens

Signature · 249 lines
Bus 002 Device 003: ID 0644:8038 TEAC Corp.
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               2.00
  bDeviceClass          239 Miscellaneous Device
  bDeviceSubClass         2 ?
  bDeviceProtocol         1 Interface Association
  bMaxPacketSize0        64
  idVendor           0x0644 TEAC Corp.
  idProduct          0x8038
  bcdDevice            0.03
  iManufacturer           1
  iProduct                2
  iSerial                 0
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength          220
    bNumInterfaces          3
    bConfigurationValue     1
    iConfiguration          0
    bmAttributes         0x80
      (Bus Powered)
    MaxPower              500mA
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           1
      bInterfaceClass         3 Human Interface Device
      bInterfaceSubClass      0 No Subclass
      bInterfaceProtocol      0 None
      iInterface              0
        HID Device Descriptor:
          bLength                 9
          bDescriptorType        33
          bcdHID               1.00
          bCountryCode            0 Not supported
          bNumDescriptors         1
          bDescriptorType        34 Report
          wDescriptorLength      26
         Report Descriptors:
           ** UNAVAILABLE **
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x81  EP 1 IN
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0020  1x 32 bytes
        bInterval               6
    Interface Association:
      bLength                 8
      bDescriptorType        11
      bFirstInterface         2
      bInterfaceCount         2
      bFunctionClass          1 Audio
      bFunctionSubClass       0
      bFunctionProtocol      32
      iFunction               4
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        2
      bAlternateSetting       0
      bNumEndpoints           0
      bInterfaceClass         1 Audio
      bInterfaceSubClass      1 Control Device
      bInterfaceProtocol     32
      iInterface              4
      AudioControl Interface Descriptor:
        bLength                 9
        bDescriptorType        36
        bDescriptorSubtype      1 (HEADER)
        bcdADC               2.00
        wTotalLength        13834
        bInCollection           0
        junk at descriptor end: 00
      AudioControl Interface Descriptor:
        bLength                 8
        bDescriptorType        36
        bDescriptorSubtype     10 (unknown)
        Invalid desc subtype: 0c 07 07 00 00
      AudioControl Interface Descriptor:
        bLength                 8
        bDescriptorType        36
        bDescriptorSubtype     10 (unknown)
        Invalid desc subtype: 0d 07 07 00 00
      AudioControl Interface Descriptor:
        bLength                17
        bDescriptorType        36
        bDescriptorSubtype      2 (INPUT_TERMINAL)
        bTerminalID             4
        wTerminalType      0x0101 USB Streaming
        bAssocTerminal          0
        bNrChannels            12
        wChannelConfig     0x0302
          Right Front (R)
          Surround (S)
          Side Left (SL)
        iChannelNames           0
        iTerminal               0
        junk at descriptor end: 00 00 00 00 00
      AudioControl Interface Descriptor:
        bLength                12
        bDescriptorType        36
        bDescriptorSubtype      3 (OUTPUT_TERMINAL)
        bTerminalID             3
        wTerminalType      0x0605 SPDIF interface
        bAssocTerminal          0
        bSourceID               4
        iTerminal              12
        junk at descriptor end: 00 00 00
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        3
      bAlternateSetting       0
      bNumEndpoints           0
      bInterfaceClass         1 Audio
      bInterfaceSubClass      2 Streaming
      bInterfaceProtocol     32
      iInterface              0
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        3
      bAlternateSetting       1
      bNumEndpoints           2
      bInterfaceClass         1 Audio
      bInterfaceSubClass      2 Streaming
      bInterfaceProtocol     32
      iInterface              0
      AudioStreaming Interface Descriptor:
        bLength                16
        bDescriptorType        36
        bDescriptorSubtype      1 (AS_GENERAL)
        bTerminalLink           4
        bDelay                  0 frames
        wFormatTag            257 undefined
        junk at descriptor end: 00 00 00 02 03 00 00 00 00
      AudioStreaming Interface Descriptor:
        bLength                 6
        bDescriptorType        36
        bDescriptorSubtype      2 (FORMAT_TYPE)
      Warning: Descriptor too short
        bFormatType             1 (FORMAT_TYPE_I)
      Warning: Descriptor too short
        bNrChannels             2
        bSubframeSize          16
        bBitResolution          0
        bSamFreqType            0 Continuous
        tLowerSamFreq          81
        tUpperSamFreq           0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x03  EP 3 OUT
        bmAttributes            5
          Transfer Type            Isochronous
          Synch Type               Asynchronous
          Usage Type               Data
        wMaxPacketSize     0x0068  1x 104 bytes
        bInterval               1
        AudioControl Endpoint Descriptor:
          bLength                 8
          bDescriptorType        37
          bDescriptorSubtype      1 (EP_GENERAL)
          bmAttributes         0x00
          bLockDelayUnits         0 Undefined
          wLockDelay            514 Undefined
        junk at descriptor end: 00
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x84  EP 4 IN
        bmAttributes           17
          Transfer Type            Isochronous
          Synch Type               None
          Usage Type               Feedback
        wMaxPacketSize     0x0004  1x 4 bytes
        bInterval               4
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        3
      bAlternateSetting       2
      bNumEndpoints           2
      bInterfaceClass         1 Audio
      bInterfaceSubClass      2 Streaming
      bInterfaceProtocol     32
      iInterface              0
      AudioStreaming Interface Descriptor:
        bLength                16
        bDescriptorType        36
        bDescriptorSubtype      1 (AS_GENERAL)
        bTerminalLink           4
        bDelay                  0 frames
        wFormatTag            257 undefined
        junk at descriptor end: 00 00 00 02 03 00 00 00 00
      AudioStreaming Interface Descriptor:
        bLength                 6
        bDescriptorType        36
        bDescriptorSubtype      2 (FORMAT_TYPE)
      Warning: Descriptor too short
        bFormatType             1 (FORMAT_TYPE_I)
      Warning: Descriptor too short
        bNrChannels             3
        bSubframeSize          24
        bBitResolution          0
        bSamFreqType            0 Continuous
        tLowerSamFreq          81
        tUpperSamFreq           0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x03  EP 3 OUT
        bmAttributes            5
          Transfer Type            Isochronous
          Synch Type               Asynchronous
          Usage Type               Data
        wMaxPacketSize     0x009c  1x 156 bytes
        bInterval               1
        AudioControl Endpoint Descriptor:
          bLength                 8
          bDescriptorType        37
          bDescriptorSubtype      1 (EP_GENERAL)
          bmAttributes         0x00
          bLockDelayUnits         0 Undefined
          wLockDelay            514 Undefined
        junk at descriptor end: 00
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x84  EP 4 IN
        bmAttributes           17
          Transfer Type            Isochronous
          Synch Type               None
          Usage Type               Feedback
        wMaxPacketSize     0x0004  1x 4 bytes
        bInterval               4
can't get device qualifier: Operation not permitted
can't get debug descriptor: Operation not permitted
cannot read device status, Operation not permitted (1)
#3 lore raw
Quoted 11 lines · Clemens Ladisch
Quoted 2 lines · bEN

the new USB DAC from Teac seems detected as 'Human Interface Device' instead of 'Audio'.

It has both HID and audio interfaces.

Quoted 2 lines

Despite the fact it is based on a standard USB Audio class v2 controller (Tenor 8802).

Which doesn't prevent Teac from writing buggy firmware.

Quoted 7 lines
Quoted 4 lines
$ dmesg
usb 2-4: new high speed USB device using ehci_hcd and address 3
usb 2-4: config 1 has an invalid interface number: 3 but max is 2
usb 2-4: config 1 has no interface number 1

This violates the USB spec. But I guess it shouldn't prevent the driver from attaching to the device.

Right, that's just a warning.

Quoted 4 lines
Quoted 1 line

Audio class v2 interfaces need an interface association

This looks like a bug in the driver; there certainly is such an descriptor. Daniel?

The USB audio driver actually just uses functions from the USB driver core to access the interface association. However, the USB core didn't assign it during its probe, which is most probably a result of the broken descriptor set.

I'm still reading through the sources, maybe we can find a more tolerant way of handling such devices. If not, we would need to add a quirk for the device and override the descriptors that way.

Daniel

#4 lore raw
Quoted 24 lines · Daniel Mack
Quoted 11 lines · Clemens Ladisch
Quoted 2 lines · bEN

the new USB DAC from Teac seems detected as 'Human Interface Device' instead of 'Audio'.

It has both HID and audio interfaces.

Quoted 2 lines

Despite the fact it is based on a standard USB Audio class v2 controller (Tenor 8802).

Which doesn't prevent Teac from writing buggy firmware.

Quoted 7 lines
Quoted 4 lines
$ dmesg
usb 2-4: new high speed USB device using ehci_hcd and address 3
usb 2-4: config 1 has an invalid interface number: 3 but max is 2
usb 2-4: config 1 has no interface number 1

This violates the USB spec. But I guess it shouldn't prevent the driver from attaching to the device.

Right, that's just a warning.

Quoted 2 lines
Quoted 1 line

Audio class v2 interfaces need an interface association

Quoted 7 lines
Quoted 2 lines

This looks like a bug in the driver; there certainly is such an descriptor. Daniel?

The USB audio driver actually just uses functions from the USB driver core to access the interface association. However, the USB core didn't assign it during its probe, which is most probably a result of the broken descriptor set.

And it turned out it is.

Ben, can you try the patch below, please? It's a pretty obvious flaw in the USB core system which is triggered by buggy descriptors.

Daniel

drivers/usb/core/message.c +3 -1
index b548cf1..8eb1a1e 100644
@@ -1838,7 +1838,6 @@ free_interfaces:
 		intfc = cp->intf_cache[i];
 		intf->altsetting = intfc->altsetting;
 		intf->num_altsetting = intfc->num_altsetting;
-		intf->intf_assoc = find_iad(dev, cp, i);
 		kref_get(&intfc->ref);
 
 		alt = usb_altnum_to_altsetting(intf, 0);
@@ -1851,6 +1850,9 @@ free_interfaces:
 		if (!alt)
 			alt = &intf->altsetting[0];
 
+		intf->intf_assoc =
+			find_iad(dev, cp, alt->desc.bInterfaceNumber);
+
 		intf->cur_altsetting = alt;
 		usb_enable_interface(dev, intf, true);
 		intf->dev.parent = &dev->dev;
#5 lore raw

Anyone try this yet? I have a fiio E10 and a at&t galaxy S3 rooted and ready to go. If someone builds me a flashable kernel I'll give it a go.

#6 lore raw
Quoted 2 lines · Patrick P

Anyone try this yet? I have a fiio E10 and a at&t galaxy S3 rooted and ready to go. If someone builds me a flashable kernel I'll give it a go.

Try what exactly? Is this message related to the thread you're replying to?