kendryte / k510_buildroot

Kendryte K510 SDK
BSD 2-Clause "Simplified" License
118 stars 57 forks source link

[help]: About gc2053sensor #419

Closed Namedqianli closed 9 months ago

Namedqianli commented 1 year ago

Help

我目前在尝试使用gc2053这款sensor但是遇到了下面的问题


[root@canaan /app/mediactl_lib ]$ ./v4l2_drm.out -f video_drm_gc2053_gc2093_1920
x1080.conf -s 0
[  824.490497] lt9611_connect_detect 1
[  824.494000] lt9611_connector_get_modes
[  825.009840] lt9611_connect_detect 1
[  825.013343] lt9611_connector_get_modes
drm: Found plane_id: 50 connector_id: 49 crtc_id: 57
drm: 1280x720 (0mm X 0mm) pixel format NV12
found plane 50found plane 51screen resolution: 1280x720
mediactl_init:auto.conf
dofile_video_cfg:auto.conf
doit_video_cfg:start
doit_video_cfg:video5_pitch 0x4cc70
cJSON_GetObjectItem: type=3, string is video5_pitch, valueint is 320 pitch is 320
doit_video_cfg:sensor1 cJSON_GetArraySize: size=8
cJSON_GetArrayItem: type=4, string is sensor1_name, valuestring is m00_f_gc2093 0-007e,m00_f_gc2093 0-007e,8
cJSON_GetArrayItem: type=4, string is sensor1_cfg_file, valuestring is gc2093.conf,gc2093.conf,8
cJSON_GetObjectItem(senso[  825.570168] k510-isp 92600000.isp1: __media_entity_setup_link:link->flags(0x3)
r1_total_width): type=3, string [  825.579883] gc2053 0-0037: set_fmt, width:1920, height:1080.
is sensor1_total_width, valueint[  825.588277] gc2053 0-0037: gc2053_ioctl
 is 2640
[  825.596240] [K510_RESET]:k510_reset id = 0x01504f80, offset = 0x00000150 type = 1 done = 31 reset =0

doit_csi2:start
dofile_vi:auto[  825.596260] [K510_RESET]:k510_reset id = 0x01484f80, offset = 0x00000148 type = 1 done = 31 reset =0
.conf
doit_vi:start
mediactl_i[  825.606760] [K510_RESET]:k510_reset id = 0x01344f80, offset = 0x00000134 type = 1 done = 31 reset =0
nit:imx219_0.conf
dofile_isp:im[  825.618940] [K510_RESET]:k510_reset id = 0x01384f80, offset = 0x00000138 type = 1 done = 31 reset =0
x219_0.conf
doit_isp:start
cJS[  825.630381] [K510_RESET]:k510_reset id = 0x013c4f80, offset = 0x0000013c type = 1 done = 31 reset =0
ON_GetObjectItem: type=3, string[  825.642650] [K510_RESET]:k510_reset id = 0x01404f80, offset = 0x00000140 type = 1 done = 31 reset =0
 is out_img_format, valueint is [  825.668289] lt9611_connect_detect 1
1
mediactl_init:gc2093.conf
do[  825.673484] lt9611_connector_get_modes
file_isp:gc2093.conf
doit_isp:start
cJSON_GetObjectItem: type=3, string is out_img_format, valueint is 1
media_open:start
media_enum_links:start!entities_count 21
media_reset_links:start
isp_f2k_video_init:entity(0x6a940)isp->video(0x6a940)
isp_f2k_video_link:media_setup_link setup!
isp_hdr_mode_cfg,hdr_mode:0
isp_hdr_mode_cfg, ioctl CNMODULE_SET_HDR_CFG failed(-1)
main block alloc:0x1d000000,size:33554432,align 4096
main block alloc:0x1c3ff000,size:12582912,align 4096
isp_f2k_cfg:1920
isp_f2k_cfg:total_width =3476,total_height =1166
ae ctl v0.2.3
k510 adaptive v0.3.3
adaptive_sensor_select_init, pipeline 0, use 2 param
k510 adaptive v0.3.3
adaptive_sensor_select_init, pipeline: 1, not match any sensor name, adaptive function will force disabled
mediactl_init:total_size.width(0xd94),total_size.height(0x48e)
main:dev_info[0].video_used(1)
main:dev_info[1].video_used(0)
main:size[0].width is 1280 size[0].height is 720,size[1].width is 9 size[1].height is 0,camera_num(1)
[  826.188337] lt9611_connect_detect 1
[  826.191976] lt9611_connector_get_modes
drm: Found plane_id: 52 connector_id: 49 crtc_id: 57
drm: 1280x720 (0mm X 0mm) pixel format NV12
found plane 52found plane 53----[  826.902668] k510-isp 92600000.isp1: k510isp_video_streamon:start
------------drm_setup_buffers --[  826.911052] k510-isp 92600000.isp1: k510isp_video_check_format:start
------------------------------- [  826.920580] k510-isp 92600000.isp1: k510isp_video_get_graph_data:start

