IMX6q video capture

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

IMX6q video capture

1,299 Views
andrekilian
Contributor I

Hi,
we are trying to capture video using a TW9910 on our custom IMX6q board (We run Android 5.0.2).
Even though we used the recommended configuration for TW9910 (BT656) we were not able to capture the correct test pattern we are using as an input.
(Test pattern Generator ----> TW9910 -----(BT656)----> imx6q CSI0)

We were able to capture a video using the camera app and also used "mxc-v4l2-tvin -ow 720 -oh 480 -ot 1 -ol 1 -f UYVY" which produced the same result on our display.
However the video is not right (see attachment), it might be a connection issue with our custom board,
the connections of the TW9910 to our board are the pixelclock and 8 data lines like this:

TW9910        IMX6q-Board
PCLK    --->    CSIO0_DATAPIXCLK
VD8    --->    CSIO0_DAT12
VD9    --->    CSIO0_DAT13
VD10    --->    CSIO0_DAT14
VD11    --->    CSIO0_DAT15
VD12    --->    CSIO0_DAT16
VD13    --->    CSIO0_DAT17
VD14    --->    CSIO0_DAT18
VD15    --->    CSIO0_DAT19

Are these connections correct or do they need to be inverted? (VD8 ---> CSIO0_DAT19 ... VD15 ---> CSIO0_DAT12)
Is there any other reason why our test pattern cannot be captured?

Here is what our driver passes on

In our driver probe:

    /* Set initial values for the sensor struct. */
    memset(&adv7180_data, 0, sizeof(adv7180_data));
    adv7180_data.sen.i2c_client = client;
    adv7180_data.sen.streamcap.timeperframe.denominator = 30;
    adv7180_data.sen.streamcap.timeperframe.numerator = 1;
    adv7180_data.std_id = V4L2_STD_NTSC;
    video_idx = ADV7180_NTSC;
    adv7180_data.sen.pix.width = video_fmts[video_idx].raw_width;
    adv7180_data.sen.pix.height = video_fmts[video_idx].raw_height;
    adv7180_data.sen.pix.pixelformat = V4L2_PIX_FMT_UYVY; /* YUV422 */
    //adv7180_data.sen.pix.pixelformat = V4L2_PIX_FMT_RGB565;//(RGB for Test Generator)
    adv7180_data.sen.pix.priv = 1;  /* 1 is used to indicate TV in */
    adv7180_data.sen.on = true;

In ioctl_g_ifparm

    /* Initialize structure to 0s then set any non-0 values. */
    memset(p, 0, sizeof(*p));
    p->if_type = V4L2_IF_TYPE_BT656; /* This is the only possibility. */
    p->u.bt656.mode = V4L2_IF_TYPE_BT656_MODE_BT_8BIT;
    p->u.bt656.bt_sync_correct = 0;
    p->u.bt656.clock_curr = 0;

Here is some IPU Debug

<7>imx-ipuv3 2400000.ipu: IPU_CLK_RATE = 264000000
<7>imx-ipuv3 2400000.ipu: CSI_SENS_CONF = 0x00000A30
<7>imx-ipuv3 2400000.ipu: CSI_SENS_FRM_SIZE = 0x020C02CF
<7>imx-ipuv3 2400000.ipu: CSI_ACT_FRM_SIZE = 0x01DF02CF

0 Kudos
2 Replies

839 Views
igorpadykov
NXP Employee
NXP Employee

Hi Andre

one can check with logic analyzer if correct synch codes are sent from camera,

also one can look on

Switching CSI into Progressive bt.656 Mode 

https://community.nxp.com/thread/435287 

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

0 Kudos

839 Views
andrekilian
Contributor I

We now have a video (almost), it was an hardware problem. Now we receive our test pattern and can see it through the camera app. However it seems that it is not synced properly see attachment. Running mxc-v4l2-tvin -ow 720 -oh 480 -ot 0 -ol 1 -f UYVY now results in this:

fmt RGB565: fourcc = 0x50424752
fmt BGR24: fourcc = 0x33524742
fmt RGB24: fourcc = 0x33424752
fmt RGB32: fourcc = 0x34424752
fmt BGR32: fourcc = 0x34524742
fmt NV12: fourcc = 0x3231564e
fmt UYVY: fourcc = 0x59565955
fmt YUYV: fourcc = 0x56595559
fmt YUV422 planar: fourcc = 0x50323234
fmt YUV444: fourcc = 0x34343459
fmt YUV420: fourcc = 0x32315559
fmt YVU420: fourcc = 0x32315659
fmt TILED NV12P: fourcc = 0x50564e54
fmt TILED NV12F: fourcc = 0x46564e54
fmt YUV444 planar: fourcc = 0x50343434
start time = 946690433 s, 979772 us
mxc_ipu mxc_ipu: ERR: no-0x0,ipu_queue_task err:-22
mxc_v4l2_output v4l2_out.19: display work fail ret = -22
mxc_ipu mxc_ipu: ERR: no-0x0,ipu_queue_task err:-22
mxc_v4l2_output v4l2_out.19: display work fail ret = -22
mxc_ipu mxc_ipu: ERR: no-0x0,ipu_queue_task err:-22
mxc_v4l2_output v4l2_out.19: display work fail ret = -22
mxc_ipu mxc_ipu: ERR: no-0x0,ipu_queue_task err:-22
mxc_v4l2_output v4l2_out.19: display work fail ret = -22 

We tried using the VSYNC and HSYNC pins by changing (driver)

    p->u.bt656.mode = V4L2_IF_TYPE_BT656_MODE_BT_8BIT;
    p->u.bt656.bt_sync_correct = 0;

to

    p->u.bt656.mode = V4L2_IF_TYPE_BT656_MODE_NOBT_8BIT;
    p->u.bt656.bt_sync_correct = 1;

We also tried to change the active top value from 13 to 3 (mxc_v4l2_capture.c)

static video_fmt_t video_fmts[] = {
    {            /*! NTSC */
     .v4l2_id = V4L2_STD_NTSC,
     .name = "NTSC",
     .raw_width = 720,        /* SENS_FRM_WIDTH */
     .raw_height = 525,        /* SENS_FRM_HEIGHT */
     .active_width = 720,        /* ACT_FRM_WIDTH */
     .active_height = 480,        /* ACT_FRM_HEIGHT */
     .active_top = 3,
     .active_left = 0,
     },

Switching to PROGRESSIVE mode sadly didn't work either. The IPU shows following warning:

<7>imx-ipuv3 2400000.ipu: IPU_CLK_RATE = 264000000
<7>imx-ipuv3 2400000.ipu: CSI_SENS_CONF = 0x00000A30
<7>imx-ipuv3 2400000.ipu: CSI_SENS_FRM_SIZE = 0x020C02CF
<7>imx-ipuv3 2400000.ipu: CSI_ACT_FRM_SIZE = 0x01DF02CF

<4>imx-ipuv3 2400000.ipu: IPU Warning - IPU_INT_STAT_5 = 0x00000001

Any suggestions as to why the video is not syncing correctly?

0 Kudos