-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow to sleep instead of busy waiting when limiting refresh rate
On single core boards, busy waiting renders the system unresponsive. We add the --led-no-busy-waiting flag, to allow the process to sleep instead of busy waiting, thereby freeing up CPU cycles for other processes at the cost of slightly less accurate frame timing. On a Raspberry Pi 3B on two 32x32 panels, busy waiting keeps a core 98% busy. Sleeping reduces it to 14%. On a Raspberry Zero on two 32x32 panels, busy waiting keeps the single core 95% busy and gives an unresponsive system. Sleeping reduces it to 32% and keeps the system responsive. Sleeping degrades the timing accuracy a bit, but is still good enough by a far margin for many uses. The following numbers are for driving two 32x32 panels and averaging the refresh rate across a minute (the 1kHz refresh rate limit is of course not reached, and is only there to make sure that the relevant code path is taken): +--------------+-----------+ | busy waiting | sleeping | +--------------------------------------------------+--------------+-----------+ | Raspberry Pi 3B, limit 70Hz, hardw. pulsing | 70.000Hz | 69.977Hz | | Raspberry Pi 3B, limit 70Hz, no hardw. pulsing | 70.000Hz | 69.977Hz | | Raspberry Pi 3B, limit 1kHz, hardw. pulsing | 430.824Hz | 430.855Hz | | Raspberry Pi 3B, limit 1kHz, no hardw. pulsing | 365.498Hz | 365.456Hz | | Raspberry Pi Zero, limit 70Hz, hardw. pulsing | 69.986Hz | 69.643Hz | | Raspberry Pi Zero, limit 70Hz, no hardw. pulsing | 69.986Hz | 69.638Hz | | Raspberry Pi Zero, limit 1kHz, hardw. pulsing | 263.877Hz | 264.538Hz | | Raspberry Pi Zero, limit 1kHz, no hardw. pulsing | 233.166Hz | 231.650Hz | +--------------------------------------------------+--------------+-----------+
- Loading branch information
Christian Aistleitner
committed
Jul 2, 2023
1 parent
a3eea99
commit ea26cd7
Showing
8 changed files
with
57 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters