savonet / liquidsoap

Liquidsoap is a statically typed scripting general-purpose language with dedicated operators and backend for all thing media, streaming, file generation, automation, HTTP backend and more.
http://liquidsoap.info
GNU General Public License v2.0
1.42k stars 130 forks source link

Buffer overrun in logs #545

Closed webtent closed 6 years ago

webtent commented 6 years ago

Hi, I am a complete newbie with Liquidsoap. We have been running Icecast2 with Darkice for a long time at our community radio station, setup by someone else. I've been tasked with upgrading since the install is very old on Ubuntu 10.04 and we need secure streaming. I've decided to start fresh and give Liquidsoap a try.

The install went great following a Linux Journal article from this past January, I installed the latest Icecast2 compiled with SSL support and the latest Liquidsoap from source using opam. Everything plays fine and I've mounted the other streaming server streams to my new server to provide the secure stream until we can get another card to add the input directly. The only thing is this error in the Liquidsoap log....

2018/04/24 08:59:26 [http_6166:3] Buffer overrun: Dropping 0.00s.

I'm seeing this over and over again, but the streams all seem to play fine, here is my config....

set("log.file",true)
set("log.file.path","/home/wmnfuser/liquidsoap-daemon/log/main-run.log")
set("init.daemon",true)
set("init.daemon.change_user",true)
set("init.daemon.change_user.group","wmnfuser")
set("init.daemon.change_user.user","wmnfuser")
set("init.daemon.pidfile",true)
set("init.daemon.pidfile.path","/home/wmnfuser/liquidsoap-daemon/pid/main-run.pid")
%include "/home/wmnfuser/liquidsoap-daemon/script/wmnf.liq"

And then my included config....

set("server.telnet", true)
set("server.telnet.port", 1234)
set("harbor.bind_addr","0.0.0.0")
set("log.file.path","/var/log/liquidsoap/main.log")

wmnf = "http://192.168.1.9:8000/wmnf_high_quality"
hd2 = "http://192.168.1.9:8000/wmnf_hd2"
hd3 = "http://192.168.1.9:8000/wmnf_hd3"
hd4 = "http://192.168.1.9:8000/wmnf_hd4"
wmnfinput = mksafe(input.http(wmnf))
hd2input = mksafe(input.http(hd2))
hd3input = mksafe(input.http(hd3))
hd4input = mksafe(input.http(hd4))

output.icecast(
  %mp3(bitrate=128),
  mount="wmnf_high_quality",
  host="localhost", port=8880, password="hackme",
  wmnfinput,genre="Eclectic",url="wmnf_high_quality",description="Community Conscious Radio")
output.icecast(
  %mp3(bitrate=128),
  mount="wmnf_hd2",
  host="localhost", port=8880, password="hackme",
  hd2input,genre="New",url="wmnf_hd2",description="New Sounds of the Left Coast")
output.icecast(
  %mp3(bitrate=128),
  mount="wmnf_hd3",
  host="localhost", port=8880, password="hackme",
  hd3input,genre="News/Talk",url="wmnf_hd3",description="The Source")
output.icecast(
  %mp3(bitrate=128),
  mount="wmnf_hd4",
  host="localhost", port=8880, password="hackme",
  hd4input,genre="Soul",url="wmnf_hd4",description="Soul School")

Can someone help me understand what is causing the log entry or any other recommendations?

toots commented 6 years ago

Hi,

Buffer overrun logs usually happen when the input.http source receives too much data. This can have several reasons, such as the sender sending data at a rate above real-time or by bursts, or the two machines having clocks that are slightly out of sync.

One way to mitigate the issue is to raise the max buffer in input.http:

s = input.http(max=20., ...)
add-n2x commented 4 years ago

This did not work for me either:

input.http(buffer=10.0, max=20.0, id="http", starturl)

Beside other issues, one reason might be, that the input stream is not routed to any output (yet). In such case, the buffer piles up and is never consumed by an output. As a consequence you'll get a buffer overrun.

I solved this be routing the input stream to some dummy output, which is fallible:

output.dummy(id="DUMMY_STREAM_OUTPUT", fallible=true, input_http)