All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Henningsson <david.henningsson@canonical.com>
To: Clemens Ladisch <clemens@ladisch.de>
Cc: tiwai@suse.de, 1095315@bugs.launchpad.net, alsa-devel@alsa-project.org
Subject: Re: [RFC PATCH] ALSA: usb - fix race in creation of M-Audio Fast track pro driver
Date: Mon, 07 Jan 2013 14:06:34 +0100	[thread overview]
Message-ID: <50EAC85A.4020905@canonical.com> (raw)
In-Reply-To: <50E73968.4070703@ladisch.de>

On 01/04/2013 09:19 PM, Clemens Ladisch wrote:
> David Henningsson wrote:
>> this patch resolves the issue for him. It also leaves a message
>> in the log:
>> "snd-usb-audio: probe of 1-1.1:1.1 failed with error -5"
>
> I'd guess this is for an interface not claimed by the driver but
> without an explicit QUIRK_IGNORE_INTERFACE entry.

My patch causes this error because the quirk fails with an error, which 
is later on turned into a -EIO. Any quirk_ignore_interface entry will 
therefore be ignored. Using the quirk_ignore_interface entry *instead 
of* my patch seems like an interesting option, but...

Looking at the code again, it seems like we have a more generic race 
problem, unless I'm missing something:

  - the same ALSA sound card can contain more than one USB interface.
  - snd_card_register is called whenever a USB interface finishes probing.
  - snd_card_register fires off uevents, causing stuff to happen such as 
volume restore (alsactl) and PulseAudio starts probing the device
  - so when userspace starts accessing the device, the device is not 
fully functional, because not all USB interfaces have yet been probed
  - as a result, volumes might not get restored (if all mixer controls 
do not belong to the first interface), and PulseAudio thinks the device 
is not capable of all the stuff it actually can do (if all pcm streams 
do not belong to the first interface).

I guess this is probably not a problem normally because the kernel is 
faster than userspace, but it is revealed here because switching 
configurations takes longer time than probing another interface.


-- 
David Henningsson, Canonical Ltd.
https://launchpad.net/~diwic

  reply	other threads:[~2013-01-07 13:06 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-04 16:02 [RFC PATCH] ALSA: usb - fix race in creation of M-Audio Fast track pro driver David Henningsson
2013-01-04 20:19 ` Clemens Ladisch
2013-01-07 13:06   ` David Henningsson [this message]
2013-01-14  7:21 ` David Henningsson
2013-01-14 10:58   ` Takashi Iwai

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=50EAC85A.4020905@canonical.com \
    --to=david.henningsson@canonical.com \
    --cc=1095315@bugs.launchpad.net \
    --cc=alsa-devel@alsa-project.org \
    --cc=clemens@ladisch.de \
    --cc=tiwai@suse.de \
    /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.