System out audio not working, breaks stream

Hi all - I’m having trouble getting the system audio outputs working (3.0.0, Ubuntu 20.4, desktop)

When I set system output to ‘true’, and reload the config file, I’m not getting audio from the system outputs, and the ‘listen’ option from the web dashboard stops working as well. There seem to be some errors in the liquidsoap log (pasted below) but not sure where to go from here. Thanks in advance for any insight!

system:
      - # Whether the output is enabled.
        # > default is false
        enabled: true
        # System output kind.
        # > must be one of (alsa, ao, oss, portaudio, pulseaudio)
        # > default is alsa
        kind: alsa


-------------


2022/10/25 12:42:51 >>> LOG START
2022/10/25 12:42:51 [main:3] Liquidsoap 1.4.2
2022/10/25 12:42:51 [main:3] Using: bytes=[distributed with OCaml 4.02 or above] pcre=[unspecified] sedlex=2.1 menhirLib=20200123 dtools=0.4.1 duppy=0.8.0 cry=0.6.4 mm=0.5.0 xmlplaylist=0.1.3 lastfm=0.3.2 ogg=0.5.2 vorbis=0.7.1 opus=0.1.3 speex=0.2.1 mad=0.4.4 flac=0.1.5 flac.ogg=0.1.5 dynlink=[distributed with Ocaml] lame=0.3.2 shine=0.2.0 gstreamer=0.3.0 frei0r=0.1.0 theora=0.3.1 gavl=0.1.5 ffmpeg=0.4.1 bjack=0.1.4 alsa=0.2.3 ao=0.2.0 samplerate=0.1.2 taglib=0.3.1 ssl=0.5.9 magic=0.7.3 camomile=[unspecified] yojson=[unspecified] faad=0.4.0 soundtouch=0.1.7 portaudio=0.2.1 pulseaudio=0.1.2 ladspa=0.1.4 sdl=0.9.1 camlimages=4.2.0 lo=0.1.2 gd=1.0a5
2022/10/25 12:42:51 [gstreamer.loader:3] Loaded GStreamer 1.16.3 0
2022/10/25 12:42:51 [dynamic.loader:3] Could not find dynamic module for fdkaac encoder.
2022/10/25 12:42:51 [frame:3] Using 44100Hz audio, 25Hz video, 44100Hz master.
2022/10/25 12:42:51 [frame:3] Frame size must be a multiple of 1764 ticks = 1764 audio samples = 1 video samples.
2022/10/25 12:42:51 [frame:3] Targetting 'frame.duration': 0.04s = 1764 audio samples = 1764 ticks.
2022/10/25 12:42:51 [frame:3] Frames last 0.04s = 1764 audio samples = 1 video samples = 1764 ticks.
2022/10/25 12:42:51 [lang:3] alsa
2022/10/25 12:42:51 [lang:3] timeout --signal=KILL 45 libretime-playout-notify started &
2022/10/25 12:42:51 [sandbox:3] Sandboxing disabled
2022/10/25 12:42:51 [video.converter:3] Using preferred video converter: gavl.
2022/10/25 12:42:51 [audio.converter:3] Using samplerate converter: ffmpeg.
2022/10/25 12:42:51 [harbor:3] Adding mountpoint '/main' on port 8001
2022/10/25 12:42:51 [harbor:3] Adding mountpoint '/show' on port 8002
2022/10/25 12:42:51 [clock.wallclock_pulse:2] Error when starting output pulse_out(liquidsoap:): Pulseaudio error: Connection refused!
2022/10/25 12:42:51 [clock.wallclock_pulse:3] Raised by primitive operation at file "pulseaudio.ml" (inlined), line 47, characters 6-67
2022/10/25 12:42:51 [clock.wallclock_pulse:3] Called from file "io/pulseaudio_io.ml", line 82, characters 10-120
2022/10/25 12:42:51 [clock.wallclock_pulse:3] Called from file "tools/start_stop.ml", line 108, characters 8-18
2022/10/25 12:42:51 [clock.wallclock_pulse:3] Called from file "clock.ml", line 245, characters 20-38
2022/10/25 12:42:51 [KGNU:3] Connecting mount main for source@localhost...
2022/10/25 12:42:51 [KGNU:3] Connection setup was successful.
2022/10/25 12:42:51 [lang:3] timeout --signal=KILL 45 libretime-playout-notify stream '1' '1666723371.54' &
2022/10/25 12:42:51 [clock.wallclock_pulse:3] Streaming loop starts, synchronized by active sources.
2022/10/25 12:42:51 [main:3] Shutdown started!
2022/10/25 12:42:51 [main:3] Waiting for main threads to terminate...
2022/10/25 12:42:51 [KGNU:3] Closing connection...
2022/10/25 12:42:51 [lang:3] timeout --signal=KILL 45 libretime-playout-notify live 'live_dj' 'false' &
2022/10/25 12:42:51 [harbor:3] Removing mountpoint '/show' on port 8002
2022/10/25 12:42:51 [harbor:3] Nothing more on port 8002: closing sockets.
2022/10/25 12:42:51 [lang:3] timeout --signal=KILL 45 libretime-playout-notify live 'master_dj' 'false' &
2022/10/25 12:42:51 [harbor:3] Removing mountpoint '/main' on port 8001
2022/10/25 12:42:51 [harbor:3] Nothing more on port 8001: closing sockets.
2022/10/25 12:42:51 [clock.wallclock_pulse:3] Streaming loop stopped.
2022-10-25 12:42:51.890 | INFO     | libretime_playout.notify.main:stream:92 - Sending output stream '1' status 'OK'
2022-10-25 12:42:51.901 | INFO     | libretime_playout.notify.main:live:73 - Sending currently playing live source 'live_dj' status 'false'
2022-10-25 12:42:51.903 | INFO     | libretime_playout.notify.main:live:73 - Sending currently playing live source 'master_dj' status 'false'
2022/10/25 12:42:51 [server:3] New client: 127.0.0.1.
2022/10/25 12:42:51 [lang:3] vars.station_name
2022/10/25 12:42:51 [lang:3] vars.stream_metadata_type
2022/10/25 12:42:51 [lang:3] vars.off_air_meta
2022/10/25 12:42:51 [lang:3] vars.default_dj_fade
2022/10/25 12:42:51 [server:3] Client 127.0.0.1 disconnected.
2022/10/25 12:42:51 [server:3] New client: 127.0.0.1.
2022/10/25 12:42:51 [lang:3] streams.master_dj_stop
2022/10/25 12:42:51 [server:3] Client 127.0.0.1 disconnected.
2022/10/25 12:42:51 [server:3] New client: 127.0.0.1.
2022/10/25 12:42:51 [lang:3] streams.live_dj_stop
2022/10/25 12:42:51 [server:3] Client 127.0.0.1 disconnected.
2022/10/25 12:42:51 [server:3] New client: 127.0.0.1.
2022/10/25 12:42:51 [lang:3] streams.scheduled_play_start
2022/10/25 12:42:51 [server:3] Client 127.0.0.1 disconnected.
2022/10/25 12:42:51 [server:3] New client: 127.0.0.1.
2022/10/25 12:42:51 [lang:3] queues.s8_skip
2022/10/25 12:42:51 [lang:3] queues.s8_skip
2022/10/25 12:42:51 [lang:3] queues.s8_skip
2022/10/25 12:42:51 [lang:3] queues.s8_skip
2022/10/25 12:42:51 [lang:3] queues.s8_skip
2022/10/25 12:42:51 [server:3] Client 127.0.0.1 disconnected.
2022/10/25 12:42:51 [server:3] New client: 127.0.0.1.
2022/10/25 12:42:51 [lang:3] vars.show_name
2022/10/25 12:42:51 [server:3] Client 127.0.0.1 disconnected.
2022/10/25 12:42:51 [server:3] New client: 127.0.0.1.
2022/10/25 12:42:51 [lang:3] dynamic_source.get_id
2022/10/25 12:42:51 [server:3] Client 127.0.0.1 disconnected.

