Fallback playlist & fallback.skip liquidsoap function
  • Hi everybody ! My problem is the following : I'm using airtime (2.4.1) with a fallback playlist. I would like that the fallback, when it starts, starts at the beginning of a new track. Currently, when the fallback starts, it starts where it as been previously interrupted. This is not very 'smooth' because I think it would be better that after a planned show (which I usually make end with a jingle) a new track from the fallback starts instead of falling in the middle of the previously interrupted track. I read about the liquidsoap fallback.skip command and it seems to be what I need, but I don't know how to apply it to work properly. I hope I explain it clearly enough. If someone could help me...
    Cheerz
    Post edited by Yann Leekid at 2013-11-18 05:20:29
  • 13 Comments sorted by
  • Sorry for not replying sooner.

    After my initial test,I felt fallback.skip was not include,but When I got access to my test machine,I checked the Airtime utils script and yes indeed its include.
    So let me apologies for that.

    Now here are the things that you need to know to make a fallback.skip works,
    1. Your playlist cannot be .m3u or pls as these cannot be randomize and when they fallback they normally start at the top of the list.
    2. You cannot do any sound processing on fallback.skip,you have to do all that at the source level.I see processing (like removing silence) done by others,IT just never works for me
    3. You need to have some way to switch from source (a) to source(b)[The fallback source].Fallback.skip occur when there is a switch
    4. A switch can occur through playlist or live [inputs like mic and when there is silence a switch occur] or Stream[connect and disconnect]
    For this example I will be 
    • playing some music and jingles
    • at the TOH I will go to the news but ending the music{track] I was playing
    • When the news is finished the music [I will start a new track]
    Anyone reading this a find it funny about my grammar , I make no apology ,Go get a translator.
    "The Problem with education today is that it takes a university degree to switch on a light bulb"
    "You learn from your mistakes but wise people learn from others mistakes avoid Making mistakes there is not sufficient rooms to make them"
    "Innuendo","If's","Assumptions" and "Fear" are for politician.Who,What,where,When and How are for those seeking knowledge and care about Humanity.
    "I might be in Mud but that does not Make me a Wild Hog(pig)"
    “Any intelligent fool can make things bigger, more complex, and more violent. It takes a touch of genius — and a lot of courage to move in the opposite direction.”
    "The only thing that remains constant is change itself"
    May the force be with you,until our path or destiny bring us in tandem.
  • Here is the code

    # do not use a m3u playlist it cannot be randomize
    #global_playlist     = playlist(mode="randomize","/srv/backup/music/music/classic_instrumental.m3u")

    global_playlist     = playlist(mode="randomize","/srv/backup/music/music/classic_instrumental")

    jingles = single("/srv/backup/jingles/jingles.mp3")


    testnews=playlist("/srv/backup/test2/")

    newshour=
             add([
                      
                   switch([
                             
                           ({ 00m00s},delay(3600.,testnews)),
                           ({ 30m00s},delay(3600.,testnews)), 
                               
                         ])

               ])


    radio = rotate(weights = [1, 2],[jingles, global_playlist])


    default = fallback.skip( input=newshour, radio)


    Thats all

    Now notice that in my switch
    I used a delay(3600.,testnews)), This prevents your  playlist playing over and over
    If you have more than one item {news,sports and weather} for the newshour  try merging the tracks
    You possible use a m3u or pls for this (I have not tested that)

    *********************************
    * V.O.I.S.S.E.S.      *         *
    * Can You Hear Me Now *         *
    *********************************
    ♬♬♬♬♬♬♬♬♬♬♬♩♪♫♩♪♫♪♩♫♪♩ ♬♬♬♬♬♬♬♬♬♬♬
    ######################################################
    [En][24/7][712- 432- 8476]############################
    [Korean][24/7] [712- 432- 8464]#######################
    [En][Sundays 2300-Mondays 0600 EST][712- 432- 8437]###
    ######################################################
    Disclaimer:-
    "The Views express by me in no way reflect the staff,team,management of airtime,its affiliate or its
    representative.
    I am in no way a member of the staff,team,management of airtime,its affiliate or its representative,

    My views are my own opinion of which I hope will help to construed a discussion in order to solve, resolved or to make things better.

    If you follow my opinions,you do so at your own risk and I bear no responsibility for your actions or in-actions.

    My opinions is not my final thoughts but something I think as I try come to my final conclusion"
    #####################################################################

    Post edited by Voisses Tech at 2013-11-23 10:00:34
    Anyone reading this a find it funny about my grammar , I make no apology ,Go get a translator.
    "The Problem with education today is that it takes a university degree to switch on a light bulb"
    "You learn from your mistakes but wise people learn from others mistakes avoid Making mistakes there is not sufficient rooms to make them"
    "Innuendo","If's","Assumptions" and "Fear" are for politician.Who,What,where,When and How are for those seeking knowledge and care about Humanity.
    "I might be in Mud but that does not Make me a Wild Hog(pig)"
    “Any intelligent fool can make things bigger, more complex, and more violent. It takes a touch of genius — and a lot of courage to move in the opposite direction.”
    "The only thing that remains constant is change itself"
    May the force be with you,until our path or destiny bring us in tandem.
  • Well, I think I was not clear enough in my question. I want the fallback input source (the first fallback.skip parameter) to be airtime (show or master/show source, or whatever instantiated by Airtime). In your example the input source is an alternative ls_script-scheduled playlist (newshour). My question was about how to fallback on a new track when falling back occurs from an airtime source dropping (NOT from a ls_script-scheduled playlist)
  • And, I don't know what you mean about randomize with .m3u files. Randomize is the default mode in the liquidsoap playlist operator (as documented in the savonet/liquidsoap documentation), so no need to mention it. I use the "global_playlist = playlist("/home/airtime/playlist.m3u") since over 2 years, and it works perfectly in a randomize way. The file can be pls, m3u, or txt, or what-you-want, what matters is the content (available pathes to tracks).
    Post edited by Yann Leekid at 2013-11-23 13:00:29

  • Well I think you are mixing two things up
    you need to read this

    Transistions and fallback playlist

    Fallback playlist have been a request here on a number of occassion.
    Let me list some of them 

    is a modification script

    What you also mention here in this post is a transitions from show source mixed with a fallback script.

    Post edited by Voisses Tech at 2013-11-23 13:21:02
    Anyone reading this a find it funny about my grammar , I make no apology ,Go get a translator.
    "The Problem with education today is that it takes a university degree to switch on a light bulb"
    "You learn from your mistakes but wise people learn from others mistakes avoid Making mistakes there is not sufficient rooms to make them"
    "Innuendo","If's","Assumptions" and "Fear" are for politician.Who,What,where,When and How are for those seeking knowledge and care about Humanity.
    "I might be in Mud but that does not Make me a Wild Hog(pig)"
    “Any intelligent fool can make things bigger, more complex, and more violent. It takes a touch of genius — and a lot of courage to move in the opposite direction.”
    "The only thing that remains constant is change itself"
    May the force be with you,until our path or destiny bring us in tandem.
  • And, I don't know what you mean about randomize with .m3u files. Randomize is the default mode in the liquidsoap playlist operator (as documented in the savonet/liquidsoap documentation), so no need to mention it. I use the "global_playlist = playlist("/home/airtime/playlist.m3u") since over 2 years, and it works perfectly in a randomize way. The file can be pls, m3u, or txt, or what-you-want, what matters is the content (available pathes to tracks).



    Just to inform you ,there is so much bug fixed for liquidsoap so lets look at the cookbook to see if what you say is true.

    You will find a line reading like this ,which I tested many times and it gave me unpredictable results

    A source which plays a playlist of requests – a playlist is a file with an URI per line.

    # Shuffle, play every URI, start over.
    playlist("/my/playlist.txt")
    # Do not randomize
    playlist(mode="normal", "/my/pl.m3u")
    # The playlist can come from any URI,
    # can be reloaded every 10 minutes.
    playlist(reload=600,"http://my/playlist.txt")

    Post edited by Voisses Tech at 2013-11-23 13:32:35
    Anyone reading this a find it funny about my grammar , I make no apology ,Go get a translator.
    "The Problem with education today is that it takes a university degree to switch on a light bulb"
    "You learn from your mistakes but wise people learn from others mistakes avoid Making mistakes there is not sufficient rooms to make them"
    "Innuendo","If's","Assumptions" and "Fear" are for politician.Who,What,where,When and How are for those seeking knowledge and care about Humanity.
    "I might be in Mud but that does not Make me a Wild Hog(pig)"
    “Any intelligent fool can make things bigger, more complex, and more violent. It takes a touch of genius — and a lot of courage to move in the opposite direction.”
    "The only thing that remains constant is change itself"
    May the force be with you,until our path or destiny bring us in tandem.
  • I don't care about transitions, that is absolutely not my question. My question is not anymore about fallback in general, as I have a simple randomized fallback that works. My question was very exactly about how to make it work in a particular way, especially with fallback.skip.
  • Yes, you exactly mention the liquidsoap/savonet documentation about playlist operator i'm referring to. But I can't see where you read that randomize does not work with .m3u. I think you misread the liquidsoap documentation.
  • What I am basically saying  you might have to look at whether you need  a featured request or a modifications.

    If you have a modified script,I doubt in my opinion the sourcefabric team would want to troubleshoot it

    if you have a vanilla installation and is having a problem I think they would more than happy to walk you through or put it on a request.

    and I think I gave you the solution for the modifications,hope someone else understand it better than I do.
    Thank you for the post because I had that problem with my news  where the music would cut in.

    I attempted to use the Kube example and it just never worked "I got an "Unlabelled source fallback.skip"

    I then looked at the function and see that  the syntax was different and fixed it.

    So once again thank you 

    Best of luck on your quest,my brain is wired on fallback and ls-script I cannot help anyone require major modifications to airtime

    Anyone reading this a find it funny about my grammar , I make no apology ,Go get a translator.
    "The Problem with education today is that it takes a university degree to switch on a light bulb"
    "You learn from your mistakes but wise people learn from others mistakes avoid Making mistakes there is not sufficient rooms to make them"
    "Innuendo","If's","Assumptions" and "Fear" are for politician.Who,What,where,When and How are for those seeking knowledge and care about Humanity.
    "I might be in Mud but that does not Make me a Wild Hog(pig)"
    “Any intelligent fool can make things bigger, more complex, and more violent. It takes a touch of genius — and a lot of courage to move in the opposite direction.”
    "The only thing that remains constant is change itself"
    May the force be with you,until our path or destiny bring us in tandem.
  • The right (and precise) documentation about the playlist operator is here .
    Excerpt :
    mode (string – defaults to "randomize"): Play the files in the playlist either in the order (“normal” mode), or shuffle the playlist each time it is loaded, and play it in this order for a whole round (“randomize” mode), or pick a random file in the playlist each time (“random” mode).

    So randomize is effectively the the default mode, that I'm experiencing since over 2 years on an .m3u file without any problem. That's all I was saying, because I didn't (and still don't) understand your problem with m3u and randomized playlists. Anyway, thanx for the effort. Cheerz

  • so lets go again,pay attention to this line above

    Now here are the things that you need to know to make a fallback.skip works,
    Your playlist cannot be .m3u or pls as these cannot be randomize and when they fallback they normally start at the top of the list.

    I am not talking about a fallback,I specifically said a fallback.skip.

    fallback.skip. is  Special track insensitive fallback that always skips current song before switching.

    In a fallback you can make a track insensitive either 
    • False that is when a switch occur it pause your track and initiate the track then resume at same spot it was pause right after the end of the switch .
    • True that is the track will wait until the end before your switch occur.
    Clearly you will see that it matters how the tracks are loaded.

    I gave you my opinion that based on my test to say do not randomize the track,you will get weird effects.
    I supplement that by saying the cookbook outline that you should not randomize m3u,

    ( the third line in my snippet above.)

    Randomize basically is to  shuffle the playlist each time it is loaded, and play it in this order for a whole round .

    What you want is for a TRACK to be acted upon not a playlist.

    Now I hope you see the point I took to build my approach.

    If You have a modified script and If you test my script and it do not work come back and say whats different from what you want.

    If You Have a Vanilla (new install) and something is wrong check the request to see if its listed and vote on it.
    If its not listed make a request for the feature.

    If you want to see the effects of the failback.skip  just read the many post here

    Now For everyone who read this
    The manual,wiki,bible,books,laws are just a guide for what you are expected to do
    That is why
    • Manuals are revised
    • wiki are update
    • Bible interpereted
    • Laws are precedents and change with case laws.
    You should use these guide to put you on the right track,not to stick it to anyone.
    You must always dare to be different because we are not all built the same way.

    So when you see the reference say

    fallback.skip
    (input:source('a),source('a))->source('a)

     do not type it exactly
    try something like
    fallback.skip(input=source1,source2) where source2 is the fallback source and source1 is the first source

    Please try my code,Let me know if it hurts.

    *********************************
    * V.O.I.S.S.E.S.      *         *
    * Can You Hear Me Now *         *
    *********************************
    ♬♬♬♬♬♬♬♬♬♬♬♩♪♫♩♪♫♪♩♫♪♩ ♬♬♬♬♬♬♬♬♬♬♬
    ######################################################
    [En][24/7][712- 432- 8476]############################
    [Korean][24/7] [712- 432- 8464]#######################
    [En][Sundays 2300-Mondays 0600 EST][712- 432- 8437]###
    ######################################################
    Disclaimer:-
    "The Views express by me in no way reflect the staff,team,management of airtime,its affiliate or its
    representative.
    I am in no way a member of the staff,team,management of airtime,its affiliate or its representative,

    My views are my own opinion of which I hope will help to construed a discussion in order to solve, resolved or to make things better.

    If you follow my opinions,you do so at your own risk and I bear no responsibility for your actions or in-actions.

    My opinions is not my final thoughts but something I think as I try come to my final conclusion"
    #####################################################################






    Post edited by Voisses Tech at 2013-11-23 18:51:24
    Anyone reading this a find it funny about my grammar , I make no apology ,Go get a translator.
    "The Problem with education today is that it takes a university degree to switch on a light bulb"
    "You learn from your mistakes but wise people learn from others mistakes avoid Making mistakes there is not sufficient rooms to make them"
    "Innuendo","If's","Assumptions" and "Fear" are for politician.Who,What,where,When and How are for those seeking knowledge and care about Humanity.
    "I might be in Mud but that does not Make me a Wild Hog(pig)"
    “Any intelligent fool can make things bigger, more complex, and more violent. It takes a touch of genius — and a lot of courage to move in the opposite direction.”
    "The only thing that remains constant is change itself"
    May the force be with you,until our path or destiny bring us in tandem.
  • Well, now it's sure, you really misread the playlist cookbook snippet. The commented third line you point just comments what the following instruction does : it does not randomize because of the 'mode' parameter set to 'normal', in opposition to the first example, where the default mode is randomize (commented as 'Shuffle, play every URI, start over.') because nothing is specified (specifying 'randomize' as playlist mode like you do is redundant as randomize is the default mode). In general, in this snippet, all the commented lines JUST describe what the following instruction does. Really nothing to do with any supposed m3u or whatelse problem. This is your (wrong) interpretation, not the facts. The file extenxion doesn't matter, you can even call it playlist.fartinginmybed, at the end it just must be a text file containing URI's. This is not an interpretation, this is fact, as I extensively tested all the playlist modes in several contexts since monthes. So, please don't make it more complicated it is by introducing wrong datas.
  • As I said before,I normally test before I make a statement.
    What works for fallback syntax doesnot necessarily work for a fallback.skip

    A fallback will put your song at pause ,then resume it when a switch occur
    A fallback.skip will end the current song and start a new song when the switch occur.

    They both have different effects on tracks. but maybe you are right and I am wrong.so lets see if you are familar with this statement

    Most supported playlists format are strict, which means that the decoder can be sure
    that is has found a correct playlist for that format. Some other format, such as m3u,
    however, may cause false positive detections.


    This is found with the playlist parser here  http://savonet.sourceforge.net/doc-svn/playlist_parsers.html

    When I tested the script,I had many times when I had the logs say that it had to check the mpeg and then returned to autodetection. and  even continues the song after a rotation,reload.

    If time allow I will paste this on pastebin for your viewing.

    My thoughts was a recommendation that you should not randomize the playlist to get the desired effect of dropping the current song and starting a new one (a fallback.skip) and not necessarily a rule of thumb.If you randomize and it works for you fine.
    I outline to you the premises on how I came to my decision as it relates to fallback.skip

    I have been using m3u like you stated for yourself and have similar effects as you, but this was all using fallback with track insensitive but it messed up my time related events

    I had hope you had tested the script,I wrote and told me how it did not meet your expectation,than dispute something trivial.

    That door is still open,so that if you need a specific function,I could help you.

    Oh by the way, playlist.fartinginmybed will only work if you lie on your belly and makes it go in the Air.

    Read the List from above


    =)) :)) =)) :-))


    Ps.

    If you are talking about

    • show / master ===> schedule event   

    • then you need to put a song are a silent jingle before the song

    if you are talking about

    • webstream ====> scheduled event

    • You will have to tweak the stream queue  in the ls_script for transistion and crossfade.
    • so it will remove the song
    • or simple delete the song

    if you are talking about to a modify script

    • you need a switch event as I outline all you have to do a stream instead of news hour as the input

    a schedule event is one you programme as a show in the Airtime calendar







    *********************************
    * V.O.I.S.S.E.S.      *         *
    * Can You Hear Me Now *         *
    *********************************
    ♬♬♬♬♬♬♬♬♬♬♬♩♪♫♩♪♫♪♩♫♪♩ ♬♬♬♬♬♬♬♬♬♬♬
    ######################################################
    [En][24/7][712- 432- 8476]############################
    http://tunein.com/radio/BIGLINK-RADIO-s190864/
    [Korean][24/7] [712- 432- 8464]#######################
    http://tunein.com/radio/Goaheadmissionorg-s190399/
    [En][Sundays 2300-Mondays 0600 EST][712- 432- 8437]###
    http://tunein.com/radio/Caribbean-Experience-s200915/
    ######################################################
    Disclaimer:-
    "The Views express by me in no way reflect the staff,team,management of airtime,its affiliate or its
    representative.
    I am in no way a member of the staff,team,management of airtime,its affiliate or its representative,

    My views are my own opinion of which I hope will help to construed a discussion in order to solve, resolved or to make things better.

    If you follow my opinions,you do so at your own risk and I bear no responsibility for your actions or in-actions.

    My opinions is not my final thoughts but something I think as I try come to my final conclusion"
    #####################################################################

    Post edited by Voisses Tech at 2013-12-02 11:57:00
    Anyone reading this a find it funny about my grammar , I make no apology ,Go get a translator.
    "The Problem with education today is that it takes a university degree to switch on a light bulb"
    "You learn from your mistakes but wise people learn from others mistakes avoid Making mistakes there is not sufficient rooms to make them"
    "Innuendo","If's","Assumptions" and "Fear" are for politician.Who,What,where,When and How are for those seeking knowledge and care about Humanity.
    "I might be in Mud but that does not Make me a Wild Hog(pig)"
    “Any intelligent fool can make things bigger, more complex, and more violent. It takes a touch of genius — and a lot of courage to move in the opposite direction.”
    "The only thing that remains constant is change itself"
    May the force be with you,until our path or destiny bring us in tandem.