fix(playout): when shows ends, next shows starts without fade-in/fade-out (#2412)

Tracks are not fading with the crossfade function which leads to hard cuts at the end of tracks and shows. Therefore the explicit fade functions are used.

In Liquidsoap version 1.4.3. crossfade is implemented as a cross with a custom transition (fade_in and fade_out).
9f730f2c5f/src/libs/fades.liq (L433-L436)

The "duration" argument is passed through to the cross function.
In the implementation of the cross operator the value duration is used to determine how log the crossfade should take.

It is set to the cross_lenght parameter

f075905715/src/operators/cross.ml (L30-L34)

This can be overwritten with metadata, but the current annotation does not include a "override_duration" field so in our case it is always 0.
f075905715/src/operators/cross.ml (L186-L198)

So I assume the crossfade is starting to fade.out the track but because the duration is set to 0. the "cross" is completed immediately and the next source of the queue is started. Our queues do only ever contain one track at a time so there is no next source to play.
The next queue is activated and the same happens for the fade.in.

Replacing the crossfade with a fade.in/out removes this time boundary as there is no longer a "cross" function involved.

Until the tag 3.0.0-alpha.8 there was a custom crossfade_airtime function.
In tag 3.0.0-alpha.9 it was replaced with the crossfade function but was unable to find why.
ecd302068c/python_apps/pypo/liquidsoap/1.4/ls_script.liq (LL76C9-L76C18)

Co-authored-by: Marvin <Marvin>
This commit is contained in:
Marvin 2023-03-02 20:20:09 +01:00 committed by GitHub
parent 59f0ed3335
commit d2f93f7c8a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 2 deletions

View File

@ -23,8 +23,11 @@ def create_source()
l = cue_cut(l)
l = amplify(1., override="replay_gain", l)
# the crossfade function controls fade in/out
l = crossfade(duration=0., smart=true, l)
# Fade the tracks to avoid hard cuts in between two tracks and at the end of the shows.
# Liquidsoap reads the fade in/out durations from the annotation "liq_fade_in/out" which
# value can be set via Libretime settings.
l = fade.in(l)
l = fade.out(l)
l = on_metadata(notify_queue, l)