After enable 16 csi0, video is rolling and color was wrong

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

After enable 16 csi0, video is rolling and color was wrong

1,710 Views
jayhuang
Contributor II

My environment is:

platform : imx6q

linux kernel: Linux version 3.10.53-88228-g9ebf157-dirty

and I wanted to enlarge the csi0 width from 8 to 16 between my sensor and ipu.

My sensor supports bt656 8-bit and YCbCr 4:2:2 16-bit. Based on IMX6DQRM, the ipu of imx6q supports bt656 8-bit and 16 bit YUV422 (In 37.4.3.9 16-bit camera support.)

Following are my combination:

   sensor             < --- >        imx6

BT656 8-bit                         BT656 8-bit     => fine, please check the attach normal.jpg

YCbCr4:2:2 16-bit               IPU_PIX_FMT_GENERIC_16   => wrong, please check the video.mp4    

My modifications (I used v4l2 to link my sensor and imx6q):

In my sensor driver:

* ioctl_g_ifparm:

  Change the V4L2_IF_TYPE_BT656_SPECIFY to V4L2_IF_TYPE_GATE.

  There are detail:

  if_type = V4L2_IF_TYPE_GATE;

  u.gate.csi_data_width = 9; //16-bit

  u.gate.nobt_hs_inv = sensor.HPolarity;

  u.gate.nobt_vs_inv = sensor..CurVTiming.VPolarity;

  u.gate.latch_clk_inv = 0;

  u.gate.swap = 0;

  u.gate.frame_start_on_rising_vs = 0;

  u.gate.v_sync_correct = 1;

  u.gate.clock_curr = sensor.curclk;

  u.gate.clock_min = sensor.minclk;

  u.gate.clock_max = sensor.maxclk;

* ioctl_g_fmt_cap:

   Change the V4L2_PIX_FMT_UYVY to IPU_PIX_FMT_GENERIC_16.

   fmt.pix.pixelformat = IPU_PIX_FMT_GENERIC_16;

   fmt.pix.width = sensor.HActive;

   fmt.pix.height = (sensor.ScanMode != 0) ? sensor.VActive * 2 : sensor.VActive;

   fmt.pix.field = V4L2_FIELD_INTERLACED_BT;

   fmt.pix.sizeimage = f->fmt.pix.width * f->fmt.pix.height;

   fmt.pix.colorspace = V4L2_COLORSPACE_JPEG;

In imx6:

I didn't do any change.

Could someone give me a hand??

Thanks very much!!

Tags (2)
6 Replies

1,127 Views
jayhuang
Contributor II

Hi!

I have fixed the rolling and 4 frames issues by changing the pixel format to IPU_PIX_FMT_GENERIC_16 of csi->mem channel.

But I got another issue, please see the attachment.

pic_1 is the correct. pic_2 is my current status.

I dump the frame via "mxc-v4l2-capture" program.

Could someone give me a hand??

Thanks very much!!

0 Kudos

1,126 Views
765077233
Contributor I

hi Jay:

Have  you resolved the problem ?

0 Kudos

1,127 Views
jayhuang
Contributor II

Yes. I solved this problem two years ago.

765077233@qq.com <admin@community.nxp.com> 於 2019年6月10日 週一 下午10:45寫道:

NXP Community

<https://community.freescale.com/resources/statics/1000/35400-NXP-Community-Email-banner-600x75.jpg>

Re: After enable 16 csi0, video is rolling and color was wrong

reply from Kyle Niu

<https://community.nxp.com/people/765077233@qq.com?et=watches.email.thread>

in i.MX Processors - View the full discussion

<https://community.nxp.com/message/1162518?commentID=1162518&et=watches.email.thread#comment-1162518>

0 Kudos

1,127 Views
765077233
Contributor I

Hi Jay:

Could you tell me how to resolve it?By the way ,where is the macro V4L2_IF_TYPE_GATE from?

0 Kudos

1,127 Views
igorpadykov
NXP Employee
NXP Employee

Hi Jay

first please verify correct sensor connection, it should be

CSI_DATA19 ~ CSI_DATA4 as shown in Table 66. Camera Input

Signal Cross Reference, Format, and Bits Per Cycle i.MX6DQ Datasheet

http://cache.freescale.com/files/32bit/doc/data_sheet/IMX6DQCEC.pdf

then please try to implement settings suggested in :

MX53 CSI/IDMAC config for Aptina 12-bit grayscale camera?

Best regards

igor

-----------------------------------------------------------------------------------------------------------------------

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

-----------------------------------------------------------------------------------------------------------------------

1,127 Views
jayhuang
Contributor II

Hi, igorpadykov.

Thanks for your suggestion.

Based on Table 66, I have verified the CSI_DATA19~CSI_DATA4 and the connections are correct with my sensor.

I think I should check the CPMEM.

BTW, I have surveyed some articles like Missing v-sync in Bt.656 capture (rolling video) . I also have the video rolling issue but I make sure that my V_Sync, H_Sync pins are fine by Oscilloscope machine. Do you have any idea??

Thanks again! The information you provide is what I need.

0 Kudos