imx6q ipu2 csi-2 16 bit yuv video

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

imx6q ipu2 csi-2 16 bit yuv video

1,972 Views
abeeshmp_dct
Contributor II

Hi All,

We are trying to get video from a camera sensor, which is connected to the ipu2-csi-2 parallel port. And we configured the CSI registers to get the video in 16 bit yuv format, but  we are not getting chroma section of the video . 

We are using the 4.1.15 kernel and gstreamer as the application.

The sensor used is Sony FCBEV7520A, but the output from this sensor is LVDS and it is converted into CMOS 16 bit format using the chip THC63LVD1024. 

We have also tried to get the video from Test pattern generator also. 

Since Sony sensor does not have a test pattern option, with the other test pattern generator video, we could understand that there is no CrCb component in the video data, got at imx6 side.

The PINs used at imx6 side is as seen in the picture below, 

picturemessage_3l5fxprc.m4q.png

And the CSI sensor configuration register is configured with following parameters, 

  • 16 bit per pixel
  • YUV422 format
  • Gated Clock 

The video obtained with this settings has only green color prominent, and that reveals that Cb and Cr values are zero and Y values varies according to video data.

In the linux kernel obtained from Yocto Morty branch does not have support for 16 bit video capture and I modified the code to get it done.

The code diff is pasted below,

From the sensor driver , video configuration area is modified as below, 

- p->if_type = V4L2_IF_TYPE_BT656_INTERLACED;
- p->u.bt656.mode = V4L2_IF_TYPE_BT656_MODE_BT_8BIT;
+ p->if_type = -1;//V4L2_IF_TYPE_BT1120_PROGRESSIVE_SDR;//V4L2_IF_TYPE_BT656_INTERLACED;
+ p->u.bt656.mode = V4L2_IF_TYPE_BT656_MODE_NOBT_12BIT;
p->u.bt656.clock_min = flir_tau2_XCLK_MIN;
p->u.bt656.clock_max = flir_tau2_XCLK_MAX;
- p->u.bt656.bt_sync_correct = 0; /* Indicate internal vsync */
+ p->u.bt656.bt_sync_correct = 1; /* Indicate internal vsync */
p->u.bt656.latch_clk_inv = 1; /* Pixel clock is inverted before applied to internal circuitry*/

and the mxc_v4l2_capture.c , 

- csi_param.data_width =
- (ifparm.u.bt656.mode == V4L2_IF_TYPE_BT656_MODE_NOBT_10BIT) ||
- (ifparm.u.bt656.mode == V4L2_IF_TYPE_BT656_MODE_BT_10BIT) ?
- IPU_CSI_DATA_WIDTH_10 : IPU_CSI_DATA_WIDTH_8;
+ csi_param.data_width = IPU_CSI_DATA_WIDTH_16;
+// (ifparm.u.bt656.mode == V4L2_IF_TYPE_BT656_MODE_NOBT_10BIT) ||
+// (ifparm.u.bt656.mode == V4L2_IF_TYPE_BT656_MODE_BT_10BIT) ?
+// IPU_CSI_DATA_WIDTH_10 : IPU_CSI_DATA_WIDTH_8;

Is there any other things to get modified to get the YUV data through 16 bit interface of CSI?

Video files obtained with these settings is attached here

Please help us to resolve this issue. I can give you more details if required.

Labels (3)
0 Kudos
3 Replies

1,615 Views
vladimirchulkov
Contributor I

Hello,

Do you have a video capture?

0 Kudos

1,616 Views
joanxie
NXP TechSupport
NXP TechSupport

Pls refer to the links as below:

iMX6 IPU TVIN Application Notes 

https://community.nxp.com/docs/DOC-97981 

If you use 16 bits data line, then only generic mode capture can be used to capture the 16 bits YUV data.

If one wants to capture YUV data in 16bits interface, onlt BT1120 can be supported, it needs camera output BT1120 protocol, and hardware data line should be CSI_DATA19 ~CSI_DATA12 and CSI_DATA9 ~CSI_DATA2.

0 Kudos

1,511 Views
jeromebolduc
Contributor III

If we want to use 16-bit YUY2 parallel input without BT1120, is it possible?

Regards,

Jerome

0 Kudos