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 130 forks source link

Segmentation fault #3054

Closed gabsoftware closed 1 year ago

gabsoftware commented 1 year ago

Describe the bug After a few hours, I had a segmentation fault on the latest rolling release of v2.2.0. The process was just stopped. Unfortunately, nothing at all showed in the logs although I had log.level at 4.

One useful information is that on another server I have exactly the same OS, same liquidsoap script, same version, receiving the same audio input at the same time, and it did not have that segmentation fault.

I just can share this screenshot:

kitty_VDtTdcEmaX

To Reproduce

Expected behavior No segmentation fault should happen

Version details

Install method Installed with .deb packages for AMD64

toots commented 1 year ago

Thanks for reporting. Haver you ever used gdb? You could run the process inside a gdb session and get the stack trace:

% gdb /path/to/liquidsoap
> run <options>
*CRASH*
> thread apply all bt
smimram commented 1 year ago

On a related note, I just compiled liq with srt support and got

Thread 1 "liquidsoap" received signal SIGSEGV, Segmentation fault.
0x00007ffff7a24bc1 in std::map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, srt::PacketFilter::ManagedPtr, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, srt::PacketFilter::ManagedPtr> > >::~map() ()
   from /lib/x86_64-linux-gnu/libsrt.so.1.5
(gdb) where
#0  0x00007ffff7a24bc1 in std::map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, srt::PacketFilter::ManagedPtr, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, srt::PacketFilter::ManagedPtr> > >::~map() ()
    at /lib/x86_64-linux-gnu/libsrt.so.1.5
#1  0x00007ffff385cf37 in __cxa_finalize (d=0x7ffff23fa000) at ./stdlib/cxa_finalize.c:83
#2  0x00007ffff2354e47 in  () at /lib/x86_64-linux-gnu/libsrt-gnutls.so.1.5
#3  0x00007fffffffd960 in  ()
#4  0x00007ffff7fcf87e in _dl_fini () at ./elf/dl-fini.c:142

at startup (running liq without any argument).

toots commented 1 year ago

@smimram you have a longer stacktrace?

smimram commented 1 year ago

No I pasted all I have

gabsoftware commented 1 year ago

Ah thanks, I didn't know about gdb. I'll try that and report back if (when) it happens again.

gabsoftware commented 1 year ago

Okay it happened again. Not sure if gdb output will be useful but here it is:

user@server.com:~/path/to/liquidsoap/script$ gdb /usr/bin/liquidsoap
GNU gdb (Debian 10.1-1.7) 10.1.90.20210103-git
Copyright (C) 2021 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<https://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from /usr/bin/liquidsoap...
Reading symbols from /usr/lib/debug/.build-id/d7/3d29bbae7e61f38ce828800735fb0638dc9b20.debug...

(gdb) run radio.liq
Starting program: /usr/bin/liquidsoap radio.liq
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
INFO: Loading Sdl_image, Target = linux
INFO: Loading Sdl_ttf, Target = linux
[New Thread 0x7fffe82a7700 (LWP 2333090)]
[New Thread 0x7fffe7aa6700 (LWP 2333091)]
[New Thread 0x7fffe72a5700 (LWP 2333092)]
[Detaching after vfork from child process 2333096]
[New Thread 0x7fffd9e7d700 (LWP 2333098)]
[New Thread 0x7fffd967c700 (LWP 2333099)]
[New Thread 0x7fffd8e7b700 (LWP 2333100)]
[New Thread 0x7fffd3fff700 (LWP 2333101)]
[New Thread 0x7fffd37fe700 (LWP 2333102)]
[New Thread 0x7fffd2ffd700 (LWP 2333103)]
[New Thread 0x7fffd27fc700 (LWP 2333104)]
[New Thread 0x7fffd1ffb700 (LWP 2333105)]
[New Thread 0x7fffd17fa700 (LWP 2333106)]
[New Thread 0x7fffd0ff9700 (LWP 2333107)]
[New Thread 0x7fffb7fff700 (LWP 2333108)]
[New Thread 0x7fffb77fe700 (LWP 2333111)]
[New Thread 0x7fffb6ffd700 (LWP 2333112)]
[New Thread 0x7fffb67fc700 (LWP 2333113)]
[New Thread 0x7fffb5ffb700 (LWP 2333114)]
[New Thread 0x7fffb57fa700 (LWP 2333117)]
[New Thread 0x7fffb4ff9700 (LWP 2333118)]
[New Thread 0x7fffb47f8700 (LWP 2333119)]
[New Thread 0x7fffb3ff7700 (LWP 2333120)]
[New Thread 0x7fffaec88700 (LWP 2333128)]

Thread 7 "liquidsoap" received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7fffd8e7b700 (LWP 2333100)]
caml_modify (fp=0x3fa3a827504ea0a5, val=1) at memory.c:642
642     memory.c: No such file or directory.

(gdb) where
#0  caml_modify (fp=0x3fa3a827504ea0a5, val=1) at memory.c:642
#1  0x0000555555f34e55 in camlContent_timed__clear_288 () at src/core/stream/content_timed.ml:41
#2  0x00005555562ccc10 in camlStdlib__List__iter_507 () at list.ml:110
#3  0x00005555562e63ef in camlStdlib__Map__iter_586 () at map.ml:297
#4  0x00005555562e63d9 in camlStdlib__Map__iter_586 () at map.ml:297
#5  0x0000555555f98aee in camlSwitch__fun_2429 () at src/core/operators/switch.ml:88
#6  0x00005555562ccc10 in camlStdlib__List__iter_507 () at list.ml:110
#7  0x0000555555f4dde7 in camlSource__fun_3625 () at src/core/source.ml:754
#8  0x0000555555f8173f in camlOutput__fun_2548 () at src/core/outputs/output.ml:182
#9  0x00005555562ccc10 in camlStdlib__List__iter_507 () at list.ml:110
#10 0x0000555555f5647b in camlClock__loop_1178 () at src/core/clock.ml:272
#11 0x0000555555f54358 in camlClock__fun_2023 () at src/core/clock.ml:275
#12 0x0000555555f3aed3 in camlTutils__process_767 () at src/core/tools/tutils.ml:164
#13 0x000055555628d5e5 in camlThread__fun_850 () at thread.ml:49
#14 0x00005555563e2271 in caml_start_program ()
#15 0x00005555563d8ced in caml_callback_exn (closure=closure@entry=140737106678936, arg=<optimized out>, arg@entry=1) at callback.c:111
#16 0x00005555563af6b0 in caml_thread_start (arg=0x555556d20f50) at st_stubs.c:548
#17 0x00007ffff72a3ea7 in start_thread (arg=<optimized out>) at pthread_create.c:477
#18 0x00007ffff437aa2f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95

(gdb) list
637     in memory.c

(gdb) bt full
#0  caml_modify (fp=0x3fa3a827504ea0a5, val=1) at memory.c:642
        old = <optimized out>
#1  0x0000555555f34e55 in camlContent_timed__clear_288 () at src/core/stream/content_timed.ml:41
No locals.
#2  0x00005555562ccc10 in camlStdlib__List__iter_507 () at list.ml:110
No locals.
#3  0x00005555562e63ef in camlStdlib__Map__iter_586 () at map.ml:297
No locals.
#4  0x00005555562e63d9 in camlStdlib__Map__iter_586 () at map.ml:297
No locals.
#5  0x0000555555f98aee in camlSwitch__fun_2429 () at src/core/operators/switch.ml:88
No locals.
#6  0x00005555562ccc10 in camlStdlib__List__iter_507 () at list.ml:110
No locals.
#7  0x0000555555f4dde7 in camlSource__fun_3625 () at src/core/source.ml:754
No locals.
#8  0x0000555555f8173f in camlOutput__fun_2548 () at src/core/outputs/output.ml:182
No locals.
#9  0x00005555562ccc10 in camlStdlib__List__iter_507 () at list.ml:110
No locals.
#10 0x0000555555f5647b in camlClock__loop_1178 () at src/core/clock.ml:272
No locals.
#11 0x0000555555f54358 in camlClock__fun_2023 () at src/core/clock.ml:275
No locals.
#12 0x0000555555f3aed3 in camlTutils__process_767 () at src/core/tools/tutils.ml:164
No locals.
#13 0x000055555628d5e5 in camlThread__fun_850 () at thread.ml:49
No locals.
#14 0x00005555563e2271 in caml_start_program ()
No symbol table info available.
#15 0x00005555563d8ced in caml_callback_exn (closure=closure@entry=140737106678936, arg=<optimized out>, arg@entry=1) at callback.c:111
No locals.
#16 0x00005555563af6b0 in caml_thread_start (arg=0x555556d20f50) at st_stubs.c:548
        th = 0x555556d20f50
        clos = 140737106678936
        termination_buf = {buf = {{__jmpbuf = {0, 5955131496978588804, 140736840838750, 140736840838751, 140736832447360, 8396800, -5955076728699870076, -572435446392281980}, __mask_was_saved = 0, __saved_mask = {__val = {0 <repeats 16 times>}}}}}
        tos = 0 '\000'
#17 0x00007ffff72a3ea7 in start_thread (arg=<optimized out>) at pthread_create.c:477
        ret = <optimized out>
        pd = <optimized out>
        unwind_buf = {cancel_jmp_buf = {{jmp_buf = {140736832452352, 5955131496978588804, 140736840838750, 140736840838751, 140736832447360, 8396800, -5955076728800533372, -5955149731314523004}, mask_was_saved = 0}}, priv = {pad = {0x0, 0x0, 0x0, 0x0}, data = {prev = 0x0,
              cleanup = 0x0, canceltype = 0}}}
        not_first_call = 0
#18 0x00007ffff437aa2f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
No locals.

(gdb) info frame
Stack level 0, frame at 0x7fffd8e79f20:
 rip = 0x5555563c7c00 in caml_modify (memory.c:642); saved rip = 0x555555f34e55
 called by frame at 0x7fffd8e79f30
 source language c.
 Arglist at 0x7fffd8e79f00, args: fp=0x3fa3a827504ea0a5, val=1
 Locals at 0x7fffd8e79f00, Previous frame's sp is 0x7fffd8e79f20
 Saved registers:
  rbx at 0x7fffd8e79f08, rbp at 0x7fffd8e79f10, rip at 0x7fffd8e79f18

(gdb) info locals
old = <optimized out>

(gdb) info args
fp = 0x3fa3a827504ea0a5
val = 1

(gdb) info threads
  Id   Target Id                                        Frame
  1    Thread 0x7fffe9676380 (LWP 2333086) "liquidsoap" 0x00007ffff42b7ba2 in __GI___sigtimedwait (set=set@entry=0x7fffffffe1b0, info=info@entry=0x7fffffffe0f0, timeout=timeout@entry=0x0) at ../sysdeps/unix/sysv/linux/sigtimedwait.c:29
  2    Thread 0x7fffe82a7700 (LWP 2333090) "liquidsoap" futex_wait_cancelable (private=0, expected=0, futex_word=0x555556c26c08 <log_condition+40>) at ../sysdeps/nptl/futex-internal.h:186
  3    Thread 0x7fffe7aa6700 (LWP 2333091) "liquidsoap" 0x00007ffff43711e3 in __GI___select (nfds=nfds@entry=0, readfds=readfds@entry=0x0, writefds=writefds@entry=0x0, exceptfds=exceptfds@entry=0x0, timeout=timeout@entry=0x7fffe7aa5210) at ../sysdeps/unix/sysv/linux/select.c:41
  4    Thread 0x7fffe72a5700 (LWP 2333092) "SRT:GC"     futex_abstimed_wait_cancelable (private=0, abstime=0x7fffe72a41e0, clockid=-416661136, expected=0, futex_word=0x7ffff7bb23f0 <CUDT::s_UDTUnited+368>) at ../sysdeps/nptl/futex-internal.h:323
  5    Thread 0x7fffd9e7d700 (LWP 2333098) "liquidsoap" futex_wait_cancelable (private=0, expected=0, futex_word=0x555556c8cf4c) at ../sysdeps/nptl/futex-internal.h:186
  6    Thread 0x7fffd967c700 (LWP 2333099) "liquidsoap" futex_wait_cancelable (private=0, expected=0, futex_word=0x555556cf28a8) at ../sysdeps/nptl/futex-internal.h:186
* 7    Thread 0x7fffd8e7b700 (LWP 2333100) "liquidsoap" caml_modify (fp=0x3fa3a827504ea0a5, val=1) at memory.c:642
  8    Thread 0x7fffd3fff700 (LWP 2333101) "liquidsoap" 0x00007ffff436ed2f in __GI___poll (fds=fds@entry=0x7fffc4004d50, nfds=nfds@entry=6, timeout=timeout@entry=-1) at ../sysdeps/unix/sysv/linux/poll.c:29
  9    Thread 0x7fffd37fe700 (LWP 2333102) "liquidsoap" futex_wait_cancelable (private=0, expected=0, futex_word=0x7fffb8002b9c) at ../sysdeps/nptl/futex-internal.h:186
  10   Thread 0x7fffd2ffd700 (LWP 2333103) "liquidsoap" futex_wait_cancelable (private=0, expected=0, futex_word=0x7fffc0002b9c) at ../sysdeps/nptl/futex-internal.h:186
  11   Thread 0x7fffd27fc700 (LWP 2333104) "liquidsoap" futex_wait_cancelable (private=0, expected=0, futex_word=0x7fffbc002b9c) at ../sysdeps/nptl/futex-internal.h:186
  12   Thread 0x7fffd1ffb700 (LWP 2333105) "liquidsoap" futex_wait_cancelable (private=0, expected=0, futex_word=0x7fffc80ac7dc) at ../sysdeps/nptl/futex-internal.h:186
  13   Thread 0x7fffd17fa700 (LWP 2333106) "liquidsoap" futex_wait_cancelable (private=0, expected=0, futex_word=0x7fffc80ac84c) at ../sysdeps/nptl/futex-internal.h:186
  14   Thread 0x7fffd0ff9700 (LWP 2333107) "liquidsoap" futex_wait_cancelable (private=0, expected=0, futex_word=0x7fffc80ac8bc) at ../sysdeps/nptl/futex-internal.h:186
  15   Thread 0x7fffb7fff700 (LWP 2333108) "liquidsoap" futex_wait_cancelable (private=0, expected=0, futex_word=0x7fffc80ac92c) at ../sysdeps/nptl/futex-internal.h:186
  16   Thread 0x7fffb77fe700 (LWP 2333111) "liquidsoap" futex_wait_cancelable (private=0, expected=0, futex_word=0x7fffc80e68dc) at ../sysdeps/nptl/futex-internal.h:186
  17   Thread 0x7fffb6ffd700 (LWP 2333112) "liquidsoap" futex_wait_cancelable (private=0, expected=0, futex_word=0x7fffc80e694c) at ../sysdeps/nptl/futex-internal.h:186
  18   Thread 0x7fffb67fc700 (LWP 2333113) "liquidsoap" futex_wait_cancelable (private=0, expected=0, futex_word=0x7fffc80e69bc) at ../sysdeps/nptl/futex-internal.h:186
  19   Thread 0x7fffb5ffb700 (LWP 2333114) "liquidsoap" futex_wait_cancelable (private=0, expected=0, futex_word=0x7fffc80e6a2c) at ../sysdeps/nptl/futex-internal.h:186
  20   Thread 0x7fffb57fa700 (LWP 2333117) "liquidsoap" futex_wait_cancelable (private=0, expected=0, futex_word=0x7fffc810e3dc) at ../sysdeps/nptl/futex-internal.h:186
  21   Thread 0x7fffb4ff9700 (LWP 2333118) "liquidsoap" futex_wait_cancelable (private=0, expected=0, futex_word=0x7fffc810e44c) at ../sysdeps/nptl/futex-internal.h:186
  22   Thread 0x7fffb47f8700 (LWP 2333119) "liquidsoap" futex_wait_cancelable (private=0, expected=0, futex_word=0x7fffc810e4bc) at ../sysdeps/nptl/futex-internal.h:186
  23   Thread 0x7fffb3ff7700 (LWP 2333120) "liquidsoap" futex_wait_cancelable (private=0, expected=0, futex_word=0x7fffc810e52c) at ../sysdeps/nptl/futex-internal.h:186
  24   Thread 0x7fffaec88700 (LWP 2333128) "liquidsoap" 0x00007ffff43711e3 in __GI___select (nfds=23, readfds=readfds@entry=0x7fffaec86be0, writefds=writefds@entry=0x7fffaec86c60, exceptfds=exceptfds@entry=0x7fffaec86ce0, timeout=timeout@entry=0x7fffaec86b90)
    at ../sysdeps/unix/sysv/linux/select.c:41

(gdb) info source
Current source file is memory.c
Compilation directory is /home/opam/.opam/4.14.0/.opam-switch/build/ocaml-base-compiler.4.14.0/runtime
Source language is c.
Producer is GNU C17 10.2.1 20210110 -mtune=generic -march=x86-64 -g -O2 -fno-strict-aliasing -fwrapv -fno-common -fexcess-precision=standard -fno-tree-vrp -ffunction-sections -fasynchronous-unwind-tables.
Compiled with DWARF 2 debugging format.
Does not include preprocessor macro info.
gabsoftware commented 1 year ago

I got another gdb output, different from the first one.

user2@server2.com:~/path/to/liquidsoap/script$ gdb /usr/bin/liquidsoap
GNU gdb (Debian 10.1-1.7) 10.1.90.20210103-git
Copyright (C) 2021 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<https://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from /usr/bin/liquidsoap...
Reading symbols from /usr/lib/debug/.build-id/d7/3d29bbae7e61f38ce828800735fb0638dc9b20.debug...

(gdb) run radio.liq
Starting program: /usr/bin/liquidsoap radio.liq
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
INFO: Loading Sdl_image, Target = linux
INFO: Loading Sdl_ttf, Target = linux
[New Thread 0x7fffe84a9700 (LWP 757837)]
[New Thread 0x7fffe7ca8700 (LWP 757838)]
[New Thread 0x7fffe74a7700 (LWP 757839)]
[Detaching after vfork from child process 757840]
[New Thread 0x7fffd9e7d700 (LWP 757842)]
[New Thread 0x7fffd967c700 (LWP 757843)]
[New Thread 0x7fffd8e7b700 (LWP 757844)]
[New Thread 0x7fffd3fff700 (LWP 757845)]
[New Thread 0x7fffd37fe700 (LWP 757846)]
[New Thread 0x7fffd2ffd700 (LWP 757847)]
[New Thread 0x7fffd27fc700 (LWP 757848)]
[New Thread 0x7fffd0a42700 (LWP 757853)]
[Thread 0x7fffd0a42700 (LWP 757853) exited]
[New Thread 0x7fffd0a42700 (LWP 762219)]
[Thread 0x7fffd0a42700 (LWP 762219) exited]
[New Thread 0x7fffd0a42700 (LWP 762221)]
[Thread 0x7fffd0a42700 (LWP 762221) exited]
[New Thread 0x7fffd0a42700 (LWP 762231)]

Thread 7 "liquidsoap" received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7fffd8e7b700 (LWP 757844)]
do_some_marking (work=0, work@entry=28281499) at major_gc.c:713
713     major_gc.c: No such file or directory.

