RV1106 MAX 双摄配置 两个I2C挂载摄像头

  • rkisp-vir0: check rkisp_selfpath link or isp input 单独使用I2C3 挂载摄像头出现rkisp-vir0: check rkisp_selfpath link or isp input这个问题应该怎么解决
    Last edited by JHD123456789 on 2025-05-13 12:19, edited 1 time in total.
  • 您好,双摄工作时ISP共用同一个VI通道,不能通过v4l2去视频流,需要通过rockit框架获取,相关的命令是 sample_multi_vi
  • Crocodile wrote: 2025-05-14 1:17 您好,双摄工作时ISP共用同一个VI通道,不能通过v4l2去视频流,需要通过rockit框架获取,相关的命令是 sample_multi_vi
    可我将 I2C4的通道关闭了 i2c3打开,发现check rkisp_mainpath link or isp input 这种问题 ,
  • 请先确定单摄像头可以正常工作,cif 到 rkisp_vir 的节点也要配置成单摄的,参考我们提供的配置
  • Crocodile wrote: 2025-05-14 2:50 请先确定单摄像头可以正常工作,cif 到 rkisp_vir 的节点也要配置成单摄的,参考我们提供的配置
    &csi2_dphy_hw {
    status = "okay";
    };

    &csi2_dphy2 {
    status = "okay";

    ports {
    #address-cells = <1>;
    #size-cells = <0>;

    port@0 {
    reg = <0>;
    #address-cells = <1>;
    #size-cells = <0>;

    csi_dphy2_input2: endpoint@2 {
    reg = <2>;
    remote-endpoint = <&ov9281_1_out>;
    data-lanes = <3 4>;
    };

    };

    port@1 {
    reg = <1>;
    #address-cells = <1>;
    #size-cells = <0>;

    csi_dphy_output1: endpoint@0 {
    reg = <0>;
    remote-endpoint = <&mipi1_csi2_input>;
    };
    };
    };
    };

    &i2c3 {
    status = "okay";
    clock-frequency = <400000>;
    pinctrl-names = "default";
    pinctrl-0 = <&i2c3m2_xfer>;


    ov9281_1: ov9281_1@70 {
    compatible = "ovti,ov9281";
    status = "okay";
    reg = <0x70>;
    pinctrl-names = "default";
    pinctrl-0 = <&mipi_refclk_out1>;
    pwdn-gpios = <&gpio3 RK_PC5 GPIO_ACTIVE_HIGH>;
    clocks = <&cru MCLK_REF_MIPI1>;
    clock-names = "xvclk";
    rockchip,camera-module-index = <0>;
    rockchip,camera-module-facing = "back";
    rockchip,camera-module-name = "CMK-OT2119-PC1";
    rockchip,camera-module-lens-name = "30IRC-F16";
    port {
    ov9281_1_out: endpoint {
    remote-endpoint = <&csi_dphy2_input2>;
    data-lanes = <3 4 >;
    };
    };
    };
    };

    &mipi1_csi2 {
    status = "okay";

    ports {
    #address-cells = <1>;
    #size-cells = <0>;

    port@0 {
    reg = <0>;
    #address-cells = <1>;
    #size-cells = <0>;

    mipi1_csi2_input: endpoint@1 {
    reg = <1>;
    remote-endpoint = <&csi_dphy_output1>;
    };
    };

    port@1 {
    reg = <1>;
    #address-cells = <1>;
    #size-cells = <0>;

    mipi1_csi2_output: endpoint@0 {
    reg = <0>;
    remote-endpoint = <&cif_mipi_in1>;
    };
    };
    };
    };

    &rkcif {
    status = "okay";
    pinctrl-names = "default";
    pinctrl-0 = <&mipi_pins>;
    };

    &rkcif_mipi_lvds_sditf {
    status = "okay";

    port {
    /* MIPI CSI-2 endpoint */
    mipi_lvds_sditf: endpoint {
    remote-endpoint = <&isp_in>;
    };
    };
    };

    &rkcif_mipi_lvds1 {
    status = "okay";

    port {
    /* MIPI CSI-2 endpoint */
    cif_mipi_in1: endpoint {
    remote-endpoint = <&mipi1_csi2_output>;
    };
    };
    };

    &rkisp {
    status = "okay";
    };

    &rkisp_vir0 {
    status = "okay";

    port@0 {
    isp_in: endpoint {
    remote-endpoint = <&mipi_lvds_sditf>;
    };
    };
    };
    配置文件是这样,我用video 1 取CIF 图没问题 ,但是就是不能用video11 过ISP 错误就是 rkisp-vir0: check rkisp_selfpath link or isp input
  • 设备树的配置需要您自己确定,您适配的摄像头不是我们支持的摄像头,我无法保证我的建议不会误导您的开发方向,比较明显的问题就是data-lane的配置不是 3 4 而是 1 2, csi2_dphy1 的 data-lane 对应 MIPI_D0 MIPI_D1, csi2_dphy2 的 data-lane 对应 MIPI_D2 MIPI_D3
  • Crocodile wrote: 2025-05-14 3:34 设备树的配置需要您自己确定,您适配的摄像头不是我们支持的摄像头,我无法保证我的建议不会误导您的开发方向,比较明显的问题就是data-lane的配置不是 3 4 而是 1 2, csi2_dphy1 的 data-lane 对应 MIPI_D0 MIPI_D1, csi2_dphy2 的 data-lane 对应 MIPI_D2 MIPI_D3
    感谢你我i2c3 上添加设备跑通了 利用video11 跑数据
    [root@luckfox ]# v4l2-ctl --device=/dev/video11 --set-fmt-video=width=640,height=480,pixelformat=NV12 --stream-mmap --stream-to=video50.yuv --stream-count=30
    <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
    [root@luckfox ]# v4l2-ctl --device=/dev/video11 --set-fmt-video=width=640,height=480,pixelformat=NV12 --stream-mmap --stream-to=video50.yuv --stream-count=30
    <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<

    问题又来了 ,RKLUNCH.SH 他走不了了,无法推流到VLC 上 ,以下是运行RKLUNCH.SH 的错误
    RKViChn 12:19:54-675 {prepareRuntime :336} vi version: 1.86, name:vvi
    RKViChn 12:19:54-676 {prepareRuntime :337} rockit-ko version: vmpi:fb2eed2be49e
    RKViChn 12:19:54-677 {prepareRuntime :338} rockit-ko building: -2023-02-09-11:04:49
    RKViChn 12:19:54-677 {prepareRuntime :339} ---------------------------------------------------------
    RKViChn 12:19:54-682 {prepareRuntime :358} mb pool create success, MBCnt= 2
    cmpi 12:19:54-683 {createRuntime :546} [non-WRAP MODE]: buff size = 1536000
    RTIsp3x 12:19:54-687 {ispInitDevice :208} sensor name = m00_b_ov9281 3-0070
    RTIsp3x 12:19:54-687 {ispInitDevice :211} sensor_index = 0
    RTDeviceV4L2 12:19:54-691 {open :138} open video name(/dev/video11)
    RKViChn 12:19:54-691 {setFrameRate :1153} [vi] dev(0) ch(0) illegal param s32SrcFrameRate(0) s32DstFrameRate(0)
    RTDeviceV4L2 12:19:54-693 {ispCameraInfo :549} current device:/dev/video11 isn't compatible(cap:0x84201000) device,memoryType:4, retry:0
    RTDeviceV4L2 12:19:54-694 {ispInitFormat :726} ioctl VIDIOC_S_FMT OK
    RKViChn 12:19:54-695 {start :813} =========== vi Start startRuntime ===========
    RTDeviceV4L2 12:19:54-695 {ispStreamOn :440} do ispStreamOn start
    RTDeviceV4L2 12:19:54-696 {ispIOCtrl :409} request 1074026002, err resion:Invalid argument err:-1
    RTDeviceV4L2 12:19:54-697 {ispStreamOn :489} failed to ioctl stream On(request=1074026002)
    [video.c][rkipc_pipe_0_init]:ERROR: create VI error! ret=-1
    不好意思 呀 一下问题很多,打扰到你了
  • Crocodile wrote: 2025-05-14 1:17 您好,双摄工作时ISP共用同一个VI通道,不能通过v4l2去视频流,需要通过rockit框架获取,相关的命令是 sample_multi_vi
    你好我按照你的命令来出现以下错误,我两个摄像头取原始数据RAW 都是正确的,摄像头驱动都是好的
    [root@luckfox ]# sample_multi_vi -w 400 -h 400 -a /etc/iqfiles/ -n 2 -l 10 -o /data/
    #CameraNum: 2
    #Output Path: /data/
    #IQ Path: /etc/iqfiles/
    #Rkaiq XML DirPath: /etc/iqfiles/
    #bMultictx: 0

    rkaiq log level ff0
    CamGroupId:0, cam_id: 0, sensor_name is m00_b_ov9281 4-0070, iqfiles is /etc/iqfiles/
    pCamGroupCfg->sns_ent_nm_array[0] is m00_b_ov9281 4-0070
    CamGroupId:0, cam_id: 1, sensor_name is m01_b_ov9281 3-0070, iqfiles is /etc/iqfiles/
    pCamGroupCfg->sns_ent_nm_array[1] is m01_b_ov9281 3-0070
    create camgroup ctx error!
    rockit log path (null), log_size = 0, can use export rt_log_path=, export rt_log_size= change
    log_file = (nil)
    RTVersion 12:00:38-030 {dump :064} ---------------------------------------------------------
    RTVersion 12:00:38-033 {dump :065} rockit version: git-8cb4d25b8 Tue Feb 28 11:12:39 2023 +0800
    RTVersion 12:00:38-033 {dump :066} rockit building: built- 2023-02-28 15:23:19
    RTVersion 12:00:38-033 {dump :067} ---------------------------------------------------------
    rockit default level 4, can use export rt_log_level=x, x=0,1,2,3,4,5,6 change
    (null) 12:00:38-033 {read_log_level :093} text is all=4
    (null) 12:00:38-034 {read_log_level :095} module is all, log_level is 4
    (null) 12:00:38-037 {monitor_log_level :144} #Start monitor_log_level thread, arg:(nil)
    RTIsp3x 12:00:38-052 {ispInitDevice :208} sensor name = m00_b_ov9281 4-0070
    RTIsp3x 12:00:38-054 {ispInitDevice :211} sensor_index = 0
    RTIsp3x 12:00:38-059 {ispInitDevice :208} sensor name = m01_b_ov9281 3-0070
    RTIsp3x 12:00:38-060 {ispInitDevice :211} sensor_index = 1
    RTIsp3x 12:00:38-067 {ispInitDevice :208} sensor name = m00_b_ov9281 4-0070
    RTIsp3x 12:00:38-068 {ispInitDevice :211} sensor_index = 0
    RTIsp3x 12:00:38-073 {ispInitDevice :208} sensor name = m01_b_ov9281 3-0070
    RTIsp3x 12:00:38-075 {ispInitDevice :211} sensor_index = 1
    RKViDev 12:00:38-086 {vi_set_dev_attr :440} VI_DEV_ATTR_S all parameter reserved
    === VI ATTRS INFO: ===
    devId : 0
    chnId : 0
    buffcnt: 0
    buffSize: 0
    width: 0
    height: 0
    Maxwidth: 0
    Maxwidth: 0
    streaming: 0
    RKViChn 12:00:38-099 {prepareRuntime :334} ---------------------------------------------------------
    RKViChn 12:00:38-099 {prepareRuntime :336} vi version: 1.98, name:vvi
    RKViChn 12:00:38-099 {prepareRuntime :337} rockit-ko version: vmpi:fb2eed2be49e
    RKViChn 12:00:38-099 {prepareRuntime :338} rockit-ko building: -2023-02-09-11:04:49
    RKViChn 12:00:38-099 {prepareRuntime :339} ---------------------------------------------------------
    RKViChn 12:00:38-104 {prepareRuntime :358} mb pool create success, MBCnt= 2
    cmpi 12:00:38-106 {createRuntime :546} [non-WRAP MODE]: buff size = 240000
    RTIsp3x 12:00:38-110 {ispInitDevice :208} sensor name = m00_b_ov9281 4-0070
    RTIsp3x 12:00:38-112 {ispInitDevice :211} sensor_index = 0
    RTIsp3x 12:00:38-117 {ispInitDevice :208} sensor name = m01_b_ov9281 3-0070
    RTIsp3x 12:00:38-118 {ispInitDevice :211} sensor_index = 1
    RTDeviceV4L2 12:00:38-123 {open :138} open video name(/dev/video22)
    RTDeviceV4L2 12:00:38-126 {ispCameraInfo :549} current device:/dev/video22 isn't compatible(cap:0x84201000) device,memoryType:4, retry:0
    RTDeviceV4L2 12:00:38-128 {ispInitFormat :726} ioctl VIDIOC_S_FMT OK
    RKViChn 12:00:38-129 {start :813} =========== vi Start startRuntime ===========
    RTDeviceV4L2 12:00:38-130 {ispStreamOn :440} do ispStreamOn start

    这个大致原因是什么呢 ,因为没有遇到过相似问题
  • 默认的rkipc应用是不支持双摄的所以无法推流,在SDK中有Rockchip提供的双摄示例应用 rv1106_dual_ipc(位于$SDK/project/app/rkipc/rkipc/src),前提是确保双摄可以运行了
    由于我们也没有支持双摄的产品,我也不确定您执行的sample_multi_vi 的信息有什么问题,看起来应该是开始运行了,查看一下/data/ 下有没有生成 /data/vi_0.bin 和 /data/vi_1.bin。