Hello Romain,
Yes of course. I'll paste my script below.
I did recently start breaking some of the long one-liners with many
brackets appart.
Hoping it would make it more understandable for others.
This also enabled me to more easily debug the script.
And I did find that indeed my problem does go away if I don't use the
"smart_crossfade" function. So with "smart_crossfade" off, as soon as
the Live Stream ends, the Standard Program kicks in with a new song.
But without further adue, here is my script as it is so far:
# Our functions
# When we go live, fade out old source and skipt old track, to
# have a new one ready when we come back home.
def GoLive(old,new) =
source.skip(old)
old = fade.final(old)
sequence([old,new])
end
# When live is off, simply play the new source (which should
# start with a fresh song).
def ComeHome(old,new) =
sequence([old,new])
end
# Create our "standard" music program.
# Our HUGE archive of playable music:
MusicCollection = playlist("/mnt/storage/radio/music/bigpile")
# Some favorite tracks to repeat more often
# So our listeners recognize us and /or are annoyed by us (not
# sure which)
HotList = playlist("/mnt/storage/radio/music/hotlist")
# Adding to our recognizability / annoyance
Jingles = playlist("/mnt/storage/radio/jingles")
# Mixing it all together
MusicalCarpet = random(weights = [1, 3], [HotList, MusicCollection])
RadioCarpet = random (weights = [1, 3], [Jingles, MusicalCarpet])
NormalizedCarpet= normalize(RadioCarpet)
NonSilentCarpet = eat_blank(at_beginning=false, threshold=-50.,
max_blank=0.4, NormalizedCarpet)
WovenCarpet = smart_crossfade(NonSilentCarpet)
# Et Voilà
StandardProgram = mksafe(WovenCarpet)
# Our Live source:
livestream = audio_to_stereo(input.harbor("rbpeval", port=8737,
password="xxxxxxxx"))
# Trying to distribute tasks amongst processor cores
clock.assign_new([livestream])
# trying to make up for volume problems
NormalizedLive = normalize(livestream)
# Next, I'd like to make sure our live source is aired only as
# soon as something more than silence is streamed.
# Simply using the "strip_blank" function resulted in our
# Standard Music being interrupted as soon as someone woule just
# connect to the stream, even when they didn't actually broadcast
# anything yet.
silence = blank()
LiveAndSilence = add([NormalizedLive, Silence])
output.dummy(LiveAndSilence)
LiveRadio = strip_blank(threshold=-80., max_blank=1.0, LiveAndSilence)
# Record our live shows, and have them uploaded as soon as the
# stream goes silent (external script)
output.file(
%mp3,
"/home/pi/radio/RecordedShows/%Y-%m-%d/%H_%M_%S.mp3",
on_close=fun(s)->system("/home/pi/liquidsoap-daemon/showdealer.sh #{s}"),
buffer(LiveRadio, fallible=true),
fallible=true
)
#])
# And putting it all together for our global listenership:
ThisIsBlindPower = fallback(track_sensitive=false,
transitions=[GoLive,
ComeHome],
[LiveRadio, StandardProgram])
output.icecast(%mp3,
host = "TestServer", port = 8888,
password = "TestWord", mount = "TestRBP", ThisIsBlindPower)
And that's it.
Thanks for your help! I really appreciate it!
Best Regards,
René
Am 11.02.2017 um 19:52 schrieb Romain Beauxis:
> Hi René,
>
> I think I'm gonna need more of your script to look at this issue.
> Would you mind sharing more of it?
>
> Thanks!
> Romain
>
> 2017-02-11 4:36 GMT-06:00 René Jaun <[email protected]>:
>> Hello Romain,
>> Thanks for this suggestion.
>> Sadly, my problem remains the same. :-(
>>
>> My Switch to Live looks like this:
>> def GoLive(old, new) =
>> source.skip(old)
>> old = fade.final(old)
>> sequence(old, new)
>> end
>>
>>
>> The Log files indeed now show a new track being chosen at the time we switch
>> to live.
>> It goes as far as:
>> 'Method "MAD" Accepted /New/Track.mp3'
>> Three seconds later, [fade_out:5206/3] issues the "Warning: get called when
>> not #is-Ready!" message.
>>
>> Then again, at the time we switch back [smart_cross] issues the not
>> #is-ready
>> !
>> After that, in the same second actually, the log file says "prepared
>> /New/Track.mp3
>>
>>
>> I was wondering if it has something to do with the "crossfade" buffer.
>> Is there a way to re-initialize (or empty) it on purpose?
>> Thanks again for any help!
>>
>> Best Regards,
>> René
>>
>>
>>
>>
>>
>>
>>
>>
>> Am 10.02.2017 um 17:39 schrieb Romain Beauxis:
>>
>> Hi René!
>>
>> Thanks for your support. We're always very proud and honored to see awesome
>> use of the software like you guys do!
>>
>> Your problem has been raised before. I believe you might be able to do it by
>> tackling the issue from the other end: could you try to trigger the
>> source.skip when switching away from the file-based source? Something like:
>>
>> def transition(old,new) =
>> source.skip(old)
>> sequence([old,new])
>> end
>>
>> That way, the old source would consume all of its remaining buffer before
>> switching away and also have time to prepare a new track for the next time
>> you switch back to it..
>>
>> Hope this help,
>> Romain
>>
>> 2017-02-08 15:47 GMT-06:00 René Jaun <[email protected]>:
>>> Hello Savonet community!
>>>
>>> Let me start by thanking all of you, the developers, the supporters, the
>>> donors of liquidsoap. this is an awesome product. And thank you so much
>>> for doing such great work!
>>>
>>> I'm involved in a non-profit station called Radio Blind Power.
>>>
>>> Currently, LiquidSoap already helps us getting our live shows on air and
>>> to our listeners (we focus on providing audio descriptions for the blind
>>> of Swiss Football League games).
>>>
>>> And we plan on using it in the future for playlist and schedule
>>> management.
>>>
>>>
>>> Well, at the moment, I'm working on a problem which occurs when using
>>> the source,skip function.
>>>
>>> My idea is simple: As soon as our live feed ends, our standard music
>>> playlist kicks in, starting with a new track.
>>>
>>> this basically works, except that before starting the new track, a few
>>> seconds of the previous song (the one that was interrupted when the live
>>> feed kicked in) can be heard.
>>>
>>> I think it has to do with the smart_crossfade function; at least, an
>>> error message appearing in the Log File seems to suggest that.
>>>
>>>
>>> the standard music source we use is defined as:
>>>
>>>
>>> musicstream = mksafe( smart_crossfade( eat_blank( at_beginning=false,
>>> playlist("/our/music"))))
>>>
>>>
>>> And the transition function I use is:
>>>
>>>
>>> def BackHome(old,new) =
>>>
>>> source.skip(new)
>>>
>>> sequence([old,new])
>>>
>>> end
>>>
>>>
>>> And here is the WARNING appearing in the log file whenever my problem
>>> occurs:
>>>
>>>
>>> "[smart_cross_5114_before:3] Warning: #get called when not #is_ready!
>>> This is normal if an operator using this source has been unused while
>>> the source has gone unavailable. If unsure about this warning, you are
>>> very welcome to report it and ask for clarifications.."
>>>
>>>
>>> So I was wondering if there is some kind of (other) "flushing" I should
>>> perform on our Music Playlist, to clear out those remaining few seconds
>>> of the previously played track.
>>>
>>>
>>> Could you point me to a solution for that?
>>>
>>>
>>> Best Regards,
>>>
>>> René
>>>
>>>
>>>
>>>
>>>
>>>
>>> ------------------------------------------------------------------------------
>>> Check out the vibrant tech community on one of the world's most
>>> engaging tech sites, SlashDot.org! http://sdm.link/slashdot
>>> _______________________________________________
>>> Savonet-users mailing list
>>> [email protected]
>>> https://lists.sourceforge.net/lists/listinfo/savonet-users
>>
>>
>>
>> ------------------------------------------------------------------------------
>> Check out the vibrant tech community on one of the world's most
>> engaging tech sites, SlashDot.org! http://sdm.link/slashdot
>>
>>
>>
>> _______________________________________________
>> Savonet-users mailing list
>> [email protected]
>> https://lists.sourceforge.net/lists/listinfo/savonet-users
>>
>>
>>
>> ------------------------------------------------------------------------------
>> Check out the vibrant tech community on one of the world's most
>> engaging tech sites, SlashDot.org! http://sdm.link/slashdot
>> _______________________________________________
>> Savonet-users mailing list
>> [email protected]
>> https://lists.sourceforge.net/lists/listinfo/savonet-users
>>
> ------------------------------------------------------------------------------
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, SlashDot.org! http://sdm.link/slashdot
> _______________________________________________
> Savonet-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/savonet-users
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Savonet-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/savonet-users