(gdb) where
#0  do_some_marking (work=0, work@entry=28281499) at major_gc.c:713
#1  0x00005555563c50f0 in mark_slice (work=28281499) at major_gc.c:782
#2  0x00005555563c6325 in caml_major_collection_slice (howmuch=howmuch@entry=-1) at major_gc.c:1113
#3  0x00005555563c776d in caml_gc_dispatch () at minor_gc.c:500
#4  0x00005555563c783e in caml_check_urgent_gc (extra_root=<optimized out>, extra_root@entry=1) at minor_gc.c:575
#5  0x00005555563c3cf8 in caml_do_pending_actions_exn () at signals.c:267
#6  0x00005555563c3ea0 in process_pending_actions_with_root_exn (extra_root=<optimized out>) at signals.c:299
#7  caml_process_pending_actions_with_root (extra_root=<optimized out>) at signals.c:320
#8  0x00005555562b1a03 in camlMm_audio__Audio__create_485 () at src/audio.ml:154
#9  0x00005555562d70eb in camlStdlib__Array__init_289 () at array.ml:56
#10 0x0000555555f2eeee in camlContent_base__get_data_1009 () at src/core/stream/content_base.ml:328
#11 0x0000555555fc8c7b in camlBlank__fun_1914 () at src/core/sources/blank.ml:57
#12 0x00005555562e63ef in camlStdlib__Map__iter_586 () at map.ml:297
#13 0x0000555555fc8792 in camlBlank__fun_1908 () at src/core/sources/blank.ml:52
#14 0x0000555555f4e4ae in camlSource__fun_3534 () at src/core/source.ml:646
#15 0x0000555555f4e204 in camlSource__fun_3605 () at src/core/source.ml:717
#16 0x0000555555f8e493 in camlAdd__fun_3112 () at src/core/operators/add.ml:75
#17 0x00005555562ccce4 in camlStdlib__List__fold_left_521 () at list.ml:121
#18 0x0000555555f8d59b in camlAdd__fun_3153 () at src/core/operators/add.ml:141
#19 0x0000555555f4e4ae in camlSource__fun_3534 () at src/core/source.ml:646
#20 0x0000555555f4e204 in camlSource__fun_3605 () at src/core/source.ml:717
#21 0x0000555555f92f76 in camlMuxer__fun_2026 () at src/core/operators/muxer.ml:92
#22 0x00005555562ccc10 in camlStdlib__List__iter_507 () at list.ml:110
#23 0x0000555555f92305 in camlMuxer__fun_2006 () at src/core/operators/muxer.ml:87
#24 0x0000555555f92113 in camlMuxer__fun_2043 () at src/core/operators/muxer.ml:133
#25 0x0000555555f4e4ae in camlSource__fun_3534 () at src/core/source.ml:646
#26 0x0000555555f4e204 in camlSource__fun_3605 () at src/core/source.ml:717
#27 0x0000555555f98790 in camlSwitch__fun_2492 () at src/core/operators/switch.ml:253
#28 0x0000555555f4e4ae in camlSource__fun_3534 () at src/core/source.ml:646
#29 0x0000555555f4e204 in camlSource__fun_3605 () at src/core/source.ml:717
#30 0x0000555555f81983 in camlOutput__fun_2537 () at src/core/outputs/output.ml:166
#31 0x0000555555f56774 in camlClock__fun_2087 () at src/core/clock.ml:305
#32 0x00005555562ccce4 in camlStdlib__List__fold_left_521 () at list.ml:121
#33 0x0000555555f53f7d in camlClock__fun_2046 () at src/core/clock.ml:302
#34 0x0000555555f5647b in camlClock__loop_1178 () at src/core/clock.ml:272
#35 0x0000555555f54358 in camlClock__fun_2023 () at src/core/clock.ml:275
#36 0x0000555555f3aed3 in camlTutils__process_767 () at src/core/tools/tutils.ml:164
#37 0x000055555628d5e5 in camlThread__fun_850 () at thread.ml:49
#38 0x00005555563e2271 in caml_start_program ()
#39 0x00005555563d8ced in caml_callback_exn (closure=closure@entry=140737108715120, arg=<optimized out>, arg@entry=1) at callback.c:111
#40 0x00005555563af6b0 in caml_thread_start (arg=0x555556c98f10) at st_stubs.c:548
#41 0x00007ffff72a6ea7 in start_thread (arg=<optimized out>) at pthread_create.c:477
#42 0x00007ffff457ba2f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95

(gdb) list
708     in major_gc.c

do_some_marking (work=0, work@entry=28281499) at major_gc.c:713
        v = <optimized out>
        scan = 0x7fffb8020ffa
        obj_end = 0x1c47edcb0bdd2
        scan_end = 0x7fffbb57013a
        scan_len = <optimized out>
        pb_enqueued = 1564673
        pb_dequeued = 1564609
        darkened_anything = 1
        pb = {140736850087160, 140736904216232, 140736904216496, 140737107029360, 140737064941816, 140737106899888, 140737106899864, 140737106899832, 140737061173504, 140737106899624, 140737055261704, 140736852206288, 140737056611392, 140737090726432, 140737106899576,
          140737106899544, 140737106600976, 140737106595496, 140737106595456, 140737106595408, 140737106595368, 140737106595328, 140737106595288, 140737107073648, 140736904208968, 140737107073648, 140736904209424, 140736904209616, 140737106600976, 140737106595496, 140737106595456,
          140737106595408, 140737106595368, 140737106595328, 140737106595288, 140737107073648, 140736904211592, 140737107073648, 140736904212048, 140736904212240, 140737106600976, 140737106595496, 140737106595456, 140737106595408, 140737106595368, 140737106595328, 140737106595288,
          140737107073648, 140736904213560, 140737107073648, 140736904214016, 140736904214208, 140736850725488, 140736850725432, 140736850725392, 140736850725344, 140736850725296, 140736850725256, 140737063166264, 140737091106136, 140737106898512, 140737106995232, 140737090675560,
          140736851872512, 140737096075128, 140736850725232, 140737106600976, 140737106595496, 140737106595456, 140737106595408, 140737106595368, 140737106595328, 140737106595288, 140737107073576, 140736904216472, 140737064940128, 140737106899704, 140737106899680, 140737106899816,
          140736904216976, 140736850752224, 140737053986872, 140737090726272, 140737096040808, 140737106899528, 140736850079392, 140736850079376, 140736850725216, 140737090675536, 140737106600976, 140737106595496, 140737106595456, 140737106595408, 140737106595368, 140737106595328,
          140737106595288, 140737106600976, 140737106595496, 140737106595456, 140737106595408, 140737106595368, 140737106595328, 140737106595288, 140737107073648, 140736904209544, 140737106600976, 140737106595496, 140737106595456, 140737106595408, 140737106595368, 140737106595328,
          140737106595288, 140737106600976, 140737106595496, 140737106595456, 140737106595408, 140737106595368, 140737106595328, 140737106595288, 140737107073648, 140736904212168, 140737106600976, 140737106595496, 140737106595456, 140737106595408, 140737106595368, 140737106595328,
          140737106595288, 140737106600976, 140737106595496, 140737106595456, 140737106595408, 140737106595368, 140737106595328, 140737106595288, 140737107073648, 140736904214136, 140737106923056, 140737106921280, 140737106921464, 140737106921528, 140737106921280, 140737106921528,
          140737106921280, 140737106921552, 140737106921528, 140737106921280, 140737106921552, 140737106921528, 140737106921280, 140737106921552, 140737106921528, 140737063166240, 140737091012368, 140737091012344, 140737106898488, 140736904216448, 140737064940104, 140737106899160,
          140737063167696, 140737056415624, 140737056416080, 140737053736376, 140737090726248, 140737096040576, 140737106153104, 140737063167576, 140737090675512, 140737090675488, 140737106600976, 140737106595496, 140737106595456, 140737106595408, 140737106595368, 140737106595328,
          140737106595288, 140737090675464, 140737090675440, 140737090675416, 140737090675392, 140737090675368, 140737090675344, 140737090675320, 140737090675296, 140737090675272, 140737106600976, 140737106595496, 140737106595456, 140737106595408, 140737106595368, 140737106595328,
          140737106595288, 140737090675248, 140737090675224, 140737090675200, 140737090675176, 140737090675152, 140737090675128, 140737090675104, 140737090675080...}
        min_pb = 64
        stk = {stack = 0x555556d56aa0, count = 168, size = 8192}
        young_start = 140737107132424
        half_young_len = 1048576
#1  0x00005555563c50f0 in mark_slice (work=28281499) at major_gc.c:782
        slice_pointers = 0
        stk = 0x555556c8ebd0
#2  0x00005555563c6325 in caml_major_collection_slice (howmuch=howmuch@entry=-1) at major_gc.c:1113
        p = 0.56673168729147949
        dp = <optimized out>
        filt_p = 0.56673168729147949
        spend = <optimized out>
        computed_work = 28281499
        i = <optimized out>
#3  0x00005555563c776d in caml_gc_dispatch () at minor_gc.c:500
No locals.
#4  0x00005555563c783e in caml_check_urgent_gc (extra_root=<optimized out>, extra_root@entry=1) at minor_gc.c:575
        caml__frame = 0x7fffd8e79a20
        caml__roots_extra_root = {next = 0x7fffd8e79a20, ntables = 1, nitems = 1, tables = {0x7fffd8e799a8, 0x0, 0x7fffe95c3aa0, 0x0, 0x2}}
        caml__dummy_extra_root = 0
#5  0x00005555563c3cf8 in caml_do_pending_actions_exn () at signals.c:267
        exn = <optimized out>
#6  0x00005555563c3ea0 in process_pending_actions_with_root_exn (extra_root=<optimized out>) at signals.c:299
        caml__frame = 0x0
        caml__roots_extra_root = {next = 0x0, ntables = 1, nitems = 1, tables = {0x7fffd8e79a18, 0x3, 0x5555563cdb31 <caml_floatarray_create+129>, 0x7fffe95c3d48, 0x555555f2fbfb <camlFrame_settings__audio_of_main_674+27>}}
        caml__dummy_extra_root = 0
        exn = <optimized out>
#7  caml_process_pending_actions_with_root (extra_root=<optimized out>) at signals.c:320
        res = <optimized out>
#8  0x00005555562b1a03 in camlMm_audio__Audio__create_485 () at src/audio.ml:154
No locals.
#9  0x00005555562d70eb in camlStdlib__Array__init_289 () at array.ml:56
No locals.
#10 0x0000555555f2eeee in camlContent_base__get_data_1009 () at src/core/stream/content_base.ml:328
No locals.
#11 0x0000555555fc8c7b in camlBlank__fun_1914 () at src/core/sources/blank.ml:57
No locals.
#12 0x00005555562e63ef in camlStdlib__Map__iter_586 () at map.ml:297
No locals.
#13 0x0000555555fc8792 in camlBlank__fun_1908 () at src/core/sources/blank.ml:52
No locals.
#14 0x0000555555f4e4ae in camlSource__fun_3534 () at src/core/source.ml:646
No locals.
#15 0x0000555555f4e204 in camlSource__fun_3605 () at src/core/source.ml:717
No locals.
#16 0x0000555555f8e493 in camlAdd__fun_3112 () at src/core/operators/add.ml:75
No locals.
#17 0x00005555562ccce4 in camlStdlib__List__fold_left_521 () at list.ml:121
No locals.
#18 0x0000555555f8d59b in camlAdd__fun_3153 () at src/core/operators/add.ml:141
No locals.
#19 0x0000555555f4e4ae in camlSource__fun_3534 () at src/core/source.ml:646
No locals.
#20 0x0000555555f4e204 in camlSource__fun_3605 () at src/core/source.ml:717
No locals.
#21 0x0000555555f92f76 in camlMuxer__fun_2026 () at src/core/operators/muxer.ml:92
No locals.
#22 0x00005555562ccc10 in camlStdlib__List__iter_507 () at list.ml:110
No locals.
#23 0x0000555555f92305 in camlMuxer__fun_2006 () at src/core/operators/muxer.ml:87
No locals.
#24 0x0000555555f92113 in camlMuxer__fun_2043 () at src/core/operators/muxer.ml:133
No locals.
#25 0x0000555555f4e4ae in camlSource__fun_3534 () at src/core/source.ml:646
No locals.
#26 0x0000555555f4e204 in camlSource__fun_3605 () at src/core/source.ml:717
No locals.
#27 0x0000555555f98790 in camlSwitch__fun_2492 () at src/core/operators/switch.ml:253
No locals.
#28 0x0000555555f4e4ae in camlSource__fun_3534 () at src/core/source.ml:646
No locals.
#29 0x0000555555f4e204 in camlSource__fun_3605 () at src/core/source.ml:717
No locals.
#30 0x0000555555f81983 in camlOutput__fun_2537 () at src/core/outputs/output.ml:166
No locals.
#31 0x0000555555f56774 in camlClock__fun_2087 () at src/core/clock.ml:305
No locals.
#32 0x00005555562ccce4 in camlStdlib__List__fold_left_521 () at list.ml:121
No locals.
#33 0x0000555555f53f7d in camlClock__fun_2046 () at src/core/clock.ml:302
No locals.
#34 0x0000555555f5647b in camlClock__loop_1178 () at src/core/clock.ml:272
No locals.
#35 0x0000555555f54358 in camlClock__fun_2023 () at src/core/clock.ml:275
No locals.
#36 0x0000555555f3aed3 in camlTutils__process_767 () at src/core/tools/tutils.ml:164
No locals.
#37 0x000055555628d5e5 in camlThread__fun_850 () at thread.ml:49
No locals.
#38 0x00005555563e2271 in caml_start_program ()
No symbol table info available.
#39 0x00005555563d8ced in caml_callback_exn (closure=closure@entry=140737108715120, arg=<optimized out>, arg@entry=1) at callback.c:111
No locals.
#40 0x00005555563af6b0 in caml_thread_start (arg=0x555556c98f10) at st_stubs.c:548
        th = 0x555556c98f10
        clos = 140737108715120
        termination_buf = {buf = {{__jmpbuf = {0, 6316478528892554066, 140736840838750, 140736840838751, 140736832447360, 8396800, -6316560097778218158, -215592564532589742}, __mask_was_saved = 0, __saved_mask = {__val = {0 <repeats 16 times>}}}}}
        tos = 0 '\000'
#41 0x00007ffff72a6ea7 in start_thread (arg=<optimized out>) at pthread_create.c:477
        ret = <optimized out>
        pd = <optimized out>
        unwind_buf = {cancel_jmp_buf = {{jmp_buf = {140736832452352, 6316478528892554066, 140736840838750, 140736840838751, 140736832447360, 8396800, -6316560097677554862, -6316494648430834862}, mask_was_saved = 0}}, priv = {pad = {0x0, 0x0, 0x0, 0x0}, data = {prev = 0x0,
              cleanup = 0x0, canceltype = 0}}}
        not_first_call = 0
#42 0x00007ffff457ba2f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
No locals.

(gdb) info frame
Stack level 0, frame at 0x7fffd8e79910:
 rip = 0x5555563c4da9 in do_some_marking (major_gc.c:713); saved rip = 0x5555563c50f0
 called by frame at 0x7fffd8e79960
 source language c.
 Arglist at 0x7fffd8e79078, args: work=0, work@entry=28281499
 Locals at 0x7fffd8e79078, Previous frame's sp is 0x7fffd8e79910
 Saved registers:
  rbx at 0x7fffd8e798d8, rbp at 0x7fffd8e798e0, r12 at 0x7fffd8e798e8, r13 at 0x7fffd8e798f0, r14 at 0x7fffd8e798f8, r15 at 0x7fffd8e79900, rip at 0x7fffd8e79908

(gdb) info locals
v = <optimized out>
scan = 0x7fffb8020ffa
obj_end = 0x1c47edcb0bdd2
scan_end = 0x7fffbb57013a
scan_len = <optimized out>
pb_enqueued = 1564673
pb_dequeued = 1564609
darkened_anything = 1
pb = {140736850087160, 140736904216232, 140736904216496, 140737107029360, 140737064941816, 140737106899888, 140737106899864, 140737106899832, 140737061173504, 140737106899624, 140737055261704, 140736852206288, 140737056611392, 140737090726432, 140737106899576, 140737106899544,
  140737106600976, 140737106595496, 140737106595456, 140737106595408, 140737106595368, 140737106595328, 140737106595288, 140737107073648, 140736904208968, 140737107073648, 140736904209424, 140736904209616, 140737106600976, 140737106595496, 140737106595456, 140737106595408,
  140737106595368, 140737106595328, 140737106595288, 140737107073648, 140736904211592, 140737107073648, 140736904212048, 140736904212240, 140737106600976, 140737106595496, 140737106595456, 140737106595408, 140737106595368, 140737106595328, 140737106595288, 140737107073648,
  140736904213560, 140737107073648, 140736904214016, 140736904214208, 140736850725488, 140736850725432, 140736850725392, 140736850725344, 140736850725296, 140736850725256, 140737063166264, 140737091106136, 140737106898512, 140737106995232, 140737090675560, 140736851872512,
  140737096075128, 140736850725232, 140737106600976, 140737106595496, 140737106595456, 140737106595408, 140737106595368, 140737106595328, 140737106595288, 140737107073576, 140736904216472, 140737064940128, 140737106899704, 140737106899680, 140737106899816, 140736904216976,
  140736850752224, 140737053986872, 140737090726272, 140737096040808, 140737106899528, 140736850079392, 140736850079376, 140736850725216, 140737090675536, 140737106600976, 140737106595496, 140737106595456, 140737106595408, 140737106595368, 140737106595328, 140737106595288,
  140737106600976, 140737106595496, 140737106595456, 140737106595408, 140737106595368, 140737106595328, 140737106595288, 140737107073648, 140736904209544, 140737106600976, 140737106595496, 140737106595456, 140737106595408, 140737106595368, 140737106595328, 140737106595288,
  140737106600976, 140737106595496, 140737106595456, 140737106595408, 140737106595368, 140737106595328, 140737106595288, 140737107073648, 140736904212168, 140737106600976, 140737106595496, 140737106595456, 140737106595408, 140737106595368, 140737106595328, 140737106595288,
  140737106600976, 140737106595496, 140737106595456, 140737106595408, 140737106595368, 140737106595328, 140737106595288, 140737107073648, 140736904214136, 140737106923056, 140737106921280, 140737106921464, 140737106921528, 140737106921280, 140737106921528, 140737106921280,
  140737106921552, 140737106921528, 140737106921280, 140737106921552, 140737106921528, 140737106921280, 140737106921552, 140737106921528, 140737063166240, 140737091012368, 140737091012344, 140737106898488, 140736904216448, 140737064940104, 140737106899160, 140737063167696,
  140737056415624, 140737056416080, 140737053736376, 140737090726248, 140737096040576, 140737106153104, 140737063167576, 140737090675512, 140737090675488, 140737106600976, 140737106595496, 140737106595456, 140737106595408, 140737106595368, 140737106595328, 140737106595288,
  140737090675464, 140737090675440, 140737090675416, 140737090675392, 140737090675368, 140737090675344, 140737090675320, 140737090675296, 140737090675272, 140737106600976, 140737106595496, 140737106595456, 140737106595408, 140737106595368, 140737106595328, 140737106595288,
  140737090675248, 140737090675224, 140737090675200, 140737090675176, 140737090675152, 140737090675128, 140737090675104, 140737090675080...}
