Hi Keita,
I never tried to get 12 bit bayer data, but read a few posts from people that tried and I still don't know if any were successful.
In include/linux/mipi_csi2.h, there are MIPI_DT_RAW8/10/12 defined. You need to make sure that you camera driver is setting MIPI_DT_RAW12. Look at the ov5640_mipi.c for reference. Since you're reading in 12 bit data, you have to use a 16 bit pixel format, so you could try using V4L2_PIX_FMT_SBGGR16 and IPU_PIX_FMT_GENERIC_16.
If you sensor can output 8 bit data, you could try starting there, and once you get that working try 12 bit.
I found this post very helpful to get started: i.MX6 OV5647 Bayer sensor driver (ERROR: v4l2 capture: mxc_v4l_dqueue timeout enc_counter 0)
You could also try posting on this thread. 10-Bit Bayer Capture
Also, be aware the the IMX6 cannot convert the bayer data to usable image data in hardware. If you can switch to an RGB or YUV sensor, I highly recommend doing it.
Good luck!
Hi Jimmychan,
Thank you for your reply.
But, i.MX6Q didn't capture the 12 bit RAW data.
<My customer modified the settings follow the community.>
1. Setting the CSI-MEM
2. Add the "V4L2_PIX_FMT_GREY" and "IPU_PIX_FMT_GREY format cases".
[Questions]
Q1. Do you have the sample code to save RAW data?
Q2. Is there relationship between the "save of the 12 bit raw data" and "vsync_external flag"?
Best Regards,
Keita
Hi Keita,
I never tried to get 12 bit bayer data, but read a few posts from people that tried and I still don't know if any were successful.
In include/linux/mipi_csi2.h, there are MIPI_DT_RAW8/10/12 defined. You need to make sure that you camera driver is setting MIPI_DT_RAW12. Look at the ov5640_mipi.c for reference. Since you're reading in 12 bit data, you have to use a 16 bit pixel format, so you could try using V4L2_PIX_FMT_SBGGR16 and IPU_PIX_FMT_GENERIC_16.
If you sensor can output 8 bit data, you could try starting there, and once you get that working try 12 bit.
I found this post very helpful to get started: i.MX6 OV5647 Bayer sensor driver (ERROR: v4l2 capture: mxc_v4l_dqueue timeout enc_counter 0)
You could also try posting on this thread. 10-Bit Bayer Capture
Also, be aware the the IMX6 cannot convert the bayer data to usable image data in hardware. If you can switch to an RGB or YUV sensor, I highly recommend doing it.
Good luck!