v4l2 and uvcvideo problem

Hi everyone!

I try to use USB Video Capture device with PX2 by uvcvideo driver.
When I use openCV to directly show the video, I always got a ‘select timeout’ message.
Then try to use v4l2, the window would froze in a short execution time.

Now, use gstreamer application get message as follow:

Setting pipeline to PAUSED ...
Pipeline is live and does not need PREROLL ...
Setting pipeline to PLAYING ...
New clock: GstSystemClock
WARNING: from element /GstPipeline:pipeline0/GstV4l2Src:v4l2src0: Got unexpected frame size of 0 instead of 1843200.
Additional debug info:
gstv4l2src.c(919): gst_v4l2src_get_mmap (): /GstPipeline:pipeline0/GstV4l2Src:v4l2src0
WARNING: from element /GstPipeline:pipeline0/GstV4l2Src:v4l2src0: Got unexpected frame size of 0 instead of 1843200.
Additional debug info:
gstv4l2src.c(919): gst_v4l2src_get_mmap (): /GstPipeline:pipeline0/GstV4l2Src:v4l2src0
WARNING: from element /GstPipeline:pipeline0/GstV4l2Src:v4l2src0: Got unexpected frame size of 0 instead of 1843200.
Additional debug info:
gstv4l2src.c(919): gst_v4l2src_get_mmap (): /GstPipeline:pipeline0/GstV4l2Src:v4l2src0
WARNING: from element /GstPipeline:pipeline0/GstV4l2Src:v4l2src0: Got unexpected frame size of 0 instead of 1843200.
Additional debug info:
gstv4l2src.c(919): gst_v4l2src_get_mmap (): /GstPipeline:pipeline0/GstV4l2Src:v4l2src0
WARNING: from element /GstPipeline:pipeline0/GstV4l2Src:v4l2src0: Got unexpected frame size of 0 instead of 1843200.
Additional debug info:
gstv4l2src.c(919): gst_v4l2src_get_mmap (): /GstPipeline:pipeline0/GstV4l2Src:v4l2src0
WARNING: from element /GstPipeline:pipeline0/GstV4l2Src:v4l2src0: Got unexpected frame size of 0 instead of 1843200.
Additional debug info:
gstv4l2src.c(919): gst_v4l2src_get_mmap (): /GstPipeline:pipeline0/GstV4l2Src:v4l2src0
WARNING: from element /GstPipeline:pipeline0/GstV4l2Src:v4l2src0: Got unexpected frame size of 0 instead of 1843200.
Additional debug info:
gstv4l2src.c(919): gst_v4l2src_get_mmap (): /GstPipeline:pipeline0/GstV4l2Src:v4l2src0
WARNING: from element /GstPipeline:pipeline0/GstV4l2Src:v4l2src0: Got unexpected frame size of 0 instead of 1843200.
Additional debug info:
gstv4l2src.c(919): gst_v4l2src_get_mmap (): /GstPipeline:pipeline0/GstV4l2Src:v4l2src0
WARNING: from element /GstPipeline:pipeline0/GstV4l2Src:v4l2src0: Got unexpected frame size of 0 instead of 1843200.
Additional debug info:
gstv4l2src.c(919): gst_v4l2src_get_mmap (): /GstPipeline:pipeline0/GstV4l2Src:v4l2src0
WARNING: from element /GstPipeline:pipeline0/GstV4l2Src:v4l2src0: Got unexpected frame size of 0 instead of 1843200.
Additional debug info:
gstv4l2src.c(919): gst_v4l2src_get_mmap (): /GstPipeline:pipeline0/GstV4l2Src:v4l2src0
WARNING: from element /GstPipeline:pipeline0/GstV4l2Src:v4l2src0: Got unexpected frame size of 0 instead of 1843200.
Additional debug info:
gstv4l2src.c(919): gst_v4l2src_get_mmap (): /GstPipeline:pipeline0/GstV4l2Src:v4l2src0
WARNING: from element /GstPipeline:pipeline0/GstV4l2Src:v4l2src0: Got unexpected frame size of 0 instead of 1843200.
Additional debug info:
gstv4l2src.c(919): gst_v4l2src_get_mmap (): /GstPipeline:pipeline0/GstV4l2Src:v4l2src0
WARNING: from element /GstPipeline:pipeline0/GstV4l2Src:v4l2src0: Got unexpected frame size of 0 instead of 1843200.
Additional debug info:
gstv4l2src.c(919): gst_v4l2src_get_mmap (): /GstPipeline:pipeline0/GstV4l2Src:v4l2src0
WARNING: from element /GstPipeline:pipeline0/GstV4l2Src:v4l2src0: Got unexpected frame size of 0 instead of 1843200.
Additional debug info:
gstv4l2src.c(919): gst_v4l2src_get_mmap (): /GstPipeline:pipeline0/GstV4l2Src:v4l2src0
WARNING: from element /GstPipeline:pipeline0/GstV4l2Src:v4l2src0: Got unexpected frame size of 0 instead of 1843200.
Additional debug info:
gstv4l2src.c(919): gst_v4l2src_get_mmap (): /GstPipeline:pipeline0/GstV4l2Src:v4l2src0
WARNING: from element /GstPipeline:pipeline0/GstV4l2Src:v4l2src0: Got unexpected frame size of 0 instead of 1843200.
Additional debug info:
gstv4l2src.c(919): gst_v4l2src_get_mmap (): /GstPipeline:pipeline0/GstV4l2Src:v4l2src0
WARNING: from element /GstPipeline:pipeline0/GstV4l2Src:v4l2src0: Got unexpected frame size of 0 instead of 1843200.
Additional debug info:
gstv4l2src.c(919): gst_v4l2src_get_mmap (): /GstPipeline:pipeline0/GstV4l2Src:v4l2src0
ERROR: from element /GstPipeline:pipeline0/GstV4l2Src:v4l2src0: Error reading 1843200 bytes on device '/dev/video0'.
Additional debug info:
gstv4l2src.c(937): gst_v4l2src_get_mmap (): /GstPipeline:pipeline0/GstV4l2Src:v4l2src0
Execution ended after 61921256715 ns.
Setting pipeline to PAUSED ...
Setting pipeline to READY ...
Setting pipeline to NULL ...
Freeing pipeline ...

