savonet/liquidsoap

`2.3.0` - merged (add) sources fail.

gAlleb opened this issue · 1 comments

2.3.0. Not to forget.

While a guy on discord asked how to merge sources a new issue appeared. LS 2.3.0 crashes.

Reproduction:

music = playlist("/testmusic/playlist.pls")
liveatc = input.http("https://s1-bos.liveatc.net/khyi1?nocache=2024041002181693985")

let {
   audio=audio_1 
} = source.tracks(music)

let {
  audio = audio_2
} = source.tracks(liveatc)

mixed_audio = track.audio.add([audio_1, audio_2])

mixed_source = source({
  audio = mixed_audio
})

output.icecast(%mp3, host = "localhost", port = 8000, password = "**", mount = "test", mksafe(mixed_source))

or this

music = playlist("/testmusic/playlist.pls")
liveatc = input.http("https://s1-bos.liveatc.net/khyi1?nocache=2024041002181693985")

mixed_audio = add([music, liveatc])

output(mksafe(mixed_audio))

Happens almost on every output.

Icecast:

2024/04/17 22:18:51 [threads:3] Thread "Clock generic" aborts with exception Lang.Runtime_error { kind: "source", msg: "Clock generic has multiple synchronization sources!", pos: [at /Users/stev/.opam/default/share/liquidsoap-lang/libs/icecast.liq, line 51 char 2 - line 53 char 3] }!
Thread 2 killed on uncaught exception Liquidsoap_lang.Runtime_error.Runtime_error(_)
Raised at Liquidsoap_lang__Runtime_error.raise in file "src/lang/runtime_error.ml", line 48, characters 14-21
Called from Clock._self_sync in file "src/core/clock.ml", line 336, characters 4-223
Called from Clock._after_tick in file "src/core/clock.ml", line 361, characters 17-36
Called from Liquidsoap_lang__Evaluation.after_eval.fn in file "src/lang/evaluation.ml", line 570, characters 14-19
Re-raised at Liquidsoap_lang__Evaluation.after_eval.(fun) in file "src/lang/evaluation.ml", line 590, characters 12-48
Called from Clock._clock_thread.run in file "src/core/clock.ml", line 446, characters 8-22
Called from Clock._clock_thread.run in file "src/core/clock.ml", line 447, characters 8-14

Soundcard:

2024/04/18 00:15:13 [threads:3] Thread "Clock generic" aborts with exception Lang.Runtime_error { kind: "source", msg: "Clock generic has multiple synchronization sources!", pos: [at /Users/stev/.opam/default/share/liquidsoap-lang/libs/io.liq, line 39 char 2 - line 41 char 3] }!
Thread 2 killed on uncaught exception Liquidsoap_lang.Runtime_error.Runtime_error(_)
Raised at Liquidsoap_lang__Runtime_error.raise in file "src/lang/runtime_error.ml", line 48, characters 14-21
Called from Clock._self_sync in file "src/core/clock.ml", line 336, characters 4-223
Called from Clock._after_tick in file "src/core/clock.ml", line 361, characters 17-36
Called from Liquidsoap_lang__Evaluation.after_eval.fn in file "src/lang/evaluation.ml", line 570, characters 14-19
Re-raised at Liquidsoap_lang__Evaluation.after_eval.(fun) in file "src/lang/evaluation.ml", line 590, characters 12-48
Called from Clock._clock_thread.run in file "src/core/clock.ml", line 446, characters 8-22
...

Thanks, @toots!