YUV Sensor
Camera Package And Specification
The YUV camera DTB for Genio 700-EVK is CAM DTB-D6
.
It contains Onsemi AP1302 ISP and AR0830 Sensor.
Connect The Camera To The EVK
There are 2 MIPI-CSI slots on Genio 700-EVK, which are CSI0
, and CSI1
.
In the following figure, the camera DTB is connected to the CSI0
slot.
Note
All two CSI slots are available. The user can connect the camera sensor to any slot.
Select Camera Device Tree Blob Overlay
The camera is inactive by default. The kernel has to load a specific device tree blob overlay to enable the camera. Please refer to bl33u-boot for more details.
Platform |
Camera DTBO |
Description |
---|---|---|
Genio 700-EVK |
camera-ar0830-ap1302-2lanes-csi0.dtbo |
CAM-DTB-D6 w/ Onsemi AR0830 sensor, connected to CSI0, use 2-lane MIPI CSI |
Genio 700-EVK |
camera-ar0830-ap1302-csi0.dtbo |
CAM-DTB-D6 w/ Onsemi AR0830 sensor, connected to CSI0, use 4-lane MIPI CSI |
Genio 700-EVK |
camera-ar0830-ap1302-csi1.dtbo |
CAM-DTB-D6 w/ Onsemi AR0830 sensor, connected to CSI1, use 4-lane MIPI CSI |
genio-flash --list-dtbo
List of available DTBO:
- camera-ar0830-ap1302-2lanes-csi0.dtbo
- camera-ar0830-ap1302-csi0.dtbo
- camera-ar0830-ap1302-csi1.dtbo
- ...
genio-flash --load-dtbo camera-ar0830-ap1302-csi0.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 camera is connected to the CSI0
slot, please load the dtbo camera-ar0830-ap1302-csi0.dtbo
.
Otherwise, the camera initialization will fail.
Supported Formats And Sizes
Platform |
Sensor |
Stream Type |
Size |
Framerate |
Format |
MIPI Lanes |
---|---|---|---|---|---|---|
Genio 700-EVK |
Onsemi AP1302 & AR0830 |
Preview |
1920x1080 |
30 |
UYVY |
4 |
Genio 700-EVK |
Onsemi AP1302 & AR0830 |
Preview |
2560x1440 |
30 |
UYVY |
4 |
Genio 700-EVK |
Onsemi AP1302 & AR0830 |
Preview |
3840x2160 |
24 |
UYVY |
4 |
Genio 700-EVK |
Onsemi AP1302 & AR0830 |
Preview |
1920x1080 |
30 |
UYVY |
2 |
Genio 700-EVK |
Onsemi AP1302 & AR0830 |
Preview |
2560x1440 |
30 |
UYVY |
2 |
Genio 700-EVK |
Onsemi AP1302 & AR0830 |
Preview |
3840x2160 |
12 |
UYVY |
2 |
Note
The supported format, resoulution, and framerate are related to the capability of the sensor and SoC.
V4L2 Device Node
Camera ISP is a complicated feature that has a large number of device nodes. The camera ISP driver creates 57 video devices in total.
mtk-cam
has 56 devicesmtk-v4l2-camera
has 1 device
mtk-cam
are used by the camera ISP middleware.
The user can just focus on mtk-v4l2-camera
which is for streaming.
v4l2-ctl --list-devices
...
mtk-cam (platform:16000000.camisp):
(56 video devices)
/dev/media0
mtk-v4l2-camera (platform:mtkcam0):
/dev/video74
Launch Camera
The V4L2 nodes with the name mtk-v4l2-camera
can be used for streaming.
For the YUV sensor, there’s only 1 V4L2 device which is for the preview stream.
The user can find the devices by the following command:
v4l2-ctl --list-device
mtk-v4l2-camera (platform:mtkcam0):
/dev/video74
cat /sys/class/video4linux/video74/name
mtk-v4l2-camera@0-Preview
Important
The above v4l2 device node number is for example. The node number may change every time the system boots.
To quickly fetch the correct node and assign the environment variable:
declare -a video=(`v4l2-ctl --list-devices | grep mtk-v4l2-camera -A 1 | grep video | tr -d "\n"`)
printf "Preview Node\t= ${video[0]}\n"
Preview Node = /dev/video74
Section Supported formats and Sizes shows the supported formats and sizes.
The user can also use the v4l2 utility, v4l2-ctl
, to list formats.
v4l2-ctl -d ${video[0]} --list-formats-ext
ioctl: VIDIOC_ENUM_FMT
Type: Video Capture Multiplanar
[0]: 'UYVY' (UYVY 4:2:2)
Size: Discrete 1920x1080
Interval: Discrete 0.033s (30.000 fps)
...
To launch the camera, the user can use v4l2-ctl
, gst-launch-1.0
, or other V4L2 applications.
Use
v4l2-ctl
v4l2-ctl -d ${video[0]} --set-fmt-video=width=1920,height=1080,pixelformat=UYVY --stream-mmap --stream-count=10 --stream-to=/tmp/ap1302.yuv --verbose
Use
gst-launch-1.0
gst-launch-1.0 v4l2src device=${video[0]} ! video/x-raw,width=1920,height=1080,format=UYVY ! v4l2convert output-io-mode=dmabuf-import ! video/x-raw,width=1280,height=720 ! waylandsink sync=false
Note
To use MediaTek video codec and mdp hardware, the user needs to load video.dtbo
. For more details, please refer to Genio 700-EVK Video Codec.
Sensor Launch Time
For the launch time of Onsemi AP1302 ISP and AR0830 sensor. Please refer to Sensor Launch Time.