open_device: dev_name /dev/vid[  826.929454] k510-isp 92600000.isp1: k510isp_video_check_external_subdevs:start
eo3 called!
open_device:fd (11)[  826.939732] k510-isp 92600000.isp1: k510isp_pipeline_set_stream:state(1)
 open
init_device:width(1280),h[  826.949116] k510-isp 92600000.isp1: k510isp_pipeline_enable:i(0)ret(0)
eight(720)
init_mmap:n_buffers([  826.958176] k510-isp 92600000.isp1: k510isp_pipeline_enable:f2k cur_video(00000000e6d5977c) f2k_used[0] (0)
5),buffers(0x62c90)
[  826.971090] k510-isp 92600000.isp1: k510isp_stat_s_stream:enable(1)
[  826.978799] k510-isp 92600000.isp1: k510isp_stat_s_stream:enable(1)
[  826.985076] k510-isp 92600000.isp1: k510isp_stat_s_stream:enable(1)
[  826.991685] k510-isp 92600000.isp1: vi_set_stream:enable 1
[  826.997217] k510-isp 92600000.isp1: k510isp_pipeline_enable:i(1)ret(0)
[  827.004040] k510-isp 92600000.isp1: csi2_set_stream:start
[  827.009494] k510-isp 92600000.isp1: k510isp_pipeline_enable:i(2)ret(0)
[  827.087569] k510-isp 92600000.isp1: k510isp_pipeline_enable:i(3)ret(0)
[  827.095564] k510-isp 92600000.isp1: k510isp_pipeline_enable:i(4) use the first camera!
[  827.113283] isp_f2k_core_table_init start!
[  827.117593] Isp2K RGB Gamma TABLE config done!
[  827.638674]  isp share config ram is not ready for wr!!!!!!!!!!
[  827.644612] k510-isp 92600000.isp1: k510isp_pipeline_enable:end
start
camera select() timeout at line [  829.653892] k510-isp 92600000.isp1: k510isp_video_streamoff:video(00000000e6d5977c) video(00000000e6d5977c) pipe(000000005c3976e9) start
1184
drm_exit
drm_exit:drm_des[  829.668281] k510-isp 92600000.isp1: k510isp_video_streamoff:video(00000000e6d5977c) pipe(000000005c3976e9)
tory_dumb!
stop_capturing: 11 c[  829.681172] k510-isp 92600000.isp1: k510isp_pipeline_set_stream:state(0)
alled!
[  829.690140] k510-isp 92600000.isp1: k510isp_pipeline_disable:cur_video(00000000e6d5977c) video (00000000e6d5977c) pipe(000000005c3976e9)start
[  829.703805] k510-isp 92600000.isp1: k510isp_pipeline_disable:cur_video(00000000e6d5977c) video (00000000e6d5977c) pipe(000000005c3976e9)start
[  829.716548] k510-isp 92600000.isp1: k510isp_stat_s_stream:enable(0)
[  829.723213] k510-isp 92600000.isp1: k510 isp f2k_awb: user wants to disable module.
[  829.730922] k510-isp 92600000.isp1: f2k_awb_enable:start
[  829.736247] k510-isp 92600000.isp1: k510isp_stat_s_stream:enable(0)
[  829.742872] k510-isp 92600000.isp1: k510 isp f2k_af: user wants to disable module.
[  829.750484] k510-isp 92600000.isp1: k510isp_stat_s_stream:enable(0)
[  829.756760] k510-isp 92600000.isp1: k510 isp f2k_ae: user wants to disable module.
[  829.828686] isp_f2k_wrap_reset>AXI_CTL = 0x33000088
[  829.833582] [K510_RESET]:k510_reset id = 0x01584f80, offset = 0x00000158 type = 1 done = 31 reset =0
[  829.833597] [K510_RESET]:k510_reset id = 0x01244f80, offset = 0x00000124 type = 1 done = 31 reset =0
[  829.843058] k510-isp 92600000.isp1: f2k ds1 no_buf_drop_cnt 0, total 0
[  829.858776] k510-isp 92600000.isp1: f2k ds1 jump drop_cnt 0
[  829.864360] k510-isp 92600000.isp1: f2k ds1 interrupt: max interval 0 us, big_cnt 0
[  829.872541] k510-isp 92600000.isp1: f2k ds1 interrupt: min interval 1048575 us, small_cnt 0
[  829.880932] k510-isp 92600000.isp1: f2k dmaErrCnt 0
[  829.885825] k510-isp 92600000.isp1: vi_set_stream:enable 0
[  829.891642] [K510_RESET]:k510_reset id = 0x01504f80, offset = 0x00000150 type = 1 done = 31 reset =0
[  829.891657] [K510_RESET]:k510_reset id = 0x01484f80, offset = 0x00000148 type = 1 done = 31 reset =0
[  829.900890] k510-isp 92600000.isp1: csi2_set_stream:start
[  829.915940] [K510_RESET]:k510_reset id = 0x01344f80, offset = 0x00000134 type = 1 done = 31 reset =0
[  829.915954] [K510_RESET]:k510_reset id = 0x01384f80, offset = 0x00000138 type = 1 done = 31 reset =0
[  829.925119] [K510_RESET]:k510_reset id = 0x013c4f80, offset = 0x0000013c type = 1 done = 31 reset =0
[  829.934524] [K510_RESET]:k510_reset id = 0x01404f80, offset = 0x00000140 type = 1 done = 31 reset =0
[  829.954070] k510-isp 92600000.isp1: k510isp_pipeline_disable:i(4) use the first camera!
stop_capturing: end![  829.963072] k510-isp 92600000.isp1: k510isp_video_streamoff:video(00000000e6d5977c) video(00000000e6d5977c) pipe(          (null)) start

