scottlawsonbc / audio-reactive-led-strip

:musical_note: :rainbow: Real-time LED strip music visualization using Python and the ESP8266 or Raspberry Pi
MIT License
2.68k stars 644 forks source link

How to Improve FPS on Wemos D1 Mini #246

Open biejay opened 4 years ago

biejay commented 4 years ago

Hey, the software is awesome! I am using it on a macbook and send the processed data to a Wemos d1 mini, which works fine. But i rarely get 60 FPS and sometimes it even drops to 20-30 FPS and the LED-Visualization really lags. Is there a known bottle neck? I am thinking about these possible causes:

So what is the best way to improve the FPS? Thanks!

bjornstevens commented 4 years ago

try turning down the MIC_RATE, i accidently made this 441000 and cpu (on ryzen 2700x) ramped up to 100%. try something less than 44100 i would say.

biejay commented 4 years ago

try turning down the MIC_RATE, i accidently made this 441000 and cpu (on ryzen 2700x) ramped up to 100%. try something less than 44100 i would say.

I don't think that this is a problem. I am not using the Mic because i re-linked the audio output. And the processing time is always pretty low and ist normally at about 25% CPU usage.

bjornstevens commented 4 years ago

Okay then i have no clue what it could be.

joeybab3 commented 4 years ago

The wemos is not the issue if it is not receiving the FPS. When you say 'FPS' are you referring to the visualization on your computer lagging and going down to 20-30fps or the visualization on the LED strip? If the visualization is slow on your mac then there isn't much we can do about that except for trying the solutions above.

biejay commented 4 years ago

@joeybab3 it's both. The fps counter (60/60) goes down to like 30/60. The visualization in my Mac is smooth. But the LEDs are lagging/get stuck for some 200-300 ms and then the Animation flows again.