-
-
Notifications
You must be signed in to change notification settings - Fork 146
Open
Labels
Description
Description
In 2.4.0, when I try to shutdown output.pulseaudio I get the following error and the liquidsoap script crashes
2025/10/31 18:14:03 [server:3] New client: 172.18.0.1.
2025/10/31 18:14:12 [clock:3] Starting top-level clock pulse-0 with sources: pulse-0 (output), opus-ebur (passive) and sync: auto
2025/10/31 18:14:12 [pulse-0:3] Content type is {audio=pcm(stereo)}.
2025/10/31 18:14:12 [opus-ebur:3] Content type is {audio=pcm(stereo)}.
2025/10/31 18:14:12 [opus-ebur:3] Initial load with URI /tracks.
2025/10/31 18:14:12 [opus-ebur:3] Prepared "/tracks/e36afb06145432371ed5ba74fcca299d-o8jskpalpk.opus" (RID 0).
2025/10/31 18:14:13 [clock.pulse-0:3] Switching to self-sync mode
Assertion 'pa_atomic_load(&(s)->_ref) >= 1' failed at ../src/pulse/stream.c:342, function pa_stream_get_state(). Aborting.
Assertion 'pthread_mutex_destroy(&m->mutex) == 0' failed at ../src/pulsecore/mutex-posix.c:85, function pa_mutex_free(). Aborting.
exited with code 139
My environment consist of Win11 with WSL2 and the script is running inside a docker container based on debian:trixie-slim on which I install the liquidsoap v2.4.0 via the release deb file.
The music plays correctly to show that the pulseaudio server exposed via TCP by wslg works as expected.
Steps to reproduce
Inspired from the docs for creating and deleting sources dynamically
settings.init.allow_root := true
settings.init.force_start := true
settings.server.telnet := true
settings.server.telnet.port := 1234
settings.server.telnet.bind_addr := "0.0.0.0"
# Replace the path here with a path to some video files:
s = playlist("/tracks")
streams = ref([])
count = ref(0)
def create_stream(url) =
if
list.assoc.mem(url, streams())
then
"Stream for url #{url} already exists!"
else
out = output.pulseaudio(id="pulse-#{count()}", fallible=true, s)
count := count() + 1
streams := [...streams(), (url, out.shutdown)]
"OK!"
end
end
def delete_stream(url) =
if
not list.assoc.mem(url, streams())
then
"Stream for url #{url} does not exists!"
else
shutdown = list.assoc(url, streams())
shutdown()
streams := list.filter((fun (el) -> fst(el) != url), streams())
"OK!"
end
end
server.register(
namespace="restream",
description=
"Redirect a stream.",
usage=
"start <url>",
"start",
create_stream
)
server.register(
namespace="restream",
description=
"Stop a dynamic playlist.",
usage=
"stop <url>",
"stop",
delete_stream
)
Expected behavior
output should shutdown without crashing the script
Log extracts
see in the description
Script extracts
see in steps to reproduce
Liquidsoap version
Liquidsoap 2.4.0
Copyright (c) 2003-2024 Savonet team
Liquidsoap is open-source software, released under GNU General Public License.
See <http://liquidsoap.info> for more information.
Liquidsoap build config
* Liquidsoap version : 2.4.0
* Compilation options
- Release build : true
- Git SHA : (none)
- OCaml version : 4.14.2
- OS type : Unix
- Libs versions : alsa=82b575f angstrom=0.16.1 ao=9b685f4 asetmap=0.8.1 asn1-combinators=0.3.2 astring=0.8.5 base=v0.16.4 base.base_internalhash_types=v0.16.4 base.caml=v0.16.4 base.shadow_stdlib=v0.16.4 base64=3.5.1 bigarray=[distributed with Ocaml] bigarray-compat=1.1.0 bigstringaf=0.10.0 bjack=84cb2d5 bos=0.2.1 bytes=[distributed with OCaml 4.02 or above] ca-certs=v1.0.1 camlp-streams camomile.lib=2.0 cohttp=v6.1.1 cohttp-lwt=v6.1.1 cohttp-lwt-unix=v6.1.1 conduit=8.0.0 conduit-lwt=8.0.0 conduit-lwt-unix=8.0.0 cron=v2.2.0-1217-ga0b4a16 cry=e6f8a26 cstruct=6.2.0 ctypes=0.23.0 ctypes-foreign=0.23.0 ctypes.stubs=0.23.0 curl=0.9.2 digestif.c=1.3.0 domain-name=0.4.1 dssi=9e75cbb dtools=v2.2.0-1217-ga0b4a16 dune-build-info=3.20.1 dune-private-libs.dune-section=3.20.1 dune-site=3.20.1 dune-site.private=3.20.1 duppy=v2.2.0-1217-ga0b4a16 eqaf=0.10 faad=95d7c39 fdkaac=59c1188 ffmpeg-av=f14edf7 ffmpeg-avcodec=f14edf7 ffmpeg-avdevice=f14edf7 ffmpeg-avfilter=f14edf7 ffmpeg-avutil=f14edf7 ffmpeg-swresample=f14edf7 ffmpeg-swscale=f14edf7 fileutils=v0.6.6 flac=315343e flac.decoder=315343e flac.ogg=315343e fmt=0.11.0 fpath=0.7.3 frei0r=d4846de gen=1.1 gmap=0.3.0 http=v6.1.1 http.__private__.http_bytebuffer=v6.1.1 inotify=v2.6 integers ipaddr=5.6.1 ipaddr-sexp=5.6.1 ipaddr.unix=5.6.1 irc-client irc-client-unix kdf.hkdf=1.0.0 kdf.pbkdf=1.0.0 ladspa=e8050d7 lame=d1f29e2 lilv=e863e12 liquidsoap-lang=2.4.0 liquidsoap-lang.console=2.4.0 liquidsoap-lang.stdlib=2.4.0 liquidsoap-lang.tooling=2.4.0 liquidsoap_alsa=v2.2.0-1217-ga0b4a16 liquidsoap_ao=v2.2.0-1217-ga0b4a16 liquidsoap_bjack=v2.2.0-1217-ga0b4a16 liquidsoap_builtins=v2.2.0-1217-ga0b4a16 liquidsoap_core=v2.2.0-1217-ga0b4a16 liquidsoap_dssi=v2.2.0-1217-ga0b4a16 liquidsoap_faad=v2.2.0-1217-ga0b4a16 liquidsoap_fdkaac=v2.2.0-1217-ga0b4a16 liquidsoap_ffmpeg=v2.2.0-1217-ga0b4a16 liquidsoap_flac=v2.2.0-1217-ga0b4a16 liquidsoap_frei0r=v2.2.0-1217-ga0b4a16 liquidsoap_irc=v2.2.0-1217-ga0b4a16 liquidsoap_ladspa=v2.2.0-1217-ga0b4a16 liquidsoap_lame=v2.2.0-1217-ga0b4a16 liquidsoap_lilv=v2.2.0-1217-ga0b4a16 liquidsoap_lo=v2.2.0-1217-ga0b4a16 liquidsoap_mad=v2.2.0-1217-ga0b4a16 liquidsoap_ndi=v2.2.0-1217-ga0b4a16 liquidsoap_ogg=v2.2.0-1217-ga0b4a16 liquidsoap_ogg_flac=v2.2.0-1217-ga0b4a16 liquidsoap_optionals=v2.2.0-1217-ga0b4a16 liquidsoap_opus=v2.2.0-1217-ga0b4a16 liquidsoap_osc=v2.2.0-1217-ga0b4a16 liquidsoap_oss=v2.2.0-1217-ga0b4a16 liquidsoap_portaudio=v2.2.0-1217-ga0b4a16 liquidsoap_posix_time=v2.2.0-1217-ga0b4a16 liquidsoap_prometheus=v2.2.0-1217-ga0b4a16 liquidsoap_pulseaudio=v2.2.0-1217-ga0b4a16 liquidsoap_runtime=v2.2.0-1217-ga0b4a16 liquidsoap_samplerate=v2.2.0-1217-ga0b4a16 liquidsoap_sdl=v2.2.0-1217-ga0b4a16 liquidsoap_sdl_log_level=v2.2.0-1217-ga0b4a16 liquidsoap_shine=v2.2.0-1217-ga0b4a16 liquidsoap_soundtouch=v2.2.0-1217-ga0b4a16 liquidsoap_speex=v2.2.0-1217-ga0b4a16 liquidsoap_sqlite=v2.2.0-1217-ga0b4a16 liquidsoap_srt=v2.2.0-1217-ga0b4a16 liquidsoap_ssl=v2.2.0-1217-ga0b4a16 liquidsoap_stereotool=v2.2.0-1217-ga0b4a16 liquidsoap_theora=v2.2.0-1217-ga0b4a16 liquidsoap_tls=v2.2.0-1217-ga0b4a16 liquidsoap_vorbis=v2.2.0-1217-ga0b4a16 liquidsoap_xmlplaylist=v2.2.0-1217-ga0b4a16 liquidsoap_yaml=v2.2.0-1217-ga0b4a16 lo=0b43bdf logs=0.9.0 logs.fmt=0.9.0 logs.lwt=0.9.0 lwt=5.9.2 lwt.unix=5.9.2 macaddr=5.6.1 mad=cdf09d9 magic-mime=1.3.1 mem_usage=9867712-dirty memtrace=0.2.3 menhirLib=20240715 metadata=2a416d3 mirage-crypto=2.0.2 mirage-crypto-ec=2.0.2 mirage-crypto-pk=2.0.2 mirage-crypto-rng=2.0.2 mirage-crypto-rng.unix=2.0.2 mm=8aff5bd mm.audio=8aff5bd mm.base=8aff5bd mm.image=8aff5bd mm.midi=8aff5bd mm.video=8aff5bd ndi=v2.2.0-1217-ga0b4a16 ocplib-endian ocplib-endian.bigstring ogg=315343e ogg.decoder=315343e ohex opus=315343e opus.decoder=315343e osc osc-unix portaudio=cb52caa posix-base=2.2.0 posix-socket=3.0.0 posix-socket.constants=3.0.0 posix-socket.stubs=3.0.0 posix-socket.types=3.0.0 posix-time2=2.2.0 posix-time2.constants=2.2.0 posix-time2.stubs=2.2.0 posix-time2.types=2.2.0 posix-types=2.2.0 posix-types.constants=2.2.0 ppx_compare.runtime-lib=v0.16.0 ppx_hash.runtime-lib=v0.16.0 ppx_sexp_conv.runtime-lib=v0.16.0 prometheus=1.2 prometheus-app=1.2 ptime=1.2.0 ptime.clock=1.2.0 ptime.clock.os=1.2.0 pulseaudio=d64fbad re result=1.5 rresult=0.7.0 samplerate=v0.1.6-8-g06a3a79 sedlex=3.6 seq=[distributed with OCaml 4.07 or above] sexplib0=v0.16.0 shine=8071973 soundtouch=7baf637 speex=315343e speex.decoder=315343e sqlite3=5.3.1 srt=dd4745a srt.constants=dd4745a srt.stubs=dd4745a srt.stubs.locked=dd4745a srt.types=dd4745a ssl=0.7.0 stdlib-shims=0.3.0 stereotool=v2.2.0-1217-ga0b4a16 str=[distributed with Ocaml] stringext=1.6.0 theora=315343e theora.decoder=315343e threads=[distributed with Ocaml] threads.posix=[internal] tls=2.0.2 tsdl=v1.1.0 tsdl-image=0.5 tsdl-ttf=0.6 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.4.0 uri-sexp=4.4.0 uri.services=4.4.0 vorbis=315343e vorbis.decoder=315343e x509=1.0.6 xml-light=2.5 xmlm=1.4.0 xmlplaylist=v2.2.0-1217-ga0b4a16 yaml=3.2.0 yaml.bindings=3.2.0 yaml.bindings.types=3.2.0 yaml.c=3.2.0 yaml.ffi=3.2.0 yaml.types=3.2.0 zarith=1.14
- architecture : amd64
- host : x86_64-pc-linux-gnu
- target : x86_64-pc-linux-gnu
- system : linux
- ocamlopt_cflags : -O2 -fno-strict-aliasing -fwrapv -pthread -fPIC
- native_c_compiler : gcc -O2 -fno-strict-aliasing -fwrapv -pthread -fPIC -D_FILE_OFFSET_BITS=64
- native_c_libraries : -lm
* Configured paths
- mode : posix
- standard library : /usr/share/liquidsoap/libs
- scripted binaries : /usr/share/liquidsoap/bin
- rundir : /var/run/liquidsoap
- logdir : /var/log/liquidsoap
- user cache : $HOME/.cache/liquidsoap (override with $LIQ_CACHE_USER_DIR)
- system cache : /var/cache/liquidsoap (override with $LIQ_CACHE_SYSTEM_DIR)
- camomile files : /usr/share/liquidsoap/camomile
* Supported input formats
- MP3 : yes
- AAC : yes
- Ffmpeg : yes
- Flac (native) : yes
- Flac (ogg) : yes
- Opus : yes
- Speex : yes
- Theora : yes
- Vorbis : yes
- WAV/AIFF : yes (native)
* Supported output formats
- FDK-AAC : yes
- FFmpeg : yes
- MP3 : yes
- MP3 (fixed-point) : yes
- Flac (native) : yes
- Flac (ogg) : yes
- Opus : yes
- Speex : yes
- Theora : yes
- Vorbis : yes
- WAV/AIFF : yes (native)
* Tags
- AAC : yes
- FFmpeg : yes
- FLAC (native) : yes
- Flac (ogg) : yes
- Native decoder : yes
- Vorbis : yes
* Input / output
- ALSA : yes
- AO : yes
- FFmpeg : yes
- JACK : yes
- NDI : yes
- OSS : yes
- Portaudio : yes
- Pulseaudio : yes
- SRT : yes
* Audio manipulation
- FFmpeg : yes
- LADSPA : yes
- Lilv : yes
- Samplerate : yes
- SoundTouch : yes
- StereoTool : yes
* Video manipulation
- camlimages : no (requires camlimages)
- FFmpeg : yes
- frei0r : yes
- SDL : yes
* MIDI manipulation
- DSSI : yes
* Visualization
- GD : no (requires gd)
- Graphics : no (requires graphics)
- SDL : yes
* Additional libraries
- FFmpeg filters : yes
- FFmpeg devices : yes
- inotify : yes
- irc : yes
- jemalloc : no (requires jemalloc)
- lo : yes
- memtrace : yes
- osc : yes
- ssl : yes
- sqlite3 : yes
- tls : yes
- posix-time2 : yes
- windows service : no (requires winsvc)
- YAML support : yes
- XML playlists : yes
* Monitoring
- Prometheus : yes
Installation method
From official packages in the release artifacts
Additional Info
No response