Skip to content

Stuttering performance on RPi 3B+ #18

Description

@twstokes

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

  1. Clean install 2021-05-07 "Buster" armhf image of Raspberry Pi OS Lite
  2. Install the script from the tutorial
  3. 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 &

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions