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.

[参考译文] PROCESSOR-SDK-AM62X:v4l2-ctl 设置在具有 MIPI 摄像头的 SDK v9.2上不可用

Guru**** 2540720 points
Other Parts Discussed in Thread: AM625

请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

https://e2e.ti.com/support/processors-group/processors/f/processors-forum/1353042/processor-sdk-am62x-v4l2-ctl-setting-not-available-on-sdk-v9-2-with-mipi-camera

器件型号:PROCESSOR-SDK-AM62X
主题中讨论的其他器件:AM625

大家好、

我想使用 v4l2-ctl 命令更改 MIPI 摄像头设置、但会出现错误、因此无法应用这些设置。

root@am62xx-evm:~# v4l2-ctl -L
root@am62xx-evm:~#

root@am62xx-evm:~# v4l2-ctl -P
VIDIOC_G_PARM: failed: Inappropriate ioctl for device

root@am62xx-evm:~# v4l2-ctl -d /dev/video0 -p 60
VIDIOC_S_PARM: failed: Inappropriate ioctl for device

我使用 MIPI 确认了实时图像流、但无法使用 gst-launch 命令进行流式传输

gst-launch-1.0 -v v4l2src device="/dev/video0"  ! "image/jpeg, width=640, height=480, framerate=(fraction)60/1" ! jpegdec ! videoconvert !  fpsdisplaysink 
是否可以在此 SDK 版本上更改这些设置?

我想以 VGA 分辨率、60fps 和 YUV 格式流式传输图像。

我的环境如下。

电路板类型:AM625

SDK:09.02.01.09,带 Linux。

构建于 VMware 中安装的 ubusbundu22.02

摄像机:PCAM 5C MIPI 接口

