[alsa-devel] [PATCH v4 09/15] ALSA: usb-audio: conditional interface altsetting

Takashi Iwai tiwai at suse.de
Mon Oct 7 12:34:12 CEST 2013

At Sun,  6 Oct 2013 22:31:14 +0200,
Eldad Zack wrote:
> On some devices, if the endpoint for the other direction is in use,
> setting one interface will shutdown the other (in use) endpoint.
> This patch moves all of the alternate setting operations for pcm
> ops to one function which checks if we can do so.
> If current alternate is 0, it is safe to set.

Is this check needed for all devices?

The combination of playback and capture streams in snd_usb_substream
is casual, just depending on the enumeration.  It doesn't always mean
that these are coupled.  For non-implicit-fb devices, won't this
result in a false positive?


> +static int subs_set_interface(struct snd_usb_substream *subs, int ifnum,
> +			      int altsetting)
> +{
> +	struct snd_usb_substream *other_subs;
> +	int err;
> +
> +	snd_printdd(KERN_DEBUG "%s: Requested set interface %d alts %d\n",
> +		    __func__, ifnum, altsetting);
> +
> +	if (subs == NULL)
> +		return usb_set_interface(subs->dev, ifnum, altsetting);

It must lead to Oops.



More information about the Alsa-devel mailing list