Re: USB isochronous frame lost

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

 



Dear Alan,

maybe there is a bug in VMWare. If so, there must be either a bug in the firmware or in the uvc module, since the camera is not working on native Linux without the nodrop option.

I verified the following. In uvc_video.c at line 595

if (urb->iso_frame_desc[i].status < 0) {
	uvc_trace(UVC_TRACE_FRAME, "USB isochronous frame "
		"lost (%d).\n", urb->iso_frame_desc[i].status);
	/* Mark the buffer as faulty. */
	if (buf != NULL)
		buf->error = 1;
	continue;
}

a complete URB is dropped, if one of the packets is erroneous. The format is uncompressed in my case. The comparison at line 627
buf->buf.length != buf->buf.bytesused
will set
buf->error = 1;
for almost every URB.

I added one line after above mentioned block for testing purposes:

if (urb->iso_frame_desc[i].status < 0) {
	uvc_trace(UVC_TRACE_FRAME, "USB isochronous frame "
		"lost (%d).\n", urb->iso_frame_desc[i].status);
	/* Mark the buffer as faulty. */
	if (buf != NULL)
		buf->error = 1;
	continue;
}
buf->error = 0;

resetting buf->error in order to receive at least the remaining packets with no status flag < 0.
So, I just discard erroneous packets, not the whole URB.
Loading uvcvideo with this modification provides a data stream as expected, even without the nodrop option. The syslog trace now looks like below. You can see that for every URB three isochronous frames are lost, and 29 packets are received. Are you sure that this is not a firmware problem?

Best regards,

   Stefan May

Oct 27 17:41:06 Brutus kernel: [53.512200] uvcvideo: uvc_v4l2_poll
Oct 27 17:41:06 Brutus kernel: [53.512210] uvcvideo: uvc_v4l2_ioctl(VIDIOC_DQBUF) Oct 27 17:41:06 Brutus kernel: [53.512214] uvcvideo: Dequeuing buffer 1 (4, 221184 bytes). Oct 27 17:41:06 Brutus kernel: [53.512217] uvcvideo: uvc_v4l2_ioctl(VIDIOC_QBUF)
Oct 27 17:41:06 Brutus kernel: [53.512219] uvcvideo: Queuing buffer 1.
Oct 27 17:41:06 Brutus kernel: [53.519804] uvcvideo: uvc_v4l2_poll
Oct 27 17:41:06 Brutus kernel: [53.524185] uvcvideo: Frame complete (EOF found). Oct 27 17:41:06 Brutus kernel: [53.524194] uvcvideo: USB isochronous frame lost (-71). Oct 27 17:41:06 Brutus kernel: [53.524195] uvcvideo: USB isochronous frame lost (-71). Oct 27 17:41:06 Brutus kernel: [53.524197] uvcvideo: USB isochronous frame lost (-71).
Oct 27 17:41:06 Brutus kernel: [53.524217] uvcvideo: uvc_v4l2_poll
Oct 27 17:41:06 Brutus kernel: [53.524226] uvcvideo: uvc_v4l2_ioctl(VIDIOC_DQBUF) Oct 27 17:41:06 Brutus kernel: [53.524230] uvcvideo: Dequeuing buffer 2 (4, 221184 bytes). Oct 27 17:41:06 Brutus kernel: [53.524232] uvcvideo: uvc_v4l2_ioctl(VIDIOC_QBUF)
Oct 27 17:41:06 Brutus kernel: [53.524234] uvcvideo: Queuing buffer 2.
Oct 27 17:41:06 Brutus kernel: [53.530820] uvcvideo: uvc_v4l2_poll
Oct 27 17:41:06 Brutus kernel: [53.536178] uvcvideo: Frame complete (EOF found).
Oct 27 17:41:06 Brutus kernel: [53.536204] uvcvideo: uvc_v4l2_poll
Oct 27 17:41:06 Brutus kernel: [53.536215] uvcvideo: uvc_v4l2_ioctl(VIDIOC_DQBUF) Oct 27 17:41:06 Brutus kernel: [53.536220] uvcvideo: Dequeuing buffer 3 (4, 221184 bytes). Oct 27 17:41:06 Brutus kernel: [53.536223] uvcvideo: uvc_v4l2_ioctl(VIDIOC_QBUF)
Oct 27 17:41:06 Brutus kernel: [53.536225] uvcvideo: Queuing buffer 3.
Oct 27 17:41:06 Brutus kernel: [53.537765] uvcvideo: uvc_v4l2_poll
Oct 27 17:41:06 Brutus kernel: [53.540155] uvcvideo: USB isochronous frame lost (-71). Oct 27 17:41:06 Brutus kernel: [53.540157] uvcvideo: USB isochronous frame lost (-71). Oct 27 17:41:06 Brutus kernel: [53.540158] uvcvideo: USB isochronous frame lost (-71). Oct 27 17:41:06 Brutus kernel: [53.552163] uvcvideo: Frame complete (EOF found). Oct 27 17:41:06 Brutus kernel: [53.552173] uvcvideo: USB isochronous frame lost (-71). Oct 27 17:41:06 Brutus kernel: [53.552174] uvcvideo: USB isochronous frame lost (-71). Oct 27 17:41:06 Brutus kernel: [53.552175] uvcvideo: USB isochronous frame lost (-71).
Oct 27 17:41:06 Brutus kernel: [53.552218] uvcvideo: uvc_v4l2_poll
Oct 27 17:41:06 Brutus kernel: [53.552227] uvcvideo: uvc_v4l2_ioctl(VIDIOC_DQBUF) Oct 27 17:41:06 Brutus kernel: [53.552231] uvcvideo: Dequeuing buffer 0 (4, 221184 bytes). Oct 27 17:41:06 Brutus kernel: [53.552234] uvcvideo: uvc_v4l2_ioctl(VIDIOC_QBUF)
Oct 27 17:41:06 Brutus kernel: [53.552236] uvcvideo: Queuing buffer 0.
Oct 27 17:41:06 Brutus kernel: [53.553636] uvcvideo: uvc_v4l2_poll
Oct 27 17:41:06 Brutus kernel: [53.564163] uvcvideo: Frame complete (EOF found).


Am 26.10.2012 19:10, schrieb Alan Stern:
On Fri, 26 Oct 2012, Stefan May wrote:

I saw different bmVideoStandards with lsusb. It is the only parameter
with a different value on both sides. Meanwhile, I found a way to make
the camera work. I need to use the load option nodrop=1 in the host, but
not in the guest.
I have no idea why UVC sees incomplete frames only on host side. It is
definitely a firmware problem. Could you imagine what was not respected
there, so that almost every packet is dropped?

I don't think it is a firmware problem.  It is a bug in VMWare.

Alan Stern

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

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