Skip to contentSkip to conversation

PROBLEM: UVC ioctl() freeze after device disconnection

DISCUSSION Laurent Pinchart 1 participant 1 message Dec 3, 2015 1 message not in the archive Media (V4L/DVB)

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw

Hi Matteo,

Quoted 6 lines · On Wednesday 02 December 2015 15:24:44 Matteo Foppiano wrote:

Hi,
working with raspberry and UVC I've found this issue:
https://github.com/raspberrypi/linux/issues/1211

As you can see in the post, the problem seems to be upstream, so I'm writing directly to you. Hope this is correct.

That's fine. I've additionally CC'ed the linux-media mailing list.

When the device is disconnected the USB host controller driver is supposed to disable all endpoints, resulting in the URB completion handler uvc_video_complete() being called with the status set to -ESHUTDOWN. The driver will then call uvc_queue_cancel() to return all queued buffers to userspace. VIDIOC_DQBUF should then wake up and return.

Quoted 1 line

From the above link I assume you use an RPi kernel. The RPi USB host

controller driver is known to be pretty unstable and buggy (at least the last time I checked) so it might not handle device disconnection properly.

The first step to debug this would be to check whether uvc_video_complete() gets called with a URB error status when you disconnect the device.

Signature · 3 lines
Regards,

Laurent Pinchart