mxc_v4l_dqueue timeout error for ov5640 in i.Mx6DL SODIMM

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

mxc_v4l_dqueue timeout error for ov5640 in i.Mx6DL SODIMM

2,224 Views
mohamedsarjoond
Contributor III

Hello team,

 

We are working in PDS device prototype based on i.Mx6DL SODIMM module.

We are using  kernel 3.10.53.We are now trying to bring camera up

Camera used is Color CMOS QSXGA (5MP) based on OV5640 sensor(parallel CSI). Resolution is 2592x1944

Following changes have been done in dts file

    ov5640: ov5640@3c {
            compatible = "ov5640";
            reg = <0x3c>;
            pinctrl-names = "default";
            pinctrl-0 = <&pinctrl_ipu1_1>;
            clocks = <&clks 201>;
            clock-names = "csi_mclk";
            csi_id = <0>;
            mclk = <24000000>;
            mclk_source = <0>;
            };

    v4l2_cap_0 {
        compatible = "fsl,imx6q-v4l2-capture";
        ipu_id = <0>;
        csi_id = <0>;
        mclk_source = <0>;
        status = "okay";
    };

    v4l2_out {
        compatible = "fsl,mxc_v4l2_output";
        status = "okay";
    };

IPU pinctrl pins are added in

----------------------------------------

   ipu1 {
                pinctrl_ipu1_1: ipu1grp-sm-csi {
                        fsl,pins = <
                    MX6QDL_PAD_CSI0_DAT10__IPU1_CSI0_DATA10  0x80000000
                    MX6QDL_PAD_CSI0_DAT8__IPU1_CSI0_DATA08   0x80000000
                    MX6QDL_PAD_CSI0_DAT9__IPU1_CSI0_DATA09   0x80000000
                    MX6QDL_PAD_CSI0_DAT15__IPU1_CSI0_DATA15  0x80000000
                    MX6QDL_PAD_CSI0_DAT14__IPU1_CSI0_DATA14  0x80000000
                    MX6QDL_PAD_CSI0_DAT17__IPU1_CSI0_DATA17  0x80000000
                    MX6QDL_PAD_CSI0_DAT16__IPU1_CSI0_DATA16  0x80000000
                    MX6QDL_PAD_CSI0_DAT13__IPU1_CSI0_DATA13  0x80000000
                    MX6QDL_PAD_CSI0_DAT11__IPU1_CSI0_DATA11  0x80000000
                    MX6QDL_PAD_CSI0_PIXCLK__IPU1_CSI0_PIXCLK 0x80000000
                    MX6QDL_PAD_CSI0_DAT12__IPU1_CSI0_DATA12  0x80000000
                    MX6QDL_PAD_CSI0_VSYNC__IPU1_CSI0_VSYNC   0x80000000
                    MX6QDL_PAD_CSI0_MCLK__IPU1_CSI0_HSYNC    0x80000000                
/*                  MX6QDL_PAD_GPIO_0__CCM_CLKO1             0x80000000 */
                        >;
                };

   }

These changes and all done and ov5640 driver has been enabled in make menuconfig

With these changes. We have run the mxc_v4l2_capture application and this is the ouput

root@imx6dlsabresd: ./mxc_v4l2_capture.out -iw 2592 -ih 1944 -ow 640 -oh 480 -d /dev/video0 -c 5 1.yuv

in_width = 2592, in_height = 1944

out_width = 640, out_height = 480

top = 0, left = 0
   Setting mclk to 24 MHz
sensor chip is ov5640_camera
sensor supported frame size:
 640x480
 320x240
 720x480
 720x576
 1280x720
 1920x1080
 2592x1944
 176x144
 1024x768
sensor frame format: YUYV
sensor frame format: YUYV
sensor frame format: YUYV
sensor frame format: YUYV
sensor frame format: YUYV
sensor frame format: YUYV
sensor frame format: YUYV
sensor frame format: YUYV
sensor frame format: YUYV

         Width = 640     Height = 480    Image size = 460800
pixelformat: YU12
YUV420
ERROR: v4l2 capture: mxc_v4l_dqueue timeout enc_counter 0
VIDIOC_DQBUF failed.
ERROR: v4l2 capture: VIDIOC_QBUF: buffer already queued
VIDIOC_QBUF failed

 Can you get what is the reason for this error. I am completely struck up with this.

Harware wise probed all possible lines. voltage supply, HSYNC,VSYNC, Data lines, pixelclock and all seems fine. So till CPU it seems fine.

But not sure why V4L2 app fails to capture. Even mxc v4l2 Overlay application also fails

Please help with this.

Thanks in advance.

Sarjoon

Labels (1)
4 Replies

1,355 Views
igorpadykov
NXP Employee
NXP Employee

Hi Sarjoon

one can try using imx-test docs in ../mxc_v4l2_test/doc/FSL-UT-V4L2-009.txt:

www.nxp.com/lgfiles/NMG/MAD/YOCTO/imx-test-5.4.tar.gz


Test 7. mxc_v4l2_capture.out -iw 2592 -ih 1944 -ow 2592 -oh 1944 -m 6 -i 1 -r 0 -c 50 -fr 15 -d /dev/video1 test.yuv 

Best regards
igor
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

1,355 Views
mohamedsarjoond
Contributor III

Dear Igor,

Thank you so much for the response.

I founf the reason for the issue. There is CSI MUX configuraion issue in board file.

I set the GPR13 register bits 0-2 as 0x4 since IPU1_CSI0 channel is connected to parallel interface.

And then the error went off and I can able to run the overlay/capture and even output application. But now the problem is the frames are having green lines fully.

 I referrred the file which you told to refer and ran your commands

capture: ./mxc_v4l2_capture.out -iw 2592 -ih 1944 -ow 2592 -oh 1944 -m 6 -i 1 -r 0 -fr 15 -d /dev/video0 -c 1 test.yuv -> ( video device is /dev/video0 for me)

overlay: ./mxc_v4l2_overlay.out -iw 2592 -ih 1944 -ow 480 -oh 272 -m 6 -fr 15 -di /dev/video0 -bg (lcd resolution is 480x272  for me)

output: ./mxc_v4l2_output.out -iw 2592 -ih 1944 -ow 480 -oh 272 -m 6 -r 0 -f UYVY -fr 15 test.yuv

All the above commands is giving same result... its coming with green lines. I have attached the captured raw file for sample

test_yuv.png

What is causing this issue. Any configuration settings is missing.

I have tried formats like YUYV, YVYU, YUV420 using -f command but all giving same results

0 Kudos
Reply

1,355 Views
igorpadykov
NXP Employee
NXP Employee

Hi Sarjoon

you are right green may be caused by wrong data format (or data absence)

so one can recheck if sensor was configured properly through i2c.

Best regards
igor

0 Kudos
Reply

1,355 Views
mohamedsarjoond
Contributor III

Dea Igor,

Thanks for the response.

Do you have any application note for those i2c configurations.

We are using QSXGA camera as I said. Its 5MP camera with Auto focus feature.

Any configuration notes/details will be a lot of help.

Thanks & Regards

Sarjoon

0 Kudos
Reply