How to support 8-bit RAW camera on IMX6Q?

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

How to support 8-bit RAW camera on IMX6Q?

1,809 Views
velarn
Contributor I

I am working on a camera driver,which is a 14MP sensor connected to csi 0 parallel port . And it only support 8 bit RAW output.

I glanced at the many discussions on the community,and modify some source files,but it still not work.

When I used mxc_v4l2_capture.out ,a error told me:

ERROR: v4l2 capture: mxc_v4l_dqueue timeout enc_counter 0.

This problem is same on the discussion:

imx6 support for 8-bit RAW camera 

Can someone help me?

thanks a lot.

***********************************************************************************
The lists that I changed:

..\drivers\media\video\mxc\capture\ipu_csi_enc.c

..\drivers\media\video\mxc\capture\mxc_v4l2_capture.c

 

..\drivers\mxc\ipu3\ipu_capture.c

..\drivers\mxc\ipu3\ipu_common.c

..\drivers\mxc\ipu3\ipu_param_mem.h

In mxc_v4l2_Capture.c, add another case at mxc_v4l2_s_fmt() as blew:

case V4L2_PIX_FMT_YUV422P:
      log_msg(LOG_DEBUG,"set format V4L2_PIX_FMT_YUV422P\n");
      break;
+   case V4L2_PIX_FMT_SGRBG8:
+   log_msg(LOG_DEBUG,"set format V4L2_PIX_FMT_SGRBG8\n");
+   break;

and other files which need this format.

Labels (3)
0 Kudos
6 Replies

964 Views
velarn
Contributor I

It still not work.But it can capture some wrong data when I set the pixformat as yuv420.

In this disscussion:

IPU - bayer pattern conversion 

Mr Li said it must be set in interlaced mode when used generic data,and clk mode must be gated clk.

And I found if I want to get generic data,the FPS in the CPMEM word1,bit 88:85 should be 0x06 in interlaced mode.(refence IMX6Q RM page 2771).

However,the explanation of RM is consistent with Mr Li.

But in the file ipu_csi_enc.c:

sensor_protocol = ipu_csi_get_sensor_protocol(cam->ipu, cam->csi);
switch (sensor_protocol) {
case IPU_CSI_CLK_MODE_GATED_CLK:
case IPU_CSI_CLK_MODE_NONGATED_CLK:
case IPU_CSI_CLK_MODE_CCIR656_PROGRESSIVE:
case IPU_CSI_CLK_MODE_CCIR1120_PROGRESSIVE_DDR:
case IPU_CSI_CLK_MODE_CCIR1120_PROGRESSIVE_SDR:
params.csi_mem.interlaced = false;

The gated clk mode is against with interlace mode.Anyone can clarify it?

0 Kudos

964 Views
velarn
Contributor I

I am study on this disscussion:

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

I think it's usefull.

0 Kudos

964 Views
gary_bisson
Senior Contributor III

Hi,

As the other thread explains, the IPU can't process RAW 8-bit format. It can pass it through to user space directly with no processing but that's it. What is your V4L2 application? If any kind of CSC is required, this won't work.

Regards,

Gary

0 Kudos

964 Views
velarn
Contributor I

Thanks Gary.

I know the IPU can't process RAW data.I want to receive the RAW data from csi 0 to memory.Then I can deal the data with sofware .

My V4L2 application is "MXC_V4L2_CAPTURE.OUT" which made through LTIB.

The Error reminder that no data in buffers. I think that the function "camera_callback" was not called.

The sensor's PCLK,VS and HS is correct. How can I know the csi got the data stream? 

Thank a lot.

Velarn.

0 Kudos

964 Views
gary_bisson
Senior Contributor III

Hi,

This might be obvious but make sure to set the input index to be 1 in order to bypass the IC (VIDIOC_S_INPUT).

linux-imx6/mxc_v4l2_capture.c at boundary-imx_3.14.28_1.0.0_ga · boundarydevices/linux-imx6 · GitHub 

Regards,

Gary

0 Kudos

964 Views
velarn
Contributor I

Hi

I used command as "mxc_v4l2_capture.out -i 1 xxx.bin",but the error still on.

Do I need to upload my source files?

0 Kudos