theori-io/nrsc5

Python CLI has lots of underrun issues

andrewfer000 opened this issue · 1 comments

Hi, so I decided to mess with the python cli and there is a problem. A pretty nasty one too.

This message will pop up
ALSA lib pcm.c:8526:(snd_pcm_recover) underrun occurred

The audio will become clickly and bad even when the signal is strong and the C program works fine. Can a python pro that is a part of this project help figure this out? It is also what is causing this issue on nrsc5-gui so if the cli code could be fixed I can likely just use that in this program and boom! problem solved! So let's fix this!

This stems from the fact that nrsc5 outputs audio as soon as it is able, rather than buffering & delaying it as real receivers do (to synchronize the analog & digital signals, among other purposes). The C version of the code works around this by inserting silence at the start of the audio, but this is not ideal. I think nrsc5 should implement delay as specified in the NRSC-5 standard.