This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

AM335x UVC摄像头问题

am335x处理器,linux-4.14.79,(ti-processor-sdk-linux-am335x-evm-05.02.00.10)

uvc标准摄像头,YUYV格式,320x240分辨率时工作正常,640x480时采集不到图像,跟踪驱动代码,看到以下信息:

uvcvideo: Marking buffer as bad (error bit set)

似乎是USB方面的问题。

如何解决这种问题?

  • 请问是自己的板子还是TI的板子?能否把完整的log信息贴出来?
  • 我们自己做的板子,以前用的是linux-3.2.0内核,工作正常。现在想升级到4.14.79,才遇到这个问题。

    跟踪了4.14.79的 drivers\media\usb\uvc 目录,部分信息:

    uvcvideo: uvc_v4l2_open
    uvcvideo: Resuming interface 0
    uvcvideo: Resuming interface 1
    uvcvideo: Trying format 0x56595559 (YUYV): 640x480.
    uvcvideo: Using default frame interval 33333.3us (30.0 fps).
    uvcvideo: uvc_v4l2_mmap
    uvcvideo: uvc_v4l2_mmap
    uvcvideo: uvc_v4l2_mmap
    uvcvideo: uvc_v4l2_mmap
    uvcvideo: Device requested 3072 B/frame bandwidth.
    uvcvideo: Selecting alternate setting 7 (3072 B/frame bandwidth).
    uvcvideo: Allocated 5 URB buffers of 32x3072 bytes each.
    uvcvideo: uvc_v4l2_poll
    uvc_video_decode_start, len: 2048, data[1]: 0c
    uvc_video_decode_start, len: 2048, data[1]: 0c
    uvc_video_decode_start, len: 3072, data[1]: 0c
    uvc_video_decode_start, len: 2048, data[1]: 0c
    uvc_video_decode_start, len: 2348, data[1]: 0c
    uvc_video_decode_start, len: 2048, data[1]: 0c
    uvc_video_decode_start, len: 3072, data[1]: 0c
    uvc_video_decode_start, len: 2048, data[1]: 0c
    uvc_video_decode_start, len: 3072, data[1]: 0c
    uvc_video_decode_start, len: 1340, data[1]: 0c
    uvc_video_decode_start, len: 3072, data[1]: 0c
    uvc_video_decode_start, len: 3072, data[1]: 0c
    uvc_video_decode_start, len: 1572, data[1]: 0c
    uvc_video_decode_start, len: 12, data[1]: 4e
    uvcvideo: Marking buffer as bad (error bit set).
    uvcvideo: Frame complete (EOF found).
    uvcvideo: EOF in empty payload.
    uvc_video_decode_start, len: 12, data[1]: 0e
    uvcvideo: Dropping payload (out of sync).

    应用程序得不到图像数据,select timeout

  • 这是一个 known bug, 在新的kernel version里,有些uvc webcams 640x480@30 YUV video不能工作。
  • 谢谢你的支持。

    不知道对于linux-4.14.79这个kernel,有没有patch解决这个问题?或者使用最新的kernel version ?

    TI网站上最新版本是

    Linux Processor SDK for AM335x
    Version: v06.01
    Version Date : 20-Oct-2019
    Linux Kernel: v4.19

  • 建议多测试几款USB 摄像头,罗技的UVC摄像头兼容性会好一点

  • 麻烦就在于我们是定制产品,摄像头型号是用户指定的,否则的话就不折腾这事情了。

    谢谢关注。

  • 输入v4l2-ctl -D 看看打印啥
  • v4l2-ctl -D

    Driver Info (not using libv4l2):
    Driver name : uvcvideo
    Card type : FiberMicroscope
    Bus info : usb-0000:00:06.0-2
    Driver version: 4.10.17
    Capabilities : 0x84200001
           Video Capture
          Streaming
         Extended Pix Format
    Device Capabilities
    Device Caps : 0x04200001
        Video Capture
       Streaming
       Extended Pix Format

    放弃YUYV格式,采用MJPEG格式,采集图像正常。

    谢谢各位关注。

  • 抱歉,最新的SDK也有这个问题,目前还没有patch。暂时的解决办法是换摄像头或者降低帧率使usb占用更少的带宽。

  • 谢谢支持。

    我们改用MJPEG格式,不再使用YUV格式,采集640x480图像正常了。