min_pb = 64
stk = {stack = 0x555556d56aa0, count = 168, size = 8192}
young_start = 140737107132424
half_young_len = 1048576

(gdb) info args
work = 0

(gdb) info threads
  Id   Target Id                                       Frame
  1    Thread 0x7fffe9878380 (LWP 757833) "liquidsoap" 0x00007ffff44b9ba2 in __GI___sigtimedwait (set=set@entry=0x7fffffffe280, info=info@entry=0x7fffffffe1c0, timeout=timeout@entry=0x0) at ../sysdeps/unix/sysv/linux/sigtimedwait.c:29
  2    Thread 0x7fffe84a9700 (LWP 757837) "liquidsoap" futex_wait_cancelable (private=0, expected=0, futex_word=0x555556c26c08 <log_condition+40>) at ../sysdeps/nptl/futex-internal.h:186
  3    Thread 0x7fffe7ca8700 (LWP 757838) "liquidsoap" 0x00007ffff4571e23 in __GI___select (nfds=nfds@entry=0, readfds=readfds@entry=0x0, writefds=writefds@entry=0x0, exceptfds=exceptfds@entry=0x0, timeout=timeout@entry=0x7fffe7ca7210) at ../sysdeps/unix/sysv/linux/select.c:41
  4    Thread 0x7fffe74a7700 (LWP 757839) "SRT:GC"     futex_abstimed_wait_cancelable (private=0, abstime=0x7fffe74a61e0, clockid=-414555792, expected=0, futex_word=0x7ffff7bb53f0 <CUDT::s_UDTUnited+368>) at ../sysdeps/nptl/futex-internal.h:323
  5    Thread 0x7fffd9e7d700 (LWP 757842) "liquidsoap" futex_wait_cancelable (private=0, expected=0, futex_word=0x555556c8cf4c) at ../sysdeps/nptl/futex-internal.h:186
  6    Thread 0x7fffd967c700 (LWP 757843) "liquidsoap" futex_wait_cancelable (private=0, expected=0, futex_word=0x555556cf28a8) at ../sysdeps/nptl/futex-internal.h:186
* 7    Thread 0x7fffd8e7b700 (LWP 757844) "liquidsoap" do_some_marking (work=0, work@entry=28281499) at major_gc.c:713
  8    Thread 0x7fffd3fff700 (LWP 757845) "liquidsoap" 0x00007ffff456f96f in __GI___poll (fds=fds@entry=0x7fffc0005ed0, nfds=nfds@entry=6, timeout=timeout@entry=-1) at ../sysdeps/unix/sysv/linux/poll.c:29
  9    Thread 0x7fffd37fe700 (LWP 757846) "liquidsoap" futex_wait_cancelable (private=0, expected=0, futex_word=0x7fffc4002b98) at ../sysdeps/nptl/futex-internal.h:186
  10   Thread 0x7fffd2ffd700 (LWP 757847) "liquidsoap" futex_wait_cancelable (private=0, expected=0, futex_word=0x7fffb8002b98) at ../sysdeps/nptl/futex-internal.h:186
  11   Thread 0x7fffd27fc700 (LWP 757848) "liquidsoap" futex_wait_cancelable (private=0, expected=0, futex_word=0x7fffbc002b98) at ../sysdeps/nptl/futex-internal.h:186
  15   Thread 0x7fffd0a42700 (LWP 762231) "liquidsoap" 0x00007ffff4571e23 in __GI___select (nfds=23, readfds=readfds@entry=0x7fffd0a40be0, writefds=writefds@entry=0x7fffd0a40c60, exceptfds=exceptfds@entry=0x7fffd0a40ce0, timeout=timeout@entry=0x7fffd0a40b90)
    at ../sysdeps/unix/sysv/linux/select.c:41

(gdb) info source
Current source file is major_gc.c
Compilation directory is /home/opam/.opam/4.14.0/.opam-switch/build/ocaml-base-compiler.4.14.0/runtime
Source language is c.
Producer is GNU C17 10.2.1 20210110 -mtune=generic -march=x86-64 -g -O2 -fno-strict-aliasing -fwrapv -fno-common -fexcess-precision=standard -fno-tree-vrp -ffunction-sections -fasynchronous-unwind-tables.
Compiled with DWARF 2 debugging format.
Does not include preprocessor macro info.
gabsoftware commented 1 year ago

Yet another different one.

(gdb) run radio.liq
Starting program: /usr/bin/liquidsoap radio.liq
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
INFO: Loading Sdl_image, Target = linux
INFO: Loading Sdl_ttf, Target = linux
[New Thread 0x7fffe82a7700 (LWP 2660501)]
[New Thread 0x7fffe7aa6700 (LWP 2660502)]
[New Thread 0x7fffe72a5700 (LWP 2660503)]
[Detaching after vfork from child process 2660505]
[New Thread 0x7fffd9e7d700 (LWP 2660507)]
[New Thread 0x7fffd967c700 (LWP 2660508)]
[New Thread 0x7fffd8e7b700 (LWP 2660509)]
[New Thread 0x7fffd3fff700 (LWP 2660510)]
[New Thread 0x7fffd37fe700 (LWP 2660511)]
[New Thread 0x7fffd2ffd700 (LWP 2660512)]
[New Thread 0x7fffd27fc700 (LWP 2660513)]
[New Thread 0x7fffd1ffb700 (LWP 2660514)]
[New Thread 0x7fffd17fa700 (LWP 2660515)]
[New Thread 0x7fffd0ff9700 (LWP 2660516)]
[New Thread 0x7fffb7fff700 (LWP 2660517)]
[New Thread 0x7fffb77fe700 (LWP 2660520)]
[New Thread 0x7fffb6ffd700 (LWP 2660521)]
[New Thread 0x7fffb67fc700 (LWP 2660522)]
[New Thread 0x7fffb5ffb700 (LWP 2660523)]
[New Thread 0x7fffb57fa700 (LWP 2660526)]
[New Thread 0x7fffb4ff9700 (LWP 2660527)]
[New Thread 0x7fffb47f8700 (LWP 2660528)]
[New Thread 0x7fffb3ff7700 (LWP 2660529)]
[New Thread 0x7fffacb7f700 (LWP 2660534)]

Thread 7 "liquidsoap" received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7fffd8e7b700 (LWP 2660509)]
0x00005555563e2c7b in bf_insert_remnant_small (v=v@entry=140737053044544) at freelist.c:1289
1289    freelist.c: No such file or directory.

(gdb) where
#0  0x00005555563e2c7b in bf_insert_remnant_small (v=v@entry=140737053044544) at freelist.c:1289
#1  0x00005555563e403c in bf_allocate (wosz=<optimized out>) at freelist.c:1537
#2  0x00005555563c893f in caml_fl_allocate (wo_sz=5) at caml/freelist.h:40
#3  caml_alloc_shr_aux (profinfo=0, track=0, tag=0, wosize=5) at memory.c:471
#4  caml_alloc_shr_aux (profinfo=0, track=0, tag=0, wosize=wosize@entry=5) at memory.c:463
#5  caml_alloc_shr_for_minor_gc (wosize=wosize@entry=5, tag=0, old_hd=old_hd@entry=5120) at memory.c:532
#6  0x00005555563c6e2a in caml_oldify_one (v=140737106694528, p=p@entry=0x7fffe89536a0) at minor_gc.c:209
#7  0x00005555563c7140 in caml_oldify_mopup () at minor_gc.c:314
#8  0x00005555563c7268 in caml_empty_minor_heap () at minor_gc.c:377
#9  0x00005555563c77a8 in caml_gc_dispatch () at minor_gc.c:492
#10 0x00005555563c783e in caml_check_urgent_gc (extra_root=<optimized out>, extra_root@entry=1) at minor_gc.c:575
#11 0x00005555563c3cf8 in caml_do_pending_actions_exn () at signals.c:267
#12 0x00005555563c3ea0 in process_pending_actions_with_root_exn (extra_root=<optimized out>) at signals.c:299
#13 caml_process_pending_actions_with_root (extra_root=<optimized out>) at signals.c:320
#14 0x00005555562b1a03 in camlMm_audio__Audio__create_485 () at src/audio.ml:154
#15 0x00005555562d70eb in camlStdlib__Array__init_289 () at array.ml:56
#16 0x0000555555f2eeee in camlContent_base__get_data_1009 () at src/core/stream/content_base.ml:328
#17 0x0000555555f8eaa5 in camlAdd__fun_3189 () at src/core/operators/add.ml:152
#18 0x00005555562ccc10 in camlStdlib__List__iter_507 () at list.ml:110
#19 0x00005555562ccc10 in camlStdlib__List__iter_507 () at list.ml:110
#20 0x0000555555f8d72e in camlAdd__fun_3153 () at src/core/operators/add.ml:147
#21 0x0000555555f4e4ae in camlSource__fun_3534 () at src/core/source.ml:646
#22 0x0000555555f4e204 in camlSource__fun_3605 () at src/core/source.ml:717
#23 0x0000555555f92f76 in camlMuxer__fun_2026 () at src/core/operators/muxer.ml:92
#24 0x00005555562ccc10 in camlStdlib__List__iter_507 () at list.ml:110
#25 0x0000555555f92305 in camlMuxer__fun_2006 () at src/core/operators/muxer.ml:87
#26 0x0000555555f92113 in camlMuxer__fun_2043 () at src/core/operators/muxer.ml:133
#27 0x0000555555f4e4ae in camlSource__fun_3534 () at src/core/source.ml:646
#28 0x0000555555f4e204 in camlSource__fun_3605 () at src/core/source.ml:717
#29 0x0000555555f98790 in camlSwitch__fun_2492 () at src/core/operators/switch.ml:253
#30 0x0000555555f4e4ae in camlSource__fun_3534 () at src/core/source.ml:646
#31 0x0000555555f4e204 in camlSource__fun_3605 () at src/core/source.ml:717
#32 0x0000555555f81983 in camlOutput__fun_2537 () at src/core/outputs/output.ml:166
#33 0x0000555555f56774 in camlClock__fun_2087 () at src/core/clock.ml:305
#34 0x00005555562ccce4 in camlStdlib__List__fold_left_521 () at list.ml:121
#35 0x0000555555f53f7d in camlClock__fun_2046 () at src/core/clock.ml:302
#36 0x0000555555f5647b in camlClock__loop_1178 () at src/core/clock.ml:272
#37 0x0000555555f54358 in camlClock__fun_2023 () at src/core/clock.ml:275
#38 0x0000555555f3aed3 in camlTutils__process_767 () at src/core/tools/tutils.ml:164
#39 0x000055555628d5e5 in camlThread__fun_850 () at thread.ml:49
#40 0x00005555563e2271 in caml_start_program ()
#41 0x00005555563d8ced in caml_callback_exn (closure=closure@entry=140737106678936, arg=<optimized out>, arg@entry=1) at callback.c:111
#42 0x00005555563af6b0 in caml_thread_start (arg=0x555556d20f50) at st_stubs.c:548
#43 0x00007ffff72a3ea7 in start_thread (arg=<optimized out>) at pthread_create.c:477
#44 0x00007ffff437aa2f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95

(gdb) list
1284    in freelist.c

(gdb) bt full
#0  0x00005555563e2c7b in bf_insert_remnant_small (v=v@entry=140737053044544) at freelist.c:1289
        wosz = 18014398509481978
#1  0x00005555563e403c in bf_allocate (wosz=<optimized out>) at freelist.c:1537
        s = <optimized out>
        block = 140737053044544
        result = 0x7fffe60daf10
#2  0x00005555563c893f in caml_fl_allocate (wo_sz=5) at caml/freelist.h:40
No locals.
#3  caml_alloc_shr_aux (profinfo=0, track=0, tag=0, wosize=5) at memory.c:471
        hp = <optimized out>
        new_block = <optimized out>
        hp = <optimized out>
        new_block = <optimized out>
#4  caml_alloc_shr_aux (profinfo=0, track=0, tag=0, wosize=wosize@entry=5) at memory.c:463
        hp = <optimized out>
        new_block = <optimized out>
        hp = <optimized out>
        new_block = <optimized out>
#5  caml_alloc_shr_for_minor_gc (wosize=wosize@entry=5, tag=0, old_hd=old_hd@entry=5120) at memory.c:532
No locals.
#6  0x00005555563c6e2a in caml_oldify_one (v=140737106694528, p=p@entry=0x7fffe89536a0) at minor_gc.c:209
        field0 = <optimized out>
        result = <optimized out>
        hd = 5120
        sz = 5
        i = <optimized out>
        tag = 0
        tail_call = <optimized out>
#7  0x00005555563c7140 in caml_oldify_mopup () at minor_gc.c:314
        v = 140737106693184
        new_v = <optimized out>
        f = <optimized out>
        i = <optimized out>
        re = <optimized out>
        redo = 0
#8  0x00005555563c7268 in caml_empty_minor_heap () at minor_gc.c:377
        r = 0x7fffe90602f0
        elt = <optimized out>
        prev_alloc_words = 262857
        re = <optimized out>
#9  0x00005555563c77a8 in caml_gc_dispatch () at minor_gc.c:492
No locals.
#10 0x00005555563c783e in caml_check_urgent_gc (extra_root=<optimized out>, extra_root@entry=1) at minor_gc.c:575
        caml__frame = 0x7fffd8e79b50
        caml__roots_extra_root = {next = 0x7fffd8e79b50, ntables = 1, nitems = 1, tables = {0x7fffd8e79ad8, 0x7fffe9412fd8, 0x7fffe93dd780, 0x0, 0x2}}
        caml__dummy_extra_root = 0
#11 0x00005555563c3cf8 in caml_do_pending_actions_exn () at signals.c:267
        exn = <optimized out>
#12 0x00005555563c3ea0 in process_pending_actions_with_root_exn (extra_root=<optimized out>) at signals.c:299
        caml__frame = 0x0
        caml__roots_extra_root = {next = 0x0, ntables = 1, nitems = 1, tables = {0x7fffd8e79b48, 0x3, 0x5555563cdb31 <caml_floatarray_create+129>, 0x7fffe9265da0, 0x555555f2fbfb <camlFrame_settings__audio_of_main_674+27>}}
        caml__dummy_extra_root = 0
        exn = <optimized out>
#13 caml_process_pending_actions_with_root (extra_root=<optimized out>) at signals.c:320
        res = <optimized out>
#14 0x00005555562b1a03 in camlMm_audio__Audio__create_485 () at src/audio.ml:154
No locals.
#15 0x00005555562d70eb in camlStdlib__Array__init_289 () at array.ml:56
No locals.
#16 0x0000555555f2eeee in camlContent_base__get_data_1009 () at src/core/stream/content_base.ml:328
No locals.
#17 0x0000555555f8eaa5 in camlAdd__fun_3189 () at src/core/operators/add.ml:152
No locals.
#18 0x00005555562ccc10 in camlStdlib__List__iter_507 () at list.ml:110
No locals.
#19 0x00005555562ccc10 in camlStdlib__List__iter_507 () at list.ml:110
No locals.
#20 0x0000555555f8d72e in camlAdd__fun_3153 () at src/core/operators/add.ml:147
No locals.
#21 0x0000555555f4e4ae in camlSource__fun_3534 () at src/core/source.ml:646
No locals.
#22 0x0000555555f4e204 in camlSource__fun_3605 () at src/core/source.ml:717
No locals.
#23 0x0000555555f92f76 in camlMuxer__fun_2026 () at src/core/operators/muxer.ml:92
No locals.
#24 0x00005555562ccc10 in camlStdlib__List__iter_507 () at list.ml:110
No locals.
#25 0x0000555555f92305 in camlMuxer__fun_2006 () at src/core/operators/muxer.ml:87
No locals.
#26 0x0000555555f92113 in camlMuxer__fun_2043 () at src/core/operators/muxer.ml:133
No locals.
#27 0x0000555555f4e4ae in camlSource__fun_3534 () at src/core/source.ml:646
No locals.
#28 0x0000555555f4e204 in camlSource__fun_3605 () at src/core/source.ml:717
No locals.
#29 0x0000555555f98790 in camlSwitch__fun_2492 () at src/core/operators/switch.ml:253
No locals.
#30 0x0000555555f4e4ae in camlSource__fun_3534 () at src/core/source.ml:646
No locals.
#31 0x0000555555f4e204 in camlSource__fun_3605 () at src/core/source.ml:717
No locals.
#32 0x0000555555f81983 in camlOutput__fun_2537 () at src/core/outputs/output.ml:166
No locals.
#33 0x0000555555f56774 in camlClock__fun_2087 () at src/core/clock.ml:305
No locals.
#34 0x00005555562ccce4 in camlStdlib__List__fold_left_521 () at list.ml:121
No locals.
#35 0x0000555555f53f7d in camlClock__fun_2046 () at src/core/clock.ml:302
No locals.
#36 0x0000555555f5647b in camlClock__loop_1178 () at src/core/clock.ml:272
No locals.
#37 0x0000555555f54358 in camlClock__fun_2023 () at src/core/clock.ml:275
No locals.
#38 0x0000555555f3aed3 in camlTutils__process_767 () at src/core/tools/tutils.ml:164
No locals.
#39 0x000055555628d5e5 in camlThread__fun_850 () at thread.ml:49
No locals.
#40 0x00005555563e2271 in caml_start_program ()
No symbol table info available.
#41 0x00005555563d8ced in caml_callback_exn (closure=closure@entry=140737106678936, arg=<optimized out>, arg@entry=1) at callback.c:111
No locals.
#42 0x00005555563af6b0 in caml_thread_start (arg=0x555556d20f50) at st_stubs.c:548
        th = 0x555556d20f50
        clos = 140737106678936
        termination_buf = {buf = {{__jmpbuf = {0, 3673535739667892933, 140736840838750, 140736840838751, 140736832447360, 8396800, -3673612910504228155, -7471004218039514427}, __mask_was_saved = 0, __saved_mask = {__val = {0 <repeats 16 times>}}}}}
        tos = 0 '\000'
#43 0x00007ffff72a3ea7 in start_thread (arg=<optimized out>) at pthread_create.c:477
        ret = <optimized out>
        pd = <optimized out>
        unwind_buf = {cancel_jmp_buf = {{jmp_buf = {140736832452352, 3673535739667892933, 140736840838750, 140736840838751, 140736832447360, 8396800, -3673612910470673723, -3673552878791734587}, mask_was_saved = 0}}, priv = {pad = {0x0, 0x0, 0x0, 0x0}, data = {prev = 0x0,
              cleanup = 0x0, canceltype = 0}}}
        not_first_call = 0
#44 0x00007ffff437aa2f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
No locals.

(gdb) info frame
Stack level 0, frame at 0x7fffd8e799f8:
 rip = 0x5555563e2c7b in bf_insert_remnant_small (freelist.c:1289); saved rip = 0x5555563e403c
 called by frame at 0x7fffd8e79a00
 source language c.
 Arglist at 0x7fffd8e799e8, args: v=v@entry=140737053044544
 Locals at 0x7fffd8e799e8, Previous frame's sp is 0x7fffd8e799f8
 Saved registers:
  rip at 0x7fffd8e799f0

