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

Choppy audio on Raspberry Pi #12

Open
ftab opened this issue May 28, 2020 · 2 comments
Open

Choppy audio on Raspberry Pi #12

ftab opened this issue May 28, 2020 · 2 comments

Comments

@ftab
Copy link

ftab commented May 28, 2020

I've got nrsc5 compiled for Raspberry Pi and that is working fine (40% CPU usage on a single core of a 3B+, audio is smooth, signal comes in great). Playing through a USB sound card rather than the Pi audio out.

nrsc5-gui however seems to play very choppy, even on a Pi 4. This is not the case when I run it on an x86-64 PC. I've tried fiddling around with the queue size but it doesn't seem to have any effect.

The Pi does not seem to be sweating too hard at decoding the audio itself, when running just nrsc5, it's just when it's run through the gui.

Any ideas?

@ftab
Copy link
Author

ftab commented Jun 9, 2020

Added frames_per_buffer=8192 parameter to the audio.open call (the PyAudio default is 1024 according to http://people.csail.mit.edu/hubert/pyaudio/docs/#pyaudio.Stream.__init__ ), and it gets better, but there's still some dropouts. They seem to coincide with when it's receiving/decoding station or image data, not sure what that's about. Threading issue, perhaps? But, the audio is already in a different thread, I don't quite get it...

@chrismrutledge
Copy link

chrismrutledge commented Jul 21, 2020

Thank you very much for tracking that down. That stuttering issue has been driving me crazy for a long time. My lack of Python knowledge was definitely the hold up though.. Like you, I am also still seeing (hearing) the pause.. And I definitely hear it more often on iHeart Media stations who send the Traffic and Weather map images regularly. So, you might be on the right track there with threading.

P.S. this is happening on a 4GB RAM Pi 4 as well..

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

No branches or pull requests

2 participants