BT.1120 capture on i.mx6q CSI1 using linux

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

BT.1120 capture on i.mx6q CSI1 using linux

5,563 Views
alexandrebellon
Contributor I

Hi,

I'm using an i.mx6q sabrelite with a kernel based on BSP 4.0.0.

There is a GV7600 full HD deserializer connected on J12 (EIM/boot mode). It is giving BT.1120 video as a pixel clock and 20bits of data. Hsync, Vsync and data enable are not connected, my understanding is that they are not necessary for BT.1120.

On the software side, I have that pinmuxing:

    MX6PAD(EIM_EB2__IPU2_CSI1_D_19),    /* GPIO2[30] */
    MX6PAD(EIM_A23__IPU2_CSI1_D_18),    /* GPIO6[6] */
    MX6PAD(EIM_A22__IPU2_CSI1_D_17),    /* GPIO2[16] */
    MX6PAD(EIM_A21__IPU2_CSI1_D_16),    /* GPIO2[17] */
    MX6PAD(EIM_A20__IPU2_CSI1_D_15),    /* GPIO2[18] */
    MX6PAD(EIM_A19__IPU2_CSI1_D_14),    /* GPIO2[19] */
    MX6PAD(EIM_A18__IPU2_CSI1_D_13),    /* GPIO2[20] */
    MX6PAD(EIM_A17__IPU2_CSI1_D_12),    /* GPIO2[21] */
    MX6PAD(EIM_EB0__IPU2_CSI1_D_11),    /* GPIO2[28] */
    MX6PAD(EIM_EB1__IPU2_CSI1_D_10),    /* GPIO2[29] */
    MX6PAD(EIM_DA0__IPU2_CSI1_D_9),        /* GPIO3[0] */
    MX6PAD(EIM_DA1__IPU2_CSI1_D_8),        /* GPIO3[1] */
    MX6PAD(EIM_DA2__IPU2_CSI1_D_7),        /* GPIO3[2] */
    MX6PAD(EIM_DA3__IPU2_CSI1_D_6),        /* GPIO3[3] */
    MX6PAD(EIM_DA4__IPU2_CSI1_D_5),        /* GPIO3[4] */
    MX6PAD(EIM_DA5__IPU2_CSI1_D_4),        /* GPIO3[5] */
    MX6PAD(EIM_DA6__IPU2_CSI1_D_3),        /* GPIO3[6] */
    MX6PAD(EIM_DA7__IPU2_CSI1_D_2),        /* GPIO3[7] */
    MX6PAD(EIM_DA8__IPU2_CSI1_D_1),        /* GPIO3[8] */
    MX6PAD(EIM_DA9__IPU2_CSI1_D_0),        /* GPIO3[9] */
    MX6PAD(EIM_DA10__IPU2_CSI1_DATA_EN),    /* GPIO3[10] */
    MX6PAD(EIM_DA11__IPU2_CSI1_HSYNC),    /* GPIO3[11] */
    MX6PAD(EIM_DA12__IPU2_CSI1_VSYNC),    /* GPIO3[12] */
    MX6PAD(EIM_A16__IPU2_CSI1_PIXCLK),    /* GPIO2[22] */

That is what I have in my data_capture[] :

        {
                .ipu = 1,
                .csi = 1,
                .mclk_source = 0,
                .is_mipi = 0,
        },

I also set CSI1 to parallel with:

    mxc_iomux_set_gpr_register(1, 20, 1, 1);

I tweaked drivers/media/video/mxc/capture/mxc_v4l2_capture.c to be able to set BT.1120 clock mode:

       csi_param.clk_mode = IPU_CSI_CLK_MODE_CCIR1120_PROGRESSIVE_SDR;
       csi_param.pixclk_pol = 0;
       csi_param.data_width = IPU_CSI_DATA_WIDTH_10;
       csi_param.mclk = 74250000;
       csi_param.Hsync_pol = 0;
       csi_param.Vsync_pol = 0;
       csi_param.ext_vsync = 0;

