.. include:: /keyword.rst .. _feature-g700-cam-imgsensor-multi-sensor: ================================= Multi-Sensor (MediaTek Imgsensor) ================================= .. important:: All the bash commands shown here are based on |G510-G700-EVK|. For |G510-EVK|, users can follow the same step to do the whole setup by changing the naming term from `700` to `510`. .. contents:: Sections :local: :depth: 2 .. note:: All command operations presented in this chapter are based on the IoT Yocto v24.0, |G700-EVK-REF-BOARD| and Sony IMX214 sensor. You might get different operation results depending on the platform you use. This chapter shows how to operate multi sensors under **MediaTek Imgsensor** architecture on |G510-G700-EVK|. Connect The Camera To The EVK ----------------------------- There are 2 MIPI-CSI slots on |G510-G700-EVK|, which are ``CSI0`` and ``CSI1``. RAW camera DTB and YUV camera DTB can run together. Select Camera Device Tree Blob Overlay -------------------------------------- The camera device is inactive by default, so the kernel has to load a specific device tree blob overlay to enable it. Please refer to the :ref:`bl33 (u-boot) section ` for more details. .. csv-filter:: Multi Camera DTBO for |G510-G700-EVK| :header-rows: 1 :file: ../../../../_asset/tables/camera-platform-sensor-dtbo.csv :include: {0: 'Genio 510\/700-EVK'} :exclude: {5: '[^2.*&^3.*&^4.*]', 6: '[^0.*]'} :included_cols: 0,1,2,4,7 .. prompt:: bash > auto > genio-flash --list-dtbo List of available DTBO: - camera-ar0830-ap1302-csi0-ar0830-ap1302-csi1.dtbo - camera-ar0830-ap1302-csi0-imx214-csi1.dtbo - camera-imx214-csi0-imx214-csi1.dtbo - camera-imx214-csi0-ar0830-ap1302-csi1.dtbo - ... > genio-flash --load-dtbo camera-imx214-csi0-imx214-csi1.dtbo --load-dtbo gpu-mali.dtbo --load-dtbo apusys.dtbo --load-dtbo video.dtbo .. warning:: Please select the DTBO according to the CSI slot to which the camera sensor is connected. For example, if the IMX214 camera is connected to the ``CSI0`` slot and the AR0830/AP1302 camera is connected to the ``CSI1`` slot, please load the `dtbo` ``camera-imx214-csi0-ar0830-ap1302-csi1.dtbo``. Otherwise, the camera initialization will fail. Dual Sony IMX214 ---------------- Hardware Setup ~~~~~~~~~~~~~~ #. Prepare 2x CAM-DTB-D2 and 2x Sony IMX214 sensors #. Connect the DTBs to CSI0 and CSI1 slots .. figure:: /_asset/sw_yocto_app-dev_camera_g700_connect-dual-d2.png :align: center :scale: 30% |G510-G700-EVK| with 2x CAM-DTB-D2 and 2x Sony IMX214 sensors Software Setup ~~~~~~~~~~~~~~ #. Select the `dtbo` ``camera-imx214-csi0-imx214-csi1.dtbo`` through ``genio-flash`` .. prompt:: bash > auto > genio-flash --load-dtbo camera-imx214-csi0-imx214-csi1.dtbo --load-dtbo gpu-mali.dtbo --load-dtbo video.dtbo #. Find the video and media device of the camera system One sensor corresponds to one **mtkcam** media device. For example, the first IMX214 sensor corresponds to **mtkcam0**, and the second one corresponds to **mtkcam1**. In the following example, there are 2x IMX214 enabled on the |G510-G700-EVK|. .. prompt:: bash # auto # v4l2-ctl -z platform:mtkcam0 --list-devices /dev/media3 /dev/video36 /dev/video37 /dev/video40 # declare -a CAM0_VIDEO_DEV=($(v4l2-ctl -z platform:mtkcam0 --list-devices | grep video | tr "\n" " ")) # echo ${CAM0_VIDEO_DEV[*]} /dev/video36 /dev/video37 /dev/video40 # # v4l2-ctl -z platform:mtkcam1 --list-devices /dev/media2 /dev/video28 /dev/video30 /dev/video32 # declare -a CAM1_VIDEO_DEV=($(v4l2-ctl -z platform:mtkcam1 --list-devices | grep video | tr "\n" " ")) # echo ${CAM1_VIDEO_DEV[*]} /dev/video28 /dev/video30 /dev/video32 .. warning:: The assigned node number for the media device may vary depending on the sequence of the probing process during the boot-up phase. As such, it is crucial to ensure the accuracy of the media device node before using the camera. #. Launch dual Sony IMX214 pipeline to show images on the Weston desktop .. prompt:: bash # auto # gst-launch-1.0 v4l2src device=${CAM0_VIDEO_DEV[0]} ! video/x-raw,width=640,height=480,format=YUY2 ! waylandsink sync=false & # gst-launch-1.0 v4l2src device=${CAM0_VIDEO_DEV[1]} ! video/x-raw,width=640,height=480,format=NV12 ! waylandsink sync=false & # gst-launch-1.0 v4l2src device=${CAM0_VIDEO_DEV[2]} ! image/jpeg,width=640,height=480,format=JPEG ! jpegdec ! waylandsink sync=false & # gst-launch-1.0 v4l2src device=${CAM1_VIDEO_DEV[0]} ! video/x-raw,width=640,height=480,format=YUY2 ! waylandsink sync=false & # gst-launch-1.0 v4l2src device=${CAM1_VIDEO_DEV[1]} ! video/x-raw,width=640,height=480,format=NV12 ! waylandsink sync=false & # gst-launch-1.0 v4l2src device=${CAM1_VIDEO_DEV[2]} ! image/jpeg,width=640,height=480,format=JPEG ! jpegdec ! waylandsink sync=false & .. note:: Compared with |G1200-EVK|, the control pins on |G510-G700-EVK| are independent for each slot, so the sensors can be opened simultaneously.