RK-3568PC使用CAM-C3568S2M双目相机问题

ubuntu 18.04系统
1、使用系统的Test-Camera,选择MIPI,程序闪退
2、使用v4l2-ctl抓取camera数据帧,报no such device
3、使用双目相机脚本
#!/bin/bash

export DISPLAY=:0
export XAUTHORITY=/home/firefly/.Xauthority
WIDTH=640
HEIGHT=480
SINK=gtksink

gst-launch-1.0 v4l2src device=/dev/video14 ! video/x-raw,format=NV12,width=${WIDTH},height=${HEIGHT}, framerate=30/1 ! videoconvert ! $SINK &
gst-launch-1.0 v4l2src device=/dev/video5 ! video/x-raw,format=NV12,width=${WIDTH},height=${HEIGHT}, framerate=30/1 ! videoconvert ! $SINK &

wait
提示 no element “gtksink”

先dmesg | grep gc20检查一下摄像头是否初始化成功
测试脚本里面的SINK=gtksink改为SINK=xvimagesink

Liuth 发表于 2022-1-21 12:00
先dmesg | grep gc20检查一下摄像头是否初始化成功
测试脚本里面的SINK=gtksink改为SINK=xvimagesink

1、dmesg | grep gc20 没有任何信息
2、脚本更改了,报错:
Rga built version:06fc7c4
Rga built version:06fc7c4
Setting pipeline to PAUSED …
Setting pipeline to PAUSED …
ERROR: Pipeline doesn’t want to pause.
ERROR: Pipeline doesn’t want to pause.
ERROR: from element /GstPipeline:pipeline0/GstV4l2Src:v4l2src0: Cannot identify device ‘/dev/video14’.
Additional debug info:
v4l2_calls.c(609): gst_v4l2_open (): /GstPipeline:pipeline0/GstV4l2Src:v4l2src0:
system error: No such file or directory
ERROR: from element /GstPipeline:pipeline0/GstV4l2Src:v4l2src0: Device ‘/dev/video5’ is not a capture device.
Additional debug info:
v4l2_calls.c(631): gst_v4l2_open (): /GstPipeline:pipeline0/GstV4l2Src:v4l2src0:
Capabilities: 0x4202000
Setting pipeline to NULL …
Setting pipeline to NULL …
Freeing pipeline …
Freeing pipeline …

dmesg | grep gc20 没有任何信息说明你的内核根本不对
需要dts里include双目摄像头的dtsi,重新编译内核烧录
https://wiki.t-firefly.com/zh_CN/ROC-RK3568-PC/driver_camera.html#dan-mu-cam-8ms1m-shuang-mu-cam-2ms2mf-she-xiang-tou-de-shi-yong

我这边重新烧了内核:
1、用Test-Camera也闪退
2、以下是dmesg | grep gc20的信息

root@firefly:/home/firefly# dmesg | grep gc20
[ 2.014470] gc2053 4-0037: driver version: 00.01.01
[ 2.014525] gc2053 4-0037: Failed to get reset-gpios
[ 2.014598] gc2053 4-0037: Looking up dovdd-supply from device tree
[ 2.014610] gc2053 4-0037: Looking up dovdd-supply property in node /i2c@fe5d0000/gc2053@37 failed
[ 2.014647] gc2053 4-0037: 4-0037 supply dovdd not found, using dummy regulator
[ 2.014751] gc2053 4-0037: Linked as a consumer to regulator.0
[ 2.014772] gc2053 4-0037: Looking up avdd-supply from device tree
[ 2.014834] gc2053 4-0037: Linked as a consumer to regulator.11
[ 2.014853] gc2053 4-0037: Looking up dvdd-supply from device tree
[ 2.014864] gc2053 4-0037: Looking up dvdd-supply property in node /i2c@fe5d0000/gc2053@37 failed
[ 2.014885] gc2053 4-0037: 4-0037 supply dvdd not found, using dummy regulator
[ 2.014943] gc2053 4-0037: lane_num(2) pixel_rate(118800000)
[ 2.014966] gc2053 4-0037: could not get default pinstate
[ 2.014981] gc2053 4-0037: could not get sleep pinstate
[ 2.020876] gc2053 4-0037: Detected GC2053 sensor
[ 2.020945] rockchip-csi2-dphy csi2-dphy1: dphy1 matches m00_b_gc2053 4-0037:bus type 4
[ 2.021967] gc2093 4-007e: driver version: 00.01.01
[ 2.022054] gc2093 4-007e: Failed to get reset-gpios
[ 2.022110] gc2093 4-007e: Looking up dovdd-supply from device tree
[ 2.022121] gc2093 4-007e: Looking up dovdd-supply property in node /i2c@fe5d0000/gc2093b@7e failed
[ 2.022155] gc2093 4-007e: 4-007e supply dovdd not found, using dummy regulator
[ 2.022238] gc2093 4-007e: Linked as a consumer to regulator.0
[ 2.022259] gc2093 4-007e: Looking up avdd-supply from device tree
[ 2.022328] gc2093 4-007e: Linked as a consumer to regulator.11
[ 2.022346] gc2093 4-007e: Looking up dvdd-supply from device tree
[ 2.022356] gc2093 4-007e: Looking up dvdd-supply property in node /i2c@fe5d0000/gc2093b@7e failed
[ 2.022375] gc2093 4-007e: 4-007e supply dvdd not found, using dummy regulator
[ 2.043758] gc2093 4-007e: Detected GC2093 sensor
[ 2.043864] rockchip-csi2-dphy csi2-dphy2: dphy2 matches m01_f_gc2093 4-007e:bus type 4

