AnsweredAssumed Answered

imx6q ipu2 csi-2 16 bit yuv video

Question asked by ABEESH M P on May 17, 2019
Latest reply on Mar 19, 2020 by Vladimir Chulkov

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, 


imx6 ipu video signals used



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) ?
+ 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) ?


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.