And the dmseg as followed:

[21212.253512] uvcvideo: Found UVC 1.10 device USB Capture HDMI (2935:0006)
[21212.257335] input: USB Capture HDMI as /devices/3530000.xhci/usb3/3-1/3-1.4/3-1.4:1.0/input/input78
[21212.297647] hid-generic 0003:2935:0006.004F: hiddev0,hidraw2: USB HID v1.01 Device [Magewell USB Capture HDMI] on usb-3530000.xhci-1.4/input9
[21275.548952] uvcvideo: Non-zero status (-71) in video completion handler.
[21275.550457] uvcvideo: Non-zero status (-71) in video completion handler.
[21275.551975] uvcvideo: Non-zero status (-71) in video completion handler.
[21275.553474] uvcvideo: Non-zero status (-71) in video completion handler.
[21275.554975] uvcvideo: Non-zero status (-71) in video completion handler.
[21275.556476] uvcvideo: Non-zero status (-71) in video completion handler.
[21275.557978] uvcvideo: Non-zero status (-71) in video completion handler.
[21275.559474] uvcvideo: Non-zero status (-71) in video completion handler.
[21275.560983] uvcvideo: Non-zero status (-71) in video completion handler.
[21275.562486] uvcvideo: Non-zero status (-71) in video completion handler.
[21275.563979] uvcvideo: Non-zero status (-71) in video completion handler.
[21275.565475] uvcvideo: Non-zero status (-71) in video completion handler.
[21275.566975] uvcvideo: Non-zero status (-71) in video completion handler.
[21275.568477] uvcvideo: Non-zero status (-71) in video completion handler.
[21275.569977] uvcvideo: Non-zero status (-71) in video completion handler.

Does anyone know the solution?
Thanks a lot.

Dear pattyliang,

-71 indicated that there were protocol errors found and returned by FW.
This error may not be caused by SW bug.
Moreover, since this problem also happens on non-NV platform, so please to test with self-power hub to see if the issue is caused by insufficient power first.

Please check the kernel log.
uvcvideo: Failed to resubmit video URB (-1).