imx6 bt656 video field doubling problem

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

imx6 bt656 video field doubling problem

2,120 Views
sergkot
Contributor II

Hi,

I have a problem with capturing video with imx6s from PAL bt656 with embeded SAV/EAV codes (thus without external HSYNC and VSYNC). We can capture video stream with mxc_v4l2_capture.out in raw file, but some frаmes have exactly same field, ie it has only odd or even lines new, other lines are the same, as in previous frame. It is very strange behaviour, because frames have different location in memory and thus we have two copies of the same field. We are using the simple chain CSI0->SMFC->IDMAC, so it is strange how the same data can be copied twise.

We are sure, that fields are the same, because noise pattern should be unique in every field.

Is it known problem and what settings or logs should I give to clarify my situation?

Here is our height and width params in mxc_v4l2_capture.c:

  .v4l2_id = V4L2_STD_PAL,

  .name = "PAL",

  .raw_width = 720,

  .raw_height = 625,

  .active_width = 720,

  .active_height = 576,

  .active_top = 0,

  .active_left = 0,

Here is our CCIR codes:

  ipu_csi_write(ipu, csi,  0x40596, CSI_CCIR_CODE_1);

  ipu_csi_write(ipu, csi, 0xD07DF, CSI_CCIR_CODE_2);

(we are tried to switch CODE_1 and CODE_2, but without any result, except odd and even lines are switched)

Clock is in interlaced mode: IPU_CSI_CLK_MODE_CCIR656_INTERLACED

Capture input is "CSI MEM" in mxc_v4l2_capture.c

{

  .index = 1,

  .name = "CSI MEM",

  .type = V4L2_INPUT_TYPE_CAMERA,

  .audioset = 0,

  .tuner = 0,

  .std = V4L2_STD_UNKNOWN,

  .status = V4L2_IN_ST_NO_POWER,

  },

Timestamp difference beetween frames is 40 ms with very small deviation (39.9-40.1).

Below is example of field doubling in frame sequence, captured by

./mxc_v4l2_capture.out -iw 720 -ih 576 -ow 720 -oh 576 -t 0 -i 0 -fr 25 -c 75 ./out_buf1.yuv

Between frames 50 and 51 even rows are exactly same. It is clearly seen, that noise pattern on frame 49 and 52 is different from frames 50 and 51. 50 and 51 have same noise pattern on even rows. This situation appears roughly every third frame, but there can be two frames in sequence with doubled field or it can be three normal frames in sequence, than bad frame.

Thanks.

Tags (5)
0 Kudos
1 Reply

1,006 Views
Yuri
NXP Employee
NXP Employee

  The following may be helpful.


1.

  Please refer to Chapter 7 (Supporting the i.MX 6Dual/6Quad/6Solo/6DualLite

Camera Sensor with CSI) in "i.MX_6_BSP_Porting_Guide.pdf".


2.

Was anyone able to receive CSI BT.1120 interlaced data correctly on iMX6 platform?

3.

  Also, from internal Community, Qiang Li wrote :

    For no VSYNC and HSYNC case, in the sensor driver such as "linux-3.0.35\drivers\media\video\mxc\capture\adv7180.c", function ioctl_g_ifparm(), you should set p->u.bt656.bt_sync_correct to 0;
    p->u.bt656.bt_sync_correct = 1; // It means external VSYNC and HSYNC will be used for SYNC.
    p->u.bt656.bt_sync_correct = 0; // No external VSYNC and HSYNC, embedded EAV and SAV will be used for SYNC.

    In iMX6 BSP, the CCIR related code is ready in "linux-3.0.35\drivers\mxc\ipu3\ipu_capture.c", function ipu_csi_init_interface(), no code modification was needed, that code was verified work.

    For BT656 mode, your sensor driver such as adv7180, should also report correct parameters in function function ioctl_g_ifparm().
    p->u.bt656.clock_curr = 0;  // This will tell linux-3.0.35\drivers\media\video\mxc\capture\mxc_v4l2_capture.c to use "IPU_CSI_CLK_MODE_CCIR656_INTERLACED" in function mxc_v4l2_s_param().

    The current iMX6 BSP mxc_v4l2_capture.c driver doesn't support BT656 progressive mode, it only supports BT656 interlace mode. To support BT656 progressive mode, the customer should modify the code in mxc_v4l2_s_param(), let csi_param.clk_mode = IPU_CSI_CLK_MODE_CCIR656_PROGRESSIVE.

Re: CSI BT656


Have a great day,
Yuri

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

0 Kudos