(gdb) info locals
wosz = 18014398509481978

(gdb) info threads
  Id   Target Id                                        Frame
  1    Thread 0x7fffe9676380 (LWP 2660497) "liquidsoap" 0x00007ffff42b7ba2 in __GI___sigtimedwait (set=set@entry=0x7fffffffe1b0, info=info@entry=0x7fffffffe0f0, timeout=timeout@entry=0x0) at ../sysdeps/unix/sysv/linux/sigtimedwait.c:29
  2    Thread 0x7fffe82a7700 (LWP 2660501) "liquidsoap" futex_wait_cancelable (private=0, expected=0, futex_word=0x555556c26c08 <log_condition+40>) at ../sysdeps/nptl/futex-internal.h:186
  3    Thread 0x7fffe7aa6700 (LWP 2660502) "liquidsoap" 0x00007ffff43711e3 in __GI___select (nfds=nfds@entry=0, readfds=readfds@entry=0x0, writefds=writefds@entry=0x0, exceptfds=exceptfds@entry=0x0, timeout=timeout@entry=0x7fffe7aa5210) at ../sysdeps/unix/sysv/linux/select.c:41
  4    Thread 0x7fffe72a5700 (LWP 2660503) "SRT:GC"     futex_abstimed_wait_cancelable (private=0, abstime=0x7fffe72a41e0, clockid=-416661136, expected=0, futex_word=0x7ffff7bb23f0 <CUDT::s_UDTUnited+368>) at ../sysdeps/nptl/futex-internal.h:323
  5    Thread 0x7fffd9e7d700 (LWP 2660507) "liquidsoap" futex_wait_cancelable (private=0, expected=0, futex_word=0x555556c8cf48) at ../sysdeps/nptl/futex-internal.h:186
  6    Thread 0x7fffd967c700 (LWP 2660508) "liquidsoap" futex_wait_cancelable (private=0, expected=0, futex_word=0x555556cf28a8) at ../sysdeps/nptl/futex-internal.h:186
* 7    Thread 0x7fffd8e7b700 (LWP 2660509) "liquidsoap" 0x00005555563e2c7b in bf_insert_remnant_small (v=v@entry=140737053044544) at freelist.c:1289
  8    Thread 0x7fffd3fff700 (LWP 2660510) "liquidsoap" futex_wait_cancelable (private=0, expected=0, futex_word=0x7fffc0002b98) at ../sysdeps/nptl/futex-internal.h:186
  9    Thread 0x7fffd37fe700 (LWP 2660511) "liquidsoap" futex_wait_cancelable (private=0, expected=0, futex_word=0x7fffc4002b98) at ../sysdeps/nptl/futex-internal.h:186
  10   Thread 0x7fffd2ffd700 (LWP 2660512) "liquidsoap" futex_wait_cancelable (private=0, expected=0, futex_word=0x7fffb8002b9c) at ../sysdeps/nptl/futex-internal.h:186
  11   Thread 0x7fffd27fc700 (LWP 2660513) "liquidsoap" 0x00007ffff436ed2f in __GI___poll (fds=fds@entry=0x7fffbc0059f0, nfds=nfds@entry=6, timeout=timeout@entry=-1) at ../sysdeps/unix/sysv/linux/poll.c:29
  12   Thread 0x7fffd1ffb700 (LWP 2660514) "liquidsoap" futex_wait_cancelable (private=0, expected=0, futex_word=0x7fffc80ac7dc) at ../sysdeps/nptl/futex-internal.h:186
  13   Thread 0x7fffd17fa700 (LWP 2660515) "liquidsoap" futex_wait_cancelable (private=0, expected=0, futex_word=0x7fffc80ac84c) at ../sysdeps/nptl/futex-internal.h:186
  14   Thread 0x7fffd0ff9700 (LWP 2660516) "liquidsoap" futex_wait_cancelable (private=0, expected=0, futex_word=0x7fffc80ac8bc) at ../sysdeps/nptl/futex-internal.h:186
  15   Thread 0x7fffb7fff700 (LWP 2660517) "liquidsoap" futex_wait_cancelable (private=0, expected=0, futex_word=0x7fffc80ac92c) at ../sysdeps/nptl/futex-internal.h:186
  16   Thread 0x7fffb77fe700 (LWP 2660520) "liquidsoap" futex_wait_cancelable (private=0, expected=0, futex_word=0x7fffc80e68dc) at ../sysdeps/nptl/futex-internal.h:186
  17   Thread 0x7fffb6ffd700 (LWP 2660521) "liquidsoap" futex_wait_cancelable (private=0, expected=0, futex_word=0x7fffc80e694c) at ../sysdeps/nptl/futex-internal.h:186
  18   Thread 0x7fffb67fc700 (LWP 2660522) "liquidsoap" futex_wait_cancelable (private=0, expected=0, futex_word=0x7fffc80e69bc) at ../sysdeps/nptl/futex-internal.h:186
  19   Thread 0x7fffb5ffb700 (LWP 2660523) "liquidsoap" futex_wait_cancelable (private=0, expected=0, futex_word=0x7fffc80e6a2c) at ../sysdeps/nptl/futex-internal.h:186
  20   Thread 0x7fffb57fa700 (LWP 2660526) "liquidsoap" futex_wait_cancelable (private=0, expected=0, futex_word=0x7fffc810e3dc) at ../sysdeps/nptl/futex-internal.h:186
  21   Thread 0x7fffb4ff9700 (LWP 2660527) "liquidsoap" futex_wait_cancelable (private=0, expected=0, futex_word=0x7fffc810e44c) at ../sysdeps/nptl/futex-internal.h:186
  22   Thread 0x7fffb47f8700 (LWP 2660528) "liquidsoap" futex_wait_cancelable (private=0, expected=0, futex_word=0x7fffc810e4bc) at ../sysdeps/nptl/futex-internal.h:186
  23   Thread 0x7fffb3ff7700 (LWP 2660529) "liquidsoap" futex_wait_cancelable (private=0, expected=0, futex_word=0x7fffc810e52c) at ../sysdeps/nptl/futex-internal.h:186
  24   Thread 0x7fffacb7f700 (LWP 2660534) "liquidsoap" 0x00007ffff43711e3 in __GI___select (nfds=23, readfds=readfds@entry=0x7fffacb7dbe0, writefds=writefds@entry=0x7fffacb7dc60, exceptfds=exceptfds@entry=0x7fffacb7dce0, timeout=timeout@entry=0x7fffacb7db90)
    at ../sysdeps/unix/sysv/linux/select.c:41

 (gdb) info source
Current source file is freelist.c
Compilation directory is /home/opam/.opam/4.14.0/.opam-switch/build/ocaml-base-compiler.4.14.0/runtime
Source language is c.
Producer is GNU C17 10.2.1 20210110 -mtune=generic -march=x86-64 -g -O2 -fno-strict-aliasing -fwrapv -fno-common -fexcess-precision=standard -fno-tree-vrp -ffunction-sections -fasynchronous-unwind-tables.
Compiled with DWARF 2 debugging format.
Does not include preprocessor macro info.
toots commented 1 year ago

Thanks. This points to a corruption in the garbage collection. Could you try without the internal ogg/flac module, using only ffmpeg?

gabsoftware commented 1 year ago

I get very high CPU and RAM usage as explained in #3017 and the OOM killer kills the process after a few hours when I use the FFMPEG decoder.

toots commented 1 year ago

Could you also try using the ffmpeg encoder and decoder on all ends? We've got some improvements pending on our internal encoders, see: https://github.com/savonet/liquidsoap/pull/3062

gabsoftware commented 1 year ago

Could you also try using the ffmpeg encoder and decoder on all ends? We've got some improvements pending on our internal encoders, see: #3062

I'll try that, but I'm thinking that maybe I don't do this the right way as I can't possibly be the first one that needs to send a lossless audio stream from one Liquidsoap instance to another.

How would you do that? Between one Liquidsoap that streams random tracks from playlists, and another liquidsoap on another server that receive the audio from the first instance, and outputs the stream in various formats as output.icecast.

gabsoftware commented 1 year ago

Could you also try using the ffmpeg encoder and decoder on all ends? We've got some improvements pending on our internal encoders, see: #3062

Just tried, and I have the same memory leak and high CPU usage on the destination servers, like previously.

On the source server I have the following:

#!/usr/bin/liquidsoap

security=single(
    id="security_single",
    "/home/user/default.flac"
)

radio_playlist=playlist(
    id="radio_playlist",
    mode="randomize",
    reload=3600,
    reload_mode="seconds",
    "/path/to/playlist.pls"
)

radio_stream=blank.skip(
    id="radio_stream_blank_skipper",
    stereo(
        id="radio_stream_audio_to_stereo",
        blank.eat(
            id="playlist_mix_blank_eater",
            max_blank=5.0,
            radio_playlist
        )
    )
)

radio=fallback.skip(
    radio_stream,
    fallback=security
)

flacstream = ffmpeg.encode.audio(
    %ffmpeg(
        %audio(
            codec="flac",
            ar=44100,
            ac=2,
            compression_level=8
        )
    ),
    radio
)

output.icecast(
    id="output_icecast_radio",
    %ffmpeg(
        format="ogg",
        %audio.copy
    ),
    host="server1.com",
    port=1111,
    password="hackme",
    mount="/master-stream.flac",
    flacstream
)

output.icecast(
    id="output_icecast_radio",
    %ffmpeg(
        format="ogg",
        %audio.copy
    ),
    host="server2.com",
    port=1111,
    password="hackme",
    mount="/master-stream.flac",
    flacstream
)

And on each of the destination servers, I have the following:

#!/usr/bin/liquidsoap

settings.harbor.bind_addrs.set(["0.0.0.0"])

security = single(
    id="security_single",
    default_wav_path
)

raw_harbor_input=input.harbor(
    id="input_harbor_master_stream",
    port=harbor_port,
    password=harbor_password,
    replay_metadata=true,
    metadata_charset="UTF-8",
    on_connect=on_harbor_connected,
    on_disconnect=on_harbor_disconnected,
    "/master-stream.flac"
)
input_harbor=stereo(
    id="input_harbor_audio_to_stereo",
    clock(
        id="input_harbor_clock",
        raw_harbor_input
    )
)

fallbackswitch=fallback.skip(
    input_harbor,
    fallback=security
)

def saferadio(radio, n) =
    mksafe(
        id="radio_mksafe_#{n}",
        add(
            id="radio_mix_blank_#{n}",
            normalize=false,
            [
                blank(
                    id="radio_blank_#{n}"
                ),
                radio
            ]
        )
    )
end

radio_ogg=saferadio(
    fallbackswitch,
    "ogg"
)
radio_opus=saferadio(
    fallbackswitch,
    "opus"
)
radio_mp3=saferadio(
    fallbackswitch,
    "mp3"
)
radio_flac=saferadio(
    fallbackswitch,
    "flac"
)

output.icecast(
    id="output_icecast_ogg",
    %ffmpeg(
        format="ogg",
        %audio(
            codec="libvorbis",
            global_quality="9"
        )
    ),
    radio_ogg,
    host=icecast_host,
    port=icecast_port,
    password=icecast_password,
    mount="/stream.ogg",
    name="#{radio_name} (OGG)",
    genre=radio_genre,
    description=radio_desc,
    url="#{radio_url}/stream.ogg",
    send_icy_metadata=true,
    encoding="UTF-8",
    format="audio/ogg",
    start=true
)

output.icecast(
    id="output_icecast_opus",
    %ffmpeg(
        format="opus",
        %audio(
            codec="libopus",
            b="327680",
            ar="48000"
        )
    ),
    radio_opus,
    host=icecast_host,
    port=icecast_port,
    password=icecast_password,
    mount="/stream.opus",
    name="#{radio_name} (OPUS)",
    genre=radio_genre,
    description=radio_desc,
    url="#{radio_url}/stream.opus",
    send_icy_metadata=true,
    encoding="UTF-8",
    format="audio/ogg",
    start=true
)

output.icecast(
    id="output_icecast_mp3",
    %ffmpeg(
        format="mp3",
        %audio(
            codec="libmp3lame",
            b="320k"
        )
    ),
    radio_mp3,
    host=icecast_host,
    port=icecast_port,
    password=icecast_password,
    mount="/stream.mp3",
    name="#{radio_name} (MP3)",
    genre=radio_genre,
    description=radio_desc,
    url="#{radio_url}/stream.mp3",
    send_icy_metadata=true,
    encoding="UTF-8",
    format="audio/mpeg",
    start=true
)

output.icecast(
    id="output_icecast_flac",
    %ffmpeg(
       format="ogg",
       %audio(
           codec="flac",
           ar=44100,
           ac=2,
           compression_level=5
       )
    ),
    radio_flac,
    host=icecast_host,
    port=icecast_port,
    password=icecast_password,
    mount="/stream.flac",
    name="#{radio_name} (FLAC)",
    genre=radio_genre,
    description=radio_desc,
    url="#{radio_url}/stream.flac",
    send_icy_metadata=true,
    encoding="UTF-8",
    format="audio/ogg",
    start=true
)
toots commented 1 year ago

I don't think that ogg/flac is super popular as a streaming format. There's only one radio for it on the icecast directory. For backend communication, I think a lot of folks use libsrt.

For the format, if bandwidth is not an issue, I would go with straight raw PCM samples.

Funny thing this wasn't really possible so I have a PR addressing it: https://github.com/savonet/liquidsoap/pull/3066

Here's my test script for it:

Sender:

s = mksafe(playlist("/tmp/pl"))

enc = %ffmpeg(
  format="s16le",
  %audio(
    codec="pcm_s16le",
    ac=1,
    ar=48000
  )
)

output.srt(
  enc,
  s
)

Receiver:

s = input.srt(
  content_type="application/ffmpeg;format=s16le,ch_layout=mono,sample_rate=48000"
)

output.ao(clock_safe=false,fallible=true, s)
gabsoftware commented 1 year ago

Funny thing this wasn't really possible so I have a PR addressing it: #3066

That seems to be what I need, but it does not work with currently provided 2.2.0 rolling release (I can't configure the content-type header as I guess this is what the PR is about, also pcm_s16le is not recognized).

What are my options in the time being?

I tried with this for the sender:

flacstream = ffmpeg.encode.audio(
    id="flac_stream",
    %ffmpeg(
        %audio(
            codec="flac",
            ar=44100,
            ac=2,
            compression_level=8
        )
    ),
    radio
)

output.srt(
    id="output_srt_radio1",
    %ffmpeg(
        format="s16le",
        %audio.copy
    ),
    host="server1.com",
    port=1111,
    flacstream
)

output.srt(
    id="output_srt_radio2",
    %ffmpeg(
        format="s16le",
        %audio.copy
    ),
    host="server2.com",
    port=1111,
    flacstream
)

(not sure if "s16le" format is correct for FLAC, vs "ogg".... But it seems to work and CPU and RAM usage is normal that way)

Then in sender I have:

raw_srt_input=input.srt(
    id="input_srt_master_stream",
    port=1111
)

It somehow works but sometimes the stream stops after a song finishes in my browser. Also I can hear the fallback track for a few seconds between each track.

So I am back to using OGG/FLAC sent from output.icecast to input.harbor, using internal OGG/FLAC decoders.

toots commented 1 year ago

The PR is not merged yet, will be soon. I'll report here.

gabsoftware commented 1 year ago

I must be lucky today because no segfaults for 24 hours :-)

toots commented 1 year ago

Great! The PR has been merged and should be included in the latest rolling-release-v2.2.x

gabsoftware commented 1 year ago

Great! The PR has been merged and should be included in the latest rolling-release-v2.2.x

Can't wait until it's out :-)

gabsoftware commented 1 year ago

More than 2.5 days without a segfault and counting, I'm not sure what changed on my end. I still haven't updated Liquidsoap. The only notable difference is that I forgot to uncomment that line by mistake when reverting back to input.harbor:

# settings.harbor.bind_addrs.set(["0.0.0.0"])

It still works without that line, by the way. But I don't see how that would solve any segfault.

Now that it worked for some time, I noticed a slow memory leak. from 21.5% to 29.3% RAM used by liquidsoap in 2.5 days.

My prior change was to use %ffmpeg instead of %ogg%flac to feed OGG/FLAC to output.icecast but I'm pretty confident that I still had segfaults after that change.

toots commented 1 year ago

GC segfaults can be very tricky to track because they depend on race conditions when cleaning up memory and those can, in turn, depends on some build-time compiler choices.. So they appear as heiseinbug, some times here, some times not.

Now that everything has been merged and built, I'd recommend to use the raw PCM libsrt solution as described here. The ffmpeg bindings are heavily tested and libsrt is definitely a good transport layer for what you are trying to do.

gabsoftware commented 1 year ago

I tried and have some issues. First it tells me that ch_layout is not a valid argument. Then if I remove it, I have a corrupted stream on my icecast outputs. I installed the latest 2.2.0 rolling release on sender and receiver.

toots commented 1 year ago

You should try channels=2 then, ch_layout is the new FFmpeg channels API and it looks like the dynamic libraries are not compiled with it.

Gonna add a remark in the doc.

gabsoftware commented 1 year ago

You should try channels=2 then, ch_layout is the new FFmpeg channels API and it looks like the dynamic libraries are not compiled with it.

Gonna add a remark in the doc.

Ah yes it works now! Thanks! 😁👍 Hopefully this is it for me! Will report if I get any issues.

gabsoftware commented 1 year ago

Also I could share my final scripts if no issues. Maybe someone could find it useful.

gabsoftware commented 1 year ago

I do have an issue but it does not influence streaming too much, on the sender side. This error happens after each track:

Error(Einvsock,Operation not supported: Invalid socket ID)
2023/05/12 01:12:17 [output_srt_radio1:3] Client connected!
2023/05/12 01:12:17 [output_srt_radio2:3] Client connected!
2023/05/12 01:16:35 [decoder:2] Decoding "/home/user/Musique/Synthwave/Orax - 2015 - Until the End (Album)/06 Time.flac" ended: Ffmpeg_decoder.End_of_file.
2023/05/12 01:16:35 [radio_synthwave:3] Prepared "/home/user/Musique/Synthwave/VA - Synthwave, Vol. 6 (2019)/21. Color Theory - The Fifth of July.flac" (RID 227).
2023/05/12 01:16:35 [lang:3] calling apply_metadata
2023/05/12 01:16:35 [lang:3] query for metadata server: artist=Color+Theory&album=Synthwave%2C+Vol.+6&title=The+Fifth+of+July
2023/05/12 01:16:35 [lang:3] icy for icecast metadata: Color+Theory+-+The+Fifth+of+July
2023/05/12 01:16:35 [decoder.ffmpeg:3] Requested content-type for "/home/user/Musique/Synthwave/Waveshaper/albums/2018 - Lost shapes [b-sides]/10 MS-20 + 50.mp3": {audio=pcm(stereo)}
2023/05/12 01:16:35 [decoder.ffmpeg:3] FFmpeg recognizes "/home/user/Musique/Synthwave/Waveshaper/albums/2018 - Lost shapes [b-sides]/10 MS-20 + 50.mp3" as video: {codec: mjpeg, 1000x1000, yuvj444p}, audio: {codec: mp3, 44100Hz, 2 channel(s)}
2023/05/12 01:16:35 [decoder.ffmpeg:3] Decoded content-type for "/home/user/Musique/Synthwave/Waveshaper/albums/2018 - Lost shapes [b-sides]/10 MS-20 + 50.mp3": {audio=pcm(stereo)}
2023/05/12 01:16:38 [output_srt_radio1:2] Error while sending client data: Error(Einvsock,Operation not supported: Invalid socket ID)
2023/05/12 01:16:38 [output_srt_radio2:2] Error while sending client data: Error(Einvsock,Operation not supported: Invalid socket ID)
2023/05/12 01:16:38 [clock.main:2] We must catchup 2.83 seconds!
2023/05/12 01:16:38 [output_srt_radio2:3] Connecting to srt://server2.com:1111..
2023/05/12 01:16:38 [output_srt_radio1:3] Connecting to srt://server1.com:1111..
2023/05/12 01:16:38 [output_srt_radio2:3] Client connected!
2023/05/12 01:16:38 [output_srt_radio1:3] Client connected!

