Fading with live source in a switch #2203
Replies: 9 comments 2 replies
-
I found the same problem which seems to be related to the harbor buffer. Increasing the buffer to a greater value then the total crossfade duration seems to help the issue, though we're still having some sporadic reports of issues. For example setting buffer to 30s should be safe:
|
Beta Was this translation helpful? Give feedback.
-
Wow, it seems to solve it! Thanks! 30s makes the transition a bit long though, but at least it works. Do you know if it's a bug, or something which is inherent to how Another thing, do you know the difference between |
Beta Was this translation helpful? Give feedback.
-
So in my testing i found that the buffer just needs to be slightly more than the entire fade duration (duration + in + out). The fade.in and fade.out methods have a default duration of 3 seconds each and cross() has a default duration of 5 seconds. 5 + 3 + 3 = 11s so i'd suggest experimenting with 12s+ of a buffer. From my understanding, buffer is a minimum and max is a maximum that is held; not entirely sure what max would be used for but i'm guessing it just allows for relaxed garbage collection with an extended duration. Just spitballing here.
I have not tested but no reports of issue with 1.4.4 so i'd imagine this to be an introduced bug in 2.0. @toots ? |
Beta Was this translation helpful? Give feedback.
-
Thanks! What a magic formula! For me it worked with 11s but not with 10s :) |
Beta Was this translation helpful? Give feedback.
-
Well I'm actually surprised that this is working. The reason is that live source inputs like harbor needs to work in real time but crossfade do accelerate so they'll consume data at a higher rate. It is indeed possible to have crossfades but you need to know what you are doing, typically you need to buffer enough data (like y'all found out) and only buffer beginning and ending. I'll revisit this shortly, thanks for reporting. |
Beta Was this translation helpful? Give feedback.
-
Interesting. And what would be then the proposed way to fade out/in a (not live) source before/after a live source if not through a |
Beta Was this translation helpful? Give feedback.
-
I finally have time to revisit this and the code is actually correct. The sources that are prohibited in a crossfade are sources that cannot be accelerated, like So, yeah, this is all correct. In order to have crossfades with harbor inputs, one should make sure that the harbor buffer contains at least enough data for the transition in and out of a live show. This is because the I have changed the default values for Thanks for bringing this up! I'm converting this as a discussion so that it sticks around for other users who might need it. |
Beta Was this translation helpful? Give feedback.
-
@gammaw i am new in liquidsoap, so sorry for stupid question... i have this script: settings.harbor.bind_addrs.set(["0.0.0.0"])
default = mksafe(single("/radio/default.mp3"))
live = input.harbor("live-harbor",port=8080,password="hackme")
live_enabled = ref(live.is_active())
radio = switch(track_sensitive=false, [
({!live_enabled}, live),
({true}, default) ])
def fading_transition(a,b)
sequence([fade.out(a.source),fade.in(b.source)])
end
radio = cross(fading_transition, radio)
output.icecast(%mp3,
host="localhost",port=8080,password="hackme",
mount="live-harbor",radio) but i am getting error:
|
Beta Was this translation helpful? Give feedback.
-
Hi, I am having the same issue, although I tried extending buffer to 30 s, I also copied @toots example (with some tweaks) here, but in all cases I'm getting the same behaviour, when
Any ideas why this is happening? Is it an issue, or am I doing something wrong? I am running Liquidsoap 2.2.4-1+dev Thanks :) |
Beta Was this translation helpful? Give feedback.
-
Hi!
I'm trying to fade in and out across several sources including a live source. The sources are scheduled using a
switch
.Something like this:
The problem is that for some reason the
live
source and the defaultradio
source are switching back and forth, although the live source remains ready the whole time. Can anybody explain why is this happening?When I remove the cross operator (no fading) the switch behaves as expected but without transition.
Thanks!
Origin of the issue: #2123
Beta Was this translation helpful? Give feedback.
All reactions