[  829.977043] k510-isp 92600000.isp1: k510isp_video_streamoff:streaming0 err!
[  830.065325] sh (297): drop_caches: 1
[  830.094490] sh (298): drop_caches: 2
[  830.124822] sh (299): drop_caches: 3
[root@canaan /app/mediactl_lib ]$

硬件链接

mipi lane 0 1 sensor 已经成检测到sensor


[    1.766913] i2c /dev entries driver
[    1.771685] gc2053 0-0037: driver version: 00.01.01
[    1.777048] gc2053 0-0037: lane_num(2)  pixel_rate(118800000)
[    1.789017] random: fast init done
[    1.793408] gc2053 0-0037: Detected GC2053 sensor

DTSI

//RGB
&i2c1 {
    status = "okay";
    #address-cells  = <1>;
    #size-cells     = <0>;
    gc2053: gc2053@37 {
        compatible = "galaxycore,gc2053";
        reg = <0x37>;
        reset-gpios = <&porta 18 GPIO_ACTIVE_LOW>;
        pwdn-gpios = <&porta 24 GPIO_ACTIVE_LOW>;
        canaanchip,camera-module-index = <0>;
        canaanchip,camera-module-facing = "front";
        canaanchip,camera-module-name = "BFC105-DUAL-L";
        canaanchip,camera-module-lens-name = "RGB";
        // ir-cut = <&cam_ircut0>;
        hflip = <1>;

        port {
            ucam_out0: endpoint {
                remote-endpoint = <&mipi_in_ucam0>;
                data-lanes = <1 2>;
            };
        };
    };
};

&isp1{
    status = "okay";
    sensor_num =<1>;
    dphy_speed =<1>; //0-RXDPHY_SPEED_MODE_2500M,1-RXDPHY_SPEED_MODE_1500M
    dphy_mode = <0>;//0-TWO_LANES_MODE,1-FOUR_LANES_MODE
    sony_mode = <0>;//0-SONY_POL_MODE_DIS,1-SONY_POL_MODE_EN
    ports {
        #address-cells = <1>;
        #size-cells = <0>;
        //port@0 {
        //  dvp_in_ucam2: endpoint@2 {
        //      //status = "okay";
        //      //remote-endpoint = <&ucam_out1>;
        //      //data-lanes = <3 4>;
        //      data-type = <0x2b>; //0x1E-MIPI_YUV422,0x2A-MIPI_RAW8,0x2B-MIPI_RAW10,0x2C-MIPI_RAW12
        //      tpg_r_en = <0>;
        //      tpg_w_en = <0>;
        //      wdr_sensor_vendor =<0>;//0-"SONY_WDR_SENSOR", 1=OTHERS_WDR_SENSOR
        //      wdr_mode = <0>;//0-none wdr mode, 1-2frame wdr mode, 2-3frame wdr mode
        //      mipi_csi_mode = <0>; //0- normal mode, 1 -debug mode
        //      isp_pipeline = <3>;//1 -ISP_F_2K, 2 -ISP_R_2K,3-ISP_TOF
        //  };
        //};
        port@1 {
            reg = <1>;
            #address-cells = <1>;
            #size-cells = <0>;
            mipi_in_ucam0: endpoint@0 {
                status = "okay";
                reg = <1>;
                remote-endpoint = <&ucam_out0>;
                clock-lanes = <0>;
                data-lanes = <1 2>;
                data-type = <0x2b>; //0x1E-MIPI_YUV422,0x2A-MIPI_RAW8,0x2B-MIPI_RAW10,0x2C-MIPI_RAW12
                tpg_r_en = <0>;
                tpg_w_en = <0>;
                wdr_sensor_vendor =<0>;//0-"SONY_WDR_SENSOR", 1=OTHERS_WDR_SENSOR
                wdr_mode = <0>;//0-none wdr mode ,1-2frame wdr mode, 2-3frame wdr mode
                mipi_csi_mode = <0>; //0- normal mode ,1 -debug mode
                isp_pipeline = <1>;//1 -ISP_F_2K, 2 -ISP_R_2K, 3-ISP_TOF
            };
        };

    };
};

conf文件为sdk自带

MrThanlon commented 10 months ago

有修改dts文件吗? 看一下 k510_crb_lp3_v1_2_defconfig/build/linux-4.17/arch/riscv/boot/dts/canaan/k510_crb_lp3_v1_2.dts

chenhb3 commented 10 months ago

@Namedqianli 请帮忙确认@MrThanlon 提出的问题,若超过7天未反馈情况,问题将关闭,请知悉!若后续还有问题可重新打开或创建,感谢您的关注!