Re: usb feedback loop problem

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, 5 Jun 2009, Tor Håkon Gjerde wrote:

> Hello.
> 
> I am building a high speed usb audio device. It uses asynch isochronous 
> mode for playback but the info from the feedback endpoint seems to get 
> lost somewhere.
> 
> Relevant ouput from usbmon (2 lines):
> f694c1c0 1057412404 S Zi:1:022:3 -115:64:3920 1 -18:0:4 4 <
> f694c5c0 1057420403 C Zi:1:022:3 0:64:3984:0 1 0:0:4 0
> 
> I would assume the last line should look somewhat like this:
> f694c5c0 1057420403 C Zi:1:022:3 0:64:3984:0 1 0:0:4 4 = 00000600
> 
> The feedback is all correct when I force the device to full speed.

What this means is that for Iso transfers, ehci-hcd does not report 
anything in urb->actual_length.  You have to look at the actual_length 
fields of the individual iso_packet_descriptors.

This is a bug in ehci-hcd.  The patch below ought to fix it.

Alan Stern


Index: usb-2.6/drivers/usb/host/ehci-sched.c
===================================================================
--- usb-2.6.orig/drivers/usb/host/ehci-sched.c
+++ usb-2.6/drivers/usb/host/ehci-sched.c
@@ -1618,10 +1618,12 @@ itd_complete (
 
 			/* HC need not update length with this error */
 			if (!(t & EHCI_ISOC_BABBLE))
-				desc->actual_length = EHCI_ITD_LENGTH (t);
+				urb->actual_length += desc->actual_length =
+						EHCI_ITD_LENGTH(t);
 		} else if (likely ((t & EHCI_ISOC_ACTIVE) == 0)) {
 			desc->status = 0;
-			desc->actual_length = EHCI_ITD_LENGTH (t);
+			urb->actual_length += desc->actual_length =
+					EHCI_ITD_LENGTH(t);
 		} else {
 			/* URB was too late */
 			desc->status = -EXDEV;
@@ -2012,7 +2014,8 @@ sitd_complete (
 			desc->status = -EPROTO;
 	} else {
 		desc->status = 0;
-		desc->actual_length = desc->length - SITD_LENGTH (t);
+		urb->actual_length += desc->actual_length =
+				desc->length - SITD_LENGTH (t);
 	}
 	stream->depth -= stream->interval << 3;
 

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux