Hi,
I'm trying to use an ADV7282A-M composite to Mipi-CSI convertor with an iMX8MMini module from Variscite.
I am using Yocto Linux Hardknott, v5.4.127 and the adv7180 drive in linux-imx/drivers/media/i2c/adv7180.c which lists the 7282-m as a compatible device.
The processor communicates with the chip correctly over i2c and the driver loads succesfully:
root@imx8mm-var-dart:~# dmesg | grep adv [ 1.427336] adv7180 3-0020: chip found @ 0x20 (30a50000.i2c) [ 1.508467] mxc_mipi-csi 32e30000.mipi_csi: Registered sensor subdevice: adv7180 3-0020 root@imx8mm-var-dart:~# dmesg | grep mipi_csi [ 0.956485] mxc_mipi-csi 32e30000.mipi_csi: 32e30000.mipi_csi supply mipi-phy not found, using dummy regulator [ 0.966686] mxc_mipi-csi 32e30000.mipi_csi: mipi csi v4l2 device registered [ 0.979354] mxc_mipi-csi 32e30000.mipi_csi: lanes: 1, hs_settle: 13, clk_settle: 2, wclk: 0, freq: 333000000 [ 1.508467] mxc_mipi-csi 32e30000.mipi_csi: Registered sensor subdevice: adv7180 3-0020
Video 0 is shown OK
root@imx8mm-var-dart:~# v4l2-ctl --list-devices i.MX6S_CSI (platform:32e20000.csi1_bridge): /dev/video0
However, no supported formats are shown:
root@imx8mm-var-dart:~# v4l2-ctl --list-formats-ext ioctl: VIDIOC_ENUM_FMT Type: Video Capture
If I run a test captue, the pipeline fails with an internal data stream read error - I'm guessing because format seelction fails:
gst-launch fails with stream error presumably because of missing formats root@imx8mm-var-dart:~# gst-launch-1.0 v4l2src device=/dev/video0 ! video/x-raw,width=640,height=480 ! autovideosink sync=false Setting pipeline to PAUSED ... Pipeline is live and does not need PREROLL ... Setting pipeline to PLAYING ... ERROR: from element /GstPipeline:pipeline0/GstV4l2Src:v4l2src0: Internal data stream error. Additional debug info: ../git/libs/gst/base/gstbasesrc.c(3072): gst_base_src_loop (): /GstPipeline:pipeline0/GstV4l2Src:v4l2src0: streaming stopped, reason not-negotiated (-4) Execution ended after 0:00:00.000224500 Setting pipeline to PAUSED ... Setting pipeline to READY ... Setting pipeline to NULL ... Total showed frames (0), playing for (0:00:00.000634500), fps (0.000). Freeing pipeline ...
When running the above, I see I2C traffic and brief activity on the MIP-CSI clock and data (a couple of pulses).
I am not particularly familiar with v4l2 and how formats are requested and in order to narrow down where the problem lies, I have some key questions:
- What would cause no formats to be reported?
- When are the available formats requested?
- Should the ADV7282A-M report formats irrespective of whether a camera is connected? I have tested with a known good composite camera on Ain1
Any other suggestions for debugging would be appreciated. I have looked at many other posts and it seems that it can be tricky to get these two parts to work together but in cases that people have been succesful, I seem to have the system configured in a similar manner.
Relevant device tree snippet shown below:
&i2c4 { clock-frequency = <100000>; pinctrl-names = "default", "gpio"; pinctrl-0 = <&pinctrl_i2c4>; pinctrl-1 = <&pinctrl_i2c4_gpio>; scl-gpios = <&gpio5 20 GPIO_ACTIVE_HIGH>; sda-gpios = <&gpio5 21 GPIO_ACTIVE_HIGH>; status = "okay"; adv7282: adv7282@20 { compatible = "adi,adv728-m"; reg = <0x20>; pinctrl-names = "default"; pinctrl-0 = <&pinctrl_adv7282>; clocks = <&clk IMX8MM_CLK_CLKO1>; clock-names = "csi_mclk"; csi_id = <0>; cvbs = <1>; powerdown-gpios = <&gpio3 21 GPIO_ACTIVE_LOW>; reset-gpios = <&gpio3 23 GPIO_ACTIVE_HIGH>; interrupt-parent = <&gpio3>; interrupts = <20 IRQ_TYPE_EDGE_FALLING>; mclk = <24000000>; mclk_source = <0>; mipi_camera = <1>; ipu_id = <0>; status = "okay"; port { adv7282_m_mipi1_ep: endpoint { remote-endpoint = <&mipi1_sensor_ep>; }; }; }; }; &mipi_csi_1 { #address-cells = <1>; #size-cells = <0>; status = "okay"; ipu_id = <0>; csi_id = <0>; port { mipi1_sensor_ep: endpoint@1 { remote-endpoint = <&adv7282_m_mipi1_ep>; clock-lanes = <0>; data-lanes = <1>; csis-hs-settle = <13>; csis-clk-settle = <2>; // csis-wclk; }; csi1_mipi_ep: endpoint@2 { remote-endpoint = <&csi1_ep>; }; }; v4l2_out { compatible = "fsl,mxc_v4l2_output"; status = "okay"; }; v4l2cap_1 { compatible = "fsl,imxq-v4l2-capture"; ipu_id = <0>; csi_id = <0>; mclk_source = <0>; mipi_camera = <1>; status = "okay"; }; }; &csi1_bridge { fsl,mipi-mode; status = "okay"; port { csi1_ep: endpoint { remote-endpoint = <&csi1_mipi_ep>; }; }; };