.. include:: /keyword.rst .. _feature-g700-cam-v4l2-multi-sensor: ========================== Multi-Sensor (V4L2 Sensor) ========================== .. 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|. You might get different operation results depending on the platform you use. This chapter shows how to operate multi sensors under **V4L2 Sensor** architecture on |G510-G700-EVK|. 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 how to load DTBO. The following table shows the supported multi-sensor combinations in V4L2 sensor architecture. IT6510FN and LT6911UXE are the proof-of-concept components. Please refer to :ref:`Proof-of-Concept ` for the usage. .. 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: '[^3.*]', 6: '[^1.*]'} :included_cols: 0,1,2,4,7 .. prompt:: bash > auto > genio-flash --list-dtbo List of available DTBO: - camera-ar0830-ap1302-dual-std.dtbo - camera-ar0830-ap1302-csi0-it6510-csi1-std.dtbo - camera-it6510-dual-std.dtbo - camera-lt6911uxe-dual-std.dtbo - ... > genio-flash --load-dtbo camera-ar0830-ap1302-dual-std.dtbo --load-dtbo gpu-mali.dtbo --load-dtbo apusys.dtbo --load-dtbo video.dtbo Dual Onsemi AP1302 & AR0830 --------------------------- Hardware Setup ~~~~~~~~~~~~~~ #. Prepare 2x CAM-DTB-D6 and 2x Onsemi AR0830 sensors #. Connect the DTBs to CSI0 and CSI1 slots .. figure:: /_asset/sw_yocto_app-dev_camera_g700_connect-dual-d6.png :align: center :scale: 30% |G510-G700-EVK| with two CAM-DTB-D6 and Onsemi AR0830 sensor Software Setup ~~~~~~~~~~~~~~ #. Select the `dtbo` ``camera-ar0830-ap1302-dual-std.dtbo`` through ``genio-flash`` .. prompt:: bash > auto > genio-flash --load-dtbo camera-ar0830-ap1302-dual-std.dtbo --load-dtbo gpu-mali.dtbo --load-dtbo video.dtbo #. Find the media device of the camera system .. prompt:: bash # auto # export MEDIA_DEV=$(v4l2-ctl -z platform:$(basename `find /sys/bus/platform/devices/ -name "*camisp"`) --list-devices | grep media) # echo ${MEDIA_DEV} /dev/media3 .. 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. #. Set the media topology and the format on the EVK .. figure:: /_asset/sw_yocto_app-dev_camera_g700_media-topology_dual-ap1302.svg :align: center :scale: 50% Media Topology Graph of Dual Onsemi AP1302 ISP and SoC .. prompt:: bash # auto # # Set Genio 700 and Onsemi AP1302 on CSI0 # # media-ctl -d ${MEDIA_DEV} -l "'seninf-0':1 -> 'mtk-cam camsv-0':0 [5]" # Enable the link between seninf-0 pad 1 and mtk-cam camsv-0 pad 0 # media-ctl -d ${MEDIA_DEV} -l "'ap1302.5-003c':2 -> 'seninf-0':0 [1]" # Enable the link between ap1302.5-003c pad 2 and seninf-0 pad 0 # # media-ctl -d ${MEDIA_DEV} -V "'ap1302.5-003c':2 [fmt:UYVY8_1X16/1920x1080 field:none]" # Set UYVY/1920x1080 to ap1302.5-003c pad 2 # media-ctl -d ${MEDIA_DEV} -V "'seninf-0':1 [fmt:UYVY8_1X16/1920x1080 field:none]" # Set UYVY/1920x1080 to seninf-0 pad 1 # media-ctl -d ${MEDIA_DEV} -V "'mtk-cam camsv-0':1 [fmt:UYVY8_1X16/1920x1080 field:none]" # Set UYVY/1920x1080 to mtk-cam camsv-0 pad 1 # # # Set Genio 700 and Onsemi AP1302 on CSI1 # # media-ctl -d ${MEDIA_DEV} -l "'seninf-1':1 -> 'mtk-cam camsv-1':0 [5]" # Enable the link between seninf-1 pad 1 and mtk-cam camsv-1 pad 0 # media-ctl -d ${MEDIA_DEV} -l "'ap1302.3-003c':2 -> 'seninf-1':0 [1]" # Enable the link between ap1302.3-003c pad 2 and seninf-1 pad 0 # # media-ctl -d ${MEDIA_DEV} -V "'ap1302.3-003c':2 [fmt:UYVY8_1X16/1920x1080 field:none]" # Set UYVY/1920x1080 to ap1302.3-003c pad 2 # media-ctl -d ${MEDIA_DEV} -V "'seninf-1':1 [fmt:UYVY8_1X16/1920x1080 field:none]" # Set UYVY/1920x1080 to seninf-1 pad 1 # media-ctl -d ${MEDIA_DEV} -V "'mtk-cam camsv-1':1 [fmt:UYVY8_1X16/1920x1080 field:none]" # Set UYVY/1920x1080 to mtk-cam camsv-1 pad 1 #. Find the video device of the camera system .. prompt:: bash # auto # declare -a VIDEO_DEV=(`for i in {0..7}; do media-ctl -d ${MEDIA_DEV} --entity "mtk-cam camsv-$i main-stream"; done | tr "\n" " "`) #. Launch Dual Onsemi AP1302 pipeline to show dual Onsemi AP1302 images on the Weston desktop .. prompt:: bash # auto # gst-launch-1.0 -v v4l2src device=${VIDEO_DEV[0]} io-mode=dmabuf-import ! video/x-raw,width=1920,height=1080,format=UYVY ! v4l2convert output-io-mode=dmabuf ! video/x-raw,width=1280,height=720 ! waylandsink sync=false & # gst-launch-1.0 -v v4l2src device=${VIDEO_DEV[1]} io-mode=dmabuf-import ! video/x-raw,width=1920,height=1080,format=UYVY ! v4l2convert output-io-mode=dmabuf ! video/x-raw,width=1280,height=720 ! waylandsink sync=false & After the above steps, the video data from two Onsemi AP1302 will be shown on the Weston desktop. .. figure:: /_asset/sw_yocto_app-dev_camera_g700_dual-ap1302-shown-on-weston.png :align: center :scale: 30% Dual Onsemi AP1302 ISP and AR0830 sensor shown on the Weston desktop