When running lame with the input being a pipe from arecord, and piping the output to ezstream (http://icecast.org/ezstream/) after a few hours the LAME process dissapears (dies). For example,
arecord -f dat -c 1 | /usr/bin/lame -r -s 48 --resample 22.05 -m m -b 16 --cbr --lowpass 4 - - | /usr/bin/ezstream -c /etc/ezstream_bcfy.xml > var/log/bcfy.log 2>&1 & Runs fine, until some point where it stops working, (presumably) because Lame has stopped running, while the other 2 commands continue, with ezstream running with high CPU (links below suggest because waiting for input from LAME).
A temporary fix is to frequently check whether LAME is running, and if it quit restart the above commands, but that's not a permanent solution.
This person had the same issue, and reccomended the fix--http://ohnosec.org/pipermail/app_rpt-users/2016-May/014103.html as well as here http://wiki.radioreference.com/index.php/Raspberry_Pi_RTL-SDR_Broadcastify#Verify_System_is_running_and_connected
Running LAME 32bits version 3.99.5, on Ubuntu 16.04 Linux kernel 4.4.0-65-generic
Lame seems to quit about every 6 hours and 10 minutes.
I have wriiten a little PCM generator, which produces 24 hours of PCM data. The PCM data is piped into lame to encode it and piped into another lame to decode it:
As you can see, LAME does encode the whole 24 hours.
Maybe you can try to leave out the streaming step out of your command chain, and let lame write the output data into /dev/null. Then let it run and check if it makes it past the 6 hours and 10 minutes mark.
I had the same problem using Ubutnu 20.4 server.
LAME would die after 6 hours.
I was able to work around this using ffmpeg instead of lame.
My stream has been up for several hours now.
I did install LAME before ffmpeg, so I had the libs.
(Installed both with apt using the Ubuntu repos)
Here's the command I used. you'll need to use arecord -L to determine your sound card values.