RockPi4の設定のメモをします。
linaro@linaro-alip:~$ sudo apt install nano
日本語キーボード対応
linaro@linaro-alip:~$ sudo nano /etc/default/keyboard
-----
# KEYBOARD CONFIGURATION FILE
# Consult the keyboard(5) manual page.
XKBMODEL="pc105"
XKBLAYOUT="us"
XKBVARIANT=""
XKBOPTIONS=""
BACKSPACE="guess"
-----
↓
-----
# KEYBOARD CONFIGURATION FILE
# Consult the keyboard(5) manual page.
#XKBMODEL="pc105"
#XKBLAYOUT="us"
XKBMODEL="jp106"
XKBLAYOUT="jp"
XKBVARIANT=""
XKBOPTIONS=""
BACKSPACE="guess"
-----
ラズパイカメラ対応
linaro@linaro-alip:~$ sudo nano /boot/hw_intfc.conf
-----
# Add imx219 camera module support. Need disabled ov5647 camera module.
#intfc:dtoverlay=imx219
-----
↓
-----
# Add imx219 camera module support. Need disabled ov5647 camera module.
intfc:dtoverlay=imx219
-----
linaro@linaro-alip:~$ test_camera-rkisp1.sh
画が出ました。
確認してみます。
linaro@linaro-alip:~$ cat /usr/local/bin/test_camera-rkisp1.sh
#!/bin/sh
export DISPLAY=:0.0
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/lib/aarch64-linux-gnu/gstreamer-1.0
#export GST_DEBUG=ispsrc:5
#export GST_DEBUG_FILE=/tmp/2.txt
echo "Start RKISP Camera Preview!"
su linaro -c " \
gst-launch-1.0 rkv4l2src device=/dev/video0 ! video/x-raw,format=NV12,width=1920,height=1080, framerate=30/1 ! videoconvert ! autovideosink"
linaro@linaro-alip:~$ media-ctl -p
Media controller API version 0.1.0
Media device information
------------------------
driver rkisp1
model rkisp1
serial
bus info
hw revision 0x0
driver version 0.0.0
Device topology
- entity 1: rkisp1-isp-subdev (4 pads, 5 links)
type V4L2 subdev subtype Unknown flags 0
device node name /dev/v4l-subdev0
pad0: Sink
[fmt:SBGGR10_1X10/800x600 field:none
crop.bounds:(0,0)/800x600
crop:(0,0)/800x600]
<- "rockchip-sy-mipi-dphy":1 [ENABLED]
pad1: Sink
<- "rkisp1-input-params":0 [ENABLED]
pad2: Source
[fmt:YUYV8_2X8/800x600 field:none
crop.bounds:(0,0)/800x600
crop:(0,0)/800x600]
-> "rkisp1_selfpath":0 [ENABLED]
-> "rkisp1_mainpath":0 [ENABLED]
pad3: Source
-> "rkisp1-statistics":0 [ENABLED]
- entity 2: rkisp1_mainpath (1 pad, 1 link)
type Node subtype V4L flags 0
device node name /dev/video0
pad0: Sink
<- "rkisp1-isp-subdev":2 [ENABLED]
- entity 3: rkisp1_selfpath (1 pad, 1 link)
type Node subtype V4L flags 0
device node name /dev/video1
pad0: Sink
<- "rkisp1-isp-subdev":2 [ENABLED]
- entity 4: rkisp1-statistics (1 pad, 1 link)
type Node subtype V4L flags 0
device node name /dev/video2
pad0: Sink
<- "rkisp1-isp-subdev":3 [ENABLED]
- entity 5: rkisp1-input-params (1 pad, 1 link)
type Node subtype V4L flags 0
device node name /dev/video3
pad0: Source
-> "rkisp1-isp-subdev":1 [ENABLED]
- entity 6: rockchip-sy-mipi-dphy (2 pads, 2 links)
type V4L2 subdev subtype Unknown flags 0
device node name /dev/v4l-subdev1
pad0: Sink
[fmt:SRGGB10_1X10/1920x1080 field:none]
<- "imx219 4-0010":0 [ENABLED]
pad1: Source
[fmt:SRGGB10_1X10/1920x1080 field:none]
-> "rkisp1-isp-subdev":0 [ENABLED]
- entity 7: imx219 4-0010 (1 pad, 1 link)
type V4L2 subdev subtype Sensor flags 0
device node name /dev/v4l-subdev2
pad0: Source
[fmt:SRGGB10_1X10/1920x1080 field:none]
-> "rockchip-sy-mipi-dphy":0 [ENABLED]
linaro@linaro-alip:~$ v4l2-ctl -d /dev/video0 --all
Driver Info (not using libv4l2):
Driver name : rkisp1
Card type : rkisp1_mainpath
Bus info : platform:ff910000.rkisp1
Driver version: 4.4.154
Capabilities : 0x84201000
Video Capture Multiplanar
Streaming
Extended Pix Format
Device Capabilities
Device Caps : 0x04201000
Video Capture Multiplanar
Streaming
Extended Pix Format
Priority: 2
Format Video Capture Multiplanar:
Width/Height : 3280/2464
Pixel Format : 'NM12'
Field : None
Number of planes : 2
Flags :
Colorspace : BT.2020
Transfer Function : Rec. 709
YCbCr Encoding : BT.2020
Quantization : Full Range
Plane 0 :
Bytes per Line : 3280
Size Image : 8081920
Plane 1 :
Bytes per Line : 3280
Size Image : 4040960
Crop: Left 0, Top 0, Width 800, Height 600
Selection: crop, Left 0, Top 0, Width 800, Height 600
Selection: crop_bounds, Left 0, Top 0, Width 800, Height 600
Selection: crop, Left 0, Top 0, Width 800, Height 600
Selection: crop_bounds, Left 0, Top 0, Width 800, Height 600
User Controls
exposure (int) : min=0 max=4095 step=1 default=1575 value=1575
gain (int) : min=256 max=43663 step=1 default=256 value=256
horizontal_flip (bool) : default=0 value=0
vertical_flip (bool) : default=0 value=0
Image Source Controls
vertical_blanking (int) : min=686 max=686 step=1 default=686 value=686
horizontal_blanking (int) : min=1524 max=1524 step=1 default=1524 value=1524
analogue_gain (int) : min=256 max=2816 step=1 default=512 value=512
Image Processing Controls
link_frequency (intmenu): min=0 max=0 default=0 value=0
pixel_rate (int64) : min=0 max=0 step=0 default=0 value=182463120 flags=read-only
test_pattern (menu) : min=0 max=13 default=0 value=0
linaro@linaro-alip:~$ v4l2-ctl -d /dev/video0 --list-formats-ext
ioctl: VIDIOC_ENUM_FMT
Index : 0
Type : Video Capture Multiplanar
Pixel Format: 'YUYV'
Name : YUYV 4:2:2
Index : 1
Type : Video Capture Multiplanar
Pixel Format: 'YVYU'
Name : YVYU 4:2:2
Index : 2
Type : Video Capture Multiplanar
Pixel Format: 'VYUY'
Name : VYUY 4:2:2
Index : 3
Type : Video Capture Multiplanar
Pixel Format: '422P'
Name : Planar YVU 4:2:2
Index : 4
Type : Video Capture Multiplanar
Pixel Format: 'NV16'
Name : Y/CbCr 4:2:2
Index : 5
Type : Video Capture Multiplanar
Pixel Format: 'NV61'
Name : Y/CrCb 4:2:2
Index : 6
Type : Video Capture Multiplanar
Pixel Format: 'YM61'
Name : Planar YVU 4:2:2 (N-C)
Index : 7
Type : Video Capture Multiplanar
Pixel Format: 'NV21'
Name : Y/CrCb 4:2:0
Index : 8
Type : Video Capture Multiplanar
Pixel Format: 'NV12'
Name : Y/CbCr 4:2:0
Index : 9
Type : Video Capture Multiplanar
Pixel Format: 'NM21'
Name : Y/CrCb 4:2:0 (N-C)
Index : 10
Type : Video Capture Multiplanar
Pixel Format: 'NM12'
Name : Y/CbCr 4:2:0 (N-C)
Index : 11
Type : Video Capture Multiplanar
Pixel Format: 'YU12'
Name : Planar YUV 4:2:0
Index : 12
Type : Video Capture Multiplanar
Pixel Format: 'YV12'
Name : Planar YVU 4:2:0
Index : 13
Type : Video Capture Multiplanar
Pixel Format: 'YM24'
Name : Planar YUV 4:4:4 (N-C)
Index : 14
Type : Video Capture Multiplanar
Pixel Format: 'GREY'
Name : 8-bit Greyscale
Index : 15
Type : Video Capture Multiplanar
Pixel Format: 'RGGB'
Name : 8-bit Bayer RGRG/GBGB
Index : 16
Type : Video Capture Multiplanar
Pixel Format: 'GRBG'
Name : 8-bit Bayer GRGR/BGBG
Index : 17
Type : Video Capture Multiplanar
Pixel Format: 'GBRG'
Name : 8-bit Bayer GBGB/RGRG
Index : 18
Type : Video Capture Multiplanar
Pixel Format: 'BA81'
Name : 8-bit Bayer BGBG/GRGR
Index : 19
Type : Video Capture Multiplanar
Pixel Format: 'RGGB'
Name : 8-bit Bayer RGRG/GBGB
Index : 20
Type : Video Capture Multiplanar
Pixel Format: 'BA10'
Name : 10-bit Bayer GRGR/BGBG
Index : 21
Type : Video Capture Multiplanar
Pixel Format: 'GB10'
Name : 10-bit Bayer GBGB/RGRG
Index : 22
Type : Video Capture Multiplanar
Pixel Format: 'BG10'
Name : 10-bit Bayer BGBG/GRGR
Index : 23
Type : Video Capture Multiplanar
Pixel Format: 'RG12'
Name : 12-bit Bayer RGRG/GBGB
Index : 24
Type : Video Capture Multiplanar
Pixel Format: 'BA12'
Name : 12-bit Bayer GRGR/BGBG
Index : 25
Type : Video Capture Multiplanar
Pixel Format: 'GB12'
Name : 12-bit Bayer GBGB/RGRG
Index : 26
Type : Video Capture Multiplanar
Pixel Format: 'BG12'
Name : 12-bit Bayer BGBG/GRGR
グラフ作成
DOTコマンドをインストール
linaro@linaro-alip:~$ sudo apt install graphviz
linaro@linaro-alip:~$ dot -V
dot - graphviz version 2.38.0 (20140413.2041)
linaro@linaro-alip:~$ media-ctl --print-dot > graph.dot
linaro@linaro-alip:~$ dot -Tpng graph.dot > graph.png
linaro@linaro-alip:~$ ls /dev/v4l-subdev* -l
crw-rw----+ 1 root video 81, 4 Nov 4 16:43 /dev/v4l-subdev0
crw-rw----+ 1 root video 81, 5 Nov 4 16:43 /dev/v4l-subdev1
crw-rw----+ 1 root video 81, 6 Nov 4 16:43 /dev/v4l-subdev2
linaro@linaro-alip:~$ ls /dev/video* -l
crw-rw----+ 1 root video 81, 0 Nov 4 16:43 /dev/video0
crw-rw----+ 1 root video 81, 1 Nov 4 16:43 /dev/video1
crw-rw----+ 1 root video 81, 2 Nov 4 16:43 /dev/video2
crw-rw----+ 1 root video 81, 3 Nov 4 16:43 /dev/video3
2画面
linaro@linaro-alip:~$ export DISPLAY=:0.0
linaro@linaro-alip:~$ export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/lib/aarch64-linux-gnu/gstreamer-1.0
linaro@linaro-alip:~$ gst-launch-1.0 rkv4l2src device=/dev/video0 ! video/x-raw,format=NV12,width=1920,height=1080, framerate=30/1 ! videoconvert ! autovideosink"
画がでます。
別端末で
linaro@linaro-alip:~$ export DISPLAY=:0.0
linaro@linaro-alip:~$ export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/lib/aarch64-linux-gnu/gstreamer-1.0
linaro@linaro-alip:~$ gst-launch-1.0 rkv4l2src device=/dev/video1 ! video/x-raw,format=NV12,width=1920,height=1080, framerate=30/1 ! videoconvert ! autovideosink"
画が出ました。
もう一つ端末を開いて
linaro@linaro-alip:~$ export DISPLAY=:0.0
linaro@linaro-alip:~$ export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/lib/aarch64-linux-gnu/gstreamer-1.0
linaro@linaro-alip:~$ gst-launch-1.0 rkv4l2src device=/dev/video2 ! video/x-raw,format=NV12,width=1920,height=1080, framerate=30/1 ! videoconvert ! autovideosink"
エラーになりました。
OpenCVをインストール
linaro@linaro-alip:~$ sudo apt install opencv-dev