OV5640 1080@30FPS on CSI

194 views
Skip to first unread message

@lex

unread,
Aug 2, 2016, 8:33:02 PM8/2/16
to linux-sunxi
I am working on OV5640 to get the best fps i can on 1920x1080 preview mode. After a lot of trial and errors i got somewhat near 15 fps, actually ~10 fps when rendering on screen.
If i set the timings to 30 fps i get the following error: [VFE]cs/isp reset after csi/isp interrupt timeout!

I have seen it is possible to get 1080p at 30 fps on MIPI CSI for some boards and i have exhausted all possible timings / setting i could get that i think is correct for the 30 FPS without success.
So the question is, is technically possible to get 30 fps on CSI ? If it is possible what i am missing and what exactly 'cs/isp reset after csi/isp interrupt timeout!' means.

Milos Ladni

unread,
May 24, 2019, 7:14:10 AM5/24/19
to linux-sunxi
Hi @lex,

sorry for wake up the topic but I am in similar problem with ov5640.
I am using A20 SoC and sunxi kernel 3.4. My goal is HD resolution 720p and 25 fps.
Currently, I can get max 15fps (although on oscilloscope VSYNC has 30 Hz, HREF 22kHz, MCLK 24MHz, and PCLK 84MHz).
I am not sure why VSYNC is 30 Hz and SCI driver give to me only 15 fps. I can print debug message from CSI driver which tell me that 'frame interval' is 66 ms (~15fps). It looks like that CSI driver detects every second frame. On my application or gstreamer, I can get max 15 fps.
- Another issue is CPU load. When I start capturing frames form CSI sensor CPU in kernel space goes very high 60-70% on average for both cores.
It looks like SCI driver consumes CPU for something. I know that CPU load is from kernel space because I use 'mpstat -P ALL 2 5' and system column tell you CPU load for kernel space.
Did you manage to get ov5640 working properly or you give up?
Any help is welcome.

Best regards,
Milos Ladni

@lex

unread,
May 24, 2019, 8:59:03 AM5/24/19
to linux-sunxi
Milos,

I was able to get ~25 FPS on 720p on A64 with some minor reg changes. You can resort to Armbian, there is a thread (ov5640) where a user/developer report he gets better results than this by modifying some regs and he explains his modification, maybe this can work on A20 (worth reading).
If you are encoding the frames with software encoder i think the load is fair. You can try ffmpeg with cedrus, there is some limitation with 720p on A64 but for H3 i think is ok. I did not have any experience with ov5640 on A20.
Currently, i am testing the latest ov5640 from mainline kernel 5.1 with sun6i_csi and i get 640x480 30 FPS and 60 FPS but i am unable to switch to any other frame size. FE offers sun6i_csi and ov5640 (kernel 4.14 but worked for me on 4.17 and 4.18) where you get 720p 30 FPS (H3) and some other frame size from the same author of sun6i_csi (Yong). 

Hope this helps.

Milos Ladni

unread,
Jun 3, 2019, 10:00:57 AM6/3/19
to linux-sunxi
Hi,

thank you for your update status. Finally, I also got 720P at ~25 fps.
So, if someone needs info, OV5640 works with A20 at ~25 fps, the output resolution is 1280x720 (input resolution 2560x1440 and pixel binning are turned on, so sensor give to me half of the input). The CPU load is ~5% with simultaneous h.264 and mjpeg encoding with CEDAR engine. Kernel version sunxi-3.4.75.
The CPU load was in two places, the first one was in kernel space when CSI and OV5640 debug is enabled a lot of printk() messages rise CPU load to 50%.
The second one was in the part where I copy output buffers from CSI to CEDAR video engine by memcpy(). I rewrite this part and now I am using 'V4L2_MEMORY_USERPTR' instead 'V4L2_MEMORY_MMAP', so v4l2 DMA copy this buffers directly to CEDRUS  for me...

Best regards,
Milos
Reply all
Reply to author
Forward
0 new messages