On the server side:

2023/05/12 01:12:17 [clock.input.srt:3] Delegating synchronisation to active
sources
2023/05/12 01:16:36 [input_srt_master_stream:2] Feeding failed: Avutil.Error(
Generic error in an external library)
2023/05/12 01:16:36 [input_srt_master_stream:4] Raised by primitive operation
 at Av.read_input in file "av/av.ml", line 220, characters 2-31
2023/05/12 01:16:36 [input_srt_master_stream:4] Called from Ffmpeg_decoder.mk
_decoder.(fun).f in file "src/core/decoder/ffmpeg_decoder.ml", line 726, char
acters 10-99
2023/05/12 01:16:36 [input_srt_master_stream:4] Re-raised at Ffmpeg_decoder.m
k_decoder.(fun).f in file "src/core/decoder/ffmpeg_decoder.ml", line 767, cha
racters 12-48
2023/05/12 01:16:36 [input_srt_master_stream:4] Called from Srt_io.input_base
#get_frame in file "src/core/io/srt_io.ml", line 727, characters 10-39
2023/05/12 01:16:36 [input_srt_master_stream:4]
2023/05/12 01:16:36 [switch_0:3] Switch to security_single with forgetful tra
nsition.
2023/05/12 01:16:36 [source:4] Source replay_metadata_9 gets up with content
type: {audio=pcm(stereo)}.
2023/05/12 01:16:36 [replay_metadata_9:3] Content type is {audio=pcm(stereo)}
.
2023/05/12 01:16:36 [security_single:3] Prepared "/home/hautclocq/default.wav
" (RID 0).
2023/05/12 01:16:36 [clock.input.srt:3] Delegating synchronisation to CPU clo
ck
2023/05/12 01:16:38 [input_srt_master_stream:4] New connection from 109.220.2
9.38:55837
2023/05/12 01:16:38 [decoder:4] Available decoders:
2023/05/12 01:16:38 [decoder:4] ffmpeg (priority: 10)
2023/05/12 01:16:38 [decoder:4] Selected decoder ffmpeg for mime-type applica
tion/ffmpeg;format=s16le,channels=2,sample_rate=44100 with expected content {
audio=pcm(stereo)}
2023/05/12 01:16:39 [switch_0:3] Switch to input_srt_audio_to_stereo with tra
nsition.
2023/05/12 01:16:39 [source:4] Source replay_metadata_9 gets down.
2023/05/12 01:16:39 [security_single:4] Finished with "/home/u ser/default.wav".
2023/05/12 01:16:39 [clock.input.srt:3] Delegating synchronisation to active
sources
2023/05/12 01:21:58 [input_srt_master_stream:2] Feeding failed: Avutil.Error(
Generic error in an external library)
toots commented 1 year ago

Yeah that looks like a bug. Can you share you current script, I'll try to reproduce locally.

gabsoftware commented 1 year ago

Yeah that looks like a bug. Can you share you current script, I'll try to reproduce locally.

Here is the whole sender script:

#!/usr/bin/liquidsoap

#settings
settings.sandbox.set(true)
settings.sandbox.network.set(true)
settings.sandbox.shell.set(true)
settings.sandbox.shell.path.set("/bin/bash")

# This function is called when
# a new metadata block is passed in
# the stream.
def apply_metadata(m) =

    log("calling apply_metadata")

    artist = url.encode(m["artist"])
    album  = url.encode(m["album"])
    title  = url.encode(m["title"])

    if(artist == "" and album == "" and title == "") then
        log("Artist, album and title all empty!")
    else
        query = "artist=#{artist}&album=#{album}&title=#{title}"
        icy   = "#{artist}+-+#{title}"
        log("query for metadata server: #{query}")
        log("icy for icecast metadata: #{icy}")

        # mise à jour metadata
        command = process.quote.command( args=["-m", "2", "https://server1.com/public/metadataEvent?#{query}"], "curl" )
        #print(command)
        process.run(timeout=4.0, command)
        command = process.quote.command( args=["-m", "2", "https://server2.com/public/metadataEvent?#{query}"], "curl" )
        #print(command)
        process.run(timeout=4.0, command)

        # mise à jour historique
        command = process.quote.command( args=["-m", "2", "https://server1.com/public/historyEvent?#{query}"], "curl" )
        #print(command)
        process.run(timeout=4.0, command)
        command = process.quote.command( args=["-m", "2", "https://server2.com/public/historyEvent?#{query}"], "curl" )
        #print(command)
        process.run(timeout=4.0, command)

        # mise à jour metadata des streams (flac et opus ne supportent pas pour l'instant)

        # mise à jour metadata du stream mp3
        command = process.quote.command( args=["-m", "2", "-u", "adminuser:adminpass", "https://server1.com:3333/admin/metadata?mount=%2Fstream.mp3&mode=updinfo&charset=UTF-8&song=#{icy}"], "curl" )
        #print(command)
        process.run(timeout=4.0, command)
        command = process.quote.command( args=["-m", "2", "-u", "adminuser:adminpass", "https://server2.com:3333/admin/metadata?mount=%2Fstream.mp3&mode=updinfo&charset=UTF-8&song=#{icy}"], "curl" )
        #print(command)
        process.run(timeout=4.0, command)

        # mise à jour metadata du stream ogg
        command = process.quote.command( args=["-m", "2", "-u", "adminuser:adminpass", "https://server1.com:3333/admin/metadata?mount=%2Fstream.ogg&mode=updinfo&charset=UTF-8&song=#{icy}"], "curl" )
        #print(command)
        process.run(timeout=4.0, command)
        command = process.quote.command( args=["-m", "2", "-u", "adminuser:adminpass", "https://server2.com:3333/admin/metadata?mount=%2Fstream.ogg&mode=updinfo&charset=UTF-8&song=#{icy}"], "curl" )
        #print(command)
        process.run(timeout=4.0, command)

        # flac et opus ne supportent pas les maj de metadata

        # # mise à jour metadata du stream opus
        # command = process.quote.command( args=["-m", "2", "-u", "adminuser:adminpass", "https://server1.com:3333/admin/metadata?mount=%2Fstream.opus&mode=updinfo&charset=UTF-8&song=#{icy}"], "curl" )
        # #print(command)
        # process.run(timeout=4.0, command)
        # command = process.quote.command( args=["-m", "2", "-u", "adminuser:adminpass", "https://server2.com:3333/admin/metadata?mount=%2Fstream.opus&mode=updinfo&charset=UTF-8&song=#{icy}"], "curl" )
        # #print(command)
        # process.run(timeout=4.0, command)

        # # mise à jour metadata du stream flac
        # command = process.quote.command( args=["-m", "2", "-u", "adminuser:adminpass", "https://server1.com:3333/admin/metadata?mount=%2Fstream.flac&mode=updinfo&charset=UTF-8&song=#{icy}"], "curl" )
        # #print(command)
        # process.run(timeout=4.0, command)
        # command = process.quote.command( args=["-m", "2", "-u", "adminuser:adminpass", "https://server2.com:3333/admin/metadata?mount=%2Fstream.flac&mode=updinfo&charset=UTF-8&song=#{icy}"], "curl" )
        # #print(command)
        # process.run(timeout=4.0, command)

    end
end

# Log dir
log.file.path.set("/home/user/radio.log")

# Music
playlist_ambient   = playlist(id="radio_ambient"  , mode="randomize", reload=3600, reload_mode="seconds", "/home/user/radio_ambient.pls")
playlist_chillout  = playlist(id="radio_chillout" , mode="randomize", reload=3600, reload_mode="seconds", "/home/user/radio_chillout.pls")
playlist_dnb       = playlist(id="radio_dnb"      , mode="randomize", reload=3600, reload_mode="seconds", "/home/user/radio_dnb.pls")
playlist_dub       = playlist(id="radio_dub"      , mode="randomize", reload=3600, reload_mode="seconds", "/home/user/radio_dub.pls")
playlist_dubstep   = playlist(id="radio_dubstep"  , mode="randomize", reload=3600, reload_mode="seconds", "/home/user/radio_dubstep.pls")
playlist_electro   = playlist(id="radio_electro"  , mode="randomize", reload=3600, reload_mode="seconds", "/home/user/radio_electro.pls")
playlist_futurepop = playlist(id="radio_futurepop", mode="randomize", reload=3600, reload_mode="seconds", "/home/user/radio_futurepop.pls")
playlist_idm       = playlist(id="radio_idm"      , mode="randomize", reload=3600, reload_mode="seconds", "/home/user/radio_idm.pls")
playlist_nightcity = playlist(id="radio_nightcity", mode="randomize", reload=3600, reload_mode="seconds", "/home/user/radio_nightcity.pls")
playlist_synthwave = playlist(id="radio_synthwave", mode="randomize", reload=3600, reload_mode="seconds", "/home/user/radio_synthwave.pls")
playlist_mix = random(
    id="playlist_mix",
    transitions=[],
    transition_length=0.0,
    weights = [3, 15, 18, 2, 1, 6, 21, 2, 3, 75],
    [
        playlist_ambient,
        playlist_chillout,
        playlist_dnb,
        playlist_dub,
        playlist_dubstep,
        playlist_electro,
        playlist_futurepop,
        playlist_idm,
        playlist_nightcity,
        playlist_synthwave
    ]
)

# If something goes wrong, we'll play this
security=single(
    id="security_single",
    "/home/user/default.wav"
)

# create the radio stream
radio_stream=blank.skip(
    id="radio_stream_blank_skipper",
    # "radio_to_stereo is deprecated in 2.2.0, use stereo instead"
    stereo(
        id="radio_stream_audio_to_stereo",
        blank.eat(
            id="playlist_mix_blank_eater",
            max_blank=5.0,
            playlist_mix
        )
    )
)

# And finally the security
radio=fallback.skip(
    radio_stream,
    fallback=security
)

# action on metadata
radio.on_metadata(apply_metadata)

rawpcmstream = ffmpeg.encode.audio(
    id="rawpcm_stream",
    %ffmpeg(
        %audio(
            codec="pcm_s16le",
            ac=2,
            ar=48000
        )
    ),
    radio
)

output.srt(
    id="output_srt_radio1",
    %ffmpeg(
        format="s16le",
        %audio.copy
    ),
    host="server1.com",
    port=1111,
    rawpcmstream
)

output.srt(
    id="output_srt_radio2",
    %ffmpeg(
        format="s16le",
        %audio.copy
    ),
    host="server2.com",
    port=1111,
    rawpcmstream
)

# called when accessing the HTTP "/skip" API endpoint
def try_skip(request, response) =
    log("Got a request on path #{request.path}, protocol version: #{request.http_version}, \
           method: #{request.method}, headers: #{request.headers}, query: #{request.query}, \
           body: #{request.body()}")

    # skip to next track
    log("Skipping to next track!")
    source.skip(playlist_mix)

    # write response for debug
    response.status_code(200)
    response.status_message("OK")
    response.content_type("application/json")
    response.http_version("1.1")
    response.json({status = "success"})
end

# register HTTP "/skip" API endpoint
harbor.http.register(
    port=2222,
    method="GET",
    "/skip",
    try_skip
)

And here is the receiver script:

#!/usr/bin/liquidsoap

# must be included by another script with the following variables:
# home_path (string)
# log_path (string)
# default_wav_path (string)
# radio_name (string)
# radio_desc (string)
# radio_genre (string)
# radio_host (string)
# radio_url (string)
# icecast_host (string)
# icecast_port (int)
# icecast_password (string)

log.file.path.set(log_path)
log.level.set(4)

# configure security input
security = single(
    id="security_single",
    default_wav_path
)

raw_srt_input=input.srt(
    content_type="application/ffmpeg;format=s16le,channels=2,sample_rate=48000",
    id="input_srt_master_stream",
    port=1111
)

input_srt=stereo(
    id="input_srt_audio_to_stereo",
    raw_srt_input
)

fallbackswitch=fallback.skip(
    input_srt,
    fallback=security
)

# make a safe radio
def saferadio(radio, n) =
    mksafe(
        id="radio_mksafe_#{n}",
        add(
            id="radio_mix_blank_#{n}",
            normalize=false,
            [
                blank(
                    id="radio_blank_#{n}"
                ),
                radio
            ]
        )
    )
end

radio_ogg=saferadio(
    fallbackswitch,
    "ogg"
)
radio_opus=saferadio(
    fallbackswitch,
    "opus"
)
radio_mp3=saferadio(
    fallbackswitch,
    "mp3"
)
radio_flac=saferadio(
    fallbackswitch,
    "flac"
)

output.icecast(
    id="output_icecast_ogg",
    %ffmpeg(
        format="ogg",
        %audio(
            codec="libvorbis",
            global_quality="9"
        )
    ),
    radio_ogg,
    host=icecast_host,
    port=icecast_port,
    password=icecast_password,
    mount="/stream.ogg",
    name="#{radio_name} (OGG)",
    genre=radio_genre,
    description=radio_desc,
    url="#{radio_url}/stream.ogg",
    send_icy_metadata=true,
    encoding="UTF-8",
    format="audio/ogg",
    start=true
)

output.icecast(
    id="output_icecast_opus",
    %ffmpeg(
        format="opus",
        %audio(
            codec="libopus",
            b="327680",
            ar="48000"
        )
    ),
    radio_opus,
    host=icecast_host,
    port=icecast_port,
    password=icecast_password,
    mount="/stream.opus",
    name="#{radio_name} (OPUS)",
    genre=radio_genre,
    description=radio_desc,
    url="#{radio_url}/stream.opus",
    send_icy_metadata=true,
    encoding="UTF-8",
    format="audio/ogg",
    start=true
)

output.icecast(
    id="output_icecast_mp3",
    %ffmpeg(
        format="mp3",
        %audio(
            codec="libmp3lame",
            b="320k"
        )
    ),
    radio_mp3,
    host=icecast_host,
    port=icecast_port,
    password=icecast_password,
    mount="/stream.mp3",
    name="#{radio_name} (MP3)",
    genre=radio_genre,
    description=radio_desc,
    url="#{radio_url}/stream.mp3",
    send_icy_metadata=true,
    encoding="UTF-8",
    format="audio/mpeg",
    start=true
)

output.icecast(
    id="output_icecast_flac",
    %ffmpeg(
       format="ogg",
       %audio(
           codec="flac",
           ar=44100,
           ac=2,
           compression_level=5
       )
    ),
    radio_flac,
    host=icecast_host,
    port=icecast_port,
    password=icecast_password,
    mount="/stream.flac",
    name="#{radio_name} (FLAC)",
    genre=radio_genre,
    description=radio_desc,
    url="#{radio_url}/stream.flac",
    send_icy_metadata=true,
    encoding="UTF-8",
    format="audio/ogg",
    start=true
)

On the sender side I have this in the log:

