i.MX 8QM MIPI-CSI

i.MX 8QM MIPI-CSI

conga-SMX8 supports 1x MIPI-CSI x4 (i.MX8 CSI1 pads) and 1x MIPI-CSI x2 (i.MX8 CSI0 pads). The camera for this test is connected to the x4 interface.

A) Setting up the Camera

1. Bootloader

Enable OmniVision OV5640 MIPI-CSI via device tree selection on bootloader-level. Use either the one with LVDS support

=> setenv fdt_file imx8qm-cgtsmx8-mipi-ov5640.dtb

or the one with HDMI graphical output

=> setenv fdt_file imx8qm-cgtsmx8-hdmi-mipi-ov5640.dtb

2. System

Check if camera is detected. It should look like this on SMX8:

root@imx8qm-cgtsmx8:~# dmesg | grep mx8-img-md [ 5.710473] mx8-img-md: Registered mxc_isi.4.capture as /dev/video0 [ 5.725895] mx8-img-md: Registered sensor subdevice: ov5640 5-003c (1) [ 5.736685] mx8-img-md: created link [mxc_isi.4] => [mxc_isi.4.capture] [ 5.752865] mx8-img-md: created link [mxc-mipi-csi2.1] => [mxc_isi.4] [ 5.759420] mx8-img-md: created link [ov5640 5-003c] => [mxc-mipi-csi2.1]

Check available video devices with:

root@imx8qm-cgtsmx8:~# v4l2-ctl --list-devices vpu B0 (platform:): /dev/video12 /dev/video13 mxc-isi-cap (platform:58140000.isi:cap_devic): /dev/video0 mxc-jpeg decoder (platform:58400000.jpegdec): /dev/video1 mxc-jpeg decoder (platform:58450000.jpegenc): /dev/video2

Check if basic gstreamer pipeline is working

$ gst-launch-1.0 videotestsrc num-buffers=150 ! autovideosink

B) Run camera

Test camera with

$ gst-launch-1.0 v4l2src device=/dev/video0 num-buffers=150 ! autovideosink

And with different resolutions:

$ gst-launch-1.0 v4l2src device=/dev/video0 num-buffers=150 ! capsfilter caps="video/x-raw, width=640, height=480, framerate=30/1" ! autovideosink $ gst-launch-1.0 v4l2src device=/dev/video0 num-buffers=150 ! capsfilter caps="video/x-raw, width=1280, height=720, framerate=30/1" ! autovideosink $ gst-launch-1.0 v4l2src device=/dev/video0 num-buffers=150 ! capsfilter caps="video/x-raw, width=1920, height=1080, framerate=30/1" ! autovideosink

Remark:
Every pipeline runs only about 5 seconds. Remove num-buffers=150 for an endless stream.