This works fine for an hour or so but after that the audio stops and al I hear are pops and clicks . If I restart service2 then it works again for an hour. If I restart service1 then it also works again. So if I hear pops anc clicks it doesn't matter which service I restart to get back the audio. So I presume that it has to do with a buffer overflow/underrun.
The audio runs at 44.1kHz on both the webstream and FM output.
If this is a sync problem, is there a way to sync both the input and output?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hello,
I am trying to route the audio from a webradio station to a program that generates an FM signal on the Raspberry.
I have a service that opens a webradio stream using mplayer and outputs it to the default alsa output device:
Service1:
mplayer -ao alsa -prefer-ipv4 http://77.72.149.48:8108
Then another service grabs the audio from the loopback and sends it to stdin. Then a program that generates a FM signal grabs the audio from stdout.
Service2:
arecord -D hw:1,1 -f S16_LE -c 2 -r 44100 - | ./tx2 -f 100.0 --audio -
This works fine for an hour or so but after that the audio stops and al I hear are pops and clicks . If I restart service2 then it works again for an hour. If I restart service1 then it also works again. So if I hear pops anc clicks it doesn't matter which service I restart to get back the audio. So I presume that it has to do with a buffer overflow/underrun.
The audio runs at 44.1kHz on both the webstream and FM output.
If this is a sync problem, is there a way to sync both the input and output?