CSI video capture image lost due to high cpu usage


Using Kernel from jetpack R21.5
Video input on CSI bus 1080p@60hz

Using the userland tool stress (with 4 CPU or 4 VM args), we got major faillure in fetching some V4L2 frames.
Do you have any optimization on VI kthreads that solve this issue ?

We tried to push the 2 VI kthreads in FIFO mode with max priority RT but there is still frames loss when stress is launched.

Best regards,

Hi Romary
Could you give more detail information here. Like what’s the stress tool and how to verify the frame loss and what command to fetching V4L2 frames.

Did you verify the 30fps have the same problem?

0./ All kthreads of VI + host_syncpt have been pushed to MAX (99) priority (FIFO SCHEDULING)

In all test case, our proprietary software is also running in background (grabbing V4L2 frame @ 60fps + convert YUYV to RGB @ 15fps + convert YUYV to I420 @ 15fps + CSI Frame loss detector @60fps), all schedules in FIFO SCHEDULING prio 96 ot 98.

1./ The stress test was done using this command (forcing FIFO SCHEDULING and minimal prio):

chrt -f 1 stress --cpu 4 --vm 2 --vm-bytes 32M --timeout 60

stress binary is the one from official ubuntu repositories.

Once you launch the tool, some V4L2 buffer are kind lost and are never updated once the stress tool is finished. The V4L2 never recovers to normal situation after stress is done. Results are worst when step 0./ is not done.

Our conclusion is the VI driver doesn’t support application with high and unlimited CPU usage in FIFO SCHEDULING. On IMX6 processor, this stress test generate image loss on V4L2 driver, but recovery is perfect once the stress process has finished.

2./ The same stress test without FIFO SCHEDULING seems to work.

stress --cpu 4 --vm 2 --vm-bytes 32M --timeout 60

This test case, less demanding since using RR_SCHEDULING, will be put in endurance test bench for 12h on our side .

  1. Does any kernel error log showed?
  2. What’s your grabbing tools and pipeline?
  3. Does the 30fps won’t have the problem ?

Hi Romary,

Have you made progress and issue got resolved?
Any further experiment result can be shared?