Broken image with custom sensor and ISP on i.MX8M Plus

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

Broken image with custom sensor and ISP on i.MX8M Plus

838 Views
stone_dvtc
Contributor I

Hello all,

we have our own hardware with our own sensor and need Lens Shade Correction. Since the ISP has such a function, we would like to use it. The sensor produces monochrome images with 8bit per pixel and uses a resolution of 2560x1936 pixels.


The following software is used:

I have created an ISS driver based on the one from OV2775. For calibration I use a copy of the XML files of the OV27775 where only the resolution was adjusted and the file sensor_dwe_bypass_4K_config.json where also only the resolution was adjusted.
The isp_media_server starts and loads the ISS driver. We can create a RAW image with the following command.

video_test -w 2560 -h 1936 -f RAW8 -t 2 -m0

rawdump_2560x1936_0.jpg

 

But when I create an processed image with YUYV it looks like this

 

video_test -w 2560 -h 1936 -f YUYV -t 2 -m0

test_frame0.jpg

 

My first thought was that a feature in the ISP is breaking the image by not calibrating properly. But after that I found out that if I scale the image it is not broken anymore.

 

video_test -s -w 1280 -h 968 -f YUYV -t 2 -m0

test_frame0.jpg

 

 

I have added commands to video_test that disable all the ISP features listed in the porting guide but it did not help.
I checked the MIPI CSI registers, they look correct.


Now I am a bit lost where the problem could be. I would be very grateful for any hints.

 

Thanks in advance !

Reagrds, stone

0 Kudos
Reply
1 Reply

773 Views
stone_dvtc
Contributor I

For further testing I enabled the log outputs of the vvcam driver and output the interrupt status in the ISR of the ISP driver. Additionally I activated the log outputs of the MIPI-CSI driver.

echo "module vvcam_isp +p" > /sys/kernel/debug/dynamic_debug/control
echo 2 > /sys/module/imx8_mipi_csi2_sam/parameters/debug

In the log I see the message isp_mis=0x20 from the ISR of the ISP driver, I guess this stands for "sampled input frame is complete"(MRV_ISP_MIS_FRAME_IN). After that comes the message isp_mis=0x8012, which probably stands for the events "Histogram measurement ready"(MRV_ISP_MIS_HIST_MEASURE_RDY), "White balancing measurement cycle is complete"(MRV_ISP_MIS_AWB_DONE) and "frame was completely put out"(MRV_ISP_MIS_FRAME).

As you can see, quite a lot of time passes between "sampled input frame is complete" and "frame was completely put out". During this time frames are sent from the camera but the DMA buffer is not changed, which would also explain why the image is broken.

Due to the lack of documentation, this is of course only speculation, which is why it would be nice if someone from NXP could comment on this.

0 Kudos
Reply