RK3588-RD-V12多imx415运行调试
RK3588-RD-V12多imx415运行调试
情况简述
之前买过一块RK3588-RD-V12,四个imx415摄像头工作正常,后板子经常硬重启,怀疑板卡出现问题,购买一块新的RK3588-RD-V12,调试imx415过程中发现问题,具体表现为:
- 四个摄像头只有两个注册成功
- 注册成功摄像头无法用gst命令工作
调试过程
开机启动dmesg
查看imx415摄像头设备信息,两个注册失败
rpdzkj@debian11:~$ dmesg | grep imx
[ 7.316092] imx415 2-001a: driver version: 00.01.08
[ 7.316102] imx415 2-001a: Get hdr mode failed! no hdr default
[ 7.316120] imx415 2-001a: Failed to get reset-gpios
[ 7.316132] imx415 2-001a: Failed to get power-gpios
[ 7.316138] imx415 2-001a: could not get default pinstate
[ 7.316142] imx415 2-001a: could not get sleep pinstate
[ 7.316166] imx415 2-001a: supply dvdd not found, using dummy regulator
[ 7.316227] imx415 2-001a: supply dovdd not found, using dummy regulator
[ 7.316254] imx415 2-001a: supply avdd not found, using dummy regulator
[ 7.384517] imx415 2-001a: Unexpected sensor id(000000), ret(-5)
[ 7.385045] imx415 2-0037: driver version: 00.01.08
[ 7.385062] imx415 2-0037: Get hdr mode failed! no hdr default
[ 7.385093] imx415 2-0037: Failed to get reset-gpios
[ 7.385114] imx415 2-0037: Failed to get power-gpios
[ 7.385124] imx415 2-0037: could not get default pinstate
[ 7.385131] imx415 2-0037: could not get sleep pinstate
[ 7.385164] imx415 2-0037: supply dvdd not found, using dummy regulator
[ 7.385274] imx415 2-0037: supply dovdd not found, using dummy regulator
[ 7.385318] imx415 2-0037: supply avdd not found, using dummy regulator
[ 7.442084] imx415 2-0037: Detected imx415 id 0000e0
[ 7.442895] imx415 3-001a: driver version: 00.01.08
[ 7.442946] imx415 3-001a: Get hdr mode failed! no hdr default
[ 7.443020] imx415 3-001a: Failed to get reset-gpios
[ 7.443073] imx415 3-001a: Failed to get power-gpios
[ 7.443097] imx415 3-001a: could not get default pinstate
[ 7.443115] imx415 3-001a: could not get sleep pinstate
[ 7.443171] imx415 3-001a: supply dvdd not found, using dummy regulator
[ 7.443441] imx415 3-001a: supply dovdd not found, using dummy regulator
[ 7.443552] imx415 3-001a: supply avdd not found, using dummy regulator
[ 7.505174] imx415 3-001a: Unexpected sensor id(000000), ret(-5)
[ 7.505775] imx415 3-0037: driver version: 00.01.08
[ 7.505803] imx415 3-0037: Get hdr mode failed! no hdr default
[ 7.505850] imx415 3-0037: Failed to get reset-gpios
[ 7.505885] imx415 3-0037: Failed to get power-gpios
[ 7.505901] imx415 3-0037: could not get default pinstate
[ 7.505913] imx415 3-0037: could not get sleep pinstate
[ 7.505949] imx415 3-0037: supply dvdd not found, using dummy regulator
[ 7.506113] imx415 3-0037: supply dovdd not found, using dummy regulator
[ 7.506188] imx415 3-0037: supply avdd not found, using dummy regulator
[ 7.568599] imx415 3-0037: Detected imx415 id 0000e0
[ 7.568686] rockchip-csi2-dphy csi2-dphy3: dphy3 matches m03_b_imx415 3-0037:bus type 5
[ 7.739599] rockchip-csi2-dphy csi2-dcphy1: dphy1 matches m01_b_imx415 2-0037:bus type 5
检测图像输出设备:
rpdzkj@debian11:~$ media-ctl -d /dev/media4 -e "rkisp_mainpath"
/dev/video44
rpdzkj@debian11:~$ media-ctl -d /dev/media4 -e "rkisp_selfpath"
/dev/video45
rpdzkj@debian11:~$ media-ctl -d /dev/media5 -e "rkisp_mainpath"
/dev/video53
rpdzkj@debian11:~$ media-ctl -d /dev/media5 -e "rkisp_selfpath"
/dev/video54
尝试gst播放,出现warning,且卡住,无播放进度
rpdzkj@debian11:~$ gst-launch-1.0 v4l2src device=/dev/video44 ! videoconvert! videoscale ! video/x-raw, width=800, height=1080 ! kmssink -v
Setting pipeline to PAUSED ...
Pipeline is live and does not need PREROLL ...
/GstPipeline:pipeline0/GstKMSSink:kmssink0: display-width = 1920
/GstPipeline:pipeline0/GstKMSSink:kmssink0: display-height = 1080
0:00:03.428497093 2241 0x556f34ac00 WARN v4l2 gstv4l2object.c:4497:gst_v4l2_object_probe_caps:<v4l2src0:src> Failed to probe pixel aspect ratio with VIDIOC_CROPCAP: Invalid argument
Pipeline is PREROLLED ...
Setting pipeline to PLAYING ...
New clock: GstSystemClock
...
播放后再次查询dmesg
rpdzkj@debian11:~$ dmesg | grep imx
[ 141.570954] imx415 2-0037: s_stream: 1. 3864x2192, hdr: 0, bpp: 10
[ 141.628798] imx415 2-0037: set vblank 0x3a vts 2250
[ 141.630361] imx415 2-0037: set exposure(shr0) 8 = cur_vts(2250) - val(2242)
[ 141.631450] imx415 2-0037: set analog gain 0x0
[ 144.315430] imx415 2-0037: s_stream: 0. 3864x2192, hdr: 0, bpp: 10
[ 173.086958] imx415 2-0037: s_stream: 1. 3864x2192, hdr: 0, bpp: 10
[ 173.139052] imx415 2-0037: set vblank 0x3a vts 2250
[ 173.140487] imx415 2-0037: set exposure(shr0) 8 = cur_vts(2250) - val(2242)
[ 173.141411] imx415 2-0037: set analog gain 0x0
[ 179.792067] imx415 2-0037: s_stream: 0. 3864x2192, hdr: 0, bpp: 10
[ 189.553972] imx415 2-0037: s_stream: 1. 3864x2192, hdr: 0, bpp: 10
[ 189.614564] imx415 2-0037: set vblank 0x3a vts 2250
[ 189.615926] imx415 2-0037: set exposure(shr0) 8 = cur_vts(2250) - val(2242)
[ 189.617039] imx415 2-0037: set analog gain 0x0
[ 207.667478] imx415 2-0037: s_stream: 0. 3864x2192, hdr: 0, bpp: 10
1. camera0默认不开启原因
根据 camera0默认不开启原因,调整硬件后,dmesg
得到:
[ 7.310055] imx415 2-001a: driver version: 00.01.08
[ 7.310070] imx415 2-001a: Get hdr mode failed! no hdr default
[ 7.310095] imx415 2-001a: Failed to get reset-gpios
[ 7.310113] imx415 2-001a: Failed to get power-gpios
[ 7.310121] imx415 2-001a: could not get default pinstate
[ 7.310127] imx415 2-001a: could not get sleep pinstate
[ 7.310154] imx415 2-001a: supply dvdd not found, using dummy regulator
[ 7.310240] imx415 2-001a: supply dovdd not found, using dummy regulator
[ 7.310278] imx415 2-001a: supply avdd not found, using dummy regulator
[ 7.375947] imx415 2-001a: Detected imx415 id 0000e0
[ 7.376262] imx415 2-0037: driver version: 00.01.08
[ 7.376272] imx415 2-0037: Get hdr mode failed! no hdr default
[ 7.376291] imx415 2-0037: Failed to get reset-gpios
[ 7.376303] imx415 2-0037: Failed to get power-gpios
[ 7.376309] imx415 2-0037: could not get default pinstate
[ 7.376314] imx415 2-0037: could not get sleep pinstate
[ 7.376332] imx415 2-0037: supply dvdd not found, using dummy regulator
[ 7.376398] imx415 2-0037: supply dovdd not found, using dummy regulator
[ 7.376432] imx415 2-0037: supply avdd not found, using dummy regulator
[ 7.446044] imx415 2-0037: Detected imx415 id 0000e0
[ 7.446295] imx415 3-001a: driver version: 00.01.08
[ 7.446308] imx415 3-001a: Get hdr mode failed! no hdr default
[ 7.446326] imx415 3-001a: Failed to get reset-gpios
[ 7.446338] imx415 3-001a: Failed to get power-gpios
[ 7.446344] imx415 3-001a: could not get default pinstate
[ 7.446348] imx415 3-001a: could not get sleep pinstate
[ 7.446363] imx415 3-001a: supply dvdd not found, using dummy regulator
[ 7.446427] imx415 3-001a: supply dovdd not found, using dummy regulator
[ 7.446454] imx415 3-001a: supply avdd not found, using dummy regulator
[ 7.506497] imx415 3-001a: Unexpected sensor id(000000), ret(-5)
[ 7.507651] imx415 3-0037: driver version: 00.01.08
[ 7.507693] imx415 3-0037: Get hdr mode failed! no hdr default
[ 7.507764] imx415 3-0037: Failed to get reset-gpios
[ 7.507816] imx415 3-0037: Failed to get power-gpios
[ 7.507840] imx415 3-0037: could not get default pinstate
[ 7.507857] imx415 3-0037: could not get sleep pinstate
[ 7.507911] imx415 3-0037: supply dvdd not found, using dummy regulator
[ 7.508145] imx415 3-0037: supply dovdd not found, using dummy regulator
[ 7.508325] imx415 3-0037: supply avdd not found, using dummy regulator
[ 7.563449] imx415 3-0037: Detected imx415 id 0000e0
[ 7.563540] rockchip-csi2-dphy csi2-dphy3: dphy3 matches m03_b_imx415 3-0037:bus type 5
[ 7.735428] rockchip-csi2-dphy csi2-dcphy0: dphy0 matches m00_f_imx415 2-001a:bus type 5
[ 7.737064] rockchip-csi2-dphy csi2-dcphy1: dphy1 matches m01_b_imx415 2-0037:bus type 5
三个摄像头注册成功,且用gst运行video44,仍无法播放,怀疑dts存在问题。
2. 自带软件测试
根据荣品技术人员建议,使用自带软件测试,但并未发现Devitest
测试demo,远程协助下分别用rockchip-test
和V4L2 Test Bench
展开测试:
2.1 rockchip-test
cd /rockchip-test/camera/
export DISPLAY=:0.0
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/lib/aarch64-linux-gnu/gstreamer-1.0
export GST_DEBUG=3
run ./camera_rkaiq_test.sh
rkaiq_3A_server: no process found
Start RKAIQ Camera Preview!
./camera_rkaiq_test.sh: line 7: warning: command substitution: ignored null byte in input
media get entity by name: rkisp-isp-subdev is null
media get entity by name: rkisp-input-params is null
media get entity by name: rkisp-statistics is null
media get entity by name: rkisp_mainpath is null
Cound not find rkisp dev names, skipped /dev/media0
ERR: Bad media topology for: /dev/media0
media get entity by name: rkisp-isp-subdev is null
media get entity by name: rkisp-input-params is null
media get entity by name: rkisp-statistics is null
media get entity by name: rkisp_mainpath is null
Cound not find rkisp dev names, skipped /dev/media1
ERR: Bad media topology for: /dev/media1
media get entity by name: rkisp-isp-subdev is null
media get entity by name: rkisp-input-params is null
media get entity by name: rkisp-statistics is null
media get entity by name: rkisp_mainpath is null
Cound not find rkisp dev names, skipped /dev/media2
ERR: Bad media topology for: /dev/media2
media get entity by name: rkisp-isp-subdev is null
media get entity by name: rkisp-input-params is null
media get entity by name: rkisp-statistics is null
media get entity by name: rkisp_mainpath is null
Cound not find rkisp dev names, skipped /dev/media3
ERR: Bad media topology for: /dev/media3
DBG: get rkisp-isp-subdev devname: /dev/v4l-subdev13
DBG: get rkisp-input-params devname: /dev/video52
DBG: get rkisp-statistics devname: /dev/video51
DBG: get rkisp_mainpath devname: /dev/video44
rkaiq log level ff0
************************** VERSION INFOS **************************
version release date: 2023-03-02
AIQ: AIQ v5.0x1.2-rc2
IQ PARSER: Calib v1.4.8,magicCode:1170944
************************ VERSION INFOS END ************************
DBG: get rkisp-isp-subdev devname: /dev/v4l-subdev3
DBG: get rkisp-input-params devname: /dev/video61
DBG: get rkisp-statistics devname: /dev/video60
DBG: get rkisp_mainpath devname: /dev/video53
DBG: get rkisp-isp-subdev devname: /dev/v4l-subdev8
DBG: get rkisp-input-params devname: /dev/video70
DBG: get rkisp-statistics devname: /dev/video69
DBG: get rkisp_mainpath devname: /dev/video62
DBG: get rkisp-isp-subdev devname: /dev/v4l-subdev17
DBG: get rkisp-input-params devname: /dev/video79
DBG: get rkisp-statistics devname: /dev/video78
DBG: get rkisp_mainpath devname: /dev/video71
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
Setting pipeline to PAUSED ...
Pipeline is live and does not need PREROLL ...
Pipeline is PREROLLED ...
Setting pipeline to PLAYING ...
0:00:01.903068420 4403 0x55ab2cd4c0 WARN v4l2 gstv4l2object.c:4497:gst_v4l2_object_probe_caps:<v4l2src0:src> Failed to probe pixel aspect ratio with VIDIOC_CROPCAP: Invalid argument
New clock: GstSystemClock
0:00:02.184899921 4403 0x55ab2cd4c0 WARN v4l2bufferpool gstv4l2bufferpool.c:1288:gst_v4l2_buffer_pool_dqbuf:<v4l2src0:pool0:src> Driver should never set v4l2_buffer.field to ANY
0:00:07.9 / 99:99:99.
按以往经验,gst控制成功播放应该会有进度条滚动,用/video0
播放会有进度条滚动,但它输出是绿色,应该是没有获取到帧。用/video44
播放直接没有进度条滚动。
gst-launch-1.0 v4l2src device=/dev/video11 ! video/x-raw,format=NV12,width=1920,height=1080, framerate=30/1 ! xvimagesink
gst-launch-1.0 v4l2src device=/dev/video44 ! video/x-raw,format=NV12,width=1920,height=1080, framerate=30/1 ! xvimagesink
2.2 V4L2 Test Bench
/video44
3. Bugs and fix of not playing
根据指示运行了该脚本,远程辅助调试同学说有图像,排查出用gst命令播放之前要手动开启:
systemctl start rkisp_demo.service
或让系统启动时便开启该服务:
sudo systemctl enable rkisp_demo.service
后面便可播放已检测到的相机。与之前不同在于,播放相机video
设备号都加一为45, 54, 63
,都为selfpath
设备,且mainpath
设备无法播放,显示busy:
rpdzkj@debian11:/$ media-ctl -d /dev/media4 -e "rkisp_selfpath"
/dev/video45
rpdzkj@debian11:/$ media-ctl -d /dev/media4 -e "rkisp_mainpath"
/dev/video44
rpdzkj@debian11:/$ gst-launch-1.0 v4l2src device=/dev/video44 ! video/x-raw,format=NV12,width=1920,height=1080, framerate=30/1 ! xvimagesink
Setting pipeline to PAUSED ...
Pipeline is live and does not need PREROLL ...
Pipeline is PREROLLED ...
Setting pipeline to PLAYING ...
New clock: GstSystemClock
ERROR: from element /GstPipeline:pipeline0/GstV4l2Src:v4l2src0: Device '/dev/video44' is busy
Additional debug info:
../sys/v4l2/gstv4l2object.c(4060): gst_v4l2_object_set_format_full (): /GstPipeline:pipeline0/GstV4l2Src:v4l2src0:
Call to S_FMT failed for NM12 @ 1920x1080: Device or resource busy
Execution ended after 0:00:00.067362722
Setting pipeline to NULL ...
Freeing pipeline ...
4. fix_tmp on can't register all IMX415
荣品科技技术人员:
前面看有沟通过你这边用的是rd-k3588-v12的版本那,摄像头相关的硬件问题是有修复的,你这边能读到对应的摄像头的i2c地址吗
i2c地址在dmesg中便有:
[ 7.188474] rockchip-csi2-dphy csi2-dphy3: dphy3 matches m03_b_imx415 3-0037:bus type 5
[ 7.273783] rockchip-csi2-dphy csi2-dcphy0: dphy0 matches m00_f_imx415 2-001a:bus type 5
[ 7.275465] rockchip-csi2-dphy csi2-dcphy1: dphy1 matches m01_b_imx415 2-0037:bus type 5
结合ls /sys/bus/i2c/devices/
:
0-0042 2-001a 3-0037 6-005d i2c-1 i2c-2 i2c-6
0-0043 2-0037 4-0022 7-001c i2c-10 i2c-3 i2c-7
1-0042 3-001a 4-0051 i2c-0 i2c-11 i2c-4 i2c-9
其中3-0037
,2-001a
,2-0037
为已注册三摄像头的i2c地址
参考:mipi-摄像头-与isp-和i2c-的对应关系是怎样的如何匹配的4路mipi-相机
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 震惊!C++程序真的从main开始吗?99%的程序员都答错了
· 别再用vector<bool>了!Google高级工程师:这可能是STL最大的设计失误
· 单元测试从入门到精通
· 【硬核科普】Trae如何「偷看」你的代码?零基础破解AI编程运行原理
· 上周热点回顾(3.3-3.9)