AnsweredAssumed Answered

Configuring CSI to generate test pattern for i.MX6

Question asked by Isaac Nickaein on Jun 7, 2015
Latest reply on Jun 8, 2015 by Wigros Sun

Hi,

 

I am trying to setup CSI to generate test image (the checkboard pattern) and capture it using Gstreamer.

I am using Kernel 3.10.17 on i.MX6DL. The reference document I am using is Freescale's "i.MX 6 BSP Porting Guide"  section "7.1.3 Configuring the CSI Unit in Test Mode".

 

What I have done so far in kernel (mostly based on the reference document):

 

    1. Enabled CSI related modules in kernel menuconfig under Device Drivers > Multimedia > V4L2

    2. Modified ov5640.c driver to remove codes related to I2C and regulators

    3. Modified ov5640.c to set the sensor format from YUYV to RGB565 (ov5640_data.pix.pixelformat = V4L2_PIX_FMT_RGB565)

    4. Modified ipu_capture.c to setup CSI in CST_TEST mode. The diff is attached.

    5. Changed all IPU_PIX_FMT_UYVY to IPU_PIX_FMT_RGB565 in ipu_bg_overlay_sdc.c (didn't have any effect though)

    6. Changed "CSI IC MEM" to "CSI MEM" in struct mxc_capture_inputs inside mxc_v4l2_capture.c

 

After these modifications, I can capture the checkboard pattern using GStreamer:

 

gst-launch mfw_v4lsrc num-buffers=1 !  jpegenc ! filesink location=sample.jpg

 

The color format of captured images is not correct. I have attached some samples for different RGB value settings.

Is there anything I am missing in the settings that causes this issue?

 

 

RGB=(0,0,0)RGB=(255,0,0)RGB=(0,255,0)
RGB=(0,0,255)RGB=(255,255,255)
0,0,0.jpg255,0,0.jpg0,255,0.jpg0,0,255.jpg255,255,255.jpeg

Original Attachment has been moved to: ipu_capture.c.diff.zip

Outcomes