Bulk transfers freeze after a random time

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

 



Hi everybody,

I've been trying to solve a weird bulk transfers issue for a couple of weeks 
in the uvcvideo driver. It now seems the problem lies in the lower layers (or 
even possibly in the device), so I'd appreciate some help to shed light on 
this.

Background information: kernel 2.6.37, EHCI controller, two identical (as far 
as the USB interface is concerned) UVC devices plugged into the root hub. The 
host sends MJPEG compressed video data to the devices (UVC allows for video 
output as well as capture) through bulk endpoints.

After a random time, one of the device seems to hang. It stops receiving data 
on the bulk endpoint. On the host side, the uvcvideo driver submits its bulk 
URBs correctly until the hang occurs, at which point the completion callback 
stops being called. No error is being reported in the last calls to the 
completion callback, and usb_submit_urb() always returns success. The other 
device continues to receive data correctly. No message is printed to the 
kernel log at that point. Turning USB verbose debugging on doesn't show any 
additional message in the kernel log when the freeze occurs.

A USB analyzer showed that bulk transfers stop completely for the device that 
hangs. Three screenshots of the trace can be found at

http://www.ideasonboard.com/usb/usb-trace-1.jpg
http://www.ideasonboard.com/usb/usb-trace-2.jpg
http://www.ideasonboard.com/usb/usb-trace-3.jpg

They have all been taken in separate runs of the application.

It seems that the device which hangs is the one that is first plugged into the 
system (lowest USB address), but this could be a coincidence. The bulk 
payloads have variable sizes, and it seems the first 1-byte bulk packet 
triggers the freeze (this can again be a coincidence). The freeze occured at 
least once without a 1-byte bulk packet though. It also seems that the freeze 
can't be reproduced when only one of the devices is in use.

When the transfer freezes, disconnecting/reconnecting the device is required 
to recover from the problem. Stopping the video stream, unloading/reloading 
the uvcvideo driver and restarting the video stream isn't enough (no bulk 
packet can be transferred at all in that case). Physically 
disconnecting/reconnecting the device works, as well as triggering a 
disconnection/reconnection through the control endpoint (the device implements 
a couple of custom debugging commands, including one which switches its 
operation mode and triggers a USB disconnection). This means that endpoint 0 
still responds correctly.

All help will be appreciated. I've got a couple of (very long) usbmon traces 
available if needed. I can also provide specific usbmon traces or kernel logs, 
and of course try patches.

-- 
Regards,

Laurent Pinchart
--
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