Closed danielmoore123 closed 8 years ago
I am using this method which seems to work fine with PiFmRds.
This works great! Thanks :+1:
To clarify to the common reader, my code is:
sudo arecord -fS16_LE -r 44100 -Dplughw:1,0 -c 2 - | sudo ./pi_fm_rds -freq 100.0 -ps 'Station1' -ctl rds_ctl -rt 'You are listening to Station1' -audio -
Using a USB Sound card: http://www.gearbest.com/development-boards/pp_176927.html?currency=GBP&gclid=CK6jqqqi2soCFRITGwodrWUN8Q
Run this overnight and get this now:
overrun!!! (at least 7.223 ms long) Any fix for that? :-o
This is a little clearer, I installed again onto a fresh image, I get the feeling the program is designed to only run for a fixed length of time...
overrun!!! (at least 0.503 ms long) overrun!!! (at least 0.400 ms long) overrun!!! (at least 0.614 ms long) overrun!!! (at least 4.543 ms long) overrun!!! (at least 1.988 ms long) overrun!!! (at least 0.070 ms long) Could not rewind in audio file, terminating Terminating: cleanly deactivated the DMA engine and killed the carrier.
The program is not designed that way, it's definitely a bug :) Unfortunately I have no idea what is causing it.
Thanks for the command to pipe audio, I'll include it in the README and close this bug. We can track the issue of program stopping on bug #37.
By the way you mention the "overrun" and "terminating" messages. Do they happen all at the same time?
Note: I had a look at the "overrun" message: it's a message printed by arecord when the Alsa input buffer is full. Not sure of the interaction with PiFmRds.
Could there be any reason PiFmRds is "lagging behind" and not consuming the data at the speed ALSA is providing the data?
So..... we're killing the memory? Any way to get the program to automatically pick itself up again when it does stop?
Okay, so it seems the best way to compensate for this is to make the program accept data a bit faster. Try adding -ppm 125000 to the PiFmRds command and see if it works. Did the trick for me. If it doesn't, do some troubleshooting: if it skips backward decrease the ppm number. If it skips forward and throws an overrun, add to the ppm number. do this until it works fine. My number is 125000 with no issues for a few hours now. Edit: tested on a Raspberry Pi 3
Would it be possible to pipe audio in via Aux lead? I feel the reason the program quits after several hours may be due to a network drop out.