[alsa-devel] [PATCH v2] ALSA: snd-usb-usx2y: remove bogus frame checks -- SUCCESS

Takashi Iwai tiwai at suse.de
Mon Oct 7 09:35:44 CEST 2013


At Thu, 3 Oct 2013 11:25:03 +0100,
Dr Nicholas J Bailey wrote:
> 
> I applied the patch by hand to my current source tree (3.10.11) and compiled 
> the kernel from scratch.
> 
> I plugged a MIDI cable between midi in and out on the TASCAM US-122. Using 
> QJackCtl, I connected the US-122's MIDI out to fluidsynth, and used amidiplay 
> to send play a MIDI file to the US-122.
> 
> While the MIDI was playing, I used Audacity to record the audio via the 
> US-122's mic inputs holding the mic close to the speakers. After about 10 
> seconds, I rewound audacity and hit record again so that it was both playing 
> and recording through the US-122 while the US-122 was also routing MIDI.
> 
> This appears to work fine (at 44100Hz sampling; I've not tried any others), and 
> I reckon this is a pretty severe test.
> 
> Thank you for pushing this patch which seems to resolve the original issue. 
> This will be particularly appreciated by many because the US-122, no longer 
> supported for Windows I believe, is currently available on eBay for about £30 
> in the UK, and represents an inexpensive way for Linux users to make 
> reasonable quality recordings from microphones needing a phantom power source.

OK, applied the patch now with Cc to stable.


thanks,

Takashi

> 
> 
> On Wednesday 02 October 2013 16:49:50 Daniel Mack wrote:
> > The frame check in i_usX2Y_urb_complete() and
> > i_usX2Y_usbpcm_urb_complete() is bogus and produces false positives as
> > described in this LAU thread:
> > 
> >   http://linuxaudio.org/mailarchive/lau/2013/5/20/200177
> > 
> > This patch removes the check code entirely.
> > 
> > Cc: fzu at wemgehoertderstaat.de
> > Reported-by: Dr Nicholas J Bailey <nicholas.bailey at glasgow.ac.uk>
> > Suggested-by: Takashi Iwai <tiwai at suse.de>
> > Signed-off-by: Daniel Mack <zonque at gmail.com>
> > ---
> >  sound/usb/usx2y/usbusx2yaudio.c | 22 +++-------------------
> >  sound/usb/usx2y/usx2yhwdeppcm.c |  7 +------
> >  2 files changed, 4 insertions(+), 25 deletions(-)
> > 
> > diff --git a/sound/usb/usx2y/usbusx2yaudio.c
> > b/sound/usb/usx2y/usbusx2yaudio.c index 63fb521..6234a51 100644
> > --- a/sound/usb/usx2y/usbusx2yaudio.c
> > +++ b/sound/usb/usx2y/usbusx2yaudio.c
> > @@ -299,19 +299,6 @@ static void usX2Y_error_urb_status(struct usX2Ydev
> > *usX2Y, usX2Y_clients_stop(usX2Y);
> >  }
> > 
> > -static void usX2Y_error_sequence(struct usX2Ydev *usX2Y,
> > -				 struct snd_usX2Y_substream *subs, struct urb *urb)
> > -{
> > -	snd_printk(KERN_ERR
> > -"Sequence Error!(hcd_frame=%i ep=%i%s;wait=%i,frame=%i).\n"
> > -"Most probably some urb of usb-frame %i is still missing.\n"
> > -"Cause could be too long delays in usb-hcd interrupt handling.\n",
> > -		   usb_get_current_frame_number(usX2Y->dev),
> > -		   subs->endpoint, usb_pipein(urb->pipe) ? "in" : "out",
> > -		   usX2Y->wait_iso_frame, urb->start_frame, usX2Y->wait_iso_frame);
> > -	usX2Y_clients_stop(usX2Y);
> > -}
> > -
> >  static void i_usX2Y_urb_complete(struct urb *urb)
> >  {
> >  	struct snd_usX2Y_substream *subs = urb->context;
> > @@ -328,12 +315,9 @@ static void i_usX2Y_urb_complete(struct urb *urb)
> >  		usX2Y_error_urb_status(usX2Y, subs, urb);
> >  		return;
> >  	}
> > -	if (likely((urb->start_frame & 0xFFFF) == (usX2Y->wait_iso_frame &
> > 0xFFFF))) -		subs->completed_urb = urb;
> > -	else {
> > -		usX2Y_error_sequence(usX2Y, subs, urb);
> > -		return;
> > -	}
> > +
> > +	subs->completed_urb = urb;
> > +
> >  	{
> >  		struct snd_usX2Y_substream *capsubs =
> > usX2Y->subs[SNDRV_PCM_STREAM_CAPTURE], *playbacksubs =
> > usX2Y->subs[SNDRV_PCM_STREAM_PLAYBACK];
> > diff --git a/sound/usb/usx2y/usx2yhwdeppcm.c
> > b/sound/usb/usx2y/usx2yhwdeppcm.c index f2a1acd..814d0e8 100644
> > --- a/sound/usb/usx2y/usx2yhwdeppcm.c
> > +++ b/sound/usb/usx2y/usx2yhwdeppcm.c
> > @@ -244,13 +244,8 @@ static void i_usX2Y_usbpcm_urb_complete(struct urb
> > *urb) usX2Y_error_urb_status(usX2Y, subs, urb);
> >  		return;
> >  	}
> > -	if (likely((urb->start_frame & 0xFFFF) == (usX2Y->wait_iso_frame &
> > 0xFFFF))) -		subs->completed_urb = urb;
> > -	else {
> > -		usX2Y_error_sequence(usX2Y, subs, urb);
> > -		return;
> > -	}
> > 
> > +	subs->completed_urb = urb;
> >  	capsubs = usX2Y->subs[SNDRV_PCM_STREAM_CAPTURE];
> >  	capsubs2 = usX2Y->subs[SNDRV_PCM_STREAM_CAPTURE + 2];
> >  	playbacksubs = usX2Y->subs[SNDRV_PCM_STREAM_PLAYBACK];
> 


More information about the Alsa-devel mailing list