2023/05/12 08:57:55 >>> LOG START
2023/05/12 08:57:51 [main:3] Liquidsoap 2.2.0+git@02da14b41
2023/05/12 08:57:51 [main:3] Using: alsa=0.3.0 angstrom=0.15.0 ao=0.2.4 asetmap=0.8.1 astring=0.8.5 base.caml=v0.15.1 base64=3.5.1 bigarray=[distributed with OCaml] bigarray-compat=1.1.0 bigstringaf=0.9.1 bjack=0.1.6 bytes=[distributed with OCaml] camlimages.all_formats=4.2.6 camlimages.core=5.0.4 camlimages.exif=5.0.4 camlimages.gif=5.0.4 camlimages.jpeg=5.0.4 camlimages.png=5.0.4 camlimages.tiff=5.0.4 camlimages.xpm=5.0.4 camlp-streams camomile=d3773ec camomile.lib=d3773ec cohttp=5.1.0 cohttp-lwt=5.1.0 cohttp-lwt-unix=5.1.0 conduit=6.2.0 conduit-lwt=6.2.0 conduit-lwt-unix=6.2.0 cry=1.0.0 ctypes=0.20.2 ctypes.foreign=0.20.2 ctypes.stubs=0.20.2 curl=0.9.2 domain-name=0.4.0 dssi=0.1.5 dtools=0.4.5 dune-build-info=3.7.1 dune-private-libs.dune-section=3.7.1 dune-site=3.7.1 dune-site.private=3.7.1 duppy=0.9.3 faad=0.5.2 fdkaac=0.3.3 ffmpeg-av=1.1.8 ffmpeg-avcodec=1.1.8 ffmpeg-avdevice=1.1.8 ffmpeg-avfilter=1.1.8 ffmpeg-avutil=1.1.8 ffmpeg-swresample=1.1.8 ffmpeg-swscale=1.1.8 fileutils=0.6.4 flac=0.4.0 flac.decoder=0.4.0 flac.ogg=0.4.0 fmt=0.9.0 frei0r=0.1.2 gd=1.0a5 gen=1.1 inotify=2.4.1 integers ipaddr=5.5.0 ipaddr-sexp=5.5.0 ipaddr.unix=5.5.0 irc-client irc-client-unix ladspa=0.2.2 lame=0.3.7 lastfm=0.3.3 lilv=0.1.0 liquidsoap-lang=2.2.0 liquidsoap-lang.console=2.2.0 liquidsoap_alsa=rolling-release-v2.2.x-51-g02da14b-dirty liquidsoap_ao=rolling-release-v2.2.x-51-g02da14b-dirty liquidsoap_bjack=rolling-release-v2.2.x-51-g02da14b-dirty liquidsoap_builtins=rolling-release-v2.2.x-51-g02da14b-dirty liquidsoap_camlimages=rolling-release-v2.2.x-51-g02da14b-dirty liquidsoap_core=rolling-release-v2.2.x-51-g02da14b-dirty liquidsoap_dssi=rolling-release-v2.2.x-51-g02da14b-dirty liquidsoap_faad=rolling-release-v2.2.x-51-g02da14b-dirty liquidsoap_fdkaac=rolling-release-v2.2.x-51-g02da14b-dirty liquidsoap_ffmpeg=rolling-release-v2.2.x-51-g02da14b-dirty liquidsoap_flac=rolling-release-v2.2.x-51-g02da14b-dirty liquidsoap_frei0r=rolling-release-v2.2.x-51-g02da14b-dirty liquidsoap_gd=rolling-release-v2.2.x-51-g02da14b-dirty liquidsoap_irc=rolling-release-v2.2.x-51-g02da14b-dirty liquidsoap_ladspa=rolling-release-v2.2.x-51-g02da14b-dirty liquidsoap_lame=rolling-release-v2.2.x-51-g02da14b-dirty liquidsoap_lastfm=rolling-release-v2.2.x-51-g02da14b-dirty liquidsoap_lilv=rolling-release-v2.2.x-51-g02da14b-dirty liquidsoap_lo=rolling-release-v2.2.x-51-g02da14b-dirty liquidsoap_mad=rolling-release-v2.2.x-51-g02da14b-dirty liquidsoap_magic=rolling-release-v2.2.x-51-g02da14b-dirty liquidsoap_mem_usage=rolling-release-v2.2.x-51-g02da14b-dirty liquidsoap_memtrace=rolling-release-v2.2.x-51-g02da14b-dirty liquidsoap_ogg=rolling-release-v2.2.x-51-g02da14b-dirty liquidsoap_ogg_flac=rolling-release-v2.2.x-51-g02da14b-dirty liquidsoap_optionals=rolling-release-v2.2.x-51-g02da14b-dirty liquidsoap_opus=rolling-release-v2.2.x-51-g02da14b-dirty liquidsoap_osc=rolling-release-v2.2.x-51-g02da14b-dirty liquidsoap_oss=rolling-release-v2.2.x-51-g02da14b-dirty liquidsoap_portaudio=rolling-release-v2.2.x-51-g02da14b-dirty liquidsoap_posix_time=rolling-release-v2.2.x-51-g02da14b-dirty liquidsoap_prometheus=rolling-release-v2.2.x-51-g02da14b-dirty liquidsoap_pulseaudio=rolling-release-v2.2.x-51-g02da14b-dirty liquidsoap_runtime=rolling-release-v2.2.x-51-g02da14b-dirty liquidsoap_samplerate=rolling-release-v2.2.x-51-g02da14b-dirty liquidsoap_sdl=rolling-release-v2.2.x-51-g02da14b-dirty liquidsoap_shine=rolling-release-v2.2.x-51-g02da14b-dirty liquidsoap_soundtouch=rolling-release-v2.2.x-51-g02da14b-dirty liquidsoap_speex=rolling-release-v2.2.x-51-g02da14b-dirty liquidsoap_srt=rolling-release-v2.2.x-51-g02da14b-dirty liquidsoap_ssl=rolling-release-v2.2.x-51-g02da14b-dirty liquidsoap_stereotool=rolling-release-v2.2.x-51-g02da14b-dirty liquidsoap_taglib=rolling-release-v2.2.x-51-g02da14b-dirty liquidsoap_theora=rolling-release-v2.2.x-51-g02da14b-dirty liquidsoap_vorbis=rolling-release-v2.2.x-51-g02da14b-dirty liquidsoap_xmlplaylist=rolling-release-v2.2.x-51-g02da14b-dirty liquidsoap_yaml=rolling-release-v2.2.x-51-g02da14b-dirty lo=0.2.0 logs=0.7.0 logs.fmt=0.7.0 logs.lwt=0.7.0 lwt=5.6.1 lwt.unix=5.6.1 macaddr=5.5.0 mad=0.5.3 magic=0.7.3 magic-mime=1.3.0 mem_usage=0.0.4 memtrace=0.2.3 menhirLib=20220210 metadata=0.2.0 mm=0.8.3 mm.audio=0.8.3 mm.base=0.8.3 mm.image=0.8.3 mm.midi=0.8.3 mm.video=0.8.3 ocplib-endian ocplib-endian.bigstring ogg=0.7.4 ogg.decoder=0.7.4 opus=0.2.3 opus.decoder=0.2.3 osc osc-unix parsexp=v0.15.0 pcre=7.5.0 portaudio=0.2.3 posix-base=65ec333 posix-socket=65ec333 posix-socket.constants=65ec333 posix-socket.stubs=65ec333 posix-socket.types=65ec333 posix-time2=65ec333 posix-time2.constants=65ec333 posix-time2.stubs=65ec333 posix-time2.types=65ec333 posix-types=65ec333 posix-types.constants=65ec333 ppx_sexp_conv.runtime-lib=v0.15.0 prometheus=1.2 prometheus-app=1.2 pulseaudio=0.1.6 re=1.10.4 result=1.5 samplerate=0.1.6 sedlex=3.1 seq=[distributed with OCaml 4.07 or above] sexplib=v0.15.1 sexplib0=v0.15.0 shine=0.2.3 soundtouch=0.1.9 speex=0.4.2 speex.decoder=0.4.2 srt=0.3.0 srt.constants=0.3.0 srt.stubs=0.3.0 srt.stubs.locked=0.3.0 srt.types=0.3.0 ssl=0.5.13 stdlib-shims=0.3.0 stereotool=rolling-release-v2.2.x-51-g02da14b-dirty str=[distributed with OCaml] stringext=1.6.0 taglib=0.3.10 theora=0.4.1 theora.decoder=0.4.1 threads=[distributed with OCaml] threads.posix=[distributed with OCaml] tsdl=v1.0.0 tsdl-image=0.5 tsdl-ttf=0.5 unix=[distributed with OCaml] unix-errno=0.6.2 unix-errno.errno_bindings=0.6.2 unix-errno.errno_types=0.6.2 unix-errno.errno_types_detected=0.6.2 unix-errno.unix=0.6.2 uri=4.2.0 uri-sexp=4.2.0 uri.services=4.2.0 vorbis=0.8.1 vorbis.decoder=0.8.1 xmlm=1.4.0 xmlplaylist=0.1.5 yaml=3.1.0 yaml.bindings=3.1.0 yaml.bindings.types=3.1.0 yaml.c=3.1.0 yaml.ffi=3.1.0 yaml.types=3.1.0
2023/05/12 08:57:51 [clock:3] Using native (high-precision) implementation for latency control
2023/05/12 08:57:54 [main:3] Standard library loaded in 3.58 seconds.
2023/05/12 08:57:55 [frame:3] Using 44100Hz audio, 25Hz video, 44100Hz main.
2023/05/12 08:57:55 [frame:3] Video frame size set to: 1280x720
2023/05/12 08:57:55 [frame:3] Frame size must be a multiple of 1764 ticks = 1764 audio samples = 1 video samples.
2023/05/12 08:57:55 [frame:3] Targeting 'frame.duration': 0.04s = 1764 audio samples = 1764 ticks.
2023/05/12 08:57:55 [frame:3] Frames last 0.04s = 1764 audio samples = 1 video samples = 1764 ticks.
2023/05/12 08:57:55 [sandbox:3] Sandboxing external processes using bubblewrap at /usr/bin/bwrap
2023/05/12 08:57:55 [sandbox:3] Set environment variables: TMP="/tmp", TMPDIR="/tmp", TEMP="/tmp", TEMPDIR="/tmp"
2023/05/12 08:57:55 [sandbox:3] Unset environment variables: 
2023/05/12 08:57:55 [sandbox:3] Network allowed: true
2023/05/12 08:57:55 [sandbox:3] Read-only directories: /
2023/05/12 08:57:55 [sandbox:3] Read/write directories: /home/user, /tmp
2023/05/12 08:57:55 [startup:3] DSSI plugins registration: 0.00s
2023/05/12 08:57:55 [startup:3] FFmpeg filters registration: 0.01s
2023/05/12 08:57:55 [startup:3] FFmpeg bitstream filters registration: 0.00s
2023/05/12 08:57:55 [startup:3] Lilv plugins registration: 0.01s
2023/05/12 08:57:55 [startup:3] Frei0r plugin registration: 0.00s
2023/05/12 08:57:55 [startup:3] LADSPA plugins registration: 0.00s
2023/05/12 08:57:55 [startup:3] Typechecking: 3.46s
2023/05/12 08:57:55 [startup:3] Evaluation: 0.01s
2023/05/12 08:57:55 [startup:3] Typechecking: 0.02s
2023/05/12 08:57:55 [startup:3] Evaluation: 0.00s
2023/05/12 08:57:55 [startup:3] Typechecking: 0.29s
2023/05/12 08:57:55 [startup:3] Evaluation: 0.09s
2023/05/12 08:57:55 [startup:3] Loaded /home/user/radio/source/liquidsoap/radio.liq: 0.38s
2023/05/12 08:57:55 [video.converter:3] Using preferred video converter: ffmpeg.
2023/05/12 08:57:55 [audio.converter:3] Using samplerate converter: libsamplerate.
2023/05/12 08:57:55 [harbor:3] Adding handler for 'GET ^/skip$' on port 8765
2023/05/12 08:57:55 [output_srt_radio1:3] Content type is {audio=ffmpeg.copy}.
2023/05/12 08:57:55 [rawpcm_stream:3] Content type is {audio=ffmpeg.copy}.
2023/05/12 08:57:55 [audio.producer_0:3] Content type is {audio=ffmpeg.copy}.
2023/05/12 08:57:55 [audio.consumer_0:3] Content type is {audio=pcm(stereo)}.
2023/05/12 08:57:55 [on_frame_0:3] Content type is {audio=pcm(stereo)}.
2023/05/12 08:57:55 [radio_stream_blank_skipper:3] Content type is {audio=pcm(stereo)}.
2023/05/12 08:57:55 [radio_stream_audio_to_stereo:3] Content type is {audio=pcm(stereo)}.
2023/05/12 08:57:55 [playlist_mix_blank_eater:3] Content type is {audio=pcm(stereo)}.
2023/05/12 08:57:55 [on_track_0:3] Content type is {audio=pcm(stereo)}.
2023/05/12 08:57:55 [radio_ambient:3] Content type is {audio=pcm(stereo)}.
2023/05/12 08:57:55 [radio_chillout:3] Content type is {audio=pcm(stereo)}.
2023/05/12 08:57:55 [radio_dnb:3] Content type is {audio=pcm(stereo)}.
2023/05/12 08:57:55 [radio_dub:3] Content type is {audio=pcm(stereo)}.
2023/05/12 08:57:55 [radio_dubstep:3] Content type is {audio=pcm(stereo)}.
2023/05/12 08:57:55 [radio_electro:3] Content type is {audio=pcm(stereo)}.
2023/05/12 08:57:55 [radio_futurepop:3] Content type is {audio=pcm(stereo)}.
2023/05/12 08:57:55 [radio_idm:3] Content type is {audio=pcm(stereo)}.
2023/05/12 08:57:55 [radio_nightcity:3] Content type is {audio=pcm(stereo)}.
2023/05/12 08:57:55 [radio_synthwave:3] Content type is {audio=pcm(stereo)}.
2023/05/12 08:57:55 [stereo_0:3] Content type is {audio=pcm(stereo)}.
2023/05/12 08:57:55 [security_single:3] "/home/user/default.wav" is static, resolving once for all...
2023/05/12 08:57:55 [decoder.ffmpeg:3] Requested content-type for "/home/user/default.wav": {audio=pcm(stereo)}
2023/05/12 08:57:55 [decoder.ffmpeg:3] FFmpeg recognizes "/home/user/default.wav" as audio: {codec: pcm_s16le, 44100Hz, 2 channel(s)}
2023/05/12 08:57:55 [decoder.ffmpeg:3] Decoded content-type for "/home/user/default.wav": {audio=pcm(stereo)}
2023/05/12 08:57:55 [security_single:3] Prepared "/home/user/default.wav" (RID 10).
2023/05/12 08:57:55 [output_srt_radio2:3] Content type is {audio=ffmpeg.copy}.
2023/05/12 08:57:55 [clock.main:3] Streaming loop starts in auto-sync mode
2023/05/12 08:57:55 [clock.main:3] Delegating synchronisation to CPU clock
2023/05/12 08:57:55 [output_srt_radio2:3] Connecting to srt://server2.com:1111..
2023/05/12 08:57:55 [output_srt_radio1:3] Connecting to srt://server1.com:1111..
2023/05/12 08:57:55 [switch_2:3] Switch to security_single.
2023/05/12 08:57:55 [lang:3] calling apply_metadata
2023/05/12 08:57:55 [lang:3] query for metadata server: artist=Gandalf&album=Between+Earth+%26+Sky&title=Just+a+Heartbeat+Away
2023/05/12 08:57:55 [lang:3] icy for icecast metadata: Gandalf+-+Just+a+Heartbeat+Away
2023/05/12 08:57:55 [output_srt_radio1:3] Client connected!
2023/05/12 08:57:55 [video.text:3] Using sdl implementation
2023/05/12 08:57:55 [output_srt_radio2:3] Client connected!
2023/05/12 08:57:55 [decoder.ffmpeg:3] Requested content-type for "/home/user/Musique/Clubroot/2009 - Clubroot/Clubroot - 03 - High Strung.flac": {audio=pcm(stereo)}
2023/05/12 08:57:55 [decoder.ffmpeg:3] FFmpeg recognizes "/home/user/Musique/Clubroot/2009 - Clubroot/Clubroot - 03 - High Strung.flac" as audio: {codec: flac, 44100Hz, 2 channel(s)}
2023/05/12 08:57:55 [decoder.ffmpeg:3] Decoded content-type for "/home/user/Musique/Clubroot/2009 - Clubroot/Clubroot - 03 - High Strung.flac": {audio=pcm(stereo)}
2023/05/12 08:57:55 [decoder.ffmpeg:3] Requested content-type for "/home/user/Musique/woodrowgerber/Liquid Data/01-night flight-Woodrowgerber.flac": {audio=pcm(stereo)}
2023/05/12 08:57:55 [decoder.ffmpeg:3] FFmpeg recognizes "/home/user/Musique/woodrowgerber/Liquid Data/01-night flight-Woodrowgerber.flac" as video: {codec: mjpeg, 300x300, yuvj444p}, audio: {codec: flac, 44100Hz, 2 channel(s)}
2023/05/12 08:57:55 [decoder.ffmpeg:3] Decoded content-type for "/home/user/Musique/woodrowgerber/Liquid Data/01-night flight-Woodrowgerber.flac": {audio=pcm(stereo)}
2023/05/12 08:57:56 [decoder.ffmpeg:3] Requested content-type for "/srv/dev-disk-by-label-mercure/nashome2/Music/DnB/Blackout Music/[BLCKTNL106] VA - Lifecycle - Rebirth [2021]/02. Phace - Lewk.flac": {audio=pcm(stereo)}
2023/05/12 08:57:56 [decoder.ffmpeg:3] FFmpeg recognizes "/srv/dev-disk-by-label-mercure/nashome2/Music/DnB/Blackout Music/[BLCKTNL106] VA - Lifecycle - Rebirth [2021]/02. Phace - Lewk.flac" as video: {codec: mjpeg, 500x500, yuvj420p}, audio: {codec: flac, 44100Hz, 2 channel(s)}
2023/05/12 08:57:56 [decoder.ffmpeg:3] Decoded content-type for "/srv/dev-disk-by-label-mercure/nashome2/Music/DnB/Blackout Music/[BLCKTNL106] VA - Lifecycle - Rebirth [2021]/02. Phace - Lewk.flac": {audio=pcm(stereo)}
2023/05/12 08:57:56 [decoder.ffmpeg:3] Requested content-type for "/home/user/Musique/Phaeleh/2011 - The Cold in You/06 - From a Distance.flac": {audio=pcm(stereo)}
2023/05/12 08:57:56 [decoder.ffmpeg:3] FFmpeg recognizes "/home/user/Musique/Phaeleh/2011 - The Cold in You/06 - From a Distance.flac" as audio: {codec: flac, 44100Hz, 2 channel(s)}
2023/05/12 08:57:56 [decoder.ffmpeg:3] Decoded content-type for "/home/user/Musique/Phaeleh/2011 - The Cold in You/06 - From a Distance.flac": {audio=pcm(stereo)}
2023/05/12 08:57:56 [decoder.ffmpeg:3] Requested content-type for "/home/user/Musique/Blackmill/Reach for Glory/05 In the Night of Wilderness.flac": {audio=pcm(stereo)}
2023/05/12 08:57:56 [decoder.ffmpeg:3] FFmpeg recognizes "/home/user/Musique/Blackmill/Reach for Glory/05 In the Night of Wilderness.flac" as video: {codec: mjpeg, 500x500, yuvj420p}, audio: {codec: flac, 44100Hz, 2 channel(s)}
2023/05/12 08:57:56 [decoder.ffmpeg:3] Decoded content-type for "/home/user/Musique/Blackmill/Reach for Glory/05 In the Night of Wilderness.flac": {audio=pcm(stereo)}
2023/05/12 08:57:56 [decoder.ffmpeg:3] Requested content-type for "/home/user/Musique/Synthwave/Orax/2017 - Deeper/07 - Out of Nowhere.flac": {audio=pcm(stereo)}
2023/05/12 08:57:56 [decoder.ffmpeg:3] FFmpeg recognizes "/home/user/Musique/Synthwave/Orax/2017 - Deeper/07 - Out of Nowhere.flac" as audio: {codec: flac, 44100Hz, 2 channel(s)}
2023/05/12 08:57:56 [decoder.ffmpeg:3] Decoded content-type for "/home/user/Musique/Synthwave/Orax/2017 - Deeper/07 - Out of Nowhere.flac": {audio=pcm(stereo)}
2023/05/12 08:57:56 [decoder.ffmpeg:3] Requested content-type for "/home/user/Musique/mind.in.a.box/2017 - Broken Legacies/14 Command_ Decode.flac": {audio=pcm(stereo)}
2023/05/12 08:57:56 [decoder.ffmpeg:3] FFmpeg recognizes "/home/user/Musique/mind.in.a.box/2017 - Broken Legacies/14 Command_ Decode.flac" as video: {codec: mjpeg, 500x500, yuvj420p}, audio: {codec: flac, 44100Hz, 2 channel(s)}
2023/05/12 08:57:56 [decoder.ffmpeg:3] Decoded content-type for "/home/user/Musique/mind.in.a.box/2017 - Broken Legacies/14 Command_ Decode.flac": {audio=pcm(stereo)}
2023/05/12 08:57:56 [decoder.ffmpeg:3] Requested content-type for "/srv/dev-disk-by-label-mercure/nashome2/Music/IDM/Aphex Twin/as Aphex Twin/Albums/(2001) Drukqs/202 Btoum-Roumada.flac": {audio=pcm(stereo)}
2023/05/12 08:57:56 [decoder.ffmpeg:3] FFmpeg recognizes "/srv/dev-disk-by-label-mercure/nashome2/Music/IDM/Aphex Twin/as Aphex Twin/Albums/(2001) Drukqs/202 Btoum-Roumada.flac" as audio: {codec: flac, 44100Hz, 2 channel(s)}
2023/05/12 08:57:56 [decoder.ffmpeg:3] Decoded content-type for "/srv/dev-disk-by-label-mercure/nashome2/Music/IDM/Aphex Twin/as Aphex Twin/Albums/(2001) Drukqs/202 Btoum-Roumada.flac": {audio=pcm(stereo)}
2023/05/12 08:57:56 [decoder.ffmpeg:3] Requested content-type for "/home/user/Musique/Synthwave/The 80's Dream Compilation Tape/Vol. 3 [2015]/10. AIRGLOW - S.A.M..flac": {audio=pcm(stereo)}
2023/05/12 08:57:56 [decoder.ffmpeg:3] FFmpeg recognizes "/home/user/Musique/Synthwave/The 80's Dream Compilation Tape/Vol. 3 [2015]/10. AIRGLOW - S.A.M..flac" as video: {codec: mjpeg, 400x400, yuvj420p}, audio: {codec: flac, 44100Hz, 2 channel(s)}
2023/05/12 08:57:56 [decoder.ffmpeg:3] Requested content-type for "/home/user/Musique/Cyberpunk 2077/Cyberpunk 2077 More Music from Night City Radio [FLAC]/47. Gr4ves (feat. Johnny Gr4ves).flac": {audio=pcm(stereo)}
2023/05/12 08:57:56 [decoder.ffmpeg:3] Decoded content-type for "/home/user/Musique/Synthwave/The 80's Dream Compilation Tape/Vol. 3 [2015]/10. AIRGLOW - S.A.M..flac": {audio=pcm(stereo)}
2023/05/12 08:57:56 [decoder.ffmpeg:3] FFmpeg recognizes "/home/user/Musique/Cyberpunk 2077/Cyberpunk 2077 More Music from Night City Radio [FLAC]/47. Gr4ves (feat. Johnny Gr4ves).flac" as video: {codec: mjpeg, 1400x1400, yuvj420p}, audio: {codec: flac, 44100Hz, 2 channel(s)}
2023/05/12 08:57:56 [decoder.ffmpeg:3] Decoded content-type for "/home/user/Musique/Cyberpunk 2077/Cyberpunk 2077 More Music from Night City Radio [FLAC]/47. Gr4ves (feat. Johnny Gr4ves).flac": {audio=pcm(stereo)}
2023/05/12 08:57:58 [radio_ambient:3] Prepared "/home/user/Musique/Clubroot/2009 - Clubroot/Clubroot - 03 - High Strung.flac" (RID 12).
2023/05/12 08:57:58 [radio_chillout:3] Prepared "/home/user/Musique/woodrowgerber/Liquid Data/01-night flight-Woodrowgerber.flac" (RID 11).
2023/05/12 08:57:58 [radio_dnb:3] Prepared "/srv/dev-disk-by-label-mercure/nashome2/Music/DnB/Blackout Music/[BLCKTNL106] VA - Lifecycle - Rebirth [2021]/02. Phace - Lewk.flac" (RID 13).
2023/05/12 08:57:58 [radio_dub:3] Prepared "/home/user/Musique/Phaeleh/2011 - The Cold in You/06 - From a Distance.flac" (RID 14).
2023/05/12 08:57:58 [radio_dubstep:3] Prepared "/home/user/Musique/Blackmill/Reach for Glory/05 In the Night of Wilderness.flac" (RID 15).
2023/05/12 08:57:58 [radio_electro:3] Prepared "/home/user/Musique/Synthwave/Orax/2017 - Deeper/07 - Out of Nowhere.flac" (RID 16).
2023/05/12 08:57:58 [radio_futurepop:3] Prepared "/home/user/Musique/mind.in.a.box/2017 - Broken Legacies/14 Command_ Decode.flac" (RID 17).
2023/05/12 08:57:58 [radio_idm:3] Prepared "/srv/dev-disk-by-label-mercure/nashome2/Music/IDM/Aphex Twin/as Aphex Twin/Albums/(2001) Drukqs/202 Btoum-Roumada.flac" (RID 18).
2023/05/12 08:57:58 [radio_nightcity:3] Prepared "/home/user/Musique/Cyberpunk 2077/Cyberpunk 2077 More Music from Night City Radio [FLAC]/47. Gr4ves (feat. Johnny Gr4ves).flac" (RID 19).
2023/05/12 08:57:58 [radio_synthwave:3] Prepared "/home/user/Musique/Synthwave/The 80's Dream Compilation Tape/Vol. 3 [2015]/10. AIRGLOW - S.A.M..flac" (RID 20).
2023/05/12 08:57:58 [switch_2:3] Switch to radio_stream_blank_skipper with transition.
2023/05/12 08:57:58 [playlist_mix:3] Switch to on_track_0.
2023/05/12 08:57:58 [switch_0:3] Switch to radio_synthwave.
2023/05/12 08:57:58 [lang:3] calling apply_metadata
2023/05/12 08:57:58 [lang:3] query for metadata server: artist=AIRGLOW&album=The+80%27s+Dream+Compilation+Tape+-+Vol.+3&title=S.A.M.
2023/05/12 08:57:58 [lang:3] icy for icecast metadata: AIRGLOW+-+S.A.M.
2023/05/12 08:57:58 [decoder.ffmpeg:3] Requested content-type for "/srv/dev-disk-by-label-mercure/nashome2/Music/Synthwave/The Midnight - Heroes (2022) [FLAC]/06 - Heart Worth Breaking.flac": {audio=pcm(stereo)}
2023/05/12 08:57:58 [decoder.ffmpeg:3] FFmpeg recognizes "/srv/dev-disk-by-label-mercure/nashome2/Music/Synthwave/The Midnight - Heroes (2022) [FLAC]/06 - Heart Worth Breaking.flac" as audio: {codec: flac, 44100Hz, 2 channel(s)}
2023/05/12 08:57:58 [decoder.ffmpeg:3] Decoded content-type for "/srv/dev-disk-by-label-mercure/nashome2/Music/Synthwave/The Midnight - Heroes (2022) [FLAC]/06 - Heart Worth Breaking.flac": {audio=pcm(stereo)}
2023/05/12 08:58:01 [output_srt_radio1:2] Error while sending client data: Error(Einvsock,Operation not supported: Invalid socket ID)
2023/05/12 08:58:01 [output_srt_radio1:4] Raised at Srt.check_err in file "src/srt.ml", line 75, characters 10-36
2023/05/12 08:58:01 [output_srt_radio1:4] Called from Srt_io.output_base#send_chunk.send in file "src/core/io/srt_io.ml", line 903, characters 27-61
2023/05/12 08:58:01 [output_srt_radio1:4] Called from Srt_io.output_base#send_chunk.f in file "src/core/io/srt_io.ml", line 914, characters 12-24
2023/05/12 08:58:01 [output_srt_radio1:4] 
2023/05/12 08:58:01 [output_srt_radio2:2] Error while sending client data: Error(Einvsock,Operation not supported: Invalid socket ID)
2023/05/12 08:58:01 [output_srt_radio2:4] Raised at Srt.check_err in file "src/srt.ml", line 75, characters 10-36
2023/05/12 08:58:01 [output_srt_radio2:4] Called from Srt_io.output_base#send_chunk.send in file "src/core/io/srt_io.ml", line 903, characters 27-61
2023/05/12 08:58:01 [output_srt_radio2:4] Called from Srt_io.output_base#send_chunk.f in file "src/core/io/srt_io.ml", line 914, characters 12-24
2023/05/12 08:58:01 [output_srt_radio2:4] 
2023/05/12 08:58:01 [clock.main:2] We must catchup 5.72 seconds!
2023/05/12 08:58:01 [output_srt_radio2:3] Connecting to srt://server2.com:1111..
2023/05/12 08:58:01 [output_srt_radio1:3] Connecting to srt://server1.com:1111..
2023/05/12 08:58:03 [output_srt_radio2:3] Client connected!
2023/05/12 08:58:04 [output_srt_radio1:3] Connect failed: Error(Enoserver,Connection setup failure: connection time out)
2023/05/12 08:58:04 [clock.main:2] We must catchup 8.68 seconds!
2023/05/12 08:58:06 [output_srt_radio1:3] Connecting to srt://server1.com:1111..
2023/05/12 08:58:07 [output_srt_radio1:3] Client connected!
2023/05/12 08:58:07 [clock.main:2] We must catchup 1.17 seconds!
2023/05/12 08:58:07 [output_srt_radio2:2] Error while sending client data: Error(Econnlost,Connection was broken)
2023/05/12 08:58:07 [output_srt_radio2:3] Connecting to srt://server2.com:1111..
2023/05/12 08:58:07 [output_srt_radio2:3] Client connected!

