CoolPi 4B OV5647 摄像头图片全黑
-
在CoolPi 4B 上使用Rpi Camera rev1.3的摄像头,最开始读取/dev/video11,光线很暗,发现rkaiq_3a_server没有跑起来,所以使用Coolpi launchpad上的rkaiq_3a_server进行测试,server没有报错,但是v4l2读取到的图片全黑(试着用手电筒对着摄像头照,也是全黑的)
使用的内核是自己编译的,是github上的develop分支,两天前clone下来并编译的,除了更新rknpu驱动之外没有动其他的地方
dmesg信息:(base) root@Ubuntu:~# dmesg | grep ov564 [ 14.392970] ov5648 8-0036: driver version: 00.01.05 [ 14.392978] ov5648 8-0036: Failed to get power-gpios, maybe no use [ 14.392981] ov5648 8-0036: Failed to get reset-gpios, maybe no use [ 14.392984] ov5648 8-0036: Failed to get pwdn-gpios [ 14.393012] ov5648 8-0036: supply dovdd not found, using dummy regulator [ 14.393034] ov5648 8-0036: supply dvdd not found, using dummy regulator [ 14.393042] ov5648 8-0036: lane_num(2) pixel_rate(84000000) [ 14.393044] ov5648 8-0036: could not get default pinstate [ 14.398434] ov5648 8-0036: could not get sleep pinstate [ 14.406994] ov5648 8-0036: Detected OV005647 sensor [ 14.407004] rockchip-csi2-dphy csi2-dphy0: dphy0 matches m01_f_ov5648 8-0036:bus type 5
/dev/video设备:
(base) root@Ubuntu:~# ls /dev/video* /dev/video0 /dev/video12 /dev/video16 /dev/video2 /dev/video6 /dev/video-dec0 /dev/video1 /dev/video13 /dev/video17 /dev/video3 /dev/video7 /dev/video-enc0 /dev/video10 /dev/video14 /dev/video18 /dev/video4 /dev/video8 /dev/video11 /dev/video15 /dev/video19 /dev/video5 /dev/video9
v4l2 list devices信息:
(base) root@Ubuntu:~# v4l2-ctl --list-devices rkisp-statistics (platform: rkisp): /dev/video18 /dev/video19 rkcif-mipi-lvds2 (platform:rkcif): /dev/media0 rkcif (platform:rkcif-mipi-lvds2): /dev/video0 /dev/video1 /dev/video2 /dev/video3 /dev/video4 /dev/video5 /dev/video6 /dev/video7 /dev/video8 /dev/video9 /dev/video10 rkisp_mainpath (platform:rkisp0-vir0): /dev/video11 /dev/video12 /dev/video13 /dev/video14 /dev/video15 /dev/video16 /dev/video17 /dev/media1
media-ctl:
(base) root@Ubuntu:~# sudo media-ctl -p -d /dev/media0 Media controller API version 5.10.110 Media device information ------------------------ driver rkcif model rkcif-mipi-lvds2 serial bus info hw revision 0x0 driver version 5.10.110 Device topology - entity 1: stream_cif_mipi_id0 (1 pad, 11 links) type Node subtype V4L flags 0 device node name /dev/video0 pad0: Sink <- "rockchip-mipi-csi2":1 [ENABLED] <- "rockchip-mipi-csi2":2 [] <- "rockchip-mipi-csi2":3 [] <- "rockchip-mipi-csi2":4 [] <- "rockchip-mipi-csi2":5 [] <- "rockchip-mipi-csi2":6 [] <- "rockchip-mipi-csi2":7 [] <- "rockchip-mipi-csi2":8 [] <- "rockchip-mipi-csi2":9 [] <- "rockchip-mipi-csi2":10 [] <- "rockchip-mipi-csi2":11 [] - entity 5: stream_cif_mipi_id1 (1 pad, 11 links) type Node subtype V4L flags 0 device node name /dev/video1 pad0: Sink <- "rockchip-mipi-csi2":1 [] <- "rockchip-mipi-csi2":2 [ENABLED] <- "rockchip-mipi-csi2":3 [] <- "rockchip-mipi-csi2":4 [] <- "rockchip-mipi-csi2":5 [] <- "rockchip-mipi-csi2":6 [] <- "rockchip-mipi-csi2":7 [] <- "rockchip-mipi-csi2":8 [] <- "rockchip-mipi-csi2":9 [] <- "rockchip-mipi-csi2":10 [] <- "rockchip-mipi-csi2":11 [] - entity 9: stream_cif_mipi_id2 (1 pad, 11 links) type Node subtype V4L flags 0 device node name /dev/video2 pad0: Sink <- "rockchip-mipi-csi2":1 [] <- "rockchip-mipi-csi2":2 [] <- "rockchip-mipi-csi2":3 [ENABLED] <- "rockchip-mipi-csi2":4 [] <- "rockchip-mipi-csi2":5 [] <- "rockchip-mipi-csi2":6 [] <- "rockchip-mipi-csi2":7 [] <- "rockchip-mipi-csi2":8 [] <- "rockchip-mipi-csi2":9 [] <- "rockchip-mipi-csi2":10 [] <- "rockchip-mipi-csi2":11 [] - entity 13: stream_cif_mipi_id3 (1 pad, 11 links) type Node subtype V4L flags 0 device node name /dev/video3 pad0: Sink <- "rockchip-mipi-csi2":1 [] <- "rockchip-mipi-csi2":2 [] <- "rockchip-mipi-csi2":3 [] <- "rockchip-mipi-csi2":4 [ENABLED] <- "rockchip-mipi-csi2":5 [] <- "rockchip-mipi-csi2":6 [] <- "rockchip-mipi-csi2":7 [] <- "rockchip-mipi-csi2":8 [] <- "rockchip-mipi-csi2":9 [] <- "rockchip-mipi-csi2":10 [] <- "rockchip-mipi-csi2":11 [] - entity 17: rkcif_scale_ch0 (1 pad, 11 links) type Node subtype V4L flags 0 device node name /dev/video4 pad0: Sink <- "rockchip-mipi-csi2":1 [] <- "rockchip-mipi-csi2":2 [] <- "rockchip-mipi-csi2":3 [] <- "rockchip-mipi-csi2":4 [] <- "rockchip-mipi-csi2":5 [ENABLED] <- "rockchip-mipi-csi2":6 [] <- "rockchip-mipi-csi2":7 [] <- "rockchip-mipi-csi2":8 [] <- "rockchip-mipi-csi2":9 [] <- "rockchip-mipi-csi2":10 [] <- "rockchip-mipi-csi2":11 [] - entity 21: rkcif_scale_ch1 (1 pad, 11 links) type Node subtype V4L flags 0 device node name /dev/video5 pad0: Sink <- "rockchip-mipi-csi2":1 [] <- "rockchip-mipi-csi2":2 [] <- "rockchip-mipi-csi2":3 [] <- "rockchip-mipi-csi2":4 [] <- "rockchip-mipi-csi2":5 [] <- "rockchip-mipi-csi2":6 [ENABLED] <- "rockchip-mipi-csi2":7 [] <- "rockchip-mipi-csi2":8 [] <- "rockchip-mipi-csi2":9 [] <- "rockchip-mipi-csi2":10 [] <- "rockchip-mipi-csi2":11 [] - entity 25: rkcif_scale_ch2 (1 pad, 11 links) type Node subtype V4L flags 0 device node name /dev/video6 pad0: Sink <- "rockchip-mipi-csi2":1 [] <- "rockchip-mipi-csi2":2 [] <- "rockchip-mipi-csi2":3 [] <- "rockchip-mipi-csi2":4 [] <- "rockchip-mipi-csi2":5 [] <- "rockchip-mipi-csi2":6 [] <- "rockchip-mipi-csi2":7 [ENABLED] <- "rockchip-mipi-csi2":8 [] <- "rockchip-mipi-csi2":9 [] <- "rockchip-mipi-csi2":10 [] <- "rockchip-mipi-csi2":11 [] - entity 29: rkcif_scale_ch3 (1 pad, 11 links) type Node subtype V4L flags 0 device node name /dev/video7 pad0: Sink <- "rockchip-mipi-csi2":1 [] <- "rockchip-mipi-csi2":2 [] <- "rockchip-mipi-csi2":3 [] <- "rockchip-mipi-csi2":4 [] <- "rockchip-mipi-csi2":5 [] <- "rockchip-mipi-csi2":6 [] <- "rockchip-mipi-csi2":7 [] <- "rockchip-mipi-csi2":8 [ENABLED] <- "rockchip-mipi-csi2":9 [] <- "rockchip-mipi-csi2":10 [] <- "rockchip-mipi-csi2":11 [] - entity 33: rkcif_tools_id0 (1 pad, 11 links) type Node subtype V4L flags 0 device node name /dev/video8 pad0: Sink <- "rockchip-mipi-csi2":1 [] <- "rockchip-mipi-csi2":2 [] <- "rockchip-mipi-csi2":3 [] <- "rockchip-mipi-csi2":4 [] <- "rockchip-mipi-csi2":5 [] <- "rockchip-mipi-csi2":6 [] <- "rockchip-mipi-csi2":7 [] <- "rockchip-mipi-csi2":8 [] <- "rockchip-mipi-csi2":9 [ENABLED] <- "rockchip-mipi-csi2":10 [] <- "rockchip-mipi-csi2":11 [] - entity 37: rkcif_tools_id1 (1 pad, 11 links) type Node subtype V4L flags 0 device node name /dev/video9 pad0: Sink <- "rockchip-mipi-csi2":1 [] <- "rockchip-mipi-csi2":2 [] <- "rockchip-mipi-csi2":3 [] <- "rockchip-mipi-csi2":4 [] <- "rockchip-mipi-csi2":5 [] <- "rockchip-mipi-csi2":6 [] <- "rockchip-mipi-csi2":7 [] <- "rockchip-mipi-csi2":8 [] <- "rockchip-mipi-csi2":9 [] <- "rockchip-mipi-csi2":10 [ENABLED] <- "rockchip-mipi-csi2":11 [] - entity 41: rkcif_tools_id2 (1 pad, 11 links) type Node subtype V4L flags 0 device node name /dev/video10 pad0: Sink <- "rockchip-mipi-csi2":1 [] <- "rockchip-mipi-csi2":2 [] <- "rockchip-mipi-csi2":3 [] <- "rockchip-mipi-csi2":4 [] <- "rockchip-mipi-csi2":5 [] <- "rockchip-mipi-csi2":6 [] <- "rockchip-mipi-csi2":7 [] <- "rockchip-mipi-csi2":8 [] <- "rockchip-mipi-csi2":9 [] <- "rockchip-mipi-csi2":10 [] <- "rockchip-mipi-csi2":11 [ENABLED] - entity 45: rockchip-mipi-csi2 (12 pads, 122 links) type V4L2 subdev subtype Unknown flags 0 device node name /dev/v4l-subdev0 pad0: Sink [fmt:SBGGR10_1X10/2592x1944 field:none crop.bounds:(0,0)/2592x1944 crop:(0,0)/2592x1944] <- "rockchip-csi2-dphy0":1 [ENABLED] pad1: Source -> "stream_cif_mipi_id0":0 [ENABLED] -> "stream_cif_mipi_id1":0 [] -> "stream_cif_mipi_id2":0 [] -> "stream_cif_mipi_id3":0 [] -> "rkcif_scale_ch0":0 [] -> "rkcif_scale_ch1":0 [] -> "rkcif_scale_ch2":0 [] -> "rkcif_scale_ch3":0 [] -> "rkcif_tools_id0":0 [] -> "rkcif_tools_id1":0 [] -> "rkcif_tools_id2":0 [] pad2: Source -> "stream_cif_mipi_id0":0 [] -> "stream_cif_mipi_id1":0 [ENABLED] -> "stream_cif_mipi_id2":0 [] -> "stream_cif_mipi_id3":0 [] -> "rkcif_scale_ch0":0 [] -> "rkcif_scale_ch1":0 [] -> "rkcif_scale_ch2":0 [] -> "rkcif_scale_ch3":0 [] -> "rkcif_tools_id0":0 [] -> "rkcif_tools_id1":0 [] -> "rkcif_tools_id2":0 [] pad3: Source -> "stream_cif_mipi_id0":0 [] -> "stream_cif_mipi_id1":0 [] -> "stream_cif_mipi_id2":0 [ENABLED] -> "stream_cif_mipi_id3":0 [] -> "rkcif_scale_ch0":0 [] -> "rkcif_scale_ch1":0 [] -> "rkcif_scale_ch2":0 [] -> "rkcif_scale_ch3":0 [] -> "rkcif_tools_id0":0 [] -> "rkcif_tools_id1":0 [] -> "rkcif_tools_id2":0 [] pad4: Source -> "stream_cif_mipi_id0":0 [] -> "stream_cif_mipi_id1":0 [] -> "stream_cif_mipi_id2":0 [] -> "stream_cif_mipi_id3":0 [ENABLED] -> "rkcif_scale_ch0":0 [] -> "rkcif_scale_ch1":0 [] -> "rkcif_scale_ch2":0 [] -> "rkcif_scale_ch3":0 [] -> "rkcif_tools_id0":0 [] -> "rkcif_tools_id1":0 [] -> "rkcif_tools_id2":0 [] pad5: Source -> "stream_cif_mipi_id0":0 [] -> "stream_cif_mipi_id1":0 [] -> "stream_cif_mipi_id2":0 [] -> "stream_cif_mipi_id3":0 [] -> "rkcif_scale_ch0":0 [ENABLED] -> "rkcif_scale_ch1":0 [] -> "rkcif_scale_ch2":0 [] -> "rkcif_scale_ch3":0 [] -> "rkcif_tools_id0":0 [] -> "rkcif_tools_id1":0 [] -> "rkcif_tools_id2":0 [] pad6: Source -> "stream_cif_mipi_id0":0 [] -> "stream_cif_mipi_id1":0 [] -> "stream_cif_mipi_id2":0 [] -> "stream_cif_mipi_id3":0 [] -> "rkcif_scale_ch0":0 [] -> "rkcif_scale_ch1":0 [ENABLED] -> "rkcif_scale_ch2":0 [] -> "rkcif_scale_ch3":0 [] -> "rkcif_tools_id0":0 [] -> "rkcif_tools_id1":0 [] -> "rkcif_tools_id2":0 [] pad7: Source -> "stream_cif_mipi_id0":0 [] -> "stream_cif_mipi_id1":0 [] -> "stream_cif_mipi_id2":0 [] -> "stream_cif_mipi_id3":0 [] -> "rkcif_scale_ch0":0 [] -> "rkcif_scale_ch1":0 [] -> "rkcif_scale_ch2":0 [ENABLED] -> "rkcif_scale_ch3":0 [] -> "rkcif_tools_id0":0 [] -> "rkcif_tools_id1":0 [] -> "rkcif_tools_id2":0 [] pad8: Source -> "stream_cif_mipi_id0":0 [] -> "stream_cif_mipi_id1":0 [] -> "stream_cif_mipi_id2":0 [] -> "stream_cif_mipi_id3":0 [] -> "rkcif_scale_ch0":0 [] -> "rkcif_scale_ch1":0 [] -> "rkcif_scale_ch2":0 [] -> "rkcif_scale_ch3":0 [ENABLED] -> "rkcif_tools_id0":0 [] -> "rkcif_tools_id1":0 [] -> "rkcif_tools_id2":0 [] pad9: Source -> "stream_cif_mipi_id0":0 [] -> "stream_cif_mipi_id1":0 [] -> "stream_cif_mipi_id2":0 [] -> "stream_cif_mipi_id3":0 [] -> "rkcif_scale_ch0":0 [] -> "rkcif_scale_ch1":0 [] -> "rkcif_scale_ch2":0 [] -> "rkcif_scale_ch3":0 [] -> "rkcif_tools_id0":0 [ENABLED] -> "rkcif_tools_id1":0 [] -> "rkcif_tools_id2":0 [] pad10: Source -> "stream_cif_mipi_id0":0 [] -> "stream_cif_mipi_id1":0 [] -> "stream_cif_mipi_id2":0 [] -> "stream_cif_mipi_id3":0 [] -> "rkcif_scale_ch0":0 [] -> "rkcif_scale_ch1":0 [] -> "rkcif_scale_ch2":0 [] -> "rkcif_scale_ch3":0 [] -> "rkcif_tools_id0":0 [] -> "rkcif_tools_id1":0 [ENABLED] -> "rkcif_tools_id2":0 [] pad11: Source -> "stream_cif_mipi_id0":0 [] -> "stream_cif_mipi_id1":0 [] -> "stream_cif_mipi_id2":0 [] -> "stream_cif_mipi_id3":0 [] -> "rkcif_scale_ch0":0 [] -> "rkcif_scale_ch1":0 [] -> "rkcif_scale_ch2":0 [] -> "rkcif_scale_ch3":0 [] -> "rkcif_tools_id0":0 [] -> "rkcif_tools_id1":0 [] -> "rkcif_tools_id2":0 [ENABLED] - entity 58: rockchip-csi2-dphy0 (2 pads, 2 links) type V4L2 subdev subtype Unknown flags 0 device node name /dev/v4l-subdev1 pad0: Sink [fmt:SBGGR10_1X10/2592x1944@10000/150000 field:none] <- "m01_f_ov5648 8-0036":0 [ENABLED] pad1: Source -> "rockchip-mipi-csi2":0 [ENABLED] - entity 63: m01_f_ov5648 8-0036 (1 pad, 1 link) type V4L2 subdev subtype Sensor flags 0 device node name /dev/v4l-subdev2 pad0: Source [fmt:SBGGR10_1X10/2592x1944@10000/150000 field:none] -> "rockchip-csi2-dphy0":0 [ENABLED]
打开摄像头时,串口有输出:
[ 271.647209] rockchip-mipi-csi2 fdd30000.mipi2-csi2: stream on, src_sd: 00000000cc5b661a, sd_name:rockchip-csi2-dphy0 [ 271.657719] rockchip-mipi-csi2 fdd30000.mipi2-csi2: stream ON [ 293.181404] rockchip-mipi-csi2 fdd30000.mipi2-csi2: stream off, src_sd: 00000000cc5b661a, sd_name:rockchip-csi2-dphy0 [ 293.191999] rockchip-mipi-csi2 fdd30000.mipi2-csi2: stream OFF
后台可以看到rkaiq server:
(base) root@Ubuntu:~# ps -aux | grep aiq root 3356 0.0 0.0 2304 828 ? S 13:24 0:00 /bin/sh -c /usr/bin/rkaiq_3A_server 2>&1 | logger -t rkaiq_3A root 3357 1.0 0.1 341528 13248 ? Sl 13:24 0:00 /usr/bin/rkaiq_3A_server root 3358 0.0 0.0 11216 1504 ? S 13:24 0:00 logger -t rkaiq_3A root 3422 0.0 0.0 8648 2008 pts/0 R+ 13:24 0:00 grep --color=auto aiq
rkaiq_3a_server的输出:
Cound not find rkisp dev names, skipped /dev/media0 ERR: Bad media topology for: /dev/media0 DBG: get rkisp-isp-subdev devname: /dev/v4l-subdev3 DBG: get rkisp-input-params devname: /dev/video19 DBG: get rkisp-statistics devname: /dev/video18 DBG: get rkisp_mainpath devname: /dev/video11 rkaiq log level ff0 ************************** VERSION INFOS ************************** version release date: 2022-09-20 AIQ: AIQ v3.0x9.1 IQ PARSER: Calib v1.4.8,magicCode:1170944 ************************ VERSION INFOS END ************************ ERR: Bad media topology for: /dev/media2 ERR: Bad media topology for: /dev/media3 ERR: Bad media topology for: /dev/media4 ERR: Bad media topology for: /dev/media5 ERR: Bad media topology for: /dev/media6 ERR: Bad media topology for: /dev/media7 ERR: Bad media topology for: /dev/media8 ERR: Bad media topology for: /dev/media9 ERR: Bad media topology for: /dev/media10 ERR: Bad media topology for: /dev/media11 ERR: Bad media topology for: /dev/media12 ERR: Bad media topology for: /dev/media13 ERR: Bad media topology for: /dev/media14 ERR: Bad media topology for: /dev/media15 DBG: subscribe events from /dev/video19 success ! DBG: device manager start DBG: rkisp_init engine succeed DBG: /dev/media1: wait stream start event... DBG: /dev/media1: wait stream start event success ... DBG: /dev/media1: wait stream stop event...
v4l2-ctl抓图的log:
sudo v4l2-ctl --verbose -d /dev/video11 --set-fmt-video=width=1920,height=1080,pixelformat='NV12' --stream-mmap=4 --set-selection=target=crop,flags=0,top=0,left=0,width=1920,height=1080 --stream-to=out1.yuv VIDIOC_QUERYCAP: ok VIDIOC_G_FMT: ok VIDIOC_S_FMT: ok Format Video Capture Multiplanar: Width/Height : 1920/1080 Pixel Format : 'NV12' (Y/CbCr 4:2:0) Field : None Number of planes : 1 Flags : Colorspace : Default Transfer Function : Default YCbCr/HSV Encoding: Default Quantization : Full Range Plane 0 : Bytes per Line : 1920 Size Image : 3110400 VIDIOC_G_SELECTION: ok VIDIOC_S_SELECTION: ok VIDIOC_REQBUFS returned 0 (Success) VIDIOC_QUERYBUF returned 0 (Success) VIDIOC_QUERYBUF returned 0 (Success) VIDIOC_QUERYBUF returned 0 (Success) VIDIOC_QUERYBUF returned 0 (Success) VIDIOC_QBUF returned 0 (Success) VIDIOC_QBUF returned 0 (Success) VIDIOC_QBUF returned 0 (Success) VIDIOC_QBUF returned 0 (Success) VIDIOC_STREAMON returned 0 (Success)
(然后就卡死在那里了,Ctrl+C之后显示streaming off,out1.yuv大小为0)
请问一下大佬们有遇到过类似的情况吗,感激不尽!! -
@traceback
使用QV4L2测试一下节点,确实是否可以正常获取图像,除了型号以外,不同的sensor镜头也会对图像产生影响。 -
@george
您好,这是qv4l2的截图 -
@george 您好,我又确认了一下,在用systemctl关闭rkaiq的服务之后,读取/dev/video11就是正常的未经isp处理的图像,颜色非常暗,然后开启rkaiq_3a_server之后图像就是全黑的,使用v4l2抓图像是没有读出来数据,感觉不像是读出来了全黑的图