audio-reactive-led-strip icon indicating copy to clipboard operation
audio-reactive-led-strip copied to clipboard

pi zero "Audio buffer has overflowed ### times"

Open bugilt opened this issue 7 years ago • 6 comments

My pi seems to be running a bit slow for some reason. I'm running in CLI and I'm getting about 10 overflows a second. I set the FPS down to 10 FPS and still had the same issue. Does the pi zero normally have enough processing power to run at a higher fps?

bugilt avatar May 08 '17 22:05 bugilt

I ordered a Raspberry PI 3 Model B to compare.

bugilt avatar May 10 '17 09:05 bugilt

The PI3 B was a little better. It's running 72 leds @ 40 fps with no audio buffering. I tried to add another strip of 72 to bring the total to 144 leds, but the fps dropped below 15 fps. The onboard audio conflicts with the pwm signal so I disabled it.

I've been trying to make a led visualization for a stereo project I'm working on. I was working on getting a teensy to do the work, but a similar audio conflict pushed that idea to the side. After two years of on and off trying to find a cool visualizer for my stereo. I'm glad I found your work. Thanks for making this!

bugilt avatar May 11 '17 14:05 bugilt

I am having the same problem on the Raspberry Pi 1 Model B, with about 5+overflows a second even at a low target FPS of 20 whilst running from CLI. Is this the processing power limitation of the Pi, or possibly a sound card problem?

theonlygerald avatar Jul 04 '17 10:07 theonlygerald

old thread, but I've found a hacky fix. Disabling errors on buffer overflows prevents the program from crashing after an overflow, but does not remove the overflows themselves. With the fix I continuously get around 40-50fps with 300 pixels on a PI3B. However, if it runs for around 10-15 minutes it still occasionally freezes, which I haven't found a fix for.

https://github.com/Toms42/audio-reactive-led-strip/commit/fa492bbffc13cc59820ffff1bf8767daad969620

Toms42 avatar Sep 04 '17 16:09 Toms42

I have the same issue on a Raspberry Pi 1 Model B. I also tried adding that fix to prevent throwing exceptions on overflow but the framerate just drops to 2 FPS.

TechnoConserve avatar Nov 04 '17 20:11 TechnoConserve

The fix posted is a little bit out of date just because it clears the buffer on every loop, which works fine on newer pi's but might cause speed issues on older models. I'll upload the newer version I'm using that only clears the buffer once per second, but I'm not sure exactly how much of a speed increase you will get. I would recommend upgrading anyways, as the visualizer itself is not very optimized for use on a pi

Toms42 avatar Nov 04 '17 22:11 Toms42