I have written a python-based audio servo controller that runs on a Raspberry Pi. It takes input from either .wav files or a microphone, analyzes the chunks of the stream to get the volume of each chunk, and commands a servo to move based on that volume. That happens in the callback function, and the input is also sent to a speaker.

This works fine on a Pi 3A+. On a Pi Zero W, the jaw moves (seems to be some slight delay), but no sound comes out (nor do I get any error messages). I suspect it's because the Zero just isn't fast enough to keep up. I've tried it with Raspian Lite as well as Raspian, to be more lightweight. I'm running pigpio under gpio zero to drive the servos. I can play an audio file alone, so it's not my sound hookup.

Does is sound likely that the Pi Zero just isn't keeping up? Is lack of sound consistent with that? Is there any way to monitor what is happening and where the problem may lie, to determine if it's fixable? Thanks!

python-3.x pyaudio

1 Answer 1


Ok, This problem I solved. The callback function in my program (which uses PyAudio) was too slow. I fixed it by changing some of the processing to use Numpy.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.