I had a difficult time troubleshooting intermittent animation stutters on my RPi 3B+ and wanted to share some findings.
To reproduce:
Prerequisites: Animated Snake Eyes Bonnet for Raspberry Pi, RPi 3B+, 2x 240x240 IPS displays
- Clean install 2021-05-07 "Buster"
armhf image of Raspberry Pi OS Lite
- Install the script from the tutorial
- Observe that at times the frame rate will drop to ~1FPS and CPU utilization for
eyes.py will climb to ~100%
I found that when eyes.py or fbx2 run on core 0, CPU utilization skyrockets. I could monitor this in real time by running top and adding the "Last used CPU" column. I could also consistently reproduce the issue if I used taskset to pin these processes on core 0 (if both are on core 0, they'll split full utilization, if one is on core 0 it'll hit 100%).
I was able to get consistently smooth animations by forcing the CPU affinity for these processes to cores 1-3 (excluding 0).
My paths differ from the install script, but this was my solution using taskset. The e mask includes cores 1-3.
taskset e /home/pi/robot/eyes/Pi_Eyes/fbx2 -i &
cd /home/pi/robot/eyes/Pi_Eyes;taskset e python3 eyes.py --radius 240 &
I had a difficult time troubleshooting intermittent animation stutters on my RPi 3B+ and wanted to share some findings.
To reproduce:
Prerequisites: Animated Snake Eyes Bonnet for Raspberry Pi, RPi 3B+, 2x 240x240 IPS displays
armhfimage of Raspberry Pi OS Liteeyes.pywill climb to ~100%I found that when
eyes.pyorfbx2run on core 0, CPU utilization skyrockets. I could monitor this in real time by runningtopand adding the "Last used CPU" column. I could also consistently reproduce the issue if I usedtasksetto pin these processes on core 0 (if both are on core 0, they'll split full utilization, if one is on core 0 it'll hit 100%).I was able to get consistently smooth animations by forcing the CPU affinity for these processes to cores 1-3 (excluding 0).
My paths differ from the install script, but this was my solution using
taskset. Theemask includes cores 1-3.