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

Error when leaving output pulse_out(liquidsoap:): File "source.ml", line 414, characters 10-16: Assertion failed! #539

Closed ghost closed 6 years ago

ghost commented 6 years ago

this works liquidsoap 'out(ladspa.noise_white(amplitude = 0.01))'

what is not working (if I change ladspa.noise_white per sine it works):

#!/home/user/.opam/system/bin/liquidsoap
set("log.file.path", "/tmp/liq.log")
msg = random(weights = [1, 2, 5],[single("say: hello"), sine(480.0, amplitude = 0.2, duration = 0.5), blank(duration = 1.0)])
signal = add([ladspa.noise_white(amplitude = 0.01),msg], normalize = true)
out(signal)

log

 $ liquidsoap -v scheduler.liq 
2018/03/30 13:20:38 >>> LOG START
2018/03/30 13:20:38 [main:3] Liquidsoap 1.3.3
2018/03/30 13:20:38 [main:3] Using: bytes=[distributed with OCaml 4.02 or above] pcre=7.2.3 dtools=0.3.4 duppy=0.7.0 duppy.syntax=0.7.0 cry=0.6.1 mm=0.3.1 ogg=0.5.2 vorbis=0.7.0 opus=0.1.2 mad=0.4.5 dynlink=[distributed with Ocaml] lame=0.3.3 samplerate=0.1.4 taglib=0.3.3 camomile=0.8.6 pulseaudio=0.1.3 ladspa=0.1.5
2018/03/30 13:20:38 [dynamic.loader:3] Could not find dynamic module for fdkaac encoder.
2018/03/30 13:20:38 [frame:3] Using 44100Hz audio, 25Hz video, 44100Hz master.
2018/03/30 13:20:38 [frame:3] Frame size must be a multiple of 1764 ticks = 1764 audio samples = 1 video samples.
2018/03/30 13:20:38 [frame:3] Targetting 'frame.duration': 0.04s = 1764 audio samples = 1764 ticks.
2018/03/30 13:20:38 [frame:3] Frames last 0.04s = 1764 audio samples = 1 video samples = 1764 ticks.
2018/03/30 13:20:38 [threads:3] Created thread "generic queue #1".
2018/03/30 13:20:38 [threads:3] Created thread "generic queue #2".
2018/03/30 13:20:38 [threads:3] Created thread "non-blocking queue #1".
2018/03/30 13:20:38 [threads:3] Created thread "non-blocking queue #2".
2018/03/30 13:20:38 [single_6073:3] "say: hello" is static, resolving once for all...
2018/03/30 13:20:39 [decoder.wav/aiff:3] WAV file "/tmp/liq-processc8f481.wav" has content type {audio=2;video=0;midi=0} but {audio=1;video=0;midi=0} was expected.
2018/03/30 13:20:39 [decoder:3] Unable to decode "/tmp/liq-processc8f481.wav" as {audio=1;video=0;midi=0}!
2018/03/30 13:20:39 [clock.wallclock_pulse:2] Error when starting pulse_out(liquidsoap:): Req_simple.Invalid_URI!
2018/03/30 13:20:39 [clock.wallclock_pulse:3] Raised at file "sources/req_simple.ml", line 37, characters 12-23
2018/03/30 13:20:39 [clock.wallclock_pulse:3] Called from file "source.ml", line 388, characters 6-29
2018/03/30 13:20:39 [clock.wallclock_pulse:3] Called from file "operators/switch.ml", line 105, characters 9-45
2018/03/30 13:20:39 [clock.wallclock_pulse:3] Called from file "list.ml", line 73, characters 12-15
2018/03/30 13:20:39 [clock.wallclock_pulse:3] Called from file "source.ml", line 388, characters 6-29
2018/03/30 13:20:39 [clock.wallclock_pulse:3] Called from file "list.ml", line 73, characters 12-15
2018/03/30 13:20:39 [clock.wallclock_pulse:3] Called from file "source.ml", line 388, characters 6-29
2018/03/30 13:20:39 [clock.wallclock_pulse:3] Called from file "operators/switch.ml", line 105, characters 9-45
2018/03/30 13:20:39 [clock.wallclock_pulse:3] Called from file "list.ml", line 73, characters 12-15
2018/03/30 13:20:39 [clock.wallclock_pulse:3] Called from file "source.ml", line 388, characters 6-29
2018/03/30 13:20:39 [clock.wallclock_pulse:3] Called from file "outputs/output.ml", line 130, characters 4-51
2018/03/30 13:20:39 [clock.wallclock_pulse:3] Called from file "source.ml", line 388, characters 6-29
2018/03/30 13:20:39 [clock.wallclock_pulse:3] Called from file "clock.ml", line 221, characters 15-40
2018/03/30 13:20:39 [pulse_out(liquidsoap:):1] Got ill-balanced activations (from pulse_out(liquidsoap:))!
2018/03/30 13:20:39 [clock:2] Error when leaving output pulse_out(liquidsoap:): File "source.ml", line 414, characters 10-16: Assertion failed!
2018/03/30 13:20:39 [clock:3] Raised at file "source.ml", line 414, characters 10-22
2018/03/30 13:20:39 [clock:3] Called from file "source.ml", line 421, characters 30-58
2018/03/30 13:20:39 [clock:3] Called from file "clock.ml", line 79, characters 6-25
2018/03/30 13:20:39 [main:3] Shutdown started!
2018/03/30 13:20:39 [main:3] Waiting for threads to terminate...
2018/03/30 13:20:39 [main:3] Threads terminated.
2018/03/30 13:20:39 [threads:3] Shutting down scheduler...
2018/03/30 13:20:39 [threads:3] Scheduler shut down.
2018/03/30 13:20:39 [threads:3] Thread "generic queue #1" terminated.
2018/03/30 13:20:39 [main:3] Cleaning downloaded files...
2018/03/30 13:20:39 [main:3] Freeing memory...
2018/03/30 13:20:39 >>> LOG END

