The i.MX8QXP processor provides an Image Sensor Interface (ISI) module that interfaces up to 5 pixel link sources to obtain the image data for processing in its pipeline channels. There are two pixel links that provide connectivity for the CSI and MIPI camera interfaces.

On the ConnectCore 8X SBC Pro:

  • A parallel camera connector is available.

  • A MIPI CSI-2 connector is available.

Default images expect only the MIPI camera to be connected. When only the parallel or both parallel and MIPI cameras are connected you need to modify the device tree accordingly, as documented in the device tree files:

/*
 * Enable only if the parallel camera is physically connected.
 * If not, the MIPI camera may not work.
 * Similarly, if the MIPI camera is not physically connected you need to
 * disable the MIPI (mipi_csi_0) so that the parallel camera works.
 */
//&parallel_csi {
//       status = "okay";
//};

//&ov5640 {
//	status = "okay";
//};

/* MIPI camera */
&mipi_csi_0 {
	status = "okay";
};

&ov5640_mipi {
	status = "okay";
};

Using the camera

Identify the camera

When the camera is connected to the ConnectCore 8X SBC Pro and it has been enabled in the device tree, the system identifies the camera sensor on the I2C bus and assigns a video device node /dev/videoX to it where X is an integer number. You can determine the capture devices on the kernel boot-up messages:

~# dmesg | grep capture
[    0.140315] videodev: Linux video capture interface: v2.00
[    2.814212] mx8-img-md: Registered mxc_isi.0.capture as /dev/video0
[    2.820828] mx8-img-md: Registered mxc_isi.1.capture as /dev/video1
[    2.827384] mx8-img-md: Registered mxc_isi.2.capture as /dev/video2
[    2.833940] mx8-img-md: Registered mxc_isi.3.capture as /dev/video3
[    2.860692] mx8-img-md: created link [mxc_isi.0] => [mxc_isi.0.capture]
[    2.874716] mx8-img-md: created link [mxc_isi.1] => [mxc_isi.1.capture]
[    2.895191] mx8-img-md: created link [mxc_isi.2] => [mxc_isi.2.capture]
[    2.908274] mx8-img-md: created link [mxc_isi.3] => [mxc_isi.3.capture]

The kernel messages show one capture interface per ISI module. On the ConnectCore 8X SBC Pro device tree, the parallel camera is associated with ISI0 and the MIPI camera is associated with ISI1.

The following examples assume you are using the MIPI camera associated to ISI1, so the device associated to it is /dev/video1.

Preview a camera image using gstreamer

Capture the camera image and preview it using gstreamer and Wayland sink:

~# gst-launch-1.0 v4l2src device=/dev/video1 ! video/x-raw,width=320,height=240,framerate=15/1 ! waylandsink

Take a picture with the camera using gstreamer

Capture a still image with the camera and save it using gstreamer:

~# gst-launch-1.0 v4l2src device=/dev/video1 num-buffers=1 ! video/x-raw,width=320,height=240,framerate=15/1 ! jpegenc ! filesink location=sample.jpg

To show the captured image using gstreamer:

~# gst-launch-1.0 filesrc location=sample.jpg ! jpegdec ! imagefreeze ! waylandsink

Record a video with the camera using gstreamer

Capture a moving image with the camera and save it using gstreamer:

~# gst-launch-1.0 v4l2src device=/dev/video1 num-buffers=90 ! video/x-raw,width=320,height=240,framerate=15/1 ! avimux ! filesink location=output.avi