Unstable framerate of SPI camera with ondemand governor since 5.4
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 25/100
- Issue type
- Bug
- Clarity
- Needs clarification
- Activity status
- Stale
- Tech stack
- c, linux, raspberry-pi
- Domain
- embedded-iot, operating-systems, performance
Research direction
Start by reproducing the unstable SPI camera framerate on a Raspberry Pi 3B+ with kernel 5.4 or 5.9 while using the ondemand governor, then compare it with powersave, performance, and conservative. Use the reported vcgencmd arm and core clock measurements to investigate; done means the camera remains synchronized with ondemand frequency scaling.
Written by the indexing model from the issue text.
Description
We have Raspberry Pi 3B+ with a camera connected via SPI interface.
kernel 4.19: When "ondemand" governor is enabled, CPU switches between 2 steps: 600 MHz and 1400 MHz. This can influence SPI clock, so the core clock is fixed at 400 MHz in /boot/config.txt (core_freq=400). Everything works correctly.
kernel 5.x: With "ondemand" governor, CPU frequency change is more smooth. It is changed in 100 MHz steps. But even with fixed core clock, the SPI camera frame rate is unstable and desynchronization occurs very often. It can be minimized a bit with "conservative" governor, but it does not fix it. The problem appears in 5.4 and 5.9 kernels.
When governor is set to "powersave" or "performance", so the CPU frequency is fixed, the problem does not appear. But this way is not effective (fixed 600 MHz is too low for our application...)
"vcgencmd measure_clock arm" shows that the CPU frequency is scaled as expected.
"vcgencmd measure_clock core" shows "frequency(1)=400000000" all the time.
- Dominant language
- C
- Stars
- 13.2k
- Forks
- 5.5k
- Avg merge
- 2d 21h
- Merged PRs (30d)
- 21
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from raspberrypi/linux
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
raspberrypi/linux#7415 · 2 comments · 1 reaction ·
-
rp1-cfe doesn't forward V4L2_EVENT_SOURCE_CHANGE event from csi-2 sensor driver to userspace app Open
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
raspberrypi/linux#7399 · 1 comment ·
-
Difficulty 1/5 Under an hour Newbie friendliness 82/100
raspberrypi/linux#7357 · 1 comment ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
raspberrypi/linux#7054 · 2 comments ·
-
Difficulty 4/5 3-5 days Newbie friendliness 48/100
raspberrypi/linux#7634 · 8 comments · 1 reaction ·
All issues in raspberrypi/linux
Similar issues
-
[adam] AdamNet network read doesn't cap to MAX_ADAM_PACKET_LEN, overflows client receive buffers Open
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
FujiNetWIFI/fujinet-firmware#1649 · 2 comments ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
HarbourMasters/Shipwright#7229 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
riscv-software-src/riscv-isa-sim#2435 · 1 comment ·
-
bug Self Built Image SNAPSHOT Supported Device target/ramips
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100