From: Daniel Mack <zonque@gmail.com>
To: bEN <ml_all@circa.be>
Cc: alsa-devel@alsa-project.org, Clemens Ladisch <clemens@ladisch.de>
Subject: Re: snd-usb-audio probe problem (Teac UD-H01)
Date: Sun, 10 Jun 2012 22:26:11 +0200 [thread overview]
Message-ID: <4FD502E3.40704@gmail.com> (raw)
In-Reply-To: <4F819F7A.4020707@gmail.com>
[-- Attachment #1: Type: text/plain, Size: 1318 bytes --]
On 08.04.2012 16:23, Daniel Mack wrote:
> On 02.04.2012 10:12, Clemens Ladisch wrote:
>> bEN wrote:
>>> the new USB DAC from Teac seems detected as 'Human Interface Device'
>>> instead of 'Audio'.
>>
>> It has both HID and audio interfaces.
>>
>>> 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.
>>
>>> $ 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.
>
>>> 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.
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
[-- Attachment #2: intf-assoc-fix.patch --]
[-- Type: text/x-patch, Size: 707 bytes --]
diff --git a/drivers/usb/core/message.c b/drivers/usb/core/message.c
index b548cf1..8eb1a1e 100644
--- a/drivers/usb/core/message.c
+++ b/drivers/usb/core/message.c
@@ -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;
[-- Attachment #3: Type: text/plain, Size: 0 bytes --]
next prev parent reply other threads:[~2012-06-10 20:26 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-03-31 18:19 snd-usb-audio probe problem (Teac UD-H01) bEN
2012-04-02 7:44 ` Pavel Hofman
2012-04-02 8:12 ` Clemens Ladisch
2012-04-08 14:23 ` Daniel Mack
2012-06-10 20:26 ` Daniel Mack [this message]
2012-10-12 21:33 ` Patrick P
2012-10-13 8:07 ` Daniel Mack
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4FD502E3.40704@gmail.com \
--to=zonque@gmail.com \
--cc=alsa-devel@alsa-project.org \
--cc=clemens@ladisch.de \
--cc=ml_all@circa.be \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).