On the receiver side I have a lot of these errors:

  1. On stdout:
...
Error while executing OCaml read callback: Srt.Error(-1013981956, "Non-blocking call failure: transmission timed out")
Error while executing OCaml read callback: Srt.Error(-1013981956, "Non-blocking call failure: transmission timed out")
Error while executing OCaml read callback: Srt.Error(-1013981956, "Non-blocking call failure: transmission timed out")
Error while executing OCaml read callback: Srt.Error(-1013981956, "Non-blocking call failure: transmission timed out")
Error while executing OCaml read callback: Srt.Error(-1013981956, "Non-blocking call failure: transmission timed out")
...
  1. In the log:
2023/05/12 08:58:06 >>> LOG START
2023/05/12 08:58:03 [main:3] Liquidsoap 2.2.0+git@02da14b41
2023/05/12 08:58:03 [main:3] Using: alsa=0.3.0 angstrom=0.15.0 ao=0.2.4 asetmap=0.8.1 astring=0.8.5 base.caml=v0.15.1 base64=3.5.1 bigarray=[distributed with OCaml] bigarray-compat=1.1.0 bigstringaf=0.9.1 bjack=0.1.6 bytes=[distributed with OCaml] camlimages.all_formats=4.2.6 camlimages.core=5.0.4 camlimages.exif=5.0.4 camlimages.gif=5.0.4 camlimages.jpeg=5.0.4 camlimages.png=5.0.4 camlimages.tiff=5.0.4 camlimages.xpm=5.0.4 camlp-streams camomile=d3773ec camomile.lib=d3773ec cohttp=5.1.0 cohttp-lwt=5.1.0 cohttp-lwt-unix=5.1.0 conduit=6.2.0 conduit-lwt=6.2.0 conduit-lwt-unix=6.2.0 cry=1.0.0 ctypes=0.20.2 ctypes.foreign=0.20.2 ctypes.stubs=0.20.2 curl=0.9.2 domain-name=0.4.0 dssi=0.1.5 dtools=0.4.5 dune-build-info=3.7.1 dune-private-libs.dune-section=3.7.1 dune-site=3.7.1 dune-site.private=3.7.1 duppy=0.9.3 faad=0.5.2 fdkaac=0.3.3 ffmpeg-av=1.1.8 ffmpeg-avcodec=1.1.8 ffmpeg-avdevice=1.1.8 ffmpeg-avfilter=1.1.8 ffmpeg-avutil=1.1.8 ffmpeg-swresample=1.1.8 ffmpeg-swscale=1.1.8 fileutils=0.6.4 flac=0.4.0 flac.decoder=0.4.0 flac.ogg=0.4.0 fmt=0.9.0 frei0r=0.1.2 gd=1.0a5 gen=1.1 inotify=2.4.1 integers ipaddr=5.5.0 ipaddr-sexp=5.5.0 ipaddr.unix=5.5.0 irc-client irc-client-unix ladspa=0.2.2 lame=0.3.7 lastfm=0.3.3 lilv=0.1.0 liquidsoap-lang=2.2.0 liquidsoap-lang.console=2.2.0 liquidsoap_alsa=rolling-release-v2.2.x-51-g02da14b-dirty liquidsoap_ao=rolling-release-v2.2.x-51-g02da14b-dirty liquidsoap_bjack=rolling-release-v2.2.x-51-g02da14b-dirty liquidsoap_builtins=rolling-release-v2.2.x-51-g02da14b-dirty liquidsoap_camlimages=rolling-release-v2.2.x-51-g02da14b-dirty liquidsoap_core=rolling-release-v2.2.x-51-g02da14b-dirty liquidsoap_dssi=rolling-release-v2.2.x-51-g02da14b-dirty liquidsoap_faad=rolling-release-v2.2.x-51-g02da14b-dirty liquidsoap_fdkaac=rolling-release-v2.2.x-51-g02da14b-dirty liquidsoap_ffmpeg=rolling-release-v2.2.x-51-g02da14b-dirty liquidsoap_flac=rolling-release-v2.2.x-51-g02da14b-dirty liquidsoap_frei0r=rolling-release-v2.2.x-51-g02da14b-dirty liquidsoap_gd=rolling-release-v2.2.x-51-g02da14b-dirty liquidsoap_irc=rolling-release-v2.2.x-51-g02da14b-dirty liquidsoap_ladspa=rolling-release-v2.2.x-51-g02da14b-dirty liquidsoap_lame=rolling-release-v2.2.x-51-g02da14b-dirty liquidsoap_lastfm=rolling-release-v2.2.x-51-g02da14b-dirty liquidsoap_lilv=rolling-release-v2.2.x-51-g02da14b-dirty liquidsoap_lo=rolling-release-v2.2.x-51-g02da14b-dirty liquidsoap_mad=rolling-release-v2.2.x-51-g02da14b-dirty liquidsoap_magic=rolling-release-v2.2.x-51-g02da14b-dirty liquidsoap_mem_usage=rolling-release-v2.2.x-51-g02da14b-dirty liquidsoap_memtrace=rolling-release-v2.2.x-51-g02da14b-dirty liquidsoap_ogg=rolling-release-v2.2.x-51-g02da14b-dirty liquidsoap_ogg_flac=rolling-release-v2.2.x-51-g02da14b-dirty liquidsoap_optionals=rolling-release-v2.2.x-51-g02da14b-dirty liquidsoap_opus=rolling-release-v2.2.x-51-g02da14b-dirty liquidsoap_osc=rolling-release-v2.2.x-51-g02da14b-dirty liquidsoap_oss=rolling-release-v2.2.x-51-g02da14b-dirty liquidsoap_portaudio=rolling-release-v2.2.x-51-g02da14b-dirty liquidsoap_posix_time=rolling-release-v2.2.x-51-g02da14b-dirty liquidsoap_prometheus=rolling-release-v2.2.x-51-g02da14b-dirty liquidsoap_pulseaudio=rolling-release-v2.2.x-51-g02da14b-dirty liquidsoap_runtime=rolling-release-v2.2.x-51-g02da14b-dirty liquidsoap_samplerate=rolling-release-v2.2.x-51-g02da14b-dirty liquidsoap_sdl=rolling-release-v2.2.x-51-g02da14b-dirty liquidsoap_shine=rolling-release-v2.2.x-51-g02da14b-dirty liquidsoap_soundtouch=rolling-release-v2.2.x-51-g02da14b-dirty liquidsoap_speex=rolling-release-v2.2.x-51-g02da14b-dirty liquidsoap_srt=rolling-release-v2.2.x-51-g02da14b-dirty liquidsoap_ssl=rolling-release-v2.2.x-51-g02da14b-dirty liquidsoap_stereotool=rolling-release-v2.2.x-51-g02da14b-dirty liquidsoap_taglib=rolling-release-v2.2.x-51-g02da14b-dirty liquidsoap_theora=rolling-release-v2.2.x-51-g02da14b-dirty liquidsoap_vorbis=rolling-release-v2.2.x-51-g02da14b-dirty liquidsoap_xmlplaylist=rolling-release-v2.2.x-51-g02da14b-dirty liquidsoap_yaml=rolling-release-v2.2.x-51-g02da14b-dirty lo=0.2.0 logs=0.7.0 logs.fmt=0.7.0 logs.lwt=0.7.0 lwt=5.6.1 lwt.unix=5.6.1 macaddr=5.5.0 mad=0.5.3 magic=0.7.3 magic-mime=1.3.0 mem_usage=0.0.4 memtrace=0.2.3 menhirLib=20220210 metadata=0.2.0 mm=0.8.3 mm.audio=0.8.3 mm.base=0.8.3 mm.image=0.8.3 mm.midi=0.8.3 mm.video=0.8.3 ocplib-endian ocplib-endian.bigstring ogg=0.7.4 ogg.decoder=0.7.4 opus=0.2.3 opus.decoder=0.2.3 osc osc-unix parsexp=v0.15.0 pcre=7.5.0 portaudio=0.2.3 posix-base=65ec333 posix-socket=65ec333 posix-socket.constants=65ec333 posix-socket.stubs=65ec333 posix-socket.types=65ec333 posix-time2=65ec333 posix-time2.constants=65ec333 posix-time2.stubs=65ec333 posix-time2.types=65ec333 posix-types=65ec333 posix-types.constants=65ec333 ppx_sexp_conv.runtime-lib=v0.15.0 prometheus=1.2 prometheus-app=1.2 pulseaudio=0.1.6 re=1.10.4 result=1.5 samplerate=0.1.6 sedlex=3.1 seq=[distributed with OCaml 4.07 or above] sexplib=v0.15.1 sexplib0=v0.15.0 shine=0.2.3 soundtouch=0.1.9 speex=0.4.2 speex.decoder=0.4.2 srt=0.3.0 srt.constants=0.3.0 srt.stubs=0.3.0 srt.stubs.locked=0.3.0 srt.types=0.3.0 ssl=0.5.13 stdlib-shims=0.3.0 stereotool=rolling-release-v2.2.x-51-g02da14b-dirty str=[distributed with OCaml] stringext=1.6.0 taglib=0.3.10 theora=0.4.1 theora.decoder=0.4.1 threads=[distributed with OCaml] threads.posix=[distributed with OCaml] tsdl=v1.0.0 tsdl-image=0.5 tsdl-ttf=0.5 unix=[distributed with OCaml] unix-errno=0.6.2 unix-errno.errno_bindings=0.6.2 unix-errno.errno_types=0.6.2 unix-errno.errno_types_detected=0.6.2 unix-errno.unix=0.6.2 uri=4.2.0 uri-sexp=4.2.0 uri.services=4.2.0 vorbis=0.8.1 vorbis.decoder=0.8.1 xmlm=1.4.0 xmlplaylist=0.1.5 yaml=3.1.0 yaml.bindings=3.1.0 yaml.bindings.types=3.1.0 yaml.c=3.1.0 yaml.ffi=3.1.0 yaml.types=3.1.0
2023/05/12 08:58:03 [clock:3] Using native (high-precision) implementation for latency control
2023/05/12 08:58:06 [main:3] Standard library loaded in 3.16 seconds.
2023/05/12 08:58:06 [frame:4] frame.audio.samplerate set to: 44100
2023/05/12 08:58:06 [frame:4] frame.video.framerate set to: 25
2023/05/12 08:58:06 [frame:4] frame.audio.channels set to: 2
2023/05/12 08:58:06 [frame:4] frame.video.default set to: false
2023/05/12 08:58:06 [frame:4] frame.midi.channels set to: 0
2023/05/12 08:58:06 [frame:4] frame.video.width set to: 1280
2023/05/12 08:58:06 [frame:4] frame.video.height set to: 720
2023/05/12 08:58:06 [frame:4] frame.audio.samplerate set to: 44100
2023/05/12 08:58:06 [frame:3] Using 44100Hz audio, 25Hz video, 44100Hz main.
2023/05/12 08:58:06 [frame:3] Video frame size set to: 1280x720
2023/05/12 08:58:06 [frame:3] Frame size must be a multiple of 1764 ticks = 1764 audio samples = 1 video samples.
2023/05/12 08:58:06 [frame:3] Targeting 'frame.duration': 0.04s = 1764 audio samples = 1764 ticks.
2023/05/12 08:58:06 [frame:3] Frames last 0.04s = 1764 audio samples = 1 video samples = 1764 ticks.
2023/05/12 08:58:06 [sandbox:3] Sandboxing disabled
2023/05/12 08:58:06 [startup:3] DSSI plugins registration: 0.00s
2023/05/12 08:58:06 [startup:3] FFmpeg filters registration: 0.01s
2023/05/12 08:58:06 [startup:3] FFmpeg bitstream filters registration: 0.00s
2023/05/12 08:58:06 [startup:3] Lilv plugins registration: 0.00s
2023/05/12 08:58:06 [startup:3] Frei0r plugin registration: 0.00s
2023/05/12 08:58:06 [startup:3] LADSPA plugins registration: 0.00s
2023/05/12 08:58:06 [startup:3] Typechecking: 3.05s
2023/05/12 08:58:06 [startup:3] Evaluation: 0.01s
2023/05/12 08:58:06 [startup:3] Typechecking: 0.01s
2023/05/12 08:58:06 [startup:3] Evaluation: 0.00s
2023/05/12 08:58:06 [startup:3] Typechecking: 0.00s
2023/05/12 08:58:06 [startup:3] Evaluation: 0.00s
2023/05/12 08:58:06 [startup:3] Loaded radio.liq: 0.01s
2023/05/12 08:58:06 [video.converter:3] Using preferred video converter: ffmpeg.
2023/05/12 08:58:06 [audio.converter:3] Using samplerate converter: libsamplerate.
2023/05/12 08:58:06 [clock:4] Currently 1 clock(s) allocated.
2023/05/12 08:58:06 [clock.input.srt:4] Starting 5 source(s)...
2023/05/12 08:58:06 [source:4] Source input_srt_master_stream gets up with content type: {audio=pcm(stereo)}.
2023/05/12 08:58:06 [input_srt_master_stream:4] Setting up socket to listen at 0.0.0.0:17770
2023/05/12 08:58:06 [source:4] Source output_icecast_ogg gets up with content type: {audio=pcm(stereo)}.
2023/05/12 08:58:06 [output_icecast_ogg:3] Content type is {audio=pcm(stereo)}.
2023/05/12 08:58:06 [source:4] Source radio_mksafe_ogg gets up with content type: {audio=pcm(stereo)}.
2023/05/12 08:58:06 [source:4] Source radio_mix_blank_ogg gets up with content type: {audio=pcm(stereo)}.
2023/05/12 08:58:06 [radio_mix_blank_ogg:3] Content type is {audio=pcm(stereo)}.
2023/05/12 08:58:06 [source:4] Source radio_mix_blank_ogg gets up with content type: {audio=pcm(stereo)}.
2023/05/12 08:58:06 [radio_mix_blank_ogg:3] Content type is {audio=pcm(stereo)}.
2023/05/12 08:58:06 [source:4] Source radio_blank_ogg gets up with content type: {audio=pcm(stereo)}.
2023/05/12 08:58:06 [radio_blank_ogg:3] Content type is {audio=pcm(stereo)}.
2023/05/12 08:58:06 [source:4] Source on_frame_0 gets up with content type: {audio=pcm(stereo)}.
2023/05/12 08:58:06 [on_frame_0:3] Content type is {audio=pcm(stereo)}.
2023/05/12 08:58:06 [source:4] Source switch_0 gets up with content type: {audio=pcm(stereo)}.
2023/05/12 08:58:06 [source:4] Source input_srt_audio_to_stereo gets up with content type: {audio=pcm(stereo)}.
2023/05/12 08:58:06 [input_srt_audio_to_stereo:3] Content type is {audio=pcm(stereo)}.
2023/05/12 08:58:06 [source:4] Source stereo_0 gets up with content type: {audio=pcm(stereo)}.
2023/05/12 08:58:06 [stereo_0:3] Content type is {audio=pcm(stereo)}.
2023/05/12 08:58:06 [source:4] Source security_single gets up with content type: {audio=pcm(stereo)}.
2023/05/12 08:58:06 [security_single:3] "/home/user/default.wav" is static, resolving once for all...
2023/05/12 08:58:06 [decoder.mad:4] Unsupported file extension for "/home/user/default.wav"!
2023/05/12 08:58:06 [decoder.mad:4] Unsupported MIME type for "/home/user/default.wav": audio/x-wav!
2023/05/12 08:58:06 [decoder.ogg:4] Unsupported file extension for "/home/user/default.wav"!
2023/05/12 08:58:06 [decoder.ogg:4] Unsupported MIME type for "/home/user/default.wav": audio/x-wav!
2023/05/12 08:58:06 [decoder.flac:4] Unsupported file extension for "/home/user/default.wav"!
2023/05/12 08:58:06 [decoder.flac:4] Unsupported MIME type for "/home/user/default.wav": audio/x-wav!
2023/05/12 08:58:06 [decoder.mp4:4] Unsupported file extension for "/home/user/default.wav"!
2023/05/12 08:58:06 [decoder.mp4:4] Unsupported MIME type for "/home/user/default.wav": audio/x-wav!
2023/05/12 08:58:06 [decoder.aac:4] Unsupported file extension for "/home/user/default.wav"!
2023/05/12 08:58:06 [decoder.aac:4] Unsupported MIME type for "/home/user/default.wav": audio/x-wav!
2023/05/12 08:58:06 [decoder.srt:4] Unsupported file extension for "/home/user/default.wav"!
2023/05/12 08:58:06 [decoder.srt:4] Unsupported MIME type for "/home/user/default.wav": audio/x-wav!
2023/05/12 08:58:06 [decoder.aiff:4] Unsupported file extension for "/home/user/default.wav"!
2023/05/12 08:58:06 [decoder.aiff:4] Unsupported MIME type for "/home/user/default.wav": audio/x-wav!
2023/05/12 08:58:06 [decoder:4] Available decoders: ffmpeg (priority: 10), image (priority: 1), wav (priority: 1)
2023/05/12 08:58:06 [decoder:4] Trying decoder "ffmpeg"
2023/05/12 08:58:06 [decoder.ffmpeg:3] Requested content-type for "/home/user/default.wav": {audio=pcm(stereo)}
2023/05/12 08:58:06 [decoder.ffmpeg:3] FFmpeg recognizes "/home/user/default.wav" as audio: {codec: pcm_s16le, 44100Hz, 2 channel(s)}
2023/05/12 08:58:06 [decoder.ffmpeg:3] Decoded content-type for "/home/user/default.wav": {audio=pcm(stereo)}
2023/05/12 08:58:06 [decoder:4] Selected decoder ffmpeg for file "/home/user/default.wav" with expected kind {audio=pcm(stereo)} and detected content {audio=pcm(stereo)}
2023/05/12 08:58:06 [decoder.video.metadata:4] Unsupported file extension for "/home/user/default.wav"!
2023/05/12 08:58:06 [decoder.video.metadata:4] Unsupported MIME type for "/home/user/default.wav": audio/x-wav!
2023/05/12 08:58:06 [decoder.ogg.metadata:4] Unsupported file extension for "/home/user/default.wav"!
2023/05/12 08:58:06 [decoder.ogg.metadata:4] Unsupported MIME type for "/home/user/default.wav": audio/x-wav!
2023/05/12 08:58:06 [decoder.image.metadata:4] Unsupported file extension for "/home/user/default.wav"!
2023/05/12 08:58:06 [decoder.image.metadata:4] Unsupported MIME type for "/home/user/default.wav": audio/x-wav!
2023/05/12 08:58:06 [decoder.flac.metadata:4] Unsupported file extension for "/home/user/default.wav"!
2023/05/12 08:58:06 [decoder.flac.metadata:4] Unsupported MIME type for "/home/user/default.wav": audio/x-wav!
2023/05/12 08:58:06 [metadata.mp4:4] Unsupported file extension for "/home/user/default.wav"!
2023/05/12 08:58:06 [metadata.mp4:4] Unsupported MIME type for "/home/user/default.wav": audio/x-wav!
2023/05/12 08:58:06 [metadata.flac:4] Unsupported file extension for "/home/user/default.wav"!
2023/05/12 08:58:06 [metadata.flac:4] Unsupported MIME type for "/home/user/default.wav": audio/x-wav!
2023/05/12 08:58:06 [decoder.ogg:4] Unsupported file extension for "/home/user/default.wav"!
2023/05/12 08:58:06 [decoder.ogg:4] Unsupported MIME type for "/home/user/default.wav": audio/x-wav!
2023/05/12 08:58:06 [decoder.taglib:4] Unsupported MIME type for "/home/user/default.wav": audio/x-wav!
2023/05/12 08:58:06 [source:4] Source safe_blank gets up with content type: {audio=pcm(stereo)}.
2023/05/12 08:58:06 [safe_blank:3] Content type is {audio=pcm(stereo)}.
2023/05/12 08:58:06 [source:4] Source output_icecast_opus gets up with content type: {audio=pcm(stereo)}.
2023/05/12 08:58:06 [output_icecast_opus:3] Content type is {audio=pcm(stereo)}.
2023/05/12 08:58:06 [source:4] Source radio_mksafe_opus gets up with content type: {audio=pcm(stereo)}.
2023/05/12 08:58:06 [source:4] Source radio_mix_blank_opus gets up with content type: {audio=pcm(stereo)}.
2023/05/12 08:58:06 [radio_mix_blank_opus:3] Content type is {audio=pcm(stereo)}.
2023/05/12 08:58:06 [source:4] Source radio_mix_blank_opus gets up with content type: {audio=pcm(stereo)}.
2023/05/12 08:58:06 [radio_mix_blank_opus:3] Content type is {audio=pcm(stereo)}.
2023/05/12 08:58:06 [source:4] Source radio_blank_opus gets up with content type: {audio=pcm(stereo)}.
2023/05/12 08:58:06 [radio_blank_opus:3] Content type is {audio=pcm(stereo)}.
2023/05/12 08:58:06 [source:4] Source safe_blank gets up with content type: {audio=pcm(stereo)}.
2023/05/12 08:58:06 [safe_blank:3] Content type is {audio=pcm(stereo)}.
2023/05/12 08:58:06 [source:4] Source output_icecast_mp3 gets up with content type: {audio=pcm(stereo)}.
2023/05/12 08:58:06 [output_icecast_mp3:3] Content type is {audio=pcm(stereo)}.
2023/05/12 08:58:06 [source:4] Source radio_mksafe_mp3 gets up with content type: {audio=pcm(stereo)}.
2023/05/12 08:58:06 [source:4] Source radio_mix_blank_mp3 gets up with content type: {audio=pcm(stereo)}.
2023/05/12 08:58:06 [radio_mix_blank_mp3:3] Content type is {audio=pcm(stereo)}.
2023/05/12 08:58:06 [source:4] Source radio_mix_blank_mp3 gets up with content type: {audio=pcm(stereo)}.
2023/05/12 08:58:06 [radio_mix_blank_mp3:3] Content type is {audio=pcm(stereo)}.
2023/05/12 08:58:06 [source:4] Source radio_blank_mp3 gets up with content type: {audio=pcm(stereo)}.
2023/05/12 08:58:06 [radio_blank_mp3:3] Content type is {audio=pcm(stereo)}.
2023/05/12 08:58:06 [source:4] Source safe_blank gets up with content type: {audio=pcm(stereo)}.
2023/05/12 08:58:06 [safe_blank:3] Content type is {audio=pcm(stereo)}.
2023/05/12 08:58:06 [source:4] Source output_icecast_flac gets up with content type: {audio=pcm(stereo)}.
2023/05/12 08:58:06 [output_icecast_flac:3] Content type is {audio=pcm(stereo)}.
2023/05/12 08:58:06 [source:4] Source radio_mksafe_flac gets up with content type: {audio=pcm(stereo)}.
2023/05/12 08:58:06 [source:4] Source radio_mix_blank_flac gets up with content type: {audio=pcm(stereo)}.
2023/05/12 08:58:06 [radio_mix_blank_flac:3] Content type is {audio=pcm(stereo)}.
2023/05/12 08:58:06 [source:4] Source radio_mix_blank_flac gets up with content type: {audio=pcm(stereo)}.
2023/05/12 08:58:06 [radio_mix_blank_flac:3] Content type is {audio=pcm(stereo)}.
2023/05/12 08:58:06 [source:4] Source radio_blank_flac gets up with content type: {audio=pcm(stereo)}.
2023/05/12 08:58:06 [radio_blank_flac:3] Content type is {audio=pcm(stereo)}.
2023/05/12 08:58:06 [source:4] Source safe_blank gets up with content type: {audio=pcm(stereo)}.
2023/05/12 08:58:06 [safe_blank:3] Content type is {audio=pcm(stereo)}.
2023/05/12 08:58:06 [threads:4] Created thread "clock_input.srt" (1 total).
2023/05/12 08:58:06 [clock:4] Main phase starts.
2023/05/12 08:58:06 [threads:4] Created thread "generic queue #1" (1 total).
2023/05/12 08:58:06 [threads:4] Created thread "generic queue #2" (2 total).
2023/05/12 08:58:06 [threads:4] Created thread "non-blocking queue #1" (3 total).
2023/05/12 08:58:06 [threads:4] Created thread "non-blocking queue #2" (4 total).
2023/05/12 08:58:06 [clock.input.srt:3] Streaming loop starts in auto-sync mode
2023/05/12 08:58:06 [clock.input.srt:3] Delegating synchronisation to CPU clock
2023/05/12 08:58:06 [video.text:3] Using sdl implementation
2023/05/12 08:58:06 [radio_mksafe_ogg:3] Switch to radio_mix_blank_ogg.
2023/05/12 08:58:06 [security_single:3] Prepared "/home/user/default.wav" (RID 0).
2023/05/12 08:58:06 [switch_0:3] Switch to security_single.
2023/05/12 08:58:06 [output_icecast_ogg:3] Connecting mount /stream.ogg for source@localhost...
2023/05/12 08:58:06 [output_icecast_ogg:3] Connection setup was successful.
2023/05/12 08:58:06 [radio_mksafe_opus:3] Switch to radio_mix_blank_opus.
2023/05/12 08:58:06 [output_icecast_opus:3] Connecting mount /stream.opus for source@localhost...
2023/05/12 08:58:06 [output_icecast_opus:3] Connection setup was successful.
2023/05/12 08:58:06 [radio_mksafe_mp3:3] Switch to radio_mix_blank_mp3.
2023/05/12 08:58:06 [output_icecast_mp3:3] Connecting mount /stream.mp3 for source@localhost...
2023/05/12 08:58:06 [output_icecast_mp3:3] Connection setup was successful.
2023/05/12 08:58:06 [radio_mksafe_flac:3] Switch to radio_mix_blank_flac.
2023/05/12 08:58:06 [output_icecast_flac:3] Connecting mount /stream.flac for source@localhost...
2023/05/12 08:58:06 [output_icecast_flac:3] Connection setup was successful.
2023/05/12 08:58:07 [input_srt_master_stream:4] New connection from 1.2.3.4:5678
2023/05/12 08:58:07 [switch_0:3] Switch to input_srt_audio_to_stereo with transition.
2023/05/12 08:58:07 [security_single:4] Finished with "/home/user/default.wav".
2023/05/12 08:58:07 [decoder:4] Available decoders:
2023/05/12 08:58:07 [decoder:4] ffmpeg (priority: 10)
2023/05/12 08:58:07 [decoder:4] Selected decoder ffmpeg for mime-type application/ffmpeg;format=s16le,channels=2,sample_rate=48000 with expected content {audio=pcm(stereo)}
2023/05/12 08:58:07 [clock.input.srt:3] Delegating synchronisation to active sources
2023/05/12 09:02:50 [input_srt_master_stream:2] Feeding failed: Avutil.Error(Generic error in an external library)
2023/05/12 09:02:50 [input_srt_master_stream:4] Raised by primitive operation at Av.read_input in file "av/av.ml", line 220, characters 2-31
2023/05/12 09:02:50 [input_srt_master_stream:4] Called from Ffmpeg_decoder.mk_decoder.(fun).f in file "src/core/decoder/ffmpeg_decoder.ml", line 726, characters 10-99
2023/05/12 09:02:50 [input_srt_master_stream:4] Re-raised at Ffmpeg_decoder.mk_decoder.(fun).f in file "src/core/decoder/ffmpeg_decoder.ml", line 767, characters 12-48
2023/05/12 09:02:50 [input_srt_master_stream:4] Called from Srt_io.input_base#get_frame in file "src/core/io/srt_io.ml", line 727, characters 10-39
2023/05/12 09:02:50 [input_srt_master_stream:4]
2023/05/12 09:02:50 [switch_0:3] Switch to security_single with forgetful transition.
2023/05/12 09:02:50 [source:4] Source replay_metadata_0 gets up with content type: {audio=pcm(stereo)}.
2023/05/12 09:02:50 [replay_metadata_0:3] Content type is {audio=pcm(stereo)}.
2023/05/12 09:02:50 [security_single:3] Prepared "/home/user/default.wav" (RID 0).
2023/05/12 09:02:50 [clock.input.srt:3] Delegating synchronisation to CPU clock
2023/05/12 09:02:52 [input_srt_master_stream:4] New connection from 1.2.3.4:5679
2023/05/12 09:02:52 [switch_0:3] Switch to input_srt_audio_to_stereo with transition.
2023/05/12 09:02:52 [source:4] Source replay_metadata_0 gets down.
2023/05/12 09:02:52 [security_single:4] Finished with "/home/user/default.wav".
2023/05/12 09:02:52 [decoder:4] Available decoders:
2023/05/12 09:02:52 [decoder:4] ffmpeg (priority: 10)
2023/05/12 09:02:52 [decoder:4] Selected decoder ffmpeg for mime-type application/ffmpeg;format=s16le,channels=2,sample_rate=48000 with expected content {audio=pcm(stereo)}
2023/05/12 09:02:52 [clock.input.srt:3] Delegating synchronisation to active sources
toots commented 1 year ago

To echo the chat response: you should send metadata processing to a asynchronous queue like this:

radio.on_metadata(fun (m) -> thread.run({apply_metadata(m)}))

Otherwise, this can delay the main streaming thread, causing disconnections on each track.

gabsoftware commented 1 year ago

All seems good now after that execute-on-another-thread fix. I'll report if I have further issues. Thank you so much for all of your help! As for the original segfault issue, I'm not sure if it's resolved or not in the latest rolling release but I use input.srt now so I don't have it anymore. Maybe I'll have it again when I add a switch with an input.harbor for live mixes.

Moonbase59 commented 1 year ago

Lots to be learned here. Didn’t know about SRT streaming, and the thread.run() example is also great. @gabsoftware, thanks for sharing the details of your setup. I also have my music collection in a central place and plan to stream to relays outside my local network, so this is a great example.

May I suggest changing the title to something more meaningful, so we can more easily find this again?

toots commented 1 year ago

No further report so I suppose this can be closed now!