This is a cache of https://discuss.96boards.org/t/d3-mezzanine-camera-on-db820c/9011. It is a snapshot of the page at 2024-11-14T02:29:27.602+0000.
D3 Mezzanine Camera on DB820C - <strong>dragonboard</strong> 820c - 96Boards Forum

D3 Mezzanine Camera on DB820C

Hi,

Is the D3 camera (OV5640) working on the DB820C? Documentation mostly mentions working with the DB410C.

Do we need to use a special branch of the qcomlt kernel or just the standard stable one?

Thanks

Yes, use the standard stable branch, for ov5640 you may have to use my branch or top: loic.poulain/linux.git - [no description]

(I definitely need to submit remaining few patches upstream)

2 Likes

Hi @Loic,

I’m testing the ov5640 (with your above changes) and I cannot do the proper conversion to NV12 following this guideline.

I can do a snapshot by using the RDI and UYVY with the following commands:

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]'
media-ctl -d /dev/media0 -V '"ov5640 3-003c":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]'
gst-launch-1.0 v4l2src device=/dev/video2 num-buffers=1 ! 'video/x-raw,format=UYVY,width=1920,height=1080' ! jpegenc ! filesink location=image01.jpg

As said, above commands work fine but when I try to use the PIX (instead of the RDI) for the conversion to NV12 I’m having a segfault. Here the bt:

[  214.560989] [<ffff000000e2c614>] vb2_start_streaming+0x10c/0x1e0 [videobuf2_core]
[  214.568800] [<ffff000000e2e490>] vb2_core_streamon+0x88/0x190 [videobuf2_core]
[  214.576270] [<ffff000000e5d2d8>] vb2_streamon+0x18/0x70 [videobuf2_v4l2]
[  214.583378] [<ffff000000e5d378>] vb2_ioctl_streamon+0x48/0x58 [videobuf2_v4l2]
[  214.590330] [<ffff000000c99a40>] v4l_streamon+0x20/0x28 [videodev]
[  214.597291] [<ffff000000c9b830>] __video_do_ioctl+0x1e8/0x2b8 [videodev]
[  214.603453] [<ffff000000c9b174>] video_usercopy+0x144/0x5f8 [videodev]
[  214.610310] [<ffff000000c9b638>] video_ioctl2+0x10/0x20 [videodev]
[  214.616647] [<ffff000000c987a8>] v4l2_ioctl+0xe0/0x120 [videodev]
[  214.622792] [<ffff000008273814>] do_vfs_ioctl+0x60c/0x868
[  214.628950] [<ffff000008273ae8>] SyS_ioctl+0x78/0x98
[  214.634329] Exception stack(0xffff00000f10bec0 to 0xffff00000f10c000)

The camera is configured properly according to media-ctl:

- entity 1: msm_csiphy0 (2 pads, 5 links)
            type Node subtype V4L flags 0
            device node name /dev/v4l-subdev0
	pad0: Sink
		<- "ov5640 3-003c":0 [ENABLED,IMMUTABLE]
	pad1: Source
		-> "msm_csid0":0 [ENABLED]
		-> "msm_csid1":0 []
		-> "msm_csid2":0 []
		-> "msm_csid3":0 []
...
- entity 10: msm_csid0 (2 pads, 7 links)
             type Node subtype V4L flags 0
             device node name /dev/v4l-subdev3
	pad0: Sink
		<- "msm_csiphy0":1 [ENABLED]
		<- "msm_csiphy1":1 []
		<- "msm_csiphy2":1 []
	pad1: Source
		-> "msm_ispif0":0 [ENABLED]
		-> "msm_ispif1":0 []
		-> "msm_ispif2":0 []
		-> "msm_ispif3":0 []
...
- entity 22: msm_ispif0 (2 pads, 12 links)
             type Node subtype V4L flags 0
             device node name /dev/v4l-subdev7
	pad0: Sink
		<- "msm_csid0":1 [ENABLED]
		<- "msm_csid1":1 []
		<- "msm_csid2":1 []
		<- "msm_csid3":1 []
	pad1: Source
		-> "msm_vfe0_rdi0":0 []
		-> "msm_vfe0_rdi1":0 []
		-> "msm_vfe0_rdi2":0 []
		-> "msm_vfe0_pix":0 [ENABLED]
		-> "msm_vfe1_rdi0":0 []
		-> "msm_vfe1_rdi1":0 []
		-> "msm_vfe1_rdi2":0 []
		-> "msm_vfe1_pix":0 []

