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

Takashi Iwai tiwai at suse.de
Mon Oct 7 09:41:06 CEST 2013


At Sun, 06 Oct 2013 10:29:23 +0200,
Guido Aulisi wrote:
> 
> > Next time, when detecting such problems, please consider sending a
> patch
> > to alsa-devel, so fixes make it to the users eventually :)
> 
> You are right, but I thought it was a problem with a broken/weird usb
> controller, because it worked with my old laptop.
> When I saw another user with the same problem, I sent the patch to LAU
> (the only mailing list I've subscribed to).
> 
> Now I remember why I did that patch: if you see my dmesg output without
> that patch, you can see that the driver is comparing 1024 to 0. If you
> check the history of the driver, you can see that this check has already
> been narrowed with the bit AND operation; I tried to narrow the check a
> little more, so I chose 0x3ff because 1024 & 0x3ff = 0.
> But I forgot about my Tascam (because I bought a RME Raydat) and never
> tested that patch, but I was quite confident that it should work.
> 
> [  669.312765] ALSA sound/usb/usx2y/usbusx2yaudio.c:141 should not be
> here with counts=42
> [  669.329821] ALSA sound/usb/usx2y/usbusx2yaudio.c:141 should not be
> here with counts=42
> [  669.345854] ALSA sound/usb/usx2y/usbusx2yaudio.c:141 should not be
> here with counts=42

Maybe this is the actual reason?  This is a place returning -EPIPE,
thus these urbs won't be submitted.

Can anyone test whether the patch below works alone without the
previous patch?  (Meanwhile, the previous patch to remove the frame
check is fine, it's just too strict for controllers like ehci, so it's
still fine to apply.)


thanks,

Takashi

---
diff --git a/sound/usb/usx2y/usbusx2yaudio.c b/sound/usb/usx2y/usbusx2yaudio.c
index 6234a51..1236ff3 100644
--- a/sound/usb/usx2y/usbusx2yaudio.c
+++ b/sound/usb/usx2y/usbusx2yaudio.c
@@ -137,10 +137,12 @@ static int usX2Y_urb_play_prepare(struct snd_usX2Y_substream *subs,
 		/* calculate the size of a packet */
 		counts = cap_urb->iso_frame_desc[pack].actual_length / usX2Y->stride;
 		count += counts;
+#if 0
 		if (counts < 43 || counts > 50) {
 			snd_printk(KERN_ERR "should not be here with counts=%i\n", counts);
 			return -EPIPE;
 		}
+#endif
 		/* set up descriptor */
 		urb->iso_frame_desc[pack].offset = pack ?
 			urb->iso_frame_desc[pack - 1].offset +


More information about the Alsa-devel mailing list