From: David Henningsson <david.henningsson@canonical.com>
To: Clemens Ladisch <clemens@ladisch.de>
Cc: alsa-devel@alsa-project.org,
Alan Stern <stern@rowland.harvard.edu>,
zonque@gmail.com
Subject: Re: USB Audio initialization race
Date: Tue, 17 Sep 2013 00:21:27 +0200 [thread overview]
Message-ID: <52378467.1040402@canonical.com> (raw)
In-Reply-To: <523574A4.4010203@ladisch.de>
On 09/15/2013 10:49 AM, Clemens Ladisch wrote:
> Alan Stern wrote:
>> On Sat, 14 Sep 2013, Clemens Ladisch wrote:
>>> Alan Stern wrote:
>>>> So here's my question: If the sound driver recognizes that interface B
>>>> is connected with interface A when B is probed, why can't it recognize
>>>> this fact when A is probed? It could claim B while A's probe is
>>>> running. Then the sound card would be registered with the PCM
>>>> component already in place.
>>>
>>> The sound driver already does this.
>>
>> It does? Why does the comment preceding snd_usb_audio_probe() say:
>>
>> * thus we check the usb device pointer and creates the card instance
>> * only at the first time. the successive calls of this function will
>> * append the pcm interface to the corresponding card.
>
> For UAC devices with correct descriptors, and for devices with multi-
> interface quirks, the driver claims all interfaces at once. But it is
> still possible to have devices with zero or two audio control interfaces.
So, indeed there is some claiming being done in the usb audio driver, so
maybe this is not as much of a problem as I thought, but I think this
comment is wrong:
/* we are allowed to call snd_card_register() many times */
...because it implies that it is okay to change the card and then call
snd_card_register again, and it is not, because userspace cannot handle
that correctly. It would be more appropriate to print a warning if this
happens.
Also, I wonder if it makes sense to also claim control interfaces
(USB_SUBCLASS_AUDIOCONTROL) in snd_usb_create_stream, in case the audio
streaming interface is probed before the control interface?
Anyway, I'm waiting for the (latest) bug reporter to return back to me
with "lsusb -v" and some more info, so I can verify if this could
actually be the problem or not.
--
David Henningsson, Canonical Ltd.
https://launchpad.net/~diwic
next prev parent reply other threads:[~2013-09-16 22:21 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-09-13 19:56 USB Audio initialization race David Henningsson
2013-09-13 20:39 ` Alan Stern
2013-09-13 20:53 ` David Henningsson
2013-09-13 21:06 ` Alan Stern
2013-09-13 23:47 ` David Henningsson
2013-09-14 13:44 ` Alan Stern
2013-09-14 19:33 ` Clemens Ladisch
2013-09-15 1:35 ` Alan Stern
2013-09-15 8:49 ` Clemens Ladisch
2013-09-16 22:21 ` David Henningsson [this message]
2013-09-13 20:55 ` Clemens Ladisch
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=52378467.1040402@canonical.com \
--to=david.henningsson@canonical.com \
--cc=alsa-devel@alsa-project.org \
--cc=clemens@ladisch.de \
--cc=stern@rowland.harvard.edu \
--cc=zonque@gmail.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.