Camera Support For RAW10 Format

cancel
Showing results for 
Search instead for 
Did you mean: 

Camera Support For RAW10 Format

1,850 Views
Contributor I

Hi,

I am using the following software packages

kernel version - 4.9.88

Yacto Distribution - Rocko

I need to connect the monochrome camera to IMX8M. The camera supports only RAW10 bit data so I made the following changes in kernel.

In mx6s_capture.c file  i add following under mx6s_configure_csi function

switch (csi_dev->fmt->pixelformat) {
case V4L2_PIX_FMT_YUV32:
case V4L2_PIX_FMT_SBGGR8:
width = pix->width;
break;
case V4L2_PIX_FMT_UYVY:
case V4L2_PIX_FMT_YUYV:
if (csi_dev->csi_mipi_mode == true)
width = pix->width;
else
/* For parallel 8-bit sensor input */
width = pix->width * 2;
break;
case V4L2_PIX_FMT_SBGGR10:
width = pix->width * 2;
break;
default:
pr_debug(" case not supported\n");
return -EINVAL;
}
csi_set_imagpara(csi_dev, width, pix->height);

if (csi_dev->csi_mipi_mode == true) {
cr1 = csi_read(csi_dev, CSI_CSICR1);
cr1 &= ~BIT_GCLK_MODE;
csi_write(csi_dev, cr1, CSI_CSICR1);

cr18 = csi_read(csi_dev, CSI_CSICR18);
cr18 &= BIT_MIPI_DATA_FORMAT_MASK;
cr18 |= BIT_DATA_FROM_MIPI;

switch (csi_dev->fmt->pixelformat) {
case V4L2_PIX_FMT_UYVY:
case V4L2_PIX_FMT_YUYV:
cr18 |= BIT_MIPI_DATA_FORMAT_YUV422_8B;
break;
case V4L2_PIX_FMT_SBGGR8:
cr18 |= BIT_MIPI_DATA_FORMAT_RAW8;
break;
case V4L2_PIX_FMT_SBGGR10:
cr18 |= BIT_MIPI_DATA_FORMAT_RAW10;
break;
default:
pr_debug(" fmt not supported\n");
return -EINVAL;
}

csi_write(csi_dev, cr18, CSI_CSICR18);
}

After enable the support in kernel i can able to receive some image data but its corrupted and also i received 10 frames per second out of 60. so my question is

1.How the RAW10 format is arranged in buffer?

1.what is the default mipi clock in imx8m and how to change the mipi clock?

2.Did i miss anything to add in kernel to enable raw10 support?

Thanks in advance

Vimal.

Labels (1)
Tags (2)
0 Kudos
9 Replies

212 Views
Contributor I

Hi,

Thanks for your Support

Now I can able to receive the raw10 format successfully,

0 Kudos

212 Views
Contributor I

Hi Vimal,

We are trying to integrate Sony IMX412 camera sensor for iMX8m platform. IMX412 is a Bayer sensor and it is configured as RAW10 mode, 1280x720 15fps 2 lanes, 300Mbps/lane setting. The sensor was properly configured as per the settings. We are also facing "Base address switching change err." issue. If I disable "Base address switching" in the mx6s_capture.c and I was not getting a proper image.

Q:

1. We are facing the same issue. How did you solve this problem?

2. What are changes required on iMX8m mipi CSI side?

3. Can you please explain it briefly for resolving this issue?

0 Kudos

212 Views
Contributor I

Hi Vimal,

Can you please tell me how did u resolve the issue.

Are you saving it in raw format?

Thanks in advance

0 Kudos

212 Views
Contributor III

Could you tell me what command did you use to save raw camera capture ?
I tried many gstreamer commands to save the .raw file but all failed.

0 Kudos

212 Views
Contributor I

How did you resolve this? I am in the same situation. I am working with IMX214 which outputs in RAW10 only.

0 Kudos

212 Views
Contributor I

Have you solved the problem yet? We have the same problem with ov9282.

0 Kudos

212 Views
Contributor I

Can you please explain your problem in brief. what is your exact problem?

0 Kudos

212 Views
Contributor I

Thanks for the response.

1. I referred the mentioned Document and it says that, the IMX8M supports RAW format. and IMX8MDQLQRM document mentioned the IMX8M supports the RAW10 format.

Can you please explain how the RAW10 data is arranged in Buffer. I attached the screenshot from IMX6 datasheet for RAW10 data arrangements.

Screenshot from 2019-02-07 11-04-06.png  

2. Yes, I talked about MIPI-CSI host clock the IMX8M supports 1.5GB per lane so what is the default operating clock? Because i received very low frame rate.

Questions

1. The RAW10 data arrangement for IMX6 & IMX8 is same or not?

2. What is the default mipi csi host clock and how can i increase the MIPI CSI host clock?

0 Kudos

212 Views
NXP TechSupport
NXP TechSupport

Hi Vimal

Supported cameras and formats are described in AN12187 Quick Start Guide

for MINISASTOCSI for i.MX 8M Evaluation Kit

https://www.nxp.com/docs/en/application-note/AN12187.pdf 

Unfortunately porting raw sensor doc guide on imx8 currently not available, sorry.

The clocks are MIPI CSI host clocks, they are not related to external camera inpu signal.

The host can support 1, 2,3 and 4 lanes camera, so 1 lane camera can be supported. The lane number is set from device tree, "data-lanes = <1 2>;" means 2 lanes are used:

 

&mipi_csi_1 {
 #address-cells = <1>;
 #size-cells = <0>;
 status = "okay";
 port {
  mipi1_sensor_ep: endpoint1 {
   remote-endpoint = <&ov5640_mipi1_ep>;
   data-lanes = <1 2>;
  };

  csi1_mipi_ep: endpoint2 {
   remote-endpoint = <&csi1_ep>;
  };
 };
};

Regards

0 Kudos