Liuth 发表于 2022-1-21 14:09
dmesg | grep gc20 没有任何信息说明你的内核根本不对
需要dts里include双目摄像头的dtsi,重新编译内核烧 …

我这边重新烧了内核:
1、用Test-Camera也闪退
2、以下是dmesg | grep gc20的信息
root@firefly:/home/firefly# dmesg | grep gc20
[ 2.014470] gc2053 4-0037: driver version: 00.01.01
[ 2.014525] gc2053 4-0037: Failed to get reset-gpios
[ 2.014598] gc2053 4-0037: Looking up dovdd-supply from device tree
[ 2.014610] gc2053 4-0037: Looking up dovdd-supply property in node /i2c@fe5d0000/gc2053@37 failed
[ 2.014647] gc2053 4-0037: 4-0037 supply dovdd not found, using dummy regulator
[ 2.014751] gc2053 4-0037: Linked as a consumer to regulator.0
[ 2.014772] gc2053 4-0037: Looking up avdd-supply from device tree
[ 2.014834] gc2053 4-0037: Linked as a consumer to regulator.11
[ 2.014853] gc2053 4-0037: Looking up dvdd-supply from device tree
[ 2.014864] gc2053 4-0037: Looking up dvdd-supply property in node /i2c@fe5d0000/gc2053@37 failed
[ 2.014885] gc2053 4-0037: 4-0037 supply dvdd not found, using dummy regulator
[ 2.014943] gc2053 4-0037: lane_num(2) pixel_rate(118800000)
[ 2.014966] gc2053 4-0037: could not get default pinstate
[ 2.014981] gc2053 4-0037: could not get sleep pinstate
[ 2.020876] gc2053 4-0037: Detected GC2053 sensor
[ 2.020945] rockchip-csi2-dphy csi2-dphy1: dphy1 matches m00_b_gc2053 4-0037:bus type 4
[ 2.021967] gc2093 4-007e: driver version: 00.01.01
[ 2.022054] gc2093 4-007e: Failed to get reset-gpios
[ 2.022110] gc2093 4-007e: Looking up dovdd-supply from device tree
[ 2.022121] gc2093 4-007e: Looking up dovdd-supply property in node /i2c@fe5d0000/gc2093b@7e failed
[ 2.022155] gc2093 4-007e: 4-007e supply dovdd not found, using dummy regulator
[ 2.022238] gc2093 4-007e: Linked as a consumer to regulator.0
[ 2.022259] gc2093 4-007e: Looking up avdd-supply from device tree
[ 2.022328] gc2093 4-007e: Linked as a consumer to regulator.11
[ 2.022346] gc2093 4-007e: Looking up dvdd-supply from device tree
[ 2.022356] gc2093 4-007e: Looking up dvdd-supply property in node /i2c@fe5d0000/gc2093b@7e failed
[ 2.022375] gc2093 4-007e: 4-007e supply dvdd not found, using dummy regulator
[ 2.043758] gc2093 4-007e: Detected GC2093 sensor
[ 2.043864] rockchip-csi2-dphy csi2-dphy2: dphy2 matches m01_f_gc2093 4-007e:bus type 4

你这log显示摄像头加载成功了,问题应该在应用层,保持这个内核不变,建议使用ubuntu20的文件系统试一下
用wiki里的预览脚本来预览,先不用Test-Camera

Liuth 发表于 2022-1-24 09:47
你这log显示摄像头加载成功了,问题应该在应用层,保持这个内核不变,建议使用ubuntu20的文件系统试一下

目前用这个脚本可以预览,这个不支持V4L2吗?

梁焯斌 发表于 2022-1-24 19:09
目前用这个脚本可以预览,这个不支持V4L2吗?

支持
https://wiki.t-firefly.com/zh_CN/ROC-RK3568-PC/driver_camera.html#camera-di-ceng-tiao-shi

楼主好:
你用这个双目做什么产品,看下我们是不是做的一样的!