Help on savonet/liquidsoap
  • Hello i have a problem, my radio (radioamorportugal.com) has a small problem, if i schedule music over night in the morning i have no audio in the site (no audio comes from icecast). I have to plug a live source for a second or two and every thing goes back to normal. As i dont want to be up so early, i decided to put an autodj. So i have made a change to liquidsoap script which is the following.

    <-- atached file -->

    But another problem appeared some times i have a music on the back for a couple of seconds, when doing live broadcast ( it should only happen when no audio is scheduled or dj connected).

    I dont use the master mountpoint just the regular mountpoint to everybody.  Just need this little problem to be fixed and i would love this :)

    Thanks in advance.
    Post edited by César Araújo at 2014-02-19 16:38:59
  • 15 Comments sorted by
  • Your line should really look like this

    #default = amplify(id="silence_src", 0.00001, noise())
    ref_off_air_meta = ref off_air_meta
    if !ref_off_air_meta == "" then
        ref_off_air_meta := "Airtime - offline"
    end
    default = rewrite_metadata([("title", !ref_off_air_meta)], default)
    ignore(output.dummy(default, fallible=true))

    # autodj cesar
    #default = playlist(mode='randomize',reload=1,reload_mode="rounds", "/srv/airtime/stor/imported/")

    # Start using this reload_mode="watch",as I explained so that when you upload new songs to the Airtime it appears

    default = playlist(mode='randomize',reload_mode="watch", "/srv/airtime/stor/imported/")

    #http://forum.sourcefabric.org/discussion/16390/you-can-set-up-your-own-includes-file-why-80-of-your-time-will-be-saved-another-in-dummies-series

    #below not needed (could you explain this for me
    #delay_default = delay(1200.,default)

    #ignore(output.dummy(delay_default, fallible=true))
    # autdj cesar


    Post edited by Voisses Tech at 2014-02-20 08:10:11
    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 know that its recommended this kind of syntax for harbour in LS.
    ignore(output.dummy(delay_default, fallible=true))

    I found it not to work for me as it relates to Airtime unless it refers to some variable that will fail.

    I saw this happen when an input http is been played and it buffers too long the current song that is queue (decode and prepared) will play briefly (1-5 seconds worth).

    I
    made a crude change to make the source infallible so that there is a
    brief silence should a stream buffers or drop,I do not like it cause it
    required a change in the general Airtime LS and not a modification so i not recommend it.

    I think @hoerich did something with buffers,I hope he comment .

    Basically you are face with a number of option and none too nice

    • you could place the input http in your mod,and then make the live connect to that which would connect to the show source,similar to the custom dj .
    Then with this you can create use a fallback with a jingle or a create a 3sec or more silence jingle -if have a jingle played will annoy you.

    You lose however the way for each user to connect with their own credentials


    What I think is that the switch from http to the others cause this but I will not called it a bug until I look at the way the transition is done at that line and see if it was intentional and the best work around or fixed

    Post edited by Voisses Tech at 2014-02-20 08:31: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.
  • Hello thanks for the help, i changed to voices tech configuration and it gave an error rigt on line 158

    root@stream:~# /etc/init.d/airtime-liquidsoap restart
    Restarting Liquidsoap Playout Engine: ('Error loading config file: %s', error(111, 'Connection refused'))
    At line 158, char 67: the variable default used here has not been previously
      defined.

    I had to uncomment this first line, could not understand why. Now it is working but still giving an error loadind config.

    #default = amplify(id="silence_src", 0.00001, noise())
    ref_off_air_meta = ref off_air_meta
    if !ref_off_air_meta == "" then
        ref_off_air_meta := "Airtime - offline"
    end
    default = rewrite_metadata([("title", !ref_off_air_meta)], default)

    This is the error it gave me

    root@stream:~# /etc/init.d/airtime-liquidsoap restart
    Restarting Liquidsoap Playout Engine: ('Error loading config file: %s', error(111, 'Connection refused'))
    Done.
    #########################################
    #           *** pypo  ***               #
    #     pypo notification gateway         #
    #########################################


    Any hint? (I have autodj cant really tell if the audio in the background disapeared (have to wait to see)
    Post edited by César Araújo at 2014-02-20 10:59:35
  • Look clearly,my line had that line commented.I also put the lines in bold for you to see the changes.
    In your original script you had it uncomment so I state it how you should.
    Q1
    The reason you have to is that
    you can only reference

    •  a variable once or to its self [known as local variable] like this  default=blah-blah-blah or default=rewrite(blah-blah-blah,default) respectively

    • . unless you use it as a function [Global] like this default=ref[]
    Q2
    The connection refused is from your stream settings.

    pico /var/log/airtime/pypo-liquidsoap/ls_script.log

    will tell you what connection is not made.Normally your username or password did not match in either stream or admin.

    but sometimes when you restart  your LS,it can be that liquidsoap start faster than the connection to icecast of which you can ignore because its temporary.


    Post edited by Voisses Tech at 2014-02-20 11:37:59
    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.
  • Voises, thanks for so short response.

    I have a dj right now streaming and her encoder does not disconnect and i hear for 2 seconds a random music in the background.

    This is the log.
    http://paste.virtual2.net/index.php?show=12

    PS: you can listen in http://stream.radioamorportugal.com:8000
    Post edited by César Araújo at 2014-02-20 13:40:07
  • It mainly happens on song switch, i had that  to delay it a few seconds.
    #delay_default = delay(1200.,default)
  • Voises, thanks for so short response.

    I have a dj right now streaming and her encoder does not disconnect and i hear for 2 seconds a random music in the background.

    This is the log.
    http://paste.virtual2.net/index.php?show=12

    PS: you can listen in http://stream.radioamorportugal.com:8000




    I will try for tomorrow

    I cannot look at script/logs posted on any site.
    If you want me to look at these (script/log) then redact them for any password username,ip etc and post on pastebin
    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.
  • Ok I will test the buffer length etc. and post how to do it,I have to test first ,so it has no effect on any other thing
    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.
  • Sorry the log is here http://pastebin.com/YTf2Qery



    Do not be sorry,Its easier for me .Some sites contains to much junk (not in particular the one you stated),but based on previous experience ,so I rather stick to what I know.

    Well sometimes I answer questions too quickly,darn brain it thinks faster than any place on my body.

    My previous answers was based on known glitches,but looking at your logs,I notice a few things

    • number of failed connection for your live dj. authentication  Password or Username
    • drop connection (could be you LAN or if you use WAN),or if you are connecting via wireless
    • Machine have to catchup >1.4sec Seems like your load on that machine.Is it a server or desktop with other purpose or jobs.

    You will best dedicate a machine exclusive for Airtime or use one that other Application is used sparingly.

    Make sure your network is stable .If you have a firewall  or router with QOS,put Airtime as an high priority

    Yes a song will played if for any reason ,there is a dropped connections.

    You could a run a airtime check system at the command prompt, make sure you meet the minimum specs,with addition 1G Ram for other application.

    Hope I am right but your problems seems external.

    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.
  • Thanks for the answer, you have been the best support i got here.

    The machine is a dedicated kvm server with debian squeeze 32bits. I have nothing there besides airtime. Its on a data-center in Germany, and my djs are all over the world, Portugal to France Brazil (the special case in the log fracas is fro, France). Most of the djs i believe they are connected to their internet via wifi.
    Cant i put savonet/liquidsoap to have a buffer of input connection for 3 seconds to avoid the music in the back? Or to make the auto dj apear only after 5 seconds or so... 

    This is my airtime-check-system. Hope it helps.

    Is there any way i can put a


     root@stream:~# airtime-check-system
    AIRTIME_STATUS_URL             = http://stream.radioamorportugal.com:80/api/status/format/json/api_key/%%api_key%%
    AIRTIME_SERVER_RESPONDING      = OK
    KERNEL_VERSION                 = 2.6.32-5-686
    MACHINE_ARCHITECTURE           = i686
    TOTAL_MEMORY_MBYTES            = 514552
    TOTAL_SWAP_MBYTES              = UNKNOWN
    AIRTIME_VERSION                = 2.5.1
    OS                             = Debian GNU/Linux 6.0.8 (squeeze) i686
    CPU                            = QEMU Virtual CPU version (cpu64-rhel6)
    WEB_SERVER                     = Apache/2.2.16 (Debian)
    PLAYOUT_ENGINE_PROCESS_ID      = 2728
    PLAYOUT_ENGINE_RUNNING_SECONDS = 154148
    PLAYOUT_ENGINE_MEM_PERC        = 2.6%
    PLAYOUT_ENGINE_CPU_PERC        = 0.0%
    LIQUIDSOAP_PROCESS_ID          = 3441
    LIQUIDSOAP_RUNNING_SECONDS     = 153950
    LIQUIDSOAP_MEM_PERC            = 8.9%
    LIQUIDSOAP_CPU_PERC            = 4.9%
    MEDIA_MONITOR_PROCESS_ID       = 1657
    MEDIA_MONITOR_RUNNING_SECONDS  = 154503
    MEDIA_MONITOR_MEM_PERC         = 2.5%
    MEDIA_MONITOR_CPU_PERC         = 0.0%
    -- Your installation of Airtime looks OK!

    root@stream:~# top
    top - 10:42:42 up 1 day, 19:05,  1 user,  load average: 0.02, 0.05, 0.03
    Tasks: 114 total,   1 running, 113 sleeping,   0 stopped,   0 zombie
    Cpu(s):  8.1%us,  0.3%sy,  0.0%ni, 91.3%id,  0.0%wa,  0.0%hi,  0.2%si,  0.0%st
    Mem:    514552k total,   505424k used,     9128k free,    53400k buffers
    Swap:   901112k total,     1604k used,   899508k free,   258544k cached


    Thanks for the help, I do really appreciate it.
    Post edited by César Araújo at 2014-02-22 05:48:56
  • Mem:    514552k total,   505424k used,     9128k free,    53400k buffers
    Swap:   901112k total,     1604k used,   899508k free,   258544k cached 

    As you know the Mem. represent the RAM. you have the basic recommendation,and its almost all used up.
    In fact its start using the Swap(hard disk).
    The more load you put on this machine is the greater your buffers,latency and cache problems become.
    You can have the fastest processor,but you need the RAM to do quick and multi-tasking.

    Try increase the Ram to the MAX or at least twice the recommended before you think of anything else

    The best and most convenient OS,I have uses with low MEM  is Xbuntu (server) and  Damn Small linux (KIOSK).
    Debian can be an Hog for Mem as soon as it starts to load.(please no one re-butt me,Its My opinion).
    Post edited by Voisses Tech at 2014-02-23 06:19:58
    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 apreciate your help, but i believe that is not an issue (at least i think) ram is stable and machine has the problem even with low usage.
    Is there anyway to make a 2 or 3 seconds buffer in the harbor of the liquidsoap/savonet?


    Thanks in advance
  • The buffer handler is found in /usr/lib/airtime/pypo/bin/liquidsoap_scripts/ls_lib.liq line 280.

    I doubt this will fixed anything,but try and then if not work,I will explain what is buffer in the context of liquidsoap and then the solution for  3 alternatives you are face with as a solution.
    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.
  • 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.