双目摄像头在ANDROID平台上的应用

添加自己双目摄像头,能识别到sensor_id,但是不能出图。
使用 camera0->csi_dphy1->isp_vir0 / camera1->csi_dphy2->isp_vir1 可单独出图。

如果使用sensor2->csi_dphy2->mipi_csi2->vicap->isp_vir1,需要额外配置其他东西吗
现在的dtsi 配置 如下:
// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
/*

  • Copyright (c) 2020 Rockchip Electronics Co., Ltd.

*/

/* 2M dual camera gc2053(IR)/gc2093(RGB) */

/*

  • csi2_dphy0: used for csi2 dphy full mode,
    is mutually exclusive with
    csi2_dphy1 and csi2_dphy2
  • csi2_dphy1: used for csi2 dphy split mode,
    physical lanes use lane0 and lane1,
    can be used with csi2_dphy2 parallel
  • csi2_dphy2: used for csi2 dphy split mode,
    physical lanes use lane2 and lane3,
    can be used with csi2_dphy1 parallel
    */

&csi2_dphy_hw {
status = “okay”;
};

&rkisp {
status = “okay”;
};

&rkisp_mmu {
status = “okay”;
};

&rkcif {
status = “okay”;
};

&rkcif_mmu {
status = “okay”;
};

&csi2_dphy0 {
status = “disabled”;
};

&csi2_dphy1 {
status = “okay”;
/*
* dphy1 only used for split mode,
* can be used concurrently with dphy2
* full mode and split mode are mutually exclusive
*/
ports {
#address-cells = <1>;
#size-cells = <0>;
port@0 {
reg = <0>;
#address-cells = <1>;
#size-cells = <0>;

		dphy1_in: endpoint@1 {
				reg = <1>;
				remote-endpoint = <&ov02k10_out>;
				data-lanes = <1 2>;
		};
	};

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

		dphy1_out: endpoint@1 {
				reg = <1>;
				remote-endpoint = <&isp1_in>;
				data-lanes = <1 2>;
		};
	};
};

};

&csi2_dphy2 {
status = “okay”;
/*
* dphy2 only used for split mode,
* can be used concurrently with dphy1
* full mode and split mode are mutually exclusive
*/
ports {
#address-cells = <1>;
#size-cells = <0>;

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

		dphy2_in: endpoint@1 {
				reg = <1>;
				remote-endpoint = <&ov9281_out>;
				data-lanes = <1 2>;
		};
	};

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

		dphy2_out: endpoint@1 {
				reg = <1>;
				remote-endpoint = <&mipi_csi2_input>;
				data-lanes = <1 2>;
		};
	};
};

};

&rkisp_vir0 {
status = “okay”;
ports {
port@0 {
reg = <0>;
#address-cells = <1>;
#size-cells = <0>;

		isp1_in: endpoint@1 {
			reg = <1>;
			remote-endpoint = <&dphy1_out>;
		};
	};
    };

};

&rkisp_vir1 {
status = “okay”;

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

		isp2_in: endpoint@0 {
			reg = <0>;
			remote-endpoint = <&mipi_lvds_sditf>;
		};
	};
};

};

&mipi_csi2 {
status = “okay”;

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

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

		mipi_csi2_input: endpoint@1 {
				reg = <1>;
				remote-endpoint = <&dphy2_out>;
				data-lanes = <1 2>;
		};
	};

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

		mipi_csi2_output: endpoint@0 {
				reg = <0>;
				remote-endpoint = <&cif_mipi_in>;
				data-lanes = <1 2>;
		};
	};
};

};

&rkcif_mipi_lvds {
status = “okay”;
port {
cif_mipi_in: endpoint {
remote-endpoint = <&mipi_csi2_output>;
data-lanes = <1 2>;
};
};
};

&rkcif_mipi_lvds_sditf {
status = “okay”;
port {
mipi_lvds_sditf: endpoint {
remote-endpoint = <&isp2_in>;
data-lanes = <1 2>;
};
};
};

