[alsa-devel] [PATCH 5/5] ALSA: snd-usb: add support for implicit feedback

Daniel Mack zonque at gmail.com
Fri Nov 18 21:22:17 CET 2011


On 11/18/2011 09:05 PM, Daniel Mack wrote:
> ---
>  sound/usb/pcm.c |   37 ++++++++++++++++++++++++++-----------
>  1 files changed, 26 insertions(+), 11 deletions(-)
> 
> diff --git a/sound/usb/pcm.c b/sound/usb/pcm.c
> index 34adb17..3cf23e3 100644
> --- a/sound/usb/pcm.c
> +++ b/sound/usb/pcm.c
> @@ -298,7 +298,7 @@ static int set_format(struct snd_usb_substream *subs, struct audioformat *fmt)
>  	struct usb_interface *iface;
>  	unsigned int ep, attr;
>  	int is_playback = subs->direction == SNDRV_PCM_STREAM_PLAYBACK;
> -	int err;
> +	int err, implicit_fb = 0;
>  
>  	iface = usb_ifnum_to_if(dev, fmt->iface);
>  	if (WARN_ON(!iface))
> @@ -323,25 +323,34 @@ static int set_format(struct snd_usb_substream *subs, struct audioformat *fmt)
>  	 * assume it as adaptive-out or sync-in.
>  	 */
>  	attr = fmt->ep_attr & USB_ENDPOINT_SYNCTYPE;
> -	if (((is_playback && attr == USB_ENDPOINT_SYNC_ASYNC) ||
> -	     (! is_playback && attr == USB_ENDPOINT_SYNC_ADAPTIVE)) &&
> -	    altsd->bNumEndpoints >= 2) {
> -		switch (subs->stream->chip->usb_id) {
> -		case USB_ID(0x0763, 0x2080): /* M-Audio FastTrack Ultra */
> -		case USB_ID(0x0763, 0x2081):
> +
> +	switch (subs->stream->chip->usb_id) {
> +	case USB_ID(0x0763, 0x2080): /* M-Audio FastTrack Ultra */
> +	case USB_ID(0x0763, 0x2081):
> +		if (is_playback) {
> +			implicit_fb = 1;
>  			ep = 0x81;
>  			iface = usb_ifnum_to_if(dev, 2);
> +
> +			if (!iface || iface->num_altsetting == 0)
> +				return -EINVAL;
> +
>  			alts = &iface->altsetting[1];
>  			goto add_sync_ep;
>  		}

Eeks, something went wrong here in my patch rebasing/squashing. It
shouldn't matter for the review though - I'll fix that up next time.




More information about the Alsa-devel mailing list