EDIT: with --debug

liquidsoap -v --debug scheduler.liq 
2018/03/30 13:25:06 >>> LOG START
2018/03/30 13:25:06 [main:3] Liquidsoap 1.3.3
2018/03/30 13:25:06 [main:3] Using: bytes=[distributed with OCaml 4.02 or above] pcre=7.2.3 dtools=0.3.4 duppy=0.7.0 duppy.syntax=0.7.0 cry=0.6.1 mm=0.3.1 ogg=0.5.2 vorbis=0.7.0 opus=0.1.2 mad=0.4.5 dynlink=[distributed with Ocaml] lame=0.3.3 samplerate=0.1.4 taglib=0.3.3 camomile=0.8.6 pulseaudio=0.1.3 ladspa=0.1.5
2018/03/30 13:25:06 [dynamic.loader:3] Could not find dynamic module for fdkaac encoder.
2018/03/30 13:25:06 [frame:3] Using 44100Hz audio, 25Hz video, 44100Hz master.
2018/03/30 13:25:06 [frame:3] Frame size must be a multiple of 1764 ticks = 1764 audio samples = 1 video samples.
2018/03/30 13:25:06 [frame:3] Targetting 'frame.duration': 0.04s = 1764 audio samples = 1764 ticks.
2018/03/30 13:25:06 [frame:3] Frames last 0.04s = 1764 audio samples = 1 video samples = 1764 ticks.
2018/03/30 13:25:06 [video.converter:4] Couldn't find preferred video converter: gavl.
2018/03/30 13:25:06 [audio.converter:4] Using preferred samplerate converter: libsamplerate.
2018/03/30 13:25:06 [threads:3] Created thread "generic queue #1".
2018/03/30 13:25:06 [threads:3] Created thread "generic queue #2".
2018/03/30 13:25:06 [threads:3] Created thread "non-blocking queue #1".
2018/03/30 13:25:06 [threads:3] Created thread "non-blocking queue #2".
2018/03/30 13:25:06 [clock:4] Currently 1 clocks allocated.
2018/03/30 13:25:06 [clock.wallclock_pulse:4] Starting 1 sources...
2018/03/30 13:25:06 [source:4] Source output.pulseaudio_6085 gets up.
2018/03/30 13:25:06 [source:4] Source mksafe gets up.
2018/03/30 13:25:06 [source:4] Source add_6081 gets up.
2018/03/30 13:25:06 [add_6081:4] Content kind is {audio=1;video=0;midi=0}.
2018/03/30 13:25:06 [source:4] Source ladspa_6080 gets up.
2018/03/30 13:25:06 [ladspa_6080:4] Content kind is {audio=1;video=0;midi=0}.
2018/03/30 13:25:06 [ladspa_6080:4] Activations changed: static=[add_6081:mksafe:pulse_out(liquidsoap:):pulse_out(liquidsoap:)], dynamic=[].
2018/03/30 13:25:06 [source:4] Source random_6078 gets up.
2018/03/30 13:25:06 [source:4] Source single_6073 gets up.
2018/03/30 13:25:06 [single_6073:3] "say: hello" is static, resolving once for all...
2018/03/30 13:25:06 [protocol.process:4] Processing wav,sox $(input) -c 2 $(output):text2wave: hello
2018/03/30 13:25:06 [protocol.process:4] Processing wav,echo " hello" | text2wave -scale 1.9 > $(output)
2018/03/30 13:25:06 [protocol.process:4] Executing echo " hello" | text2wave -scale 1.9 > "/tmp/liq-process363ea6.wav"
2018/03/30 13:25:06 [lang.run_process:4] Starting process
2018/03/30 13:25:06 [lang.run_process:4] Closing process's stdin
2018/03/30 13:25:06 [lang.run_process:4] Process exited
2018/03/30 13:25:06 [lang.run_process:4] Cleaning up process
2018/03/30 13:25:06 [protocol.process:4] Executing sox "/tmp/liq-process363ea6.wav" -c 2 "/tmp/liq-processe0d2dc.wav"
2018/03/30 13:25:06 [lang.run_process:4] Starting process
2018/03/30 13:25:06 [lang.run_process:4] Closing process's stdin
2018/03/30 13:25:06 [lang.run_process:4] Process exited
2018/03/30 13:25:06 [lang.run_process:4] Cleaning up process
2018/03/30 13:25:06 [decoder:4] Trying method "META" for "/tmp/liq-processe0d2dc.wav"...
2018/03/30 13:25:06 [decoder:4] Trying method "WAV" for "/tmp/liq-processe0d2dc.wav"...
2018/03/30 13:25:06 [decoder.wav/aiff:4] "/tmp/liq-processe0d2dc.wav" recognized as WAV file (s16le,16000Hz,2 channels).
2018/03/30 13:25:06 [decoder.wav/aiff:3] WAV file "/tmp/liq-processe0d2dc.wav" has content type {audio=2;video=0;midi=0} but {audio=1;video=0;midi=0} was expected.
2018/03/30 13:25:06 [decoder:4] Trying method "AIFF" for "/tmp/liq-processe0d2dc.wav"...
2018/03/30 13:25:06 [decoder.wav/aiff:4] Invalid file extension for "/tmp/liq-processe0d2dc.wav"!
2018/03/30 13:25:06 [decoder:4] Trying method "MIDI" for "/tmp/liq-processe0d2dc.wav"...
2018/03/30 13:25:06 [decoder:4] Trying method "IMAGE" for "/tmp/liq-processe0d2dc.wav"...
2018/03/30 13:25:06 [decoder:4] Trying method "OGG" for "/tmp/liq-processe0d2dc.wav"...
2018/03/30 13:25:06 [decoder.ogg:4] Invalid file extension for "/tmp/liq-processe0d2dc.wav"!
2018/03/30 13:25:06 [decoder:4] Trying method "MAD" for "/tmp/liq-processe0d2dc.wav"...
2018/03/30 13:25:06 [decoder.mad:4] Invalid file extension for "/tmp/liq-processe0d2dc.wav"!
2018/03/30 13:25:06 [decoder:3] Unable to decode "/tmp/liq-processe0d2dc.wav" as {audio=1;video=0;midi=0}!
2018/03/30 13:25:06 [clock.wallclock_pulse:2] Error when starting pulse_out(liquidsoap:): Req_simple.Invalid_URI!
2018/03/30 13:25:06 [clock.wallclock_pulse:3] Raised at file "sources/req_simple.ml", line 37, characters 12-23
2018/03/30 13:25:06 [clock.wallclock_pulse:3] Called from file "source.ml", line 388, characters 6-29
2018/03/30 13:25:06 [clock.wallclock_pulse:3] Called from file "operators/switch.ml", line 105, characters 9-45
2018/03/30 13:25:06 [clock.wallclock_pulse:3] Called from file "list.ml", line 73, characters 12-15
2018/03/30 13:25:06 [clock.wallclock_pulse:3] Called from file "source.ml", line 388, characters 6-29
2018/03/30 13:25:06 [clock.wallclock_pulse:3] Called from file "list.ml", line 73, characters 12-15
2018/03/30 13:25:06 [clock.wallclock_pulse:3] Called from file "source.ml", line 388, characters 6-29
2018/03/30 13:25:06 [clock.wallclock_pulse:3] Called from file "operators/switch.ml", line 105, characters 9-45
2018/03/30 13:25:06 [clock.wallclock_pulse:3] Called from file "list.ml", line 73, characters 12-15
2018/03/30 13:25:06 [clock.wallclock_pulse:3] Called from file "source.ml", line 388, characters 6-29
2018/03/30 13:25:06 [clock.wallclock_pulse:3] Called from file "outputs/output.ml", line 130, characters 4-51
2018/03/30 13:25:06 [clock.wallclock_pulse:3] Called from file "source.ml", line 388, characters 6-29
2018/03/30 13:25:06 [clock.wallclock_pulse:3] Called from file "clock.ml", line 221, characters 15-40
2018/03/30 13:25:06 [pulse_out(liquidsoap:):1] Got ill-balanced activations (from pulse_out(liquidsoap:))!
2018/03/30 13:25:06 [clock:2] Error when leaving output pulse_out(liquidsoap:): File "source.ml", line 414, characters 10-16: Assertion failed!
2018/03/30 13:25:06 [clock:3] Raised at file "source.ml", line 414, characters 10-22
2018/03/30 13:25:06 [clock:3] Called from file "source.ml", line 421, characters 30-58
2018/03/30 13:25:06 [clock:3] Called from file "clock.ml", line 79, characters 6-25
2018/03/30 13:25:06 [clock:4] Main phase starts.
2018/03/30 13:25:06 [main:3] Shutdown started!
2018/03/30 13:25:06 [main:3] Waiting for threads to terminate...
2018/03/30 13:25:06 [main:3] Threads terminated.
2018/03/30 13:25:06 [threads:3] Shutting down scheduler...
2018/03/30 13:25:06 [threads:3] Scheduler shut down.
2018/03/30 13:25:06 [threads:3] Thread "generic queue #1" terminated.
2018/03/30 13:25:06 [main:3] Cleaning downloaded files...
2018/03/30 13:25:06 [main:3] Freeing memory...
2018/03/30 13:25:06 >>> LOG END
toots commented 6 years ago

Thanks for reporting this, will have a look at it.

toots commented 6 years ago

Ok, sorry it's not a bug. The ladspa operator needs a mono source. You can convert the source to mono this way:

signal = add([ladspa.noise_white(amplitude = 0.01),mean(msg)], normalize = true)