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.4k stars 128 forks source link

Harbor.input && http.input : Buffer overrun looping after a some days #1311

Open yah00078 opened 4 years ago

yah00078 commented 4 years ago

Describe the bug

Hello !

I start liquidsoap, it run well during a while listening icecast stream and one day (can be from 24h to 7 days) all stop (sound, switch, fallback, encoders).

When I see logs I can find about 3500 line of '[http_9625:3] Buffer overrun: Dropping 0.03s.' (same for harbor.input) every 0.03s a new line is generated.

The only way to turn back available, is to restart liquidsoap.

Following many forums topics, I see there is a possible clock sync problem between encoder and liquidsoap.

I'am convinced there is an hardware un-sync but on many systems I never reached theses issues.

I can add info: more resources expensive is the code, more often it happens.

2020/08/04 09:39:51 [http_9625:3] New metadata chunk: ? -- -M- - Crois au Printemps.
2020/08/04 09:39:57 [http_9625:3] Buffer overrun: Dropping 0.00s.
2020/08/04 09:39:57 [http_9625:3] Buffer overrun: Dropping 0.03s.
2020/08/04 09:39:57 [http_9625:3] Buffer overrun: Dropping 0.03s.
2020/08/04 09:39:57 [http_9625:3] Buffer overrun: Dropping 0.03s.
2020/08/04 09:39:57 [http_9625:3] Buffer overrun: Dropping 0.03s.
2020/08/04 09:39:57 [http_9625:3] Buffer overrun: Dropping 0.03s.
2020/08/04 09:39:57 [http_9625:3] Buffer overrun: Dropping 0.03s.
2020/08/04 09:39:57 [http_9625:3] Buffer overrun: Dropping 0.03s.
2020/08/04 09:39:57 [http_9625:3] Buffer overrun: Dropping 0.03s.
2020/08/04 09:39:58 [http_9625:3] Buffer overrun: Dropping 0.03s.
2020/08/04 09:39:58 [http_9625:3] Buffer overrun: Dropping 0.03s.
2020/08/04 09:39:58 [http_9625:3] Buffer overrun: Dropping 0.03s.
2020/08/04 09:39:58 [http_9625:3] Buffer overrun: Dropping 0.03s.
......

To Reproduce src = input.http("http://XXXXX") PGM = fallback([[strip_blank(max_blank=30.,master_src),ANOTHER_SOURCE)

cross fingers and wait ! :-)

Expected behavior

-> add a buffer adaptation on input

-> Is it possible to implement a resilience security action. as if there is more than XXsec of buffer overrun, drop all buffer and listen back?

Version details

Install method packages

Thank you for help :-)

yah00078 commented 4 years ago

Hello after some tests, I can add this : -> At 320 kbs/s it works about 5 days before drops. -> At 224 kbs/s it immediately buffer overrun

yah00078 commented 4 years ago

I found a possibly clue to explain why there is no fallback in this case.

I tried direct input vs direct input + fallback with strip_blank function.

I think when harbor.input buffer overrun, stripblank function doesn't see it as sound blank, so fallback mechanism don't do anything.

toots commented 3 years ago

Hi! Sorry for the late response. I'll try to take a minute to test and give you a more informed response soon :-)

stale[bot] commented 3 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

hydrosIII commented 1 year ago

I am having similar problems with a stream that has a lot of latency. 150 ms from the server to input.http. And I have some crashes of liquidsoap, or the output just get silenced instead of dropping the buffer and reinitiating it. I have to reboot liquidsoap often. Sometimes it reinitiates the clocks, but sometimes just silently crashes.