&i2c4 {
status = “okay”;

ov02k10: ov02k10@36{ //RGB
        status = "okay";
        compatible = "ovti,ov02k10";
        reg = <0x36>;

        avdd-supply = <&vcc_camera>;
        power-domains = <&power RK3568_PD_VI>;
        clocks = <&cru CLK_CIF_OUT>;
        clock-names = "xvclk";
        pinctrl-names = "rockchip,camera_default";
        pinctrl-0 = <&cif_clk>;

        flash-leds = <&flash_led>;

        reset-gpios = <&pca9555 PCA_IO0_0 GPIO_ACTIVE_HIGH>;
        pwdn-gpios = <&pca9555 PCA_IO0_1 GPIO_ACTIVE_HIGH>;

        firefly,clkout-enabled-index = <0>;
        rockchip,camera-module-index = <0>;
        rockchip,camera-module-facing = "back";
        rockchip,camera-module-name = "default";
        rockchip,camera-module-lens-name = "default";
        port {
                ov02k10_out: endpoint {
                                remote-endpoint = <&dphy1_in>;
                                data-lanes = <1 2>;
                };
        };
};
ov9281: ov9281@60 { //IR
        status = "okay";
        compatible = "ovti,ov9281";
        reg = <0x60>;

        avdd-supply = <&vcc_camera>;
        clocks = <&pmucru CLK_WIFI>;
        clock-names = "xvclk";
        power-domains = <&power RK3568_PD_VI>;
        pinctrl-names = "rockchip,camera_default";
        pinctrl-0 = <&refclk_pins>;

	 reset-gpios = <&pca9555 PCA_IO0_3 GPIO_ACTIVE_HIGH>;
       //pwdn-gpios = <&pca9555 PCA_IO0_4 GPIO_ACTIVE_LOW>;

        firefly,clkout-enabled-index = <1>;
        rockchip,camera-module-index = <1>;
        rockchip,camera-module-facing = "front";
        rockchip,camera-module-name = "default";
        rockchip,camera-module-lens-name = "default";
        port {
                ov9281_out: endpoint {
                                remote-endpoint = <&dphy2_in>;
                                data-lanes = <1 2>;
                };
        };
};

};

dmesg :

[ 1.883863] flash vendor storage:20170308 ret = -1
[ 1.884159] ov02k10 4-0036: driver version: 00.01.01
[ 1.884178] ov02k10 4-0036: Get hdr mode failed! no hdr default
[ 1.886514] ov02k10 4-0036: could not get sleep pinstate
[ 1.886545] ov02k10 4-0036: Failed to get supply ‘avdd’: -517
[ 1.886555] ov02k10 4-0036: Failed to get power regulators
[ 1.886887] ov9281 4-0060: driver version: 00.01.03
[ 1.886914] ov9281 4-0060: Failed to get power-gpios, maybe no use
[ 1.886931] ov9281 4-0060: Failed to get power-gpios2, maybe no use
[ 1.888090] ov9281 4-0060: Failed to get pwdn-gpios
[ 1.888151] ov9281 4-0060: could not get sleep pinstate
[ 1.892089] ov9281 4-0060: __ov9281_power_on: ok xvclk
[ 1.892729] ov9281 4-0060: Detected OV009281 sensor
[ 1.892756] rockchip-csi2-dphy csi2-dphy2: dphy2 matches m01_f_ov9281 4-0060:bus type 4
[ 1.893095] rkcif_mipi_lvds: Async subdev notifier completed
[ 1.894652] registered taskstats version 1
[ 1.894666] Loading compiled-in X.509 certificates

[ 1.926587] ov02k10 4-0036: driver version: 00.01.01
[ 1.926607] ov02k10 4-0036: Get hdr mode failed! no hdr default
[ 1.928905] ov02k10 4-0036: could not get sleep pinstate
[ 1.928970] ov02k10 4-0036: Linked as a consumer to regulator.37
[ 1.929010] ov02k10 4-0036: 4-0036 supply dovdd not found, using dummy regulator
[ 1.929047] ov02k10 4-0036: Linked as a consumer to regulator.0
[ 1.929073] ov02k10 4-0036: 4-0036 supply dvdd not found, using dummy regulator
[ 1.947843] ov02k10 4-0036: __ov02k10_power_on
[ 1.948634] ov02k10 4-0036: Detected OV530243 sensor
[ 1.948682] rockchip-csi2-dphy csi2-dphy1: dphy1 matches m00_b_ov02k10 4-0036:bus type 4
[ 1.951336] 11wk2xxx_probe: setup mode 0, 8 bits/w, 10000000 Hz max

