Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

High CPU consumption even with auto_refresh=False #48

Open
monojk opened this issue Sep 19, 2024 · 1 comment · May be fixed by adafruit/Adafruit_Blinka_Displayio#143
Open

High CPU consumption even with auto_refresh=False #48

monojk opened this issue Sep 19, 2024 · 1 comment · May be fixed by adafruit/Adafruit_Blinka_Displayio#143

Comments

@monojk
Copy link

monojk commented Sep 19, 2024

I noticed 100% CPU with my application on a Raspberry Pi, even I have several seconds sleep in my loop. I use auto_refresh = False

I can reproduce that behaviour with these modifications of examples/displayio_ssd1306_simpletest.py

from time import sleep
...
display = adafruit_displayio_ssd1306.SSD1306(display_bus, width=WIDTH, height=HEIGHT, auto_refresh=False)
...
display.auto_refresh = False        # just to be sure

while True:
    display.refresh()
    sleep(5)

How can I bring down the CPU usage?

@FoamyGuy
Copy link
Contributor

I believe this is not specific to the SSD1306, but more generally with the way BlinkaDisplayIO works.

You can see this effect if you open a REPL and just import displayio while watching htop.

I'm not certain of all of the specifics but I think there is a background thread getting used during some part of the process for rendering that is running as soon as displayio gets imported.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants