After studying both solutions, finally I decided to modify the apq8016-sbc.dtsi file because I’m not sure how to modify the enable-ov5645.sh
script to enable the 2nd ov5645.
After generating the new boot img and use it to update the boot partition of the sd card, now the second ov5645 is enabled. By executing:
sudo media-ctl -d /dev/media0 -p
, it appears as:
- entity 89: ov5645 4-003a (1 pad, 1 link) ...
According to Using CSI camera with a Dragonboard-410c - 96Boards,
I can configure the first ov5645 with the following command:
sudo media-ctl -d /dev/media0 -l '"msm_csiphy0":1->"msm_csid0":0[1],"msm_csid0":1->"msm_ispif0":0[1],"msm_ispif0":1->"msm_vfe0_rdi0":0[1]'
sudo media-ctl -d /dev/media0 -V '"ov5645 4-003b":0[fmt:UYVY8_2X8/1920x1080 field:none],"msm_csiphy0":0[fmt:UYVY8_2X8/1920x1080 field:none],"msm_csid0":0[fmt:UYVY8_2X8/1920x1080 field:none],"msm_ispif0":0[fmt:UYVY8_2X8/1920x1080 field:none],"msm_vfe0_rdi0":0[fmt:UYVY8_2X8/1920x1080 field:none]'
And then I can actually take a snap shot using gst-launch-1.0
.
For the 2nd ov5645, the following commands are used to configure:
sudo media-ctl -d /dev/media0 -l '"msm_csiphy1":1->"msm_csid1":0[1],"msm_csid1":1->"msm_ispif1":0[1],"msm_ispif1":1->"msm_vfe0_rdi1":0[1]'
sudo media-ctl -d /dev/media0 -V '"ov5645 4-003a":0[fmt:UYVY8_2X8/1920x1080 field:none],"msm_csiphy1":0[fmt:UYVY8_2X8/1920x1080 field:none],"msm_csid1":0[fmt:UYVY8_2X8/1920x1080 field:none],"msm_ispif1":0[fmt:UYVY8_2X8/1920x1080 field:none],"msm_vfe0_rdi1":0[fmt:UYVY8_2X8/1920x1080 field:none]'
and take a snap shot:
gst-launch-1.0 v4l2src device=/dev/video1 num-buffers=1 ! 'video/x-raw,format=UYVY,width=1920,height=1080' ! jpegenc ! filesink location=image02.jpg
It’s great to solve this issue. Many thanks to the great help from @Loic and @danielt!