Camera image glitching/tearing when DEMO_CAMERA_BUFFER_COUNT 3

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

Camera image glitching/tearing when DEMO_CAMERA_BUFFER_COUNT 3

Jump to solution
6,249 Views
kayakaantuna
Contributor III

Hi,

 

I'm using csi_mipi_rgb_cm7 example. I customized the example for my camera, so I'm not using ov5640. With `DEMO_CAMERA_BUFFER_COUNT 2` I can get solid 20~fps with no image tearing or anything on my LVDS. But when I increased DEMO_CAMERA_BUFFER_COUNT to 3, I get full 30 fps which my camera supports, however the image see on my LVDS is like the one I attached.

 

- I get this image by memory dumping the &cameraReceivedFrameAddr, so it cannot be LVDS issue.

- And also when I increase Cortex M7 Core Root Clock higher, for example 600 MHz, more of this tearing thing happens.

 

(Note project runs on BOARD_SDRAM)

What may be the issue ?

Thanks in advance.

0 Kudos
Reply
1 Solution
5,545 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi @kayakaantuna ,

   After internal checking, still in the SDRAM read area have limit, you can consider it is the hardware limit.

  As the semc just can connect 16bit max data length, then even your code use the 32bit read, still have read limit.

  I am thinking, your LCD resolution is smaller than the camera, why you don't change your camera solution to the same to the LCD, that may save some frame buffer.

  Normally to the SDRAM read limit, just can use the low FPS to resolve the issues, no other workaround now.

 

Best Regards,

kerry

View solution in original post

0 Kudos
Reply
28 Replies
1,364 Views
kayakaantuna
Contributor III

Hi @kerryzhou,

 

Sorry for the late response.

- Do you try 25fps, whether that is stable or not?

I tried to change fps by changing 

#define DEMO_CAMERA_FRAME_RATE    30

this define but I didn't notice anything on the camera. It seems like its not affecting the camera stream ?

 

- BTW, do you use the PXP to switch your CSI from 1280*960 to the LCD resolution 1280*720?

Yes, this is the exact operation I used.

 

- What's the SDRAM data width you are using? 32bit in your hardware?

Here is our SDRAM we are using. I don't know it's 32bit or not. If you can tell me I would highly appreciate it.


Thanks.

0 Kudos
Reply
1,342 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi @kayakaantuna ,

   Thanks for your updated information.

   1. you mentioned your previous 20 fps is working, do you also just modify this define?

#define DEMO_CAMERA_FRAME_RATE    30

  whether that works, I think just like your previous situation, try the 20-30 fps to find out which is the highest fps to work normally.

  2. About the SDRAM bit width

 You can check your hardware, how many data line you are using.

After talking your issue internally, we think your 30 fps data to save and read to the SDRAM is so high, your SDRAM read bandwidth should the root limit, to this situation, normally, can't improve it.

You may need to try 20-30 fps, to find which is the max stable fps, then use that data.

 

Wish it helps you!

Best Regards,

Kerry

0 Kudos
Reply
1,332 Views
kayakaantuna
Contributor III

Hi @kerryzhou,

 

 1. you mentioned your previous 20 fps is working, do you also just modify this define?

Yes, I get stable 20 fps when I change DEMO_CAMERA_BUFFER_COUNT to 2. And no I did not modify this define

#define DEMO_CAMERA_FRAME_RATE    30

Even though I modify it, it seems that it has no effect to the LVDS stream.

 

 2. About the SDRAM bit width

According to the datasheet of W9825G6KH-5:

"W9825G6KH is a high-speed synchronous dynamic random access memory (SDRAM), organized as
4M words x 4 banks x 16 bits. W9825G6KH delivers a data bandwidth of up to 200M words per
second"

 

By the information above, what do you suggest us to change on our SDRAM ?

 

Thanks.

0 Kudos
Reply
1,280 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi @kayakaantuna ,

  If you still use DEMO_CAMERA_BUFFER_COUNT to 2. Can you run to 30fps or not?

  To your SDRAM, your data width is 16bit.

Can you share your RT board with the SDRAM part, just to confirm it from your hardware.

 

Best Regards,

Kerry

 

0 Kudos
Reply
1,279 Views
kayakaantuna
Contributor III

Hi @kerryzhou ,

 

- If you still use DEMO_CAMERA_BUFFER_COUNT to 2. Can you run to 30fps or not?

No, I can't run 30fps when I use DEMO_CAMERA_BUFFER_COUNT to 2. As I said before, it's close to 20 fps even though DEMO_CAMERA_FRAME_RATE is 30.

 

- Can you share your RT board with the SDRAM part, just to confirm it from your hardware.

Unfortunately, we can't share the schematic, but I can confirm that by looking at out schematic I can see the DQ0-15.

 

Thanks

0 Kudos
Reply
1,274 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi @kayakaantuna ,

   Thanks for your updated information.

   As I told you, should related to the SDRAM read bitwidth.

   Tomorrow, I will discuss it internally again.

Best Regards,

Kerry

 

0 Kudos
Reply
1,272 Views
kayakaantuna
Contributor III

Hi @kerryzhou,

 

Thank you for your continous support.

I'm asking this for the future, should we upgrade the SDRAM read bitwidth, for example 32bit, or 16bit is good enough ?

 

Thanks

0 Kudos
Reply
1,269 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi @kayakaantuna ,

  I checked the SEMC for the SDRAM in the RM:

kerryzhou_0-1704364605138.png

 

So, you still need to use 16bit SDRAM.

Please keep patient, any updated information internally, I will let you know after my discussion.

Best Regards,

Kerry