you ever get a fix for this? same issue here as well?

no luck, i tried a clean reinstall a couple of times, but ran out of time and had to move on…

having audio out’s pretty mission critical for our use case, so we’re still using an old release, where the audio out setting is on the admin page, not in a config file. not sure why this changed?

That’s a bummer to hear. I have spent about 40 hours trying to get this to work and no matter what I do it will not output audio or even connect to a stream. Had high hopes for libretime but I killed the server and have to move on myself. Maybe in the future they will figure this release out.

what version has the working Audio out? Worst case maybe I can pipe that audio to a working encoder like BUTT.

Hi,

If liquidsoap fails to setup any audio output, the entire app exits. The logs shows that liquidsoap fails while trying to configure the system output.

I recommend using pulseaudio instead of alsa, unless you really know what your are doing.

If liquidsoap is failing to setup the pusleaudio output (with 2022/10/25 12:42:51 [clock.wallclock_pulse:2] Error when starting output pulse_out(liquidsoap:): Pulseaudio error: Connection refused!), make sure that the libretime is part of the audio group (this is part of the installation documentation).
Check that pulseaudio is properly running, you can try to play audio from the command line interface, and search for some documentation online to help you debug pulseaudio issues.

Once you are able to play sound from the CLI, but not from liquidsoap you will have a better idea where the problem is.

Thank you - I’ll give this a try, hopefully soon!