提前感谢您。

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    尊敬的 Nakanishi-San:

    您是否按照学院中提供的步骤查询 CSI-2传感器和更改摄像头参数? 以下链接中提到了相关步骤:

    https://dev.ti.com/tirex/explore/node?node=A__AEIJm0rwIeU.2P1OBWwlaA__AM62-ACADEMY__uiYMDcq__LATEST

    Linux ->在 TI EVM 上开发 Linux ->使用摄像头

    我在 AM62x 上连接了 OV5640摄像头、并执行以下步骤来查看正在显示的摄像头捕捉:

    media-ctl -d /dev/media0 -p
    v4l2-ctl -d /dev/v4l-subdev2 --list-subdev-mbus-codes pad=0
    v4l2-ctl -d /dev/v4l-subdev2 --list-subdev-framesizes pad=0,code=0x200f
    media-ctl --set-v4l2 "'ov5640 4-003c':0 [fmt:UYVY8_1X16/1920x1080@1/30 field:none]"
    systemctl stop weston
    gst-launch-1.0 -v v4l2src device=/dev/video0 ! video/x-raw, format=1920, height=1080, format=UYVY, framerate=30/1 ! kmssink driver-name=tidss sync=false force-modesetting=true

    希望这对您有所帮助

    此致、

    苏伦

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    尊敬的 Suren:

    实际上、我在 https://dev.ti.com/tirex/explore/node?node=A__Afvqyi8mUm05676JZJ-UlQ__AM62-ACADEMY__uiYMDcq__LATEST 中找不到描述的"ti/k3-am625-sk-csi2-ov5640.dtbo"、而是使用了"k3-am62x-sk-csi2-ov5640.dtbo"、如

    =>setenv name_overlays ti/k3-am62x-sk-csi2-ov5640.dtbo
    => saveenv
    Unknown command 'saveenv' - try 'help'
    =>boot

    我注意到"saveenv"在 U-Boot 提示符下不可用。

    然后我尝试了你的过程,结果如下。

    root@am62xx-evm:~# media-ctl -d /dev/media0 -p
    Media controller API version 6.1.80
    
    Media device information
    ------------------------
    driver          j721e-csi2rx
    model           TI-CSI2RX
    serial          
    bus info        platform:30102000.ticsi2rx
    hw revision     0x1
    driver version  6.1.80
    
    Device topology
    - entity 1: 30102000.ticsi2rx (5 pads, 0 link, 0 route)
                type V4L2 subdev subtype Unknown flags 0
            pad0: Sink
            pad1: Source
            pad2: Source
            pad3: Source
            pad4: Source
    
    root@am62xx-evm:~# v4l2-ctl -d /dev/v4l-subdev2 --list-subdev-mbus-codes pad=0
    Cannot open device /dev/v4l-subdev2, exiting.
    root@am62xx-evm:~# v4l2-ctl -d /dev/v4l-subdev2 --list-subdev-framesizes pad=0,code=0x200f
    Cannot open device /dev/v4l-subdev2, exiting.
    root@am62xx-evm:~# media-ctl --set-v4l2 "'ov5640 4-003c':0 [fmt:UYVY8_1X16/1920x1080@1/30 field:none]"
    Unable to setup formats: Invalid argument (22)
    root@am62xx-evm:~# systemctl stop weston
    Warning: Stopping weston.service, but it can still be activated by:
      weston.socket
    root@am62xx-evm:~# v4l2-ctl -d /dev/v4l-subdev2 --list-subdev-framesizes pad=0,code=0x200f
    Cannot open device /dev/v4l-subdev2, exiting.
    root@am62xx-evm:~# gst-launch-1.0 -v v4l2src device=/dev/video0 ! video/x-raw, format=1920, height=1080, format=UYVY, framerate=30/1 ! kmssink driver-name=tidss sync=false force-modesetting=true
    Setting pipeline to PAUSED ...
    ERROR: from element /GstPipeline:pipeline0/GstV4l2Src:v4l2src0: Cannot identify device '/dev/video0'.
    Additional debug info:
    ../gst-plugins-good-1.20.7/sys/v4l2/v4l2_calls.c(608): gst_v4l2_open (): /GstPipeline:pipeline0/GstV4l2Src:v4l2src0:
    system error: No such file or directory
    ERROR: pipeline doesn't want to preroll.
    Failed to set pipeline to PAUSED.
    Setting pipeline to NULL ...
    Freeing pipeline ...
    

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    我尝试了"setenv name_overlays k3-am62x-sk-csi2-ov5640.dtbo"、MIPI 才起作用。

    我做了你的步骤,下面的日志

    root@am62xx-evm:~# media-ctl -d /dev/media0 -p
    Media controller API version 6.1.80
     
    Media device information
    ------------------------
    driver          j721e-csi2rx
    model           TI-CSI2RX
    serial         
    bus info        platform:30102000.ticsi2rx
    hw revision     0x1
    driver version  6.1.80
     
    Device topology
    - entity 1: 30102000.ticsi2rx (5 pads, 5 links, 1 route)
               type V4L2 subdev subtype Unknown flags 0
               device node name /dev/v4l-subdev0
           routes:
                   0/0 -> 1/0 [ACTIVE]
           pad0: Sink
                   [stream:0 fmt:UYVY8_1X16/640x480 field:none colorspace:srgb xfer:srgb ycbcr:601 quantization:lim-range]
                   <- "cdns_csi2rx.30101000.csi-bridge":1 [ENABLED,IMMUTABLE]
           pad1: Source
                   [stream:0 fmt:UYVY8_1X16/640x480 field:none colorspace:srgb xfer:srgb ycbcr:601 quantization:lim-range]
                   -> "30102000.ticsi2rx context 0":0 [ENABLED,IMMUTABLE]
           pad2: Source
                   -> "30102000.ticsi2rx context 1":0 [ENABLED,IMMUTABLE]
           pad3: Source
                   -> "30102000.ticsi2rx context 2":0 [ENABLED,IMMUTABLE]
           pad4: Source
                   -> "30102000.ticsi2rx context 3":0 [ENABLED,IMMUTABLE]
     
    - entity 7: cdns_csi2rx.30101000.csi-bridge (5 pads, 2 links, 1 route)
               type V4L2 subdev subtype Unknown flags 0
               device node name /dev/v4l-subdev1
           routes:
                   0/0 -> 1/0 [ACTIVE]
           pad0: Sink
                   [stream:0 fmt:UYVY8_1X16/640x480 colorspace:srgb xfer:srgb ycbcr:601 quantization:full-range]
                   <- "ov5640 4-003c":0 [ENABLED,IMMUTABLE]
           pad1: Source
                   [stream:0 fmt:UYVY8_1X16/640x480 colorspace:srgb xfer:srgb ycbcr:601 quantization:full-range]
                   -> "30102000.ticsi2rx":0 [ENABLED,IMMUTABLE]
           pad2: Source
           pad3: Source
           pad4: Source
     
    - entity 13: ov5640 4-003c (1 pad, 1 link, 0 route)
                type V4L2 subdev subtype Sensor flags 0
                device node name /dev/v4l-subdev2
           pad0: Source
                   [stream:0 fmt:UYVY8_1X16/640x480@1/30 colorspace:srgb xfer:srgb ycbcr:601 quantization:full-range
                    crop.bounds:(0,0)/2624x1964
                    crop:(16,14)/2592x1944]
                   -> "cdns_csi2rx.30101000.csi-bridge":0 [ENABLED,IMMUTABLE]
     
    - entity 19: 30102000.ticsi2rx context 0 (1 pad, 1 link, 0 route)
                type Node subtype V4L flags 0
                device node name /dev/video0
           pad0: Sink
                   <- "30102000.ticsi2rx":1 [ENABLED,IMMUTABLE]
     
    - entity 25: 30102000.ticsi2rx context 1 (1 pad, 1 link, 0 route)
                type Node subtype V4L flags 0
                device node name /dev/video1
           pad0: Sink
                   <- "30102000.ticsi2rx":2 [ENABLED,IMMUTABLE]
     
    - entity 31: 30102000.ticsi2rx context 2 (1 pad, 1 link, 0 route)
                type Node subtype V4L flags 0
                device node name /dev/video2
           pad0: Sink
                   <- "30102000.ticsi2rx":3 [ENABLED,IMMUTABLE]
     
    - entity 37: 30102000.ticsi2rx context 3 (1 pad, 1 link, 0 route)
                type Node subtype V4L flags 0
                device node name /dev/video3
           pad0: Sink
                   <- "30102000.ticsi2rx":4 [ENABLED,IMMUTABLE]
     
    root@am62xx-evm:~# v4l2-ctl -d /dev/v4l-subdev2 --list-subdev-mbus-codes pad=0
    ioctl: VIDIOC_SUBDEV_ENUM_MBUS_CODE (pad=0,stream=0)
           0x4001: MEDIA_BUS_FMT_JPEG_1X8
           0x200f: MEDIA_BUS_FMT_UYVY8_1X16
           0x2011: MEDIA_BUS_FMT_YUYV8_1X16
           0x1017: MEDIA_BUS_FMT_RGB565_1X16
           0x1013: MEDIA_BUS_FMT_BGR888_1X24
           0x3001: MEDIA_BUS_FMT_SBGGR8_1X8
           0x3013: MEDIA_BUS_FMT_SGBRG8_1X8
           0x3002: MEDIA_BUS_FMT_SGRBG8_1X8
           0x3014: MEDIA_BUS_FMT_SRGGB8_1X8
    root@am62xx-evm:~# v4l2-ctl -d /dev/v4l-subdev2 --list-subdev-framesizes pad=0,code=0x200f
    ioctl: VIDIOC_SUBDEV_ENUM_FRAME_SIZE (pad=0,stream=0)
           Size Range: 160x120 - 160x120
           Size Range: 176x144 - 176x144
           Size Range: 320x240 - 320x240
           Size Range: 640x480 - 640x480
           Size Range: 720x480 - 720x480
           Size Range: 720x576 - 720x576
           Size Range: 1024x768 - 1024x768
           Size Range: 1280x720 - 1280x720
           Size Range: 1920x1080 - 1920x1080
           Size Range: 2592x1944 - 2592x1944
    root@am62xx-evm:~# media-ctl --set-v4l2 "'ov5640 4-003c':0 [fmt:UYVY8_1X16/1920x1080@1/30 field:none]"
    root@am62xx-evm:~# systemctl stop weston
    Warning: Stopping weston.service, but it can still be activated by:
     weston.socket
    root@am62xx-evm:~# gst-launch-1.0 -v v4l2src device=/dev/video0 ! video/x-raw, format=1920, height=1080, format=UYVY, framerate=30/1 ! kmssink driver-name=tidss sync=false force-modesetting=true
    Setting pipeline to PAUSED ...
    Pipeline is live and does not need PREROLL ...
    /GstPipeline:pipeline0/GstKMSSink:kmssink0: display-width = 1920
    /GstPipeline:pipeline0/GstKMSSink:kmssink0: display-height = 1080
    Pipeline is PREROLLED ...
    Setting pipeline to PLAYING ...
    /GstPipeline:pipeline0/GstV4l2Src:v4l2src0.GstPad:src: caps = video/x-raw, format=(string)UYVY, height=(int)1080, framerate=(fraction)30/1, width=(int)1920, interlace-mode=(string)progressive, colorimetry=(string)bt709
    New clock: GstSystemClock
    /GstPipeline:pipeline0/GstCapsFilter:capsfilter0.GstPad:src: caps = video/x-raw, format=(string)UYVY, height=(int)1080, framerate=(fraction)30/1, width=(int)1920, interlace-mode=(string)progressive, colorimetry=(string)bt709
    /GstPipeline:pipeline0/GstKMSSink:kmssink0.GstPad:sink: caps = video/x-raw, format=(string)UYVY, height=(int)1080, framerate=(fraction)30/1, width=(int)1920, interlace-mode=(string)progressive, colorimetry=(string)bt709
    /GstPipeline:pipeline0/GstCapsFilter:capsfilter0.GstPad:sink: caps = video/x-raw, format=(string)UYVY, height=(int)1080, framerate=(fraction)30/1, width=(int)1920, interlace-mode=(string)progressive, colorimetry=(string)bt709
    Redistribute latency...
    0:00:05.3 / 99:99:99.

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    尊敬的 Suren:

    我想要 YUV 格式的60fps 实时图像。

    我确认存在 MIPI 摄像头实体。

    - entity 13: ov5640 4-003c (1 pad, 1 link, 0 route)
                 type V4L2 subdev subtype Sensor flags 0
                 device node name /dev/v4l-subdev2
            pad0: Source
                    [stream:0 fmt:UYVY8_1X16/640x480@1/60 field:none colorspace:srgb xfer:srgb ycbcr:601 quantization:full-range
                     crop.bounds:(0,0)/2624x1964
                     crop:(16,14)/2592x1944]
                    -> "cdns_csi2rx.30101000.csi-bridge":0 [ENABLED,IMMUTABLE]

    我按如下所示更改了设置、但它不起作用。

    v4l2-ctl -d /dev/v4l-subdev2 --set-subdev-fps pad=0,fps=60
       "  --set-subdev-fps pad=<pad>,fps=<fps> (for testing only, otherwise use media-ctl)\n"
           "                     set the frame rate [VIDIOC_SUBDEV_S_FRAME_INTERVAL]\n"
     
     
    media-ctl --set-v4l2 "'ov5640 4-003c':0 [fmt:UYVY8_1X16/640x480@1/60 field:none]"
    

    设置这些属性后、我尝试了以下命令、但它将帧速率限制在30 fps。

    gst-launch-1.0 -v v4l2src device=/dev/video0 ! video/x-raw, width=640,height=480,framerate=60/1, pixel-aspect-ratio=1/1,format=UYVY ! queue ! fpsdisplaysink

    是否有将帧速率设置为60的最佳方法?

    我想以 VGA 分辨率、60fps 和 YUV 格式流式传输图像。

    不知道您能否 在这种条件下演示流式传输。

    此致、
    中西

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    尊敬的 Nakanishi-San:  

    很抱歉耽误了我们的时间。

    驱动程序中 VGA 的 OV5640默认设置为30fps、因此无法实现60fps 的帧速率。

    https://github.com/torvalds/linux/blob/master/drivers/media/i2c/ov5640.c#L3866

    请修改驱动程序以设置为60fps、并尝试一下、看看它是否有帮助。

    此致、

    苏伦

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    尊敬的 Suren:

    我试图修改 ov5640驱动程序像这样的链接,但当该更改应用时, AM625无法识别 MIPI 相机。

    这里是驱动程序文件。

    tisdk/build/arago-tmp-default-glibc/work/am62xx_evm-OE-linux/linux-ti-staging/6.1.80+gitAUTOINC+2e423244f8-r0b.arago5_tisdk_3_edgeai_0_edgeai_8/git/drivers/media/5640.c.c

    和二进制文件为:tisdk/build/Arago-tmp-default-glibc/work/am62xx_evm-OE-linux/linux-ti-staging/6.1.80+gitAUTOINC+2e423244f8-r0b.arago5_tisdk_3_edgeai_0_edgeai_8/build/drivers/media/5640.2c/media/5640.2c

    我已将其复制到/lib/modules/6.1.80-ti-g2e423244f8c0/kernel/drivers/media/i2c.

    在做这件事的时候,我尝试了一下

    root@am62xx-evm:~# media-ctl -d /dev/media0 -p
    Media controller API version 6.1.80
    
    Media device information
    ------------------------
    driver          j721e-csi2rx
    model           TI-CSI2RX
    serial          
    bus info        platform:30102000.ticsi2rx
    hw revision     0x1
    driver version  6.1.80
    
    Device topology
    - entity 1: 30102000.ticsi2rx (5 pads, 0 link, 0 route)
                type V4L2 subdev subtype Unknown flags 0
            pad0: Sink
            pad1: Source
            pad2: Source
            pad3: Source
            pad4: Source
    
    - entity 7: cdns_csi2rx.30101000.csi-bridge (5 pads, 0 link, 0 route)
                type V4L2 subdev subtype Unknown flags 0
            pad0: Sink
            pad1: Source
            pad2: Source
            pad3: Source
            pad4: Source

    我是否必须修改其他行?


  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    如果需要任何其他更改、我将与我的同事核实。 请允许一天/两天进行回复。

    此致、

    苏伦

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    请浏览此上游讨论: https://lore.kernel.org/all/2wjwwyg2y42vse6vj6376vzruieb4c7e6ruw5de4ivc42bonvz@jmruiyfr4wo4/。为 ov5640启用60fps 不仅仅是更改这条线。 您需要咨询 Omnivision 以了解如何正确操作。