imx6q sabresd ov5640_mipi read timeout error

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

imx6q sabresd ov5640_mipi read timeout error

3,094 Views
linyang1
Contributor I

hi,

i want to debug ov5640_mipi on  sabresd board with imx6q, the kernel version is kernel_imx 3.0.35 , i use the ov5640_mipi.c default in kernel.

I have set the following parameters in my board configure files:

arch/arm/mach-mx6/board-mx6q_sabresd.c

static struct i2c_board_info mxc_i2c1_board_info[] __initdata = {

......

        {

                I2C_BOARD_INFO("ov5640_mipi", 0x3c),

                .platform_data = (void *)&mipi_csi2_data,

        },

......

};

static struct fsl_mxc_camera_platform_data mipi_csi2_data = {

        .mclk = 24000000,

        .mclk_source = 0,

        .csi = 0,

        .io_init = mx6q_mipi_sensor_io_init,

        .pwdn = mx6q_mipi_powerdown,

};

static void mx6q_mipi_powerdown(int powerdown)

{

        if (powerdown)

        {

                gpio_set_value(SABRESD_MIPICSI_PWN, 1);

        }

        else

        {

                gpio_set_value(SABRESD_MIPICSI_PWN, 0);

        }

       msleep(2);

}

static struct fsl_mxc_capture_platform_data capture_data[] = {

        {

                .csi = 0,

                .ipu = 1,,

                .mclk_source = 0,

                .is_mipi = 1,

        }, {

                .csi = 0,

                .ipu = 1,

                .mclk_source = 0,

                .is_mipi = 1,

        },

};

static void __init mx6_sabresd_board_init(void)

{

......

imx6q_add_v4l2_capture(0, &capture_data[0]);

......

}

and some other modify.

but when i cat the /dev/video0, i got  the error msg :

root@android:/ # cat /dev/video0

ERROR:  v4l2 capture: mxc_v4l_read timeout counter 0

how can  i do?

thanks!

0 Kudos
8 Replies

1,079 Views
Raybiztech
Contributor V

Hi Yang

Did you compile OV5640_mipi.c as a module or as part of kernel?

Try compiling as a module and insert it after inserting the below dependent modules from /lib/modules/3.0.35/drivers/media/video/mxc/capture/

insmod camera_sensor_clock.ko

insmod ipu_bg_overlay_sdc.ko

insmod ipu_fg_overlay_sdc.ko

insmod ipu_csi_enc.ko

insmod ipu_prp_enc.ko

insmod ipu_still.ko

insmod mxc_v4l2_capture.ko

and then insmod ov5642_camera_mipi.ko

and then try to cat the newly created video device file.

If this doesn’t work please provide the output of your lsmod and dmesg.The error you are facing seems to be due to a waitevent_timeout_interruptible interrupted by a signal.

0 Kudos

1,079 Views
linyang1
Contributor I

Thanks! I tried it , but it's also display the timeout error, the dmesg is:

root@android:/data/yyl # insmod camera_sensor_clock.ko                           

root@android:/data/yyl # insmod ipu_bg_overlay_sdc.ko                            

root@android:/data/yyl # insmod ipu_fg_overlay_sdc.ko                            

root@android:/data/yyl # insmod ipu_csi_enc.ko                                   

root@android:/data/yyl # insmod ipu_prp_enc.ko                                   

root@android:/data/yyl # insmod ipu_still.ko                                     

root@android:/data/yyl # insmod mxc_v4l2_capture.ko                              

root@android:/data/yyl # insmod ov5640_camera_mipi.ko                            

root@android:/data/yyl # cat /dev/video0                                                                              

On Open: Input to ipu size is 640 x 480                                                        

yyl--OV5640_get_sysclk  222, ov5640_data.mclk:24000000                                                               

ERROR: v4l2 capture: mxc_v4l_read timeout counter 0                              

/dev/video0: invalid length 

and the dmesg when i open the camera apk:

On Open: Input to ipu size is 640 x 480                                            

yyl--OV5640_get_sysclk  222, ov5640_data.mclk:24000000                           

yyl--OV5640_get_sysclk  222, ov5640_data.mclk:24000000                           

ERROR: v4l2 capture: mxc_v4l_dqueue timeout enc_counter 0                        

ERROR: v4l2 capture: VIDIOC_QBUF: buffer already queued                          

ERROR: v4l2 capture: mxc_v4l_dqueue timeout enc_counter 0                        

ERROR: v4l2 capture: VIDIOC_QBUF: buffer already queued

0 Kudos

1,079 Views
Raybiztech
Contributor V

Mipi camera on my i.MX sabre lite board is working fine with the linux source provided by freescale.I am not facing any issues.I don’t think we are using same source code.Can you attach your ov5640_mipi.c and mxc_v4l2_capture.c .Is it the linux source or android source you using.I am looking into mxc_v4l_capture.c , i ll let you know if i find anything..

0 Kudos

1,079 Views
linyang1
Contributor I

Hi Raybiztech,

Thanks for your reply! It's the android source, and my BPS version is 13.4.1, android source version is 4.0.3, kernel version is 3.0.5 . I uploaded my board-mx6q_sabresd.c and ov5640_mipi.c and mxc_v4l2_capture.c, could you help me to diff it with your files or check it ?

Thanks!

0 Kudos

1,080 Views
Raybiztech
Contributor V

I am using linux-imx6-boundary-imx_3.0.35_1.1.1 source provided by Boundary devices.I have attached the diff file.

0 Kudos

1,080 Views
linyang1
Contributor I

Thank you! I checked the diff file , but it's also not fix the error,May be I should look into mxc_v4l_capture... Thanks for your kindly help!

0 Kudos

1,080 Views
weidong_sun
NXP TechSupport
NXP TechSupport

hello, Liu yang,

      By default, OV5640 mipi sensor is supported by sabresdp board, you don't need to modify the setting of CSI and IPU ID in board-sabresd_mx6q.c. Could you check how many video devices in path /dev/ ? is ov5640 mipi device video0 ?

Regards,

Weidong

1,080 Views
linyang1
Contributor I

hi, Weidong ,Thanks for your reply!

firstly i didn't modify the setting, but it's display the error : "imx-ipuv3 imx-ipuv3.0: Not a CSI channel" , so i modified the setting.

my video devices is /dev/video0 when the setting is :

static void __init mx6_sabresd_board_init(void)

{

......

imx6q_add_v4l2_capture(0, &capture_data[0]);

//imx6q_add_v4l2_capture(1, &capture_data[1]);

......

}

and the error is:

root@android:/ # cat /dev/video0                                                                                       

ERROR: v4l2 capture: mxc_v4l_read timeout counter 0                                               

/dev/video0: invalid length

thanks and regards!

Yang Lin

0 Kudos