I am using a script to broadcast to icecast, which works very well, and then 40 minutes in it starts to glitch. I have a Sure mic connected to the audio port in the PiSound.
You can here the sound here:
Check around 40minutes in, where the sound start to distort.
Here is the script I am using (no worries about the p/w it’s public),
the setting for ffmpeg are mostly for the icecast server. For Jack,
I didn’t configure much of it.
When this starts happening, try running the following commands:
free -h
top
htop
to get a sense of current system usage. Then run these commands to see the logs:
dmesg
journalctl -u jack # Hit 'end' key to go to the latest lines
And finally, when this starts happening, try connecting system:capture_* ports to system:playback_* ports, so the captured audio goes directly to the output without involving ffmpeg or icecast, to better close in on the source of the problem.
Also, try using larger -n or -p parameter for Jack, to see if it makes a difference. In case your purpose is recording / streaming, and you don’t require immediate feedback, these params can safely be set to quite large and stable values.
Pisound only supports 48kHz, 96kHz and 192kHz rates. Ideally you’d want to use the same sampling rate for everything. I don’t think resampling to 44.1kHz is the source of the issue, unless the software has a bug. If you are running 64 bit OS, try doing the same test running on 32 bits if possible and see if there’s a difference.
Yes so after the bug, I did jack_connect the input to the output so I could listen in (which I should have done before) and the glitch was still there, so it’s not from ffmpeg from what I can understand. Yes I can live with a long delay as I am broadcasting and listener already have many second delay,
So a larger -n or -p parameter for Jack will only add a bit of ‘delay’ while adding stability? And would a RT kernel help in this situation?
Also can an underpowered PI create such a weird effect? I have a 2.5 amp power supply.