导航

    全志在线开发者论坛

    • 注册
    • 登录
    • 搜索
    • 版块
    • 话题
    • 在线文档
    • 社区主页

    V851S USB UVC uvcout 示例问题

    V Series
    1
    4
    1950
    正在加载更多帖子
    • 从旧到新
    • 从新到旧
    • 最多赞同
    回复
    • 在新帖中回复
    登录后回复
    此主题已被删除。只有拥有主题管理权限的用户可以查看。
    • kanken6174
      kanken6174 LV 6 最后由 编辑

      大家好,我购买了 yukilizard 板(基于 V851S)作为我自己的开发板的基准,我正在尝试让 usb uvcout 演示正常工作,但我遇到了一些问题。
      首先,GC2053 相机工作完美,我已经用camerademo 尝试过,并且确实得到了图像,所以问题不在于此。 我做了本自述文件要求的一切:
      https://github.com/YuzukiHD/Yuzukilizard/tree/master/Software/sunxi-mpp/sample/sample_uvcout
      我删除了 S50usb,配置了 USB uvc 小工具使用的内核,编译并复制了 sample_uvcout 演示到开发板上,并为其创建了一个配置:

      ########### paramter (ref to tulip_cedarx.conf)############
      [parameter]
      uvc_dev = 1
      
      vin_dev = 0
      
      #some encode parameters
      enc_bit_rate = 4194304 # 4M(4194304) 8M(8388608) for mjpeg and h264
      
      cap_format = nv21
      cap_width = 1920
      cap_height = 1080
      cap_frame_rate = 30
      
      encoder_type = mjpeg
      enc_frame_quality = 1
      enc_width = 1920
      enc_height = 1080
      enc_frame_rate = 30
      use_eve = 0
      

      然后,我运行 run_otg 脚本来配置 USB UVC,这似乎确实有点作用,因为 linux 确实报告了一个新的 USB UVC 设备,但系统也报告了 UVC 探测错误:

      root@TinaLinux:/home# ./run_otg
      [   38.452727] file system registered
      [   38.466141] Mass Storage Function, version: 2009/09/11
      [   38.472108] LUN: removable file: (no medium)
      sh: write error: No such device
      rm: can't remove '/sys/kernel/config/usb_gadget/g1/configs/c.1/uvc.usb0': No such file or directory
      [   38.513667] configfs-gadget gadget: uvc_function_bind
      root@TinaLinux:/home# [   38.970716] sunxi_set_cur_vol_work()482 WARN: get power supply failed
      [   39.052572] android_work: sent uevent USB_STATE=CONNECTED
      [   39.058701] sunxi_set_cur_vol_work()482 WARN: get power supply failed
      [   39.158319] configfs-gadget gadget: full-speed config #1: c
      [   39.164561] configfs-gadget gadget: uvc_function_set_alt(0, 0)
      [   39.171083] configfs-gadget gadget: reset UVC Control
      [   39.176747] configfs-gadget gadget: uvc_function_set_alt(1, 0)
      [   39.183344] android_work: sent uevent USB_STATE=CONFIGURED
      sh: write error: Resource busy
      [   44.232236] handle_ep0: ep0 setup end
      [   44.236363] configfs-gadget gadget: uvc_function_set_alt(1, 0)
      [   49.348032] handle_ep0: ep0 setup end
      [   54.467809] handle_ep0: ep0 setup end
      
      root@TinaLinux:/home#
      

      97fd0bb1-586f-48de-a5f3-486b0bbfe1c1-image.png
      但请注意,创建的节点并不是专门针对 UVC 的! 如果我运行 setusbconfig uvc 那么它确实会创建正确的节点:

      root@TinaLinux:/home# setusbconfig uvc
      sh: bulk: unknown operand
      [  159.371427] configfs-gadget gadget: uvc_function_disable
      [  159.377457] android_work: sent uevent USB_STATE=DISCONNECTED
      rm: can't remove '/sys/kernel/co[  159.383997] configfs-gadget gadget: uvc_unbind
      nfig/usb_gadget/g1/functions/uvc.usb0/streaming/header/h/bTriggerUsage': Operation not permitted[  159.405418] android_work: did not send uevent (0 0   (null))
      
      rm: can't remove '/sys/kernel/config/usb_gadget/g1/functions/uvc.usb0/streaming/header/h/bTriggerSupport': Operation not permitted
      rm: can't remove '/sys/kernel/config/usb_gadget/g1/functions/uvc.usb0/streaming/header/h/bStillCaptureMethod': Operation not permitted
      rm: can't remove '/sys/kernel/config/usb_gadget/g1/functions/uvc.usb0/streaming/header/h/bTerminalLink': Operation not permitted
      rm: can't remove '/sys/kernel/config/usb_gadget/g1/functions/uvc.usb0/streaming/header/h/bmInfo': Operation not permitted
      rm: can't remove '/sys/kernel/config/usb_gadget/g1/functions/uvc.usb0/streaming/class/fs': Operation not permitted
      rm: can't remove '/sys/kernel/config/usb_gadget/g1/functions/uvc.usb0/streaming/class/hs': Operation not permitted
      rm: can't remove '/sys/kernel/config/usb_gadget/g1/functions/uvc.usb0/control/class/fs': Operation not permitted
      rm: can't remove '/sys/kernel/config/usb_gadget/g1/functions/uvc.usb0/control/class/ss': Operation not permitted
      rm: can't remove '/sys/kernel/config/usb_gadget/g1/functions/uvc.usb0/streaming/mjpeg/m/720p/bFrameIndex': Operation not permitted
      rm: can't remove '/sys/kernel/config/usb_gadget/g1/functions/uvc.usb0/streaming/mjpeg/m/720p/dwFrameInterval': Operation not permitted
      rm: can't remove '/sys/kernel/config/usb_gadget/g1/functions/uvc.usb0/streaming/mjpeg/m/720p/dwDefaultFrameInterval': Operation not permitted
      rm: can't remove '/sys/kernel/config/usb_gadget/g1/functions/uvc.usb0/streaming/mjpeg/m/720p/dwMaxVideoFrameBufferSize': Operation not permitted
      rm: can't remove '/sys/kernel/config/usb_gadget/g1/functions/uvc.usb0/streaming/mjpeg/m/720p/dwMaxBitRate': Operation not permitted
      rm: can't remove '/sys/kernel/config/usb_gadget/g1/functions/uvc.usb0/streaming/mjpeg/m/720p/dwMinBitRate': Operation not permitted
      rm: can't remove '/sys/kernel/config/usb_gadget/g1/functions/uvc.usb0/streaming/mjpeg/m/720p/wHeight': Operation not permitted
      rm: can't remove '/sys/kernel/config/usb_gadget/g1/functions/uvc.usb0/streaming/mjpeg/m/720p/wWidth': Operation not permitted
      rm: can't remove '/sys/kernel/config/usb_gadget/g1/functions/uvc.usb0/streaming/mjpeg/m/720p/bmCapabilities': Operation not permitted
      rm: can't remove '/sys/kernel/config/usb_gadget/g1/functions/uvc.usb0/streaming/mjpeg/m/bmaControls': Operation not permitted
      rm: can't remove '/sys/kernel/config/usb_gadget/g1/functions/uvc.usb0/streaming/mjpeg/m/bmInterfaceFlags': Operation not permitted
      rm: can't remove '/sys/kernel/config/usb_gadget/g1/functions/uvc.usb0/streaming/mjpeg/m/bAspectRatioY': Operation not permitted
      rm: can't remove '/sys/kernel/config/usb_gadget/g1/functions/uvc.usb0/streaming/mjpeg/m/bAspectRatioX': Operation not permitted
      rm: can't remove '/sys/kernel/config/usb_gadget/g1/functions/uvc.usb0/streaming/mjpeg/m/bmFlags': Operation not permitted
      rm: can't remove '/sys/kernel/config/usb_gadget/g1/functions/uvc.usb0/streaming/mjpeg/m/bDefaultFrameIndex': Operation not permitted
      rm: can't remove '/sys/kernel/config/usb_gadget/g1/functions/uvc.usb0/streaming/mjpeg/m/720p/bFrameIndex': Operation not permitted
      rm: can't remove '/sys/kernel/config/usb_gadget/g1/functions/uvc.usb0/streaming/mjpeg/m/720p/dwFrameInterval': Operation not permitted
      rm: can't remove '/sys/kernel/config/usb_gadget/g1/functions/uvc.usb0/streaming/mjpeg/m/720p/dwDefaultFrameInterval': Operation not permitted
      rm: can't remove '/sys/kernel/config/usb_gadget/g1/functions/uvc.usb0/streaming/mjpeg/m/720p/dwMaxVideoFrameBufferSize': Operation not permitted
      rm: can't remove '/sys/kernel/config/usb_gadget/g1/functions/uvc.usb0/streaming/mjpeg/m/720p/dwMaxBitRate': Operation not permitted
      rm: can't remove '/sys/kernel/config/usb_gadget/g1/functions/uvc.usb0/streaming/mjpeg/m/720p/dwMinBitRate': Operation not permitted
      rm: can't remove '/sys/kernel/config/usb_gadget/g1/functions/uvc.usb0/streaming/mjpeg/m/720p/wHeight': Operation not permitted
      rm: can't remove '/sys/kernel/config/usb_gadget/g1/functions/uvc.usb0/streaming/mjpeg/m/720p/wWidth': Operation not permitted
      rm: can't remove '/sys/kernel/config/usb_gadget/g1/functions/uvc.usb0/streaming/mjpeg/m/720p/bmCapabilities': Operation not permitted
      rm: can't remove '/sys/kernel/config/usb_gadget/g1/functions/uvc.usb0/streaming/mjpeg/m/bmaControls': Operation not permitted
      rm: can't remove '/sys/kernel/config/usb_gadget/g1/functions/uvc.usb0/streaming/mjpeg/m/bmInterfaceFlags': Operation not permitted
      rm: can't remove '/sys/kernel/config/usb_gadget/g1/functions/uvc.usb0/streaming/mjpeg/m/bAspectRatioY': Operation not permitted
      rm: can't remove '/sys/kernel/config/usb_gadget/g1/functions/uvc.usb0/streaming/mjpeg/m/bAspectRatioX': Operation not permitted
      rm: can't remove '/sys/kernel/config/usb_gadget/g1/functions/uvc.usb[  159.826349] configfs-gadget gadget: uvc_function_bind
      0/streaming/mjpeg/m/bmFlags': Operation not permitted
      rm: can't remove '/sys/kernel/config/usb_gadget/g1/functions/uvc.usb0/streaming/mjpeg/m/bDefaultFrameIndex': Operation not permitted
      rm: can't remove '/sys/kernel/config/usb_gadget/g1/functions/uvc.usb0/streaming/uncompressed': Operation not permitted
      sh: bulk: unknown operand
      mkdir: can't create directory 'uvc.usb0': File exists
      root@TinaLinux:/home# [  160.172555] sunxi_set_cur_vol_work()482 WARN: get power supply failed
      [  160.250418] android_work: sent uevent USB_STATE=CONNECTED
      [  160.256501] sunxi_set_cur_vol_work()482 WARN: get power supply failed
      [  160.352246] configfs-gadget gadget: full-speed config #1: c
      [  160.358501] configfs-gadget gadget: uvc_function_set_alt(0, 0)
      [  160.365023] configfs-gadget gadget: reset UVC Control
      [  160.root@TinaLinux:/home# setusbconfig uvc
      sh: bulk: unknown operand
      [  159.371427] configfs-gadget gadget: uvc_function_disable
      [  159.377457] android_work: sent uevent USB_STATE=DISCONNECTED
      rm: can't remove '/sys/kernel/co[  159.383997] configfs-gadget gadget: uvc_unbind
      nfig/usb_gadget/g1/functions/uvc.usb0/streaming/header/h/bTriggerUsage': Operation not permitted[  159.405418] android_work: did not send uevent (0 0   (null))
      
      rm: can't remove '/sys/kernel/config/usb_gadget/g1/functions/uvc.usb0/streaming/header/h/bTriggerSupport': Operation not permitted
      rm: can't remove '/sys/kernel/config/usb_gadget/g1/functions/uvc.usb0/streaming/header/h/bStillCaptureMethod': Operation not permitted
      rm: can't remove '/sys/kernel/config/usb_gadget/g1/functions/uvc.usb0/streaming/header/h/bTerminalLink': Operation not permitted
      rm: can't remove '/sys/kernel/config/usb_gadget/g1/functions/uvc.usb0/streaming/header/h/bmInfo': Operation not permitted
      rm: can't remove '/sys/kernel/config/usb_gadget/g1/functions/uvc.usb0/streaming/class/fs': Operation not permitted
      rm: can't remove '/sys/kernel/config/usb_gadget/g1/functions/uvc.usb0/streaming/class/hs': Operation not permitted
      rm: can't remove '/sys/kernel/config/usb_gadget/g1/functions/uvc.usb0/control/class/fs': Operation not permitted
      rm: can't remove '/sys/kernel/config/usb_gadget/g1/functions/uvc.usb0/control/class/ss': Operation not permitted
      rm: can't remove '/sys/kernel/config/usb_gadget/g1/functions/uvc.usb0/streaming/mjpeg/m/720p/bFrameIndex': Operation not permitted
      rm: can't remove '/sys/kernel/config/usb_gadget/g1/functions/uvc.usb0/streaming/mjpeg/m/720p/dwFrameInterval': Operation not permitted
      rm: can't remove '/sys/kernel/config/usb_gadget/g1/functions/uvc.usb0/streaming/mjpeg/m/720p/dwDefaultFrameInterval': Operation not permitted
      rm: can't remove '/sys/kernel/config/usb_gadget/g1/functions/uvc.usb0/streaming/mjpeg/m/720p/dwMaxVideoFrameBufferSize': Operation not permitted
      rm: can't remove '/sys/kernel/config/usb_gadget/g1/functions/uvc.usb0/streaming/mjpeg/m/720p/dwMaxBitRate': Operation not permitted
      rm: can't remove '/sys/kernel/config/usb_gadget/g1/functions/uvc.usb0/streaming/mjpeg/m/720p/dwMinBitRate': Operation not permitted
      rm: can't remove '/sys/kernel/config/usb_gadget/g1/functions/uvc.usb0/streaming/mjpeg/m/720p/wHeight': Operation not permitted
      rm: can't remove '/sys/kernel/config/usb_gadget/g1/functions/uvc.usb0/streaming/mjpeg/m/720p/wWidth': Operation not permitted
      rm: can't remove '/sys/kernel/config/usb_gadget/g1/functions/uvc.usb0/streaming/mjpeg/m/720p/bmCapabilities': Operation not permitted
      rm: can't remove '/sys/kernel/config/usb_gadget/g1/functions/uvc.usb0/streaming/mjpeg/m/bmaControls': Operation not permitted
      rm: can't remove '/sys/kernel/config/usb_gadget/g1/functions/uvc.usb0/streaming/mjpeg/m/bmInterfaceFlags': Operation not permitted
      rm: can't remove '/sys/kernel/config/usb_gadget/g1/functions/uvc.usb0/streaming/mjpeg/m/bAspectRatioY': Operation not permitted
      rm: can't remove '/sys/kernel/config/usb_gadget/g1/functions/uvc.usb0/streaming/mjpeg/m/bAspectRatioX': Operation not permitted
      rm: can't remove '/sys/kernel/config/usb_gadget/g1/functions/uvc.usb0/streaming/mjpeg/m/bmFlags': Operation not permitted
      rm: can't remove '/sys/kernel/config/usb_gadget/g1/functions/uvc.usb0/streaming/mjpeg/m/bDefaultFrameIndex': Operation not permitted
      rm: can't remove '/sys/kernel/config/usb_gadget/g1/functions/uvc.usb0/streaming/mjpeg/m/720p/bFrameIndex': Operation not permitted
      rm: can't remove '/sys/kernel/config/usb_gadget/g1/functions/uvc.usb0/streaming/mjpeg/m/720p/dwFrameInterval': Operation not permitted
      rm: can't remove '/sys/kernel/config/usb_gadget/g1/functions/uvc.usb0/streaming/mjpeg/m/720p/dwDefaultFrameInterval': Operation not permitted
      rm: can't remove '/sys/kernel/config/usb_gadget/g1/functions/uvc.usb0/streaming/mjpeg/m/720p/dwMaxVideoFrameBufferSize': Operation not permitted
      rm: can't remove '/sys/kernel/config/usb_gadget/g1/functions/uvc.usb0/streaming/mjpeg/m/720p/dwMaxBitRate': Operation not permitted
      rm: can't remove '/sys/kernel/config/usb_gadget/g1/functions/uvc.usb0/streaming/mjpeg/m/720p/dwMinBitRate': Operation not permitted
      rm: can't remove '/sys/kernel/config/usb_gadget/g1/functions/uvc.usb0/streaming/mjpeg/m/720p/wHeight': Operation not permitted
      rm: can't remove '/sys/kernel/config/usb_gadget/g1/functions/uvc.usb0/streaming/mjpeg/m/720p/wWidth': Operation not permitted
      rm: can't remove '/sys/kernel/config/usb_gadget/g1/functions/uvc.usb0/streaming/mjpeg/m/720p/bmCapabilities': Operation not permitted
      rm: can't remove '/sys/kernel/config/usb_gadget/g1/functions/uvc.usb0/streaming/mjpeg/m/bmaControls': Operation not permitted
      rm: can't remove '/sys/kernel/config/usb_gadget/g1/functions/uvc.usb0/streaming/mjpeg/m/bmInterfaceFlags': Operation not permitted
      rm: can't remove '/sys/kernel/config/usb_gadget/g1/functions/uvc.usb0/streaming/mjpeg/m/bAspectRatioY': Operation not permitted
      rm: can't remove '/sys/kernel/config/usb_gadget/g1/functions/uvc.usb0/streaming/mjpeg/m/bAspectRatioX': Operation not permitted
      rm: can't remove '/sys/kernel/config/usb_gadget/g1/functions/uvc.usb[  159.826349] configfs-gadget gadget: uvc_function_bind
      0/streaming/mjpeg/m/bmFlags': Operation not permitted
      rm: can't remove '/sys/kernel/config/usb_gadget/g1/functions/uvc.usb0/streaming/mjpeg/m/bDefaultFrameIndex': Operation not permitted
      rm: can't remove '/sys/kernel/config/usb_gadget/g1/functions/uvc.usb0/streaming/uncompressed': Operation not permitted
      sh: bulk: unknown operand
      mkdir: can't create directory 'uvc.usb0': File exists
      root@TinaLinux:/home# [  160.172555] sunxi_set_cur_vol_work()482 WARN: get power supply failed
      [  160.250418] android_work: sent uevent USB_STATE=CONNECTED
      [  160.256501] sunxi_set_cur_vol_work()482 WARN: get power supply failed
      [  160.352246] configfs-gadget gadget: full-speed config #1: c
      [  160.358501] configfs-gadget gadget: uvc_function_set_alt(0, 0)
      [  160.365023] configfs-gadget gadget: reset UVC Control
      [  160.370690] configfs-gadget gadget: uvc_function_set_alt(1, 0)
      [  160.377404] android_work: sent uevent USB_STATE=CONFIGURED
      [  165.566125] handle_ep0: ep0 setup end
      [  165.570253] configfs-gadget gadget: uvc_function_set_alt(1, 0)
      [  170.685884] handle_ep0: ep0 setup end
      [  175.805665] handle_ep0: ep0 setup end
      370690] configfs-gadget gadget: uvc_function_set_alt(1, 0)
      [  160.377404] android_work: sent uevent USB_STATE=CONFIGURED
      [  165.566125] handle_ep0: ep0 setup end
      [  165.570253] configfs-gadget gadget: uvc_function_set_alt(1, 0)
      [  170.685884] handle_ep0: ep0 setup end
      [  175.805665] handle_ep0: ep0 setup end
      
      root@TinaLinux:/home#
      

      3ac4d2da-3fe8-4282-87cf-2331510ddd07-image.png

      ./sample_uvcout -path ./sample_uvcout.conf --width 1920 --
      height 1080 --framerate 30 --device 0
      

      此时,如果我尝试使用我的配置运行sample_uvcout,它可以工作,但客户端没有任何反应(PC 上没有创建视频节点)

      root@TinaLinux:/home# ./sample_uvcout -path ./sample_uvcout.conf --width 1920 --
      eight 1080 --framerate 30 --device 0WARNING: Logging before InitGoogleLogging() is written to STDERR
      I0101 02:01:55.038077  1402 dup2SeldomUsedFd.c:20]          <dup2SeldomUsedFdInit> gFdLock init
      I0101 02:01:55.053476  1402 sample_uvcout.c:1616]           <main> sample_uvcout running!
      I0101 02:01:55.059839  1402 sample_uvcout.c:1541]           <ParseCmdLine> path is [./sample_uvcout.conf]
      I0101 02:01:55.060048  1402 sample_uvcout.c:1549]           <ParseCmdLine> width is [1920]
      I0101 02:01:55.061297  1402 confparser.c:60]                <createConfParser> load conf file ./sample_uvcout.conf ok!
      I0101 02:01:55.061518  1402 sample_uvcout.c:1501]           <LoadSampleUVCConfig> UVCDev=1,CapDev=0,CapWidth=1920,CapHeight=0,CapFrmRate=30,EncBitRate=4194304,        EncWidth=0,EncHeight=0,EncFrmRate=30,quality=99
      I0101 02:01:55.061647  1402 sample_uvcout.c:108]            <OpenUVCDevice> open uvc device[/dev/video1]
      I0101 02:01:55.061804  1402 sample_uvcout.c:119]            <OpenUVCDevice> device is sunxi_usb_udc on bus gadget
      

      7e525958-bf92-487b-a19f-c254663c743f-image.png

      知道这里可能出了什么问题吗?

      1 条回复 最后回复 回复 引用 分享 0
      • kanken6174
        kanken6174 LV 6 最后由 编辑

        在我的主机上重新加载 uvcvideo 内核模块后,成功找到了新的视频节点...串行日志中发生了很多事情,似乎板载 ISP 出现了一些问题,以及一些内存问题。
        我可能会尝试删除 tmpfs 以获得完整的 64mb 内存可用。 日志附后。
        isp.log

        1 条回复 最后回复 回复 引用 分享 0
        • kanken6174
          kanken6174 LV 6 最后由 编辑

          我已经取得了一些进展,我已在此处附加了我的开发日志,流现在开始,但 ISP 完全崩溃了......?
          devlog.md

          1 条回复 最后回复 回复 引用 分享 0
          • kanken6174
            kanken6174 LV 6 最后由 编辑

            这是 ISP 疯狂的一瞥,这是我首先调用camerademo,然后调用sample_uvcout的时候
            Screencast from 08-01-2024 22:53:55.webm

            1 条回复 最后回复 回复 引用 分享 0
            • 1 / 1
            • First post
              Last post

            Copyright © 2024 深圳全志在线有限公司 粤ICP备2021084185号 粤公网安备44030502007680号

            行为准则 | 用户协议 | 隐私权政策