Hi There,
We need to be able to capture (parallel CSI) and display HD video on our product based on the iMX6. However, we run into a problem with high-CPU usage and dropped frames. The problem is easily reproduced on the SabreSD development board.
This 720P pipeline shows 14% usage in top, meaning it uses more than 50% of one processor if I'm not mistaken. There appears to be no frames dropped
gst-launch mfw_v4lsrc capture-mode=4 device=/dev/video1 ! mfw_v4lsink
Running time 0:01:00.329872674 render fps 29.985
However, when switching to 1080P the situation gets significantly worse. Top shows 25%, meaning one CPU is used %100. About 15% of the frames are dropped.
gst-launch mfw_v4lsrc capture-mode=5 device=/dev/video1 ! mfw_v4lsink
Running time 0:01:04.074657008 render fps 24.487
Not being able to capture and display full HD material in 30FPS is a very serious problem for us, so we are hoping this can be resolved soon.
Btw, the SabreSD camera is using MIPI CSI capture while we are using the parallel CSI on our board, but the performance appears to be about the same.
Any help or hints would be appreciated
Thanks
/Otto
Using iMX6Q on Yocto GA1.0.0
Solved! Go to Solution.
1.
Please try to use "mfw_v4isink" instead of "mfw_v4lsink".
2.
As for the VPU - as I see - the VPU is not involved in Your pipeline.
Just as a demo example :
$ gst-launch mfw_v4lsrc device=/dev/video1 ! vpuenc codec=6 ! matroskamux ! queue max-size-bytes=0 max-size-time=0 ! vpudec ! mfw_v4lsink
Please pay attention, both operations (encoding and decoding - just for demo) are used here !
Usually encoding is applied on one board, while the decoding - on the other one, connected via Etherenet.
Regards,
Yuri.
Update - I tried increasing the VPU frequency to 352Mhz, which reduced the CPU usage on our platform from 21% to 18% when capturing 1080i. I do not have a build-platform set up for building a clean SabreSD kernel with the 352MHz VPU option enabled, but I think its safe to assume the CPU usage will drop a few percent there as well maybe enough for it to be able to capture 1080P30 without any dropped frames. Still does not explain why capturing video and displaying it uses up essentially 100% of one core. Shouldn't DMA be used ? Can it be used ?
Thanks,
/Otto
Btw, I'll set up a clean build environment for the SabreSD board so I can go more general testing
Minor update - Increasing the VPU frequency on SabreSD board did not lead to any significant improvement. "Top" still showing 25% usage (100% of one Core)
root@imx6qsabresd:/# cat /sys/kernel/debug/clk/clk_summary | grep vpu
vpu_axi_sel 0 0 352000000
vpu_axi_podf 0 0 352000000
vpu_axi 0 0 352000000
gst-launch mfw_v4lsrc capture-mode=5 device=/dev/video1 ! mfw_v4lsink
Running time 0:02:03.897685014 render fps 24.504
Setting pipeline to READY ...
Setting pipeline to NULL ...
Total rendered:3036
Freeing pipeline ...
[--->FINALIZE v4l_sink
1.
Please try to use "mfw_v4isink" instead of "mfw_v4lsink".
2.
As for the VPU - as I see - the VPU is not involved in Your pipeline.
Just as a demo example :
$ gst-launch mfw_v4lsrc device=/dev/video1 ! vpuenc codec=6 ! matroskamux ! queue max-size-bytes=0 max-size-time=0 ! vpudec ! mfw_v4lsink
Please pay attention, both operations (encoding and decoding - just for demo) are used here !
Usually encoding is applied on one board, while the decoding - on the other one, connected via Etherenet.
Regards,
Yuri.
Thanks a lot for your help Yuri ! CPU usage is now shown as 0% in top
I hope some hints below helps.
1. Please use "mfw_v4lsrc" element.
"VPU performance: CSI-2 MIPI camera vs. USB camera"
https://community.freescale.com/message/394777#394777
2. It is not clear if VPU is used in the Gstreamer pipeline.
VPU using can decrease system load because of coding raw camera data.
Regards,
Yuri.
Yuri,
I generalized the post after making some discoveries. Preferably I would have liked to delete the post and add a new one but it did not allow me.
Any thoughts on how to solve this ?
Thanks !
/Otto