MX95 CSI
This page is using the default release mx95-yocto-scarthgap-6.6.23_2.0.0-v1.0.
To view this page for a specific Variscite SoM and software release, please follow these steps:
- Visit variwiki.com
- Select your SoM
- Select the software release
Testing MIPI-CSI2 cameras
Before running any of the pipelines below make sure you have camera(s) connected. i.MX95 family of processors uses gstreamer as multimedia framework. Please refer to https://gstreamer.freedesktop.org/
Camera Probe
Run the following command to see if you have the camera(s) detected
# v4l2-ctl --list-devices
This should produce the following output
mxc-isi-cap (platform:4ad50000.isi): /dev/video0 /dev/video1 /dev/video2 /dev/video3 /dev/video4 /dev/video5 /dev/video6 /dev/video7 /dev/media0 mxc-jpeg codec (platform:4c500000.jpegdec): /dev/video10 mxc-jpeg codec (platform:4c550000.jpegenc): /dev/video11 wave6-dec (platform:wave6-dec): /dev/video8 wave6-enc (platform:wave6-enc): /dev/video9
The camera interface is /dev/video0
Testing Camera Preview on Display
The driver is implemented using V4L2’s Media Controller (MC) API. In the MC API, each element in the media pipeline is configured individually by the user-space application.
Setup links:
# media-ctl -l "'ov5640_mainline 2-003c':0->'csidev-4ad30000.csi':0 [1]" # media-ctl -l "'csidev-4ad30000.csi':1 -> '4ac10000.syscon:formatter@20':0 [1]"
Setup the media pipeline:
# media-ctl -V "'ov5640_mainline 2-003c':0 [fmt: UYVY8_1X16/${width}x${heigth} field:none]" # media-ctl -V "'csidev-4ad30000.csi':0 [fmt: UYVY8_1X16/${width}x${heigth} field:none]" # media-ctl -V "'4ac10000.syscon:formatter@20':0 [fmt: UYVY8_1X16/${width}x${heigth} field:none]" # media-ctl -V "'crossbar':2 [fmt: UYVY8_1X16/${width}x${heigth} field:none]" # media-ctl -V "'mxc_isi.0':0 [fmt: UYVY8_1X16/${width}x${heigth} field:none]" # media-ctl -V "'mxc_isi.1':0 [fmt: UYVY8_1X16/${width}x${heigth} field:none]" # media-ctl -V "'mxc_isi.2':0 [fmt: UYVY8_1X16/${width}x${heigth} field:none]" # media-ctl -V "'mxc_isi.3':0 [fmt: UYVY8_1X16/${width}x${heigth} field:none]" # media-ctl -V "'mxc_isi.4':0 [fmt: UYVY8_1X16/${width}x${heigth} field:none]" # media-ctl -V "'mxc_isi.5':0 [fmt: UYVY8_1X16/${width}x${heigth} field:none]" # media-ctl -V "'mxc_isi.6':0 [fmt: UYVY8_1X16/${width}x${heigth} field:none]" # media-ctl -V "'mxc_isi.7':0 [fmt: UYVY8_1X16/${width}x${heigth} field:none]"
After configuring the pipeline, it can be confirmed by reading it back, for example:
# media-ctl --get-v4l2 "'ov5640_mainline 2-003c':0
The following examples show how to preview the camera on the display for different resolutions:
- QCIF 176x14430fps:
# media-ctl -V "'ov5640_mainline 2-003c':0 [fmt: UYVY8_1X16/176x144 field:none]" # media-ctl -V "'csidev-4ad30000.csi':0 [fmt: UYVY8_1X16/176x144 field:none]" # media-ctl -V "'4ac10000.syscon:formatter@20':0 [fmt: UYVY8_1X16/176x144 field:none]" # media-ctl -V "'crossbar':2 [fmt: UYVY8_1X16/176x144 field:none]" # media-ctl -V "'mxc_isi.0':0 [fmt: UYVY8_1X16/176x144 field:none]" # media-ctl -V "'mxc_isi.1':0 [fmt: UYVY8_1X16/176x144 field:none]" # media-ctl -V "'mxc_isi.2':0 [fmt: UYVY8_1X16/176x144 field:none]" # media-ctl -V "'mxc_isi.3':0 [fmt: UYVY8_1X16/176x144 field:none]" # media-ctl -V "'mxc_isi.4':0 [fmt: UYVY8_1X16/176x144 field:none]" # media-ctl -V "'mxc_isi.5':0 [fmt: UYVY8_1X16/176x144 field:none]" # media-ctl -V "'mxc_isi.6':0 [fmt: UYVY8_1X16/176x144 field:none]" # media-ctl -V "'mxc_isi.7':0 [fmt: UYVY8_1X16/176x144 field:none]" # gst-launch-1.0 v4l2src device=/dev/video0 ! video/x-raw,width=176,height=144 ! autovideosink sync=false
- CGA 320x24030fps:
# media-ctl -V "'ov5640_mainline 2-003c':0 [fmt: UYVY8_1X16/320x240 field:none]" # media-ctl -V "'csidev-4ad30000.csi':0 [fmt: UYVY8_1X16/320x240 field:none]" # media-ctl -V "'4ac10000.syscon:formatter@20':0 [fmt: UYVY8_1X16/320x240 field:none]" # media-ctl -V "'crossbar':2 [fmt: UYVY8_1X16/320x240 field:none]" # media-ctl -V "'mxc_isi.0':0 [fmt: UYVY8_1X16/320x240 field:none]" # media-ctl -V "'mxc_isi.1':0 [fmt: UYVY8_1X16/320x240 field:none]" # media-ctl -V "'mxc_isi.2':0 [fmt: UYVY8_1X16/320x240 field:none]" # media-ctl -V "'mxc_isi.3':0 [fmt: UYVY8_1X16/320x240 field:none]" # media-ctl -V "'mxc_isi.4':0 [fmt: UYVY8_1X16/320x240 field:none]" # media-ctl -V "'mxc_isi.5':0 [fmt: UYVY8_1X16/320x240 field:none]" # media-ctl -V "'mxc_isi.6':0 [fmt: UYVY8_1X16/320x240 field:none]" # media-ctl -V "'mxc_isi.7':0 [fmt: UYVY8_1X16/320x240 field:none]" # gst-launch-1.0 v4l2src device=/dev/video0 ! video/x-raw,width=320,height=240 ! autovideosink sync=false
- VGA 640x48030fps:
# media-ctl -V "'ov5640_mainline 2-003c':0 [fmt: UYVY8_1X16/640x480 field:none]" # media-ctl -V "'csidev-4ad30000.csi':0 [fmt: UYVY8_1X16/640x480 field:none]" # media-ctl -V "'4ac10000.syscon:formatter@20':0 [fmt: UYVY8_1X16/640x480 field:none]" # media-ctl -V "'crossbar':2 [fmt: UYVY8_1X16/640x480 field:none]" # media-ctl -V "'mxc_isi.0':0 [fmt: UYVY8_1X16/640x480 field:none]" # media-ctl -V "'mxc_isi.1':0 [fmt: UYVY8_1X16/640x480 field:none]" # media-ctl -V "'mxc_isi.2':0 [fmt: UYVY8_1X16/640x480 field:none]" # media-ctl -V "'mxc_isi.3':0 [fmt: UYVY8_1X16/640x480 field:none]" # media-ctl -V "'mxc_isi.4':0 [fmt: UYVY8_1X16/640x480 field:none]" # media-ctl -V "'mxc_isi.5':0 [fmt: UYVY8_1X16/640x480 field:none]" # media-ctl -V "'mxc_isi.6':0 [fmt: UYVY8_1X16/640x480 field:none]" # media-ctl -V "'mxc_isi.7':0 [fmt: UYVY8_1X16/640x480 field:none]" # gst-launch-1.0 v4l2src device=/dev/video0 ! video/x-raw,width=640,height=480 ! autovideosink sync=false
- NTSC 720x48030fps:
# media-ctl -V "'ov5640_mainline 2-003c':0 [fmt: UYVY8_1X16/720x480 field:none]" # media-ctl -V "'csidev-4ad30000.csi':0 [fmt: UYVY8_1X16/720x480 field:none]" # media-ctl -V "'4ac10000.syscon:formatter@20':0 [fmt: UYVY8_1X16/720x480 field:none]" # media-ctl -V "'crossbar':2 [fmt: UYVY8_1X16/720x480 field:none]" # media-ctl -V "'mxc_isi.0':0 [fmt: UYVY8_1X16/720x480 field:none]" # media-ctl -V "'mxc_isi.1':0 [fmt: UYVY8_1X16/720x480 field:none]" # media-ctl -V "'mxc_isi.2':0 [fmt: UYVY8_1X16/720x480 field:none]" # media-ctl -V "'mxc_isi.3':0 [fmt: UYVY8_1X16/720x480 field:none]" # media-ctl -V "'mxc_isi.4':0 [fmt: UYVY8_1X16/720x480 field:none]" # media-ctl -V "'mxc_isi.5':0 [fmt: UYVY8_1X16/720x480 field:none]" # media-ctl -V "'mxc_isi.6':0 [fmt: UYVY8_1X16/720x480 field:none]" # media-ctl -V "'mxc_isi.7':0 [fmt: UYVY8_1X16/720x480 field:none]" # gst-launch-1.0 v4l2src device=/dev/video0 ! video/x-raw,width=720,height=480 ! autovideosink sync=false
- NTSC 720x57630fps:
# media-ctl -V "'ov5640_mainline 2-003c':0 [fmt: UYVY8_1X16/720x576 field:none]" # media-ctl -V "'csidev-4ad30000.csi':0 [fmt: UYVY8_1X16/720x576 field:none]" # media-ctl -V "'4ac10000.syscon:formatter@20':0 [fmt: UYVY8_1X16/720x576 field:none]" # media-ctl -V "'crossbar':2 [fmt: UYVY8_1X16/720x576 field:none]" # media-ctl -V "'mxc_isi.0':0 [fmt: UYVY8_1X16/720x576 field:none]" # media-ctl -V "'mxc_isi.1':0 [fmt: UYVY8_1X16/720x576 field:none]" # media-ctl -V "'mxc_isi.2':0 [fmt: UYVY8_1X16/720x576 field:none]" # media-ctl -V "'mxc_isi.3':0 [fmt: UYVY8_1X16/720x576 field:none]" # media-ctl -V "'mxc_isi.4':0 [fmt: UYVY8_1X16/720x576 field:none]" # media-ctl -V "'mxc_isi.5':0 [fmt: UYVY8_1X16/720x576 field:none]" # media-ctl -V "'mxc_isi.6':0 [fmt: UYVY8_1X16/720x576 field:none]" # media-ctl -V "'mxc_isi.7':0 [fmt: UYVY8_1X16/720x576 field:none]" # gst-launch-1.0 v4l2src device=/dev/video0 ! video/x-raw,width=720,height=576 ! autovideosink sync=false
- XGA 1024x76830fps:
# media-ctl -V "'ov5640_mainline 2-003c':0 [fmt: UYVY8_1X16/1024x768 field:none]" # media-ctl -V "'csidev-4ad30000.csi':0 [fmt: UYVY8_1X16/1024x768 field:none]" # media-ctl -V "'4ac10000.syscon:formatter@20':0 [fmt: UYVY8_1X16/1024x768 field:none]" # media-ctl -V "'crossbar':2 [fmt: UYVY8_1X16/1024x768 field:none]" # media-ctl -V "'mxc_isi.0':0 [fmt: UYVY8_1X16/1024x768 field:none]" # media-ctl -V "'mxc_isi.1':0 [fmt: UYVY8_1X16/1024x768 field:none]" # media-ctl -V "'mxc_isi.2':0 [fmt: UYVY8_1X16/1024x768 field:none]" # media-ctl -V "'mxc_isi.3':0 [fmt: UYVY8_1X16/1024x768 field:none]" # media-ctl -V "'mxc_isi.4':0 [fmt: UYVY8_1X16/1024x768 field:none]" # media-ctl -V "'mxc_isi.5':0 [fmt: UYVY8_1X16/1024x768 field:none]" # media-ctl -V "'mxc_isi.6':0 [fmt: UYVY8_1X16/1024x768 field:none]" # media-ctl -V "'mxc_isi.7':0 [fmt: UYVY8_1X16/1024x768 field:none]" # gst-launch-1.0 v4l2src device=/dev/video0 ! video/x-raw,width=1024,height=768 ! autovideosink sync=false
- HD 1280x72030fps:
# media-ctl -V "'ov5640_mainline 2-003c':0 [fmt: UYVY8_1X16/1280x720 field:none]" # media-ctl -V "'csidev-4ad30000.csi':0 [fmt: UYVY8_1X16/1280x720 field:none]" # media-ctl -V "'4ac10000.syscon:formatter@20':0 [fmt: UYVY8_1X16/1280x720 field:none]" # media-ctl -V "'crossbar':2 [fmt: UYVY8_1X16/1280x720 field:none]" # media-ctl -V "'mxc_isi.0':0 [fmt: UYVY8_1X16/1280x720 field:none]" # media-ctl -V "'mxc_isi.1':0 [fmt: UYVY8_1X16/1280x720 field:none]" # media-ctl -V "'mxc_isi.2':0 [fmt: UYVY8_1X16/1280x720 field:none]" # media-ctl -V "'mxc_isi.3':0 [fmt: UYVY8_1X16/1280x720 field:none]" # media-ctl -V "'mxc_isi.4':0 [fmt: UYVY8_1X16/1280x720 field:none]" # media-ctl -V "'mxc_isi.5':0 [fmt: UYVY8_1X16/1280x720 field:none]" # media-ctl -V "'mxc_isi.6':0 [fmt: UYVY8_1X16/1280x720 field:none]" # media-ctl -V "'mxc_isi.7':0 [fmt: UYVY8_1X16/1280x720 field:none]" # gst-launch-1.0 v4l2src device=/dev/video0 ! video/x-raw,width=1280,height=720 ! autovideosink sync=false
- Full HD 1920x108030fps:
# media-ctl -V "'ov5640_mainline 2-003c':0 [fmt: UYVY8_1X16/1920x1080 field:none]" # media-ctl -V "'csidev-4ad30000.csi':0 [fmt: UYVY8_1X16/1920x1080 field:none]" # media-ctl -V "'4ac10000.syscon:formatter@20':0 [fmt: UYVY8_1X16/1920x1080 field:none]" # media-ctl -V "'crossbar':2 [fmt: UYVY8_1X16/1920x1080 field:none]" # media-ctl -V "'mxc_isi.0':0 [fmt: UYVY8_1X16/1920x1080 field:none]" # media-ctl -V "'mxc_isi.1':0 [fmt: UYVY8_1X16/1920x1080 field:none]" # media-ctl -V "'mxc_isi.2':0 [fmt: UYVY8_1X16/1920x1080 field:none]" # media-ctl -V "'mxc_isi.3':0 [fmt: UYVY8_1X16/1920x1080 field:none]" # media-ctl -V "'mxc_isi.4':0 [fmt: UYVY8_1X16/1920x1080 field:none]" # media-ctl -V "'mxc_isi.5':0 [fmt: UYVY8_1X16/1920x1080 field:none]" # media-ctl -V "'mxc_isi.6':0 [fmt: UYVY8_1X16/1920x1080 field:none]" # media-ctl -V "'mxc_isi.7':0 [fmt: UYVY8_1X16/1920x1080 field:none]" # gst-launch-1.0 v4l2src device=/dev/video0 ! video/x-raw,width=1920,height=1080 ! autovideosink sync=false
Testing Camera JPEG Snapshot
To capture JPEG snapshot run one of the pipelines below depending upon the required picture resolution.
- VGA 640x480:
# media-ctl --set-v4l2 '"ov5640 0-003c":0 [fmt:YUYV8_1X16/640x480@1/30]' # XDG_RUNTIME_DIR="/run/user/0" gst-launch-1.0 v4l2src device=/dev/video0 num-buffers=5 ! video/x-raw,width=640,height=480 ! jpegenc ! multifilesink max-files=1 location=/tmp/test_640x480.jpg
- NTSC 480p 720x480:
# media-ctl --set-v4l2 '"ov5640 0-003c":0 [fmt:YUYV8_1X16/720x480@1/30]' # XDG_RUNTIME_DIR="/run/user/0" gst-launch-1.0 v4l2src device=/dev/video0 num-buffers=5 ! video/x-raw,width=720,height=480 ! jpegenc ! multifilesink max-files=1 location=/tmp/test_720x480.jpg
- HD 720p 1280x720:
# media-ctl --set-v4l2 '"ov5640 0-003c":0 [fmt:YUYV8_1X16/1280x720@1/30]' # XDG_RUNTIME_DIR="/run/user/0" gst-launch-1.0 v4l2src device=/dev/video0 num-buffers=5 ! video/x-raw,width=1280,height=720 ! jpegenc ! multifilesink max-files=1 location=/tmp/test_1280x720.jpg
- Full HD 1080p 1920x1080:
# media-ctl --set-v4l2 '"ov5640 0-003c":0 [fmt:YUYV8_1X16/1920x1080@1/15]' # XDG_RUNTIME_DIR="/run/user/0" gst-launch-1.0 v4l2src device=/dev/video0 num-buffers=5 ! video/x-raw,width=1920,height=1080 ! jpegenc ! multifilesink max-files=1 location=/tmp/test_1920x1080.jpg
- QSXGA 1944p 2592x1944:
# media-ctl --set-v4l2 '"ov5640 0-003c":0 [fmt:YUYV8_1X16/2592x1944@1/15]' # XDG_RUNTIME_DIR="/run/user/0" gst-launch-1.0 v4l2src device=/dev/video0 num-buffers=5 ! video/x-raw,width=2592,height=1944 ! jpegenc ! multifilesink max-files=1 location=/tmp/test_2592x1944.jpg