New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(playout): when shows ends, next shows starts without fade-in/fade-out #2412
Conversation
Codecov Report
@@ Coverage Diff @@
## main #2412 +/- ##
=======================================
Coverage 58.60% 58.60%
=======================================
Files 146 146
Lines 4343 4343
=======================================
Hits 2545 2545
Misses 1798 1798
Flags with carried forward coverage won't be shown. Click here to find out more. Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
6e655b3
to
0fc60b3
Compare
Hey, it is amazing that you spend some time on fixing this! Thanks a lot! Ping me when this is ready for a proper review. I had a few small question though, did you manage to get it fixed ? Or are you still searching ? Did you consider that liquidsoap is supposed to read the fade in/out from the play request annotations ? libretime/playout/libretime_playout/player/liquidsoap_gateway.py Lines 11 to 40 in 32e0c2a
https://www.liquidsoap.info/doc-1.4.4/reference.html#fade.in |
In my test it did work after applying the patch. Is it not working for you?
Thanks, I didn't saw that. I will remove the "default_fade_in" and "default_fade_out". |
I didn't test yet, I was just curious about the reason why it was broken and why your changes fixed it.
Hmm, I like your changes about this default_fade_in, default fade out, could you keep them around ? We might want to keep them. But I have to think a bit more about whether it is a good idea. |
I do think it was broken because the "duration" for the crossfade was set to 0. I assume the "fade_in" and "fade_out" are supposed to happen during the crossfade "duration". libretime/playout/libretime_playout/liquidsoap/1.4/ls_script.liq Lines 25 to 28 in 32e0c2a
If you want to keep the "default_fade_in" and "default_fade_out" then I would say this PR is ready from my side :) |
The fade in/out does not happen on the same queue, this is why there are multiple queues Also, the fade between shows seemed to be working before (maybe in around the 3.0.0-alpha.* release) and I probably broken something, or a newer version of liquidsoap broke it. I am still trying to understand why we have multiple request queues. This part of the liquidsoap script was written 7/10 years ago, and I think liquidsoap didn't have all the feature for fading it had back then. So a lot of the timing management happens on the python side. |
…-out Tracks are not fadeing with the crossfade function which leads to hard cuts at the end of tracks and shows. Therefore the explicit fade functions are used
e259f41
to
076fa18
Compare
I did some more experiments and found that replacing the crossfade function with fade.in and fade.out did get the tracks to fade in/out. Could you please test it again? I tested it on a Debian11 VM with a fresh install of this branch and the fade did work for tracks in shows as for the end of shows. This is why I think the crossfade operator is not working here:In Liquidsoap version 1.4.3. crossfade is implemented as a cross with a custom transition (fade_in and fade_out). The "duration" argument is passed through to the cross function. It is set to the cross_lenght parameter 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. 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. 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. The crossfade_airtime function is basicly a reimplementation of the crossfade function, except that cross has no duration set, so it will use the default value (5.0).
Alternatively we could also extend the annotation to include the "liq_cross_duration", but as we are not crossfading in any case I do like it more to use the the explicit fade.out and fade.in functions. Maybe the "Crossfade duration" form from the settings page could be removed as it does not have any affect on the script. |
Nice digging! I think what you wrote above should be in the commit body, it is a gold mine for future miners (I'll add it while merging). I've tested the PR and it is working! We might be loosing some of the "smart" from the crossfade, but since we were using it wrong, I would keep your fix as it is, and rework the whole schedule queues system it in the future. The "Crossfade duration" is used, we must keep it. I think the legacy app is using it compute the cue_in/cue_out values which in the end has an impact on the crossfade/fade duration:
The problem is that the streaming code is spread between legacy (php code), the new api, the playout app and liquidsoap, and it's difficult to work with. I'm slowly working on improving this, but it takes time... I'll do some more testing, and let this PR sit for the day. |
The only missing part is that we don't have any crossing between shows, only fades. But that's unrelated and for another ticket. Thanks a lot for the patch. |
Thanks for The fix! @jooola Hello! |
There is no ETA yet, it should be released in 3.1.0. I want to ship some important changes in 3.1.0 so this will probably need some more time. |
Description
Liquidsoap did a harsh cut at the end of every show.
This MR fixes this an (re)enables settings for the crossfading by
Testing Notes
Created a VM, installed my Libretime branch, scheduled some shows to hear the fade at the end of the show.
I also run "make test" in the "playout" folder.
Links
Closes: #2070
https://discourse.libretime.org/t/how-to-fade-out-shows/700
https://discourse.libretime.org/t/no-fadestop-at-the-show-end/1412