[ 2.021693] devfreq fde60000.gpu: Couldn’t update frequency transition information.
[ 2.145069] wk2xxx_serial_init()
[ 2.145137] wk2xxx_request_port
[ 2.145166] ttysWK0 at I/O 0x1 (irq = 116, base_baud = 460800) is a wk2xxx
[ 2.146035] uart_add_one_port success for line i:= 0 with right 0
[ 2.146097] wk2xxx_request_port
[ 2.146142] ttysWK1 at I/O 0x2 (irq = 116, base_baud = 460800) is a wk2xxx
[ 2.146939] uart_add_one_port success for line i:= 1 with right 0
[ 2.147002] wk2xxx_request_port
[ 2.147031] ttysWK2 at I/O 0x3 (irq = 116, base_baud = 460800) is a wk2xxx
[ 2.147899] uart_add_one_port success for line i:= 2 with right 0
[ 2.147916] wk2xxx_request_port
[ 2.147929] ttysWK3 at I/O 0x4 (irq = 116, base_baud = 460800) is a wk2xxx
[ 2.148127] uart_add_one_port success for line i:= 3 with right 0
[ 2.148143] uart_add_one_port = 0x0
[ 2.148830] register spi return v = :0
[ 2.150431] rkisp-vir1: Async subdev notifier completed
[ 2.150486] rkcif rkcif_mipi_lvds: clear unready subdev num: 0

[ 1.345676] rkcif_mipi_lvds: Async registered subdev
[ 1.346352] rkcif_mipi_lvds: get_remote_sensor: remote pad is null
[ 1.346389] rkcif_mipi_lvds: rkcif_update_sensor_info: stream[0] get remote sensor_sd failed!
[ 1.346403] rkisp-vir1: update sensor failed
[ 1.346737] rkcif rkcif_mipi_lvds: clear unready subdev num: 1
[ 1.347292] rkcif_mipi_lvds: remote fmt: mbus code:0x200a, size:1280x720, field: 1
[ 1.347303] rkcif_mipi_lvds: C-Plane 0 size: 921600, Total imagesize: 921600
[ 1.347305] rkcif_mipi_lvds: C-Plane 1 size: 921600, Total imagesize: 1843200
[ 1.347309] rkcif_mipi_lvds: rkcif_set_fmt: req(1280, 720) out(1280, 720)
[ 1.347312] rkcif_mipi_lvds: remote fmt: mbus code:0x200a, size:1280x720, field: 1
[ 1.347316] rkcif_mipi_lvds: C-Plane 0 size: 921600, Total imagesize: 921600
[ 1.347318] rkcif_mipi_lvds: C-Plane 1 size: 921600, Total imagesize: 1843200
[ 1.347321] rkcif_mipi_lvds: rkcif_set_fmt: req(1280, 720) out(1280, 720)
[ 1.347324] rkcif_mipi_lvds: remote fmt: mbus code:0x200a, size:1280x720, field: 1
[ 1.347328] rkcif_mipi_lvds: C-Plane 0 size: 921600, Total imagesize: 921600
[ 1.347330] rkcif_mipi_lvds: C-Plane 1 size: 921600, Total imagesize: 1843200
[ 1.347333] rkcif_mipi_lvds: rkcif_set_fmt: req(1280, 720) out(1280, 720)
[ 1.347336] rkcif_mipi_lvds: remote fmt: mbus code:0x200a, size:1280x720, field: 1
[ 1.347340] rkcif_mipi_lvds: C-Plane 0 size: 921600, Total imagesize: 921600
[ 1.347342] rkcif_mipi_lvds: C-Plane 1 size: 921600, Total imagesize: 1843200
[ 1.347345] rkcif_mipi_lvds: rkcif_set_fmt: req(1280, 720) out(1280, 720)
[ 1.347347] rkcif_mipi_lvds: Async subdev notifier completed

走vicap 是否可以抓帧

sensor2->csi_dphy2->mipi_csi2->vicap->isp_vir1 抓不到帧
sensor2->csi_dphy2->isp_vir1 可以抓到帧

ov02k10,ov9281这两个sensor没调过。是raw sensor吗

是的,都是raw sensor。
现在两个sensor如果都走 isp的话,是可以用v4l2-ctl抓到图的。

因为这两个sensor没有调过。
可以看一下抓帧报什么错误或对比一下官方的双目,对应地去找一下原因。
media-ctl -d /dev/media1 -p看一下拓扑对不对
最后raw sensor效果方面要考虑清楚怎么处理,目前 iq效果文件方面并没有这两个sensor的支持