I end up with those register set (by drivers/mxc/ipu3/ipu_capture.c):

CSI_SENS_CONF = 0x4001A50

CSI_SENS_FRM_SIZE = 0x0437077F

CSI_ACT_FRM_SIZE = 0x0437077F

CSI_OUT_FRM_CTRL = 0x0

CSI_CCIR_CODE_1 = 0x1040030

CSI_CCIR_CODE_3 = 0xFF0000

So, my issue is that I always hit a timeout in mxc_v4l_dqueue() without having the ipu detecting any frame. Also, shouldn't I put 2200x1125 as my resolution in CSI_SENS_FRM_SIZE or would the active resolution of 1920x1080 be cropped/synced automatically thanks to the CCIR ?


What am I missing ? Is there any way to debug what the IPU is seeing ? Any help appreciated


Labels (3)
11 Replies

2,748 Views
XXiao1z
Contributor III

Did you get this working? I'm trying to get BT1120 working and using GV7605, which should be nearly the same as GV7600. So far I can not capture any video yet.

0 Kudos
Reply

2,748 Views
qiang_li-mpu_se
NXP Employee
NXP Employee

The iMX6 BT1120 capture patch can be found at the followed link:

https://community.freescale.com/message/356584

2,748 Views
michalkaczmarek
Contributor II

Hi

Did you solved this problem? Does your IMX6 receives BT.1120 data from GV7600?

Michal

0 Kudos
Reply

2,748 Views
chunxin
Contributor II

we receives BT.1120 data use adv7441a.

please check this link https://community.freescale.com/message/302798#302798

and don't use the DATA_EN gpio pin

2,748 Views
XXiao1z
Contributor III

The link is for iMX53, how is it related to iMX6Q, if at all?

0 Kudos
Reply

2,748 Views
bellzhong
Contributor II

Hi chunxin,

Thanks for the hint of the DATA_EN gpio pin. I also used adv7441a to capture videos, but was able to received only BT.1120 progressive data. When tried to received BT.1120 interlaced data, the video was displayed but moving from the top side to the bottom side quickly. Were you able to used adv7441a to capture BT.1120 interlaced videos? If so, any other modification to the code for BT.1120 interlaced data is needed except for setting the clockmode to IPU_CSI_CLK_MODE_CCIR1120_INTERLACED_SDR?

Thank you in advance.

Bell

0 Kudos
Reply

2,748 Views
chunxin
Contributor II

we also have this issue,  does you have solved this issue. thanks !!!!!!!

0 Kudos
Reply

2,748 Views
michalkaczmarek
Contributor II

Hi All

We have a similar problem:

https://community.freescale.com/message/348083#348083


Regards


Michal

0 Kudos
Reply

2,748 Views
weidong_sun
NXP TechSupport
NXP TechSupport

Hello,Alexandre,

      I drew a simple work flow for your connection and drivers , Just for you as a reference. I feel your settings are right. but It seems that the configurations don't accord with working flow of v4l2 drivers.

gv7600.png

On our BSP, ov5642/ov5640/adv7180 camera sensor or capture IC are supported, you should tread gv7600 as a camera sensor in your system, then refer to those sensors have been supported in BSP to finish gv7600 porting.

Regards,

Weidong

2,748 Views
alexandrebellon
Contributor I

Hi,

I already created a v4l2 slave driver that is mainly a stub as the GV7600 does not need to be configured using SPI on our setup.

The fact is that BT.1120 doesn't seem to be supported in mxc_v4l2_capture.c and I'm not sure it has been tested in ipu_capture.c



0 Kudos
Reply

2,748 Views
michalkaczmarek
Contributor II

Hi

Have you tried to switch IPU into BT.1120 DDR 10-bit mode?

GV7600 can work in this mode.

Regards
Michal

0 Kudos
Reply