...
- entity 61: msm_vfe0_pix (2 pads, 5 links)
             type V4L2 subdev subtype Unknown flags 0
             device node name /dev/v4l-subdev14
	pad0: Sink
		[fmt:UYVY8_2X8/1280x960 field:none colorspace:srgb
		 compose.bounds:(0,0)/1280x960
		 compose:(0,0)/1280x960]
		<- "msm_ispif0":1 [ENABLED]
		<- "msm_ispif1":1 []
		<- "msm_ispif2":1 []
		<- "msm_ispif3":1 []
	pad1: Source
		[fmt:UYVY8_1_5X8/1280x960 field:none colorspace:srgb
		 crop.bounds:(0,0)/1280x960
		 crop:(0,0)/1280x960]
		-> "msm_vfe0_video3":0 [ENABLED,IMMUTABLE]
...
- entity 64: msm_vfe0_video3 (1 pad, 1 link)
             type Node subtype V4L flags 0
             device node name /dev/video5
	pad0: Sink
		<- "msm_vfe0_pix":1 [ENABLED,IMMUTABLE]

- entity 226: ov5640 3-003c (1 pad, 1 link)
              type V4L2 subdev subtype Sensor flags 0
              device node name /dev/v4l-subdev19
	pad0: Source
		[fmt:UYVY8_2X8/1280x720@1/30 field:none colorspace:srgb xfer:srgb ycbcr:601 quantization:full-range]
		-> "msm_csiphy0":0 [ENABLED,IMMUTABLE]

Here the commands I’m using:

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_pix":0[1]'
media-ctl -d /dev/media0 -V '"ov5640 3-003c":0[fmt:UYVY8_2X8/1280x960 field:none],"msm_csiphy0":0[fmt:UYVY8_2X8/1280x960 field:none],"msm_csid0":0[fmt:UYVY8_2X8/1280x960 field:none],"msm_ispif0":0[fmt:UYVY8_2X8/1280x960 field:none],"msm_vfe0_pix":0[fmt:UYVY8_2X8/1280x960 field:none],"msm_vfe0_pix":1[fmt:UYVY8_1_5X8/1280x960 field:none]'
gst-launch-1.0 v4l2src device=/dev/video5 num-buffers=1 ! 'video/x-raw,format=NV12,width=1280,height=960,framerate=30/1' ! jpegenc ! filesink location=image02.jpg

Devices:

# v4l2-ctl --list-devices
Qualcomm Camera Subsystem (platform:a34000.camss):
	/dev/video2
	/dev/video3
	/dev/video4
	/dev/video5
	/dev/video6
	/dev/video7
	/dev/video8
	/dev/video9

Qualcomm Camera Subsystem (platform:qcom-camss):
	/dev/media0

Qualcomm Venus video encoder (platform:qcom-venus):
	/dev/video0
	/dev/video1

Any feedback is appreciated.

Thanks!

It looks like your sensor driver doesn’t support 1280x960 (and is defaulting to 1280x720 based on the ov5640 part of “media-ctl -d /dev/media* -p” output).

Try change your pipeline to use 1920x1080 for the NV12 conversion - this should work. Or try 1280x720.

2 Likes

Cool!
Thanks for the help. I didn’t realize about the format. Now, I’m able to do NV12 snapshot in both resolutions:

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_pix":0[1]'
media-ctl -d /dev/media0 -V '"ov5640 3-003c":0[fmt:UYVY8_2X8/1280x720 field:none],"msm_csiphy0":0[fmt:UYVY8_2X8/1280x720 field:none],"msm_csid0":0[fmt:UYVY8_2X8/1280x720 field:none],"msm_ispif0":0[fmt:UYVY8_2X8/1280x720 field:none],"msm_vfe0_pix":0[fmt:UYVY8_2X8/1280x720 field:none],"msm_vfe0_pix":1[fmt:UYVY8_1_5X8/1280x720 field:none]'
gst-launch-1.0 v4l2src device=/dev/video5 num-buffers=1 ! 'video/x-raw,format=NV12,width=1280,height=720,framerate=30/1' ! jpegenc ! filesink location=image02.jpg
media-ctl -d /dev/media0 -V '"ov5640 3-003c":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_pix":0[fmt:UYVY8_2X8/1920x1080 field:none],"msm_vfe0_pix":1[fmt:UYVY8_1_5X8/1920x1080 field:none]'
gst-launch-1.0 v4l2src device=/dev/video5 num-buffers=1 ! 'video/x-raw,format=NV12,width=1920,height=1080,framerate=30/1' ! jpegenc ! filesink location=image02.jpg