Hi everybody,

some people have run into EHCI-related issue where the video would freeze and 
the Linux UVC driver would print "uvcvideo: Failed to resubmit video URB 
(-45)" errors after a while.

Alan Stern was kind enough to write a quick patch to try to solve the issue. 
Could you please test it and report the results ? I'm particularly interested 
in hearing from people who ran into the -45 error frequently. Please retest 
your camera without the patch, make sure you can reproduce the problem 
accurately, and try to recompile your kernel with the patch applied.

Thanks in advance for your help.

Best regards,

Laurent Pinchart

----------  Forwarded Message  ----------

Subject: Re: ehci-hcd issue with webcam / uvcvideo driver
Date: Tuesday 25 March 2008
From: Alan Stern <[EMAIL PROTECTED]>
To: Malte Gell <[EMAIL PROTECTED]>, Laurent Pinchart 
<[EMAIL PROTECTED]>

On Tue, 25 Mar 2008, Laurent Pinchart wrote:

> Regardless of the userspace application and the kind of USB device, I don't 
> think the EHCI driver should return -EL2NSYNC upon URB submission when the 
> URB_ISO_ASAP is set in the transfer_flags field.

You're right; it shouldn't.  Here's a patch that attempts to fix the 
bug.  Let me know how it behaves.

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
@@ -1349,18 +1349,27 @@ iso_stream_schedule (
        /* when's the last uframe this urb could start? */
        max = now + mod;
 
-       /* typical case: reuse current schedule. stream is still active,
-        * and no gaps from host falling behind (irq delays etc)
+       /* Typical case: reuse current schedule, stream is still active.
+        * Hopefully there are no gaps from the host falling behind
+        * (irq delays etc), but if there are we'll take the next
+        * slot in the schedule, implicitly assuming URB_ISO_ASAP.
         */
        if (likely (!list_empty (&stream->td_list))) {
                start = stream->next_uframe;
                if (start < now)
                        start += mod;
-               if (likely ((start + sched->span) < max))
-                       goto ready;
-               /* else fell behind; someday, try to reschedule */
-               status = -EL2NSYNC;
-               goto fail;
+
+               /* Fell behind (by up to twice the slop amount)? */
+               if (start >= max - 2 * 8 * SCHEDULE_SLOP)
+                       start += stream->interval * DIV_ROUND_UP(
+                                       max - start, stream->interval) - mod;
+
+               /* Tried to schedule too far into the future? */
+               if (unlikely((start + sched->span) >= max)) {
+                       status = -EFBIG;
+                       goto fail;
+               }
+               goto ready;
        }
 
        /* need to schedule; when's the next (u)frame we could start?

--
_______________________________________________
Linux-uvc-devel mailing list
[email protected]
https://lists.berlios.de/mailman/listinfo/linux-uvc-devel

Reply via email to