Fallback and AutoDJ
  • Hi all,

    How can I setup Icecast's feature of a mountpoint fallback, since there are no mountpoints defined in the /etc/icecast2/icecast.xml ?

    Also, would appreciate a hint on how to set an auto-dj, that will be broadcast when no output from Airtime is feeded, taking random songs from a certain folder, considering all of them are mp3?


    Kind regards,
    Sergei S.
  • 37 Comments sorted by
  • Solution found!

    Thanks RadioA6 and liquidsoap docs

    To set up some random music on air, when nothing is scheduled in Airtime, I had to edit the file
    /usr/lib/airtime/pypo/bin/scripts/ls_script.liq


    * SMART NOTES *
    Create a backup copy of the original file before editing it.
    Create a copy of the resulting file, cause it can be replaced by future Airtime updates.


    Find there lines ##27-28:
    default = amplify(0.00001, noise())
    default = rewrite_metadata([("artist","Airtime"), ("title", "offline")],default)
    

    These two lines define what is transmitted when AirTime is silent. For now it is a noise at a very low volume.

    To play random mp3 files from a certain folder replace those two lines with the following:
    default = playlist(mode='random', "/srv/music/")

    A couple of handy commands.
    To check if your new .liq is valid and has no errors:
    sudo /usr/lib/airtime/pypo/bin/liquidsoap/liquidsoap --check /usr/lib/airtime/pypo/bin/scripts/ls_script.liq

    If above outputs no errors, restart liquidsoap with:
    sudo /usr/lib/airtime/pypo/bin/airtime-pypo-stop
    sudo /usr/lib/airtime/pypo/bin/airtime-pypo-start

    For the endless possibilities that liquidsoap opens, again, please see the liquidsoap documentation and their cookbook
  • Upd. I guess in case of AirTime config, as its the LiquidSoap who's feeding the IceCast2, the question redirects to the LiquidSoap config. Again, LS is controlled by Pypo. So here I am completely lost. Help! : )
  • This is something I am also trying to do. So far I have found this link for liquidsoap http://savonet.sourceforge.net/doc-1.0.0-beta1/harbor.html that might be useful but I hope this will be eventually integrated in a future release of airtime.

    Also this little app http://www.pira.cz/eng/silence.htm has promises, works with wine, but I was never able to make it work, maybe because I don't feed the airtime audio output to the soundcard instead only stream.
  • Airtime is based on liquidsoap and uses it in a different kind of way atm. There really bussy implementing things as fallbacks etc. didn't chek up on the progress of it atm.

    The Icecast fallback in itself is another thing. It uses mount point fallback to an mp3 file. As the airtime stream is the input for icecast the fallback info should be set by airtime.

    The solution for us this far is an seperate liquidsoap server which is running liquidsoap with a special config.

    Ill post it later this day ( im off to a music festival )
  • Thanks for the replies,

    mellowtothemax, I think you're targeting some overcomplicated weapons here. LiquidSoap itself has the needed features, and it can tell if a stream from AirTime has stopped - to switch to another source, a file folder, for instance.
    In their "Complete Case" tutorial there are all the necessary examples, for instance the fallback:
    # Play user requests if there are any,
    # otherwise one of our playlists,
    # and the default file if anything goes wrong.
    radio = fallback([ request.queue(id="request"),
    	                switch([({ 6h-22h }, day),
    	                        ({ 22h-6h }, night)]),
    	                default])


    However, I have no idea yet, how does AirTime deal with LiquidSoap via Pypo - to be able to alter that behavior.

    radioa6, how was the fest? Can you please tell more about your radio config?
  • Getting closer: found the .liq file responsible for the broadcast:
    /usr/lib/airtime/pypo/bin/scripts/ls_script.liq

    At least here I hope to set the Welcome jingle for each of the mounting points - the IceCast-way.
  • # log file settings
    set("log.file.path","/var/log/liquidsoap/A6radio.log")

    # Music at the streaming server used for backup
    myplaylist = playlist("/radioa6data/music/testplaylist/")

    # Some jingles ( one with the station jingles, one for sponsors )
    jingles = playlist("/radioa6data/music/jingles/")
    reclame = playlist("/radioa6data/music/jingles/")

    # failsafe
    # If something goes wrong, we'll play this
    security = single("/radioa6data/music/testplaylist/Anne.mp3")

    # Start building the feed with music
    backup = myplaylist

    # And finally the security
    backup = fallback(track_sensitive = false, [backup,security])
    # --


    # -- Add the ability to relay the carrousel and the live shows
    #carrousel
    addcarrousel=strip_blank(length=2.,input.http("http://localhost:8000/airtime.mp3"))
    carrousel = fallback(track_sensitive = false,[addcarrousel,backup])

    #-- jingles on top of carrousel and backup
    carrousel = add([ carrousel, switch([({00m0s},jingles)])])
    carrousel = add([ carrousel, switch([({15m0s},jingles)])])
    carrousel = add([ carrousel, switch([({30m0s},jingles)])])
    carrousel = add([ carrousel, switch([({45m0s},jingles)])])
    carrousel = add([ carrousel, switch([({59m0s},jingles)])])

    #livrstream
    livestream=input.http("http://localhost:8000/A6live.mp3")
    radio = fallback(track_sensitive = false,[strip_blank(length=3.,livestream),carrousel])
    # --

    # full with news on the hour
    news = playlist ("/radioa6data/news/")
    full = fallback(track_sensitive = false, [ switch ([({0m0s},news)]), radio])

    # -- Stream it out
    output.icecast.lame(
    mount="Radio-A6", host="(replace with ipadress of the streaming server itself)", port=8000, password="(Replace with password)",
    genre = "Almere", url = "(replace with url)", description = "Radio-A6",
    full )

  • Thank you, radioa6,

    I'm still a little confused and don't get the whole picture:
    do you run liquidsoap as a separate instance/server to accomplish the fallbacks and random playlist - while feeding Airtime's output to that second Liquidsoap instance as one of the input sources?

    Or is this the modification of the Airtime's
    /usr/lib/airtime/pypo/bin/scripts/ls_script.liq
    ?

    Sorry, I'm a bit new to the scene.
  • Well it could also be i wasn't clear enough Wink

    I haven't hacked the liquidsoap script that comes with airtime becuase there is always a possibility of breaking something when upgrading to a new version. As far as i been looking into the script of airtime the same fallback and settings can also be added to the script. But as said before it might be more trouble then its worth, so we had to find a different solution.

    The setup we got atm is as follows : One streaming server which is running liquidsoap and icecast. The server handles the incoming stream from the carrousel ( which for us is airtime ) and the live shows. It falls back to the default playlist and to a fallback jingle if even that fails. It Also handles blank detection and adds the jingles and the hourly news-feed (which is played on top of everything ).

    In the studio there 2 pc's.One, that functions as an airtime server and handles the 24/7 music. This one connects directly to the streaming server. Same goes for the live pc, which also mounts at the streaming server.

    We ensure this way even if there is no music from the studio ( from either live or the carousel ) that our listeners are always served

    hoped that clarified things a bit.
  • Nice one guys
  • Really good Smile
  • Amazing! Thanks so much!
  • Vote Up0Vote Down Daniel JamesDaniel James
    Posts: 844Member, Sourcefabric Team
    For some tips on using fallback mounts in Icecast, see the manual chapter http://en.flossmanuals.net/airtime/stream-handover/
    This is aimed at a different use case, falling back between live (remote) and Airtime (local) streams.
  • Hello:

    I'm starting with airtime in the past days. I check too the problems that there are for make a random playlist, and found this treath. Many thanks for share your knows ;-D.

    Unfortunatly, this solution don't works for me.

    First, I think that there is a mistake in the hack. If I put "/srv/music/" as path for the music, I get paths like this in the logs: "/srv/music//e4c/e4cf3ecd46b16aa1b645843fb7241069.mp3" (note the two //). So I need to put a path like "/srv/music" (without trailing slash).

    But there isn't the solution. If I make the proposed changes in /usr/lib/airtime/pypo/bin/scripts/ls_script.liq, my airtime sistem stops to output sound !!. In any case, with and without a scheduled playlist.

    My sistem is a Debian/testing box, with airtime installed from the repository at http://apt.sourcefabric.org/. I have the 1.8.2-6 version of airtime. I output my sound only to the soundcard.

    There are the logs at /var/log/airtime/pypo-liquidsoap/main/current, with and without the change in the ls_script.liq file:

    Without the change:

    @400000004e22c0683011909c *** Daemontools: starting liquidsoap
    @400000004e22c06d067c35ac 2011/07/17 12:58:43 >>> LOG START
    @400000004e22c06d067fa87c 2011/07/17 12:58:39 [protocols.external:3] Didn't find "ufetch".
    @400000004e22c06d0681080c 2011/07/17 12:58:39 [protocols.external:3] Found "/usr/bin/wget".
    @400000004e22c06d0683790c 2011/07/17 12:58:42 [main:3] Liquidsoap 1.0.0-beta+svn (default@e712df4d96c0:20110502:175204)
    @400000004e22c06d0686cc9c 2011/07/17 12:58:42 [main:3] Using: pcre=6.0.1 dtools=0.2.2 duppy=0.4.0 duppy.syntax=0.4.0 cry=0.2.0 mm=0.1.0 xmlplaylist=0.1.2 ogg=0.4.1 vorbis=0.5.1 mad=0.4.0 flac=0.1.0 flac.ogg=0.1.0 lame=0.2.4 alsa=0.2.1 samplerate=0.1.1 taglib=0.1.4 camomile=0.7.1 portaudio=@VERSION ladspa=0.1.2
    @400000004e22c06d06884784 2011/07/17 12:58:42 [main:2]
    @400000004e22c06d06899f44 2011/07/17 12:58:42 [main:2] DISCLAIMER: This version of Liquidsoap has been
    [...]
    @400000004e22c06d06fd48a4 2011/07/17 12:58:42 [main:2] We hope you enjoy this snapshot build of Liquidsoap!
    @400000004e22c06d0700bf5c 2011/07/17 12:58:42 [main:2]
    @400000004e22c06d070222d4 2011/07/17 12:58:42 [lang:3] Found flac binary: enabling flac external decoder.
    @400000004e22c06d0703864c 2011/07/17 12:58:42 [lang:3] Found metaflac binary: enabling flac external metadata resolver.
    @400000004e22c06d0704edac 2011/07/17 12:58:42 [lang:3] Did not find faad binary: faad decoder disabled.
    @400000004e22c06d07064d3c 2011/07/17 12:58:42 [lang:3] Lastfm/audioscrobbler support was not compiled.
    @400000004e22c06d0707accc 2011/07/17 12:58:42 [frame:3] Using 44100Hz audio, 25Hz video, 44100Hz master.
    @400000004e22c06d0709142c 2011/07/17 12:58:42 [frame:3] Frame size must be a multiple of 1764 ticks = 1764 audio samples = 1 video samples.
    @400000004e22c06d070a7b8c 2011/07/17 12:58:42 [frame:3] Targetting 'frame.duration': 0.04s = 1764 audio samples = 1764 ticks.
    @400000004e22c06d070bdf04 2011/07/17 12:58:42 [frame:3] Frames last 0.04s = 1764 audio samples = 1 video samples = 1764 ticks.
    @400000004e22c06d0714c45c 2011/07/17 12:58:43 [threads:3] Created thread "generic queue #1".
    @400000004e22c06d07186ddc 2011/07/17 12:58:43 [threads:3] Created thread "non-blocking queue #1".
    @400000004e22c06d074f25ac 2011/07/17 12:58:43 [threads:3] Created thread "output(dot)alsa" (1 total).
    @400000004e22c06d0777cbec 2011/07/17 12:58:43 [threads:3] Created thread "wallclock_alsa" (2 total).
    @400000004e22c06d077ef3f4 2011/07/17 12:58:43 [clock.wallclock_alsa:3] Streaming loop starts, no sync.
    @400000004e22c06d0781c69c 2011/07/17 12:58:43 [mksafe:3] Switch to src_6737.
    @400000004e22c06d0784e764 2011/07/17 12:58:43 [fallback_6726:3] Switch to src_6724.
    @400000004e22c06d07b457ec 2011/07/17 12:58:43 [src_6724:3] Inserting missing metadata.
    @400000004e22c06d100c4c9c /usr/lib/airtime/pypo/bin/scripts/notify.sh --data='0' --media-id=
    @400000004e22c06f12880a9c 2011/07/17 12:58:45 [output(dot)alsa:3] Using ALSA 1.0.23.
    @400000004e22c06f1771fdc4 2011/07/17 12:58:45 [output(dot)alsa:3] Samplefreq=44100Hz, Bufsize=15052B, Frame=4B, Periods=17
    @400000004e22c06f24713b34
    @400000004e22c06f24714ebc #########################################
    @400000004e22c06f24715a74 # *** pypo *** #
    @400000004e22c06f24716244 # pypo notification gateway #
    @400000004e22c06f24716a14 #########################################
    @400000004e22c06f247171e4 NOTICE: 'media_id' command-line argument not given.
    @400000004e22c0702c99790c 2011/07/17 12:58:46 [server:3] New client: fundy
    [...]
    @400000004e22c132028d7b04 2011/07/17 13:02:00 [server:3] New client: fundy
    @400000004e22c13208e50404 2011/07/17 13:02:00 [decoder:3] Method "MP3" accepted " /var/tmp/airtime/pypo/cache/scheduler/2011-07-17-13-02-00/1c 1528419c7d4711723f61669837a16b.mp3 ".
    @400000004e22c13211b7166c 2011/07/17 13:02:00 [queue:3] Prepared " /var/tmp/airtime/pypo/cache/scheduler/2011-07-17-13-02-00/1c 1528419c7d4711723f61669837a16b.mp3 " (RID 0).
    @400000004e22c13211bb2964 2011/07/17 13:02:00 [fallback_6726:3] Switch to src_6691 with transition.
    @400000004e22c13306921b24 /usr/lib/airtime/pypo/bin/scripts/notify.sh --data='19' --media-id=19
    @400000004e22c13307048c04 2011/07/17 13:02:01 [output(dot)alsa:2] Underrun!
    @400000004e22c1330704a75c 2011/07/17 13:02:01 [output(dot)alsa:2] Trying to recover..
    [...]
    @400000004e22c13322ea415c 2011/07/17 13:02:01 [output(dot)alsa:2] Underrun!
    @400000004e22c13322ea58cc 2011/07/17 13:02:01 [output(dot)alsa:2] Trying to recover..
    @400000004e22c13528addf2c
    @400000004e22c13528adf2b4 #########################################
    @400000004e22c13528adfa84 # *** pypo *** #
    @400000004e22c13528ae0254 # pypo notification gateway #
    @400000004e22c13528ae0a24 #########################################
    @400000004e22c13528ae11f4 2011-07-17 13:02:03,676 DEBUG - [pypo-notify.py : notify_media_start_playing() : line 75] - #################################################
    @400000004e22c13528b84354 2011-07-17 13:02:03,682 DEBUG - [pypo-notify.py : notify_media_start_playing() : line 76] - # Calling server to update about what's playing #
    @400000004e22c13528d7a294 2011-07-17 13:02:03,683 DEBUG - [pypo-notify.py : notify_media_start_playing() : line 77] - #################################################
    @400000004e22c13529fa4cbc 2011-07-17 13:02:03,703 DEBUG - [pypo-notify.py : notify_media_start_playing() : line 78] - data = 19
    @400000004e22c1352a0dec2c 2011-07-17 13:02:03,704 DEBUG - [api_client.py : notify_media_item_start_playing() : line 286] - http://localhost:80/api/notify-media-item-start-play/api_key /%%api_key%%/media_id/19/schedule_id/19
    @400000004e22c139273b57b4 2011/07/17 13:02:07 [output(dot)alsa:2] Underrun!
    @400000004e22c139273b6f24 2011/07/17 13:02:07 [output(dot)alsa:2] Trying to recover..
    @400000004e22c13b30f63f94 2011-07-17 13:02:09,806 INFO - [api_client.py : notify_media_item_start_playing() : line 290] - API-Status 1
    @400000004e22c13b3103f364 2011-07-17 13:02:09,821 INFO - [api_client.py : notify_media_item_start_playing() : line 291] - API-Message
    @400000004e22c13b313c9764 2011-07-17 13:02:09,825 DEBUG - [pypo-notify.py : notify_media_start_playing() : line 80] - Response: {"status": 1, "message": ""}
    @400000004e22c2213673df6c 2011/07/17 13:05:59 [queue:3] Finished with " /var/tmp/airtime/pypo/cache/scheduler/2011-07-17-13-02-00/1c 1528419c7d4711723f61669837a16b.mp3 ".


    With the change:

    @400000004e22b8ff1f6c5d6c *** Daemontools: starting liquidsoap
    @400000004e22b90a14cf2bdc 2011/07/17 12:27:12 >>> LOG START
    @400000004e22b90a1aefd5fc 2011/07/17 12:27:07 [protocols.external:3] Didn't find "ufetch".
    @400000004e22b90a1af19734 2011/07/17 12:27:07 [protocols.external:3] Found "/usr/bin/wget".
    @400000004e22b90a1af2faac 2011/07/17 12:27:11 [main:3] Liquidsoap 1.0.0-beta+svn (default@e712df4d96c0:20110502:175204)
    @400000004e22b90a1af47594 2011/07/17 12:27:11 [main:3] Using: pcre=6.0.1 dtools=0.2.2 duppy=0.4.0 duppy.syntax=0.4.0 cry=0.2.0 mm=0.1.0 xmlplaylist=0.1.2 ogg=0.4.1 vorbis=0.5.1 mad=0.4.0 flac=0.1.0 flac.ogg=0.1.0 lame=0.2.4 alsa=0.2.1 samplerate=0.1.1 taglib=0.1.4 camomile=0.7.1 portaudio=@VERSION ladspa=0.1.2
    @400000004e22b90a1af5f07c 2011/07/17 12:27:11 [main:2]
    @400000004e22b90a1af757dc 2011/07/17 12:27:11 [main:2] DISCLAIMER: This version of Liquidsoap has been
    [....]
    @400000004e22b90a1b12dad4 2011/07/17 12:27:11 [main:2] We hope you enjoy this snapshot build of Liquidsoap!
    @400000004e22b90a1b143a64 2011/07/17 12:27:11 [main:2]
    @400000004e22b90a1b159ddc 2011/07/17 12:27:12 [lang:3] Found flac binary: enabling flac external decoder.
    @400000004e22b90a1b170d0c 2011/07/17 12:27:12 [lang:3] Found metaflac binary: enabling flac external metadata resolver.
    @400000004e22b90a1b187854 2011/07/17 12:27:12 [lang:3] Did not find faad binary: faad decoder disabled.
    @400000004e22b90a1b19e39c 2011/07/17 12:27:12 [lang:3] Lastfm/audioscrobbler support was not compiled.
    @400000004e22b90a1b1b4714 2011/07/17 12:27:12 [frame:3] Using 44100Hz audio, 25Hz video, 44100Hz master.
    @400000004e22b90a1b1cc1fc 2011/07/17 12:27:12 [frame:3] Frame size must be a multiple of 1764 ticks = 1764 audio samples = 1 video samples.
    @400000004e22b90a1b1e2d44 2011/07/17 12:27:12 [frame:3] Targetting 'frame.duration': 0.04s = 1764 audio samples = 1764 ticks.
    @400000004e22b90a1b1fa444 2011/07/17 12:27:12 [frame:3] Frames last 0.04s = 1764 audio samples = 1 video samples = 1764 ticks.
    @400000004e22b90a1b2958a4 2011/07/17 12:27:12 [threads:3] Created thread "generic queue #1".
    @400000004e22b90a1b2d11c4 2011/07/17 12:27:12 [threads:3] Created thread "non-blocking queue #1".
    @400000004e22b90a1b40f784 2011/07/17 12:27:12 [stor:3] Loading playlist...
    @400000004e22b90a270357c4 2011/07/17 12:27:12 [stor:3] Playlist is a directory.
    @400000004e22b90a389bf75c 2011/07/17 12:27:12 [stor:3] Successfully loaded a playlist of 6 tracks.
    @400000004e22b90a38f56db4 2011/07/17 12:27:12 [threads:3] Created thread "output(dot)alsa" (1 total).
    @400000004e22b90a38fc99a4 2011/07/17 12:27:12 [threads:3] Created thread "wallclock_alsa" (2 total).
    @400000004e22b90a3908e22c 2011/07/17 12:27:12 [clock.wallclock_alsa:3] Streaming loop starts, no sync.
    @400000004e22b90a390d2404 2011/07/17 12:27:12 [mksafe:3] Switch to safe_blank.
    @400000004e22b90a392789d4 2011/07/17 12:27:12 [output(dot)alsa:3] Using ALSA 1.0.23.
    @400000004e22b90b38a00a54 2011/07/17 12:27:13 [output(dot)alsa:3] Samplefreq=44100Hz, Bufsize=15052B, Frame=4B, Periods=17
    @400000004e22b90c1222ff6c 2011/07/17 12:27:14 [decoder:3] Method "MP3" accepted " /home/martintxo/Music/stor/e4c/e4cf3ecd46b16aa1b645843fb7241 069.mp3 ".
    @400000004e22b91023cf137c 2011/07/17 12:27:18 [server:3] New client: fundy
    [...]
    @400000004e22ba2a0156c40c 2011/07/17 12:32:00 [server:3] New client: fundy
    @400000004e22ba2a082a6e64 2011/07/17 12:32:00 [decoder:3] Method "MP3" accepted " /var/tmp/airtime/pypo/cache/scheduler/2011-07-17-12-32-00/1c 1528419c7d4711723f61669837a16b.mp3 ".
    @400000004e22bb5708685ddc 2011/07/17 12:37:01 [server:3] New client: fundy


    In this last case I don't get any sound, nor from the file " /home/martintxo/Music/stor/e4c/e4cf3ecd46b16aa1b645843fb7241 069.mp3 ", nor from the scheduled playlist at " /var/tmp/airtime/pypo/cache/scheduler/2011-07-17-12-32-00/1c 1528419c7d4711723f61669837a16b.mp3 ".

    I think that there is a problem with pypo, so if I make the change in the ls_script.liq file, I don't see this in the log:

    @400000004e22c13528adf2b4 #########################################
    @400000004e22c13528adfa84 # *** pypo *** #
    @400000004e22c13528ae0254 # pypo notification gateway #
    @400000004e22c13528ae0a24 #########################################

    Thanks in advance for any advice. Greetings. Martintxo.
  • Vote Up0Vote Down Albert FRAlbert FR
    Posts: 1,978Member, Airtime Moderator
    Hi,

    a possibility to integrate this feature in airtime quickly ?
    that's be a better solution ( a hack is always a dangerous way...)
  • Hi all. Thank for your help. i'm new to Airtime, that's a wonderfull software.
    I modified the /usr/lib/airtime/pypo/bin/scripts/ls_script.liq
    as described by Sergei, to run an autodj playlist when nothing is schedulled on Airplay.

    I've made changes of lines 27 and 28 to :

    default = playlist(mode='random', "/home/mp3/autodj//")

    I'd like to add random jingles from a folder : /home/mp3/jingles/
    each 3 songs of the playlist.
    I tried several scripts that don't match. Could you help me please ?
    (Excuse my poor english).

    Jean-Noel
    Radio Mandarine (France)
    http://radiomandarine.net:9000/radiomandarine.ogg
    http://radiomandarine.net:9000/radiomandarine.mp3
  • Sergei S. wrote on Tue, 14 June 2011 18:37
    Solution found!
    To play random mp3 files from a certain folder replace those two lines with the following:
    default = playlist(mode='random', "/srv/music/")

    A couple of handy commands.
    To check if your new .liq is valid and has no errors:
    sudo /usr/lib/airtime/pypo/bin/liquidsoap/liquidsoap --check /usr/lib/airtime/pypo/bin/scripts/ls_script.liq

    If above outputs no errors, restart liquidsoap with:
    sudo /usr/lib/airtime/pypo/bin/airtime-pypo-stop
    sudo /usr/lib/airtime/pypo/bin/airtime-pypo-start



    Hi, when I do this my mp3 mountpoint in Icecast2 going down. The script does'nt turn anything. So I don't know what is going on.
  • Jean-Noel писал(а) Ср., 20 Июль 2011 20:34
    add random jingles from a folder : /home/mp3/jingles/
    each 3 songs of the playlist.


    Hi Jean-Noel,

    To switch 1:3 there's a Liquidsoap function "rotate". Check the LiquidSoap documentation.

    Your code might look like this:
    music = playlist(mode='random', "/home/mp3/autodj/")
    jingles = playlist(mode='random', "/home/mp3/jingles/")
    default = rotate(weights=[1,3], [jingles, music])
    
  • krzakx писал(а) Вс., 07 Август 2011 23:24
    my mp3 mountpoint in Icecast2 going down. The script does'nt turn anything. So I don't know what is going on.

    Hi krzakx,

    1. did you set you music files location instead of my "/srv/music/"?
    2. did you run the "liquidsoap --check" - and did it went with no errors?
    3. check the log files in /var/log/airtime/

    good luck!
  • eh... I solved it!.
    The main problem was that the music have been in subfolders wichones liqudsoap can't read I don't know why.

    I have one more question because my Radio License.
    Is possible to play random music on CreativeCommons license by 00.00 to 8.00am ? And random All Rights Reserved music from 22.00 to 24.00 ?
    In another way is possible to set times ?
  • Vote Up0Vote Down Albert FRAlbert FR
    Posts: 1,978Member, Airtime Moderator
    the CC licences are attached at your statut.

    if you are a non profit radio, you can do this. (but you must send informations about licences, etc, a web link is a good idea)

    but not if you are a commercial entity

    see the CC website for more informations Wink
  • Hi, thanks for replay.
    You didn't understand me correctly. I am non profit Radio but I have some right reserver music wich I can strem from 17.00 to 00.00. In rest hours I would like to stream CC music from 00.00 to 17.00.
    Thanks
  • Vote Up0Vote Down Albert FRAlbert FR
    Posts: 1,978Member, Airtime Moderator
    that exactly what I say !

    if you are a commercial radio, is forbidden or you must pay for playing this music.

    but if you are a non profit radio you can do this
    the only thing is informing your listeners about the license (on a web page for example Wink

    You can find more information in your language on the website of creative commons : http://creativecommons.org/

    http://creativecommons.pl/
  • Vote Up0Vote Down Albert FRAlbert FR
    Posts: 1,978Member, Airtime Moderator
    This tweak is a feature for airtime, that's clear.
    it's a good thing, i think Wink
    That will be integrate in a near future ?
    for the 2.0 for example.

    this is possible ?
  • I dont't ask about license. I ment sheduling music in set times.

    1) From 17.00 to 0.00 music from Rights Reserved folder.
    2) From 0.00 to 17.00 music from CC folder.

    How do this in LiquidSoap??
  • Vote Up0Vote Down Albert FRAlbert FR
    Posts: 1,978Member, Airtime Moderator
  • hi,

    The location of the file in version 1.9 is /usr/lib/airtime/pypo/bin/liquidsoap_scripts/ls_script.liq

    but where i can found airtime-pypo-stop and airtime-pypo-start
  • 1.9.0 uses init.d:

    sudo service airtime-playout stop
    sudo service airtime-playout start
  • Vote Up0Vote Down Albert FRAlbert FR
    Posts: 1,978Member, Airtime Moderator
    but where i can found airtime-pypo-stop and airtime-pypo-start 


    here :

    /etc/init.d/

  • # Log dir
    set("log.file.path","/tmp/basic-radio.log")
    
    def streamcrossfade(a,b)
      add(normalize=false,
              [ sequence([ blank(duration=0.1),
                           fade.initial(duration=3.,b) ]),
                fade.final(duration=3.,a) ])
    end
    
    # Podlaczenie do JACKA
    live_inp = mksafe(input.http("http://localhost:8000/studio.mp3"))
    #Podlaczenia aritime
    airtime=mksafe(input.http("http://localhost:8000/airtime.mp3"))
    
    #PARAMETR length OKRESLA DLUGOSC CISZY NA PODAWANEJ NA JACKA, PO KTOREJ PRZELACZA PLYNNIE NA AIRTIME
    radio = fallback(track_sensitive = false, transitions=[streamcrossfade,streamcrossfade],
    [strip_blank(length=4.,live_inp),airtime])
    
    
    # WYJSCIA STREAMA
    output.icecast.vorbis(host = "localhost", port = 8000, quality=-1.0,
      password = "****", mount = "low.ogg", description = "***", url="http://***",
      radio)
    output.icecast.lame(host = "localhost", port = 8000, bitrate=128,
      password = "***", mount = "live", description = "***", url="http://***",
      radio)
    
    #output.jack(id="odsluch",radio)
    


    Hi!
    I don't know if I am doing the live stream in good way.
    I turn on my script with one I showed up (So I gave up second instance of liquidsoap), than If I want do live something I am streaming by darkice to http://localhost:8000/studio.mp3. If I do not want stream live the liqudsoap fallback /airtime.mp3 to the client mount point in this situation /live.

    But this way crashing every time after about 30 min. I don't know why.
    Any other ideas how make live streaming ?

  • I am also interested in streaming the live shows which are being recorded. One solution I found in airtime 1.8.2 was to modify /usr/lib/airtime/show-recorder/recorder.py as follows:

    change:
    command = "ecasound -i alsa -o %s -t:%s" % (filepath, length)

    to:
    command = "live-show %s %s" % (length, filepath)
    

    where live-show is a bash script containing:
    #!/bin/bash
    ecasound -f:s16_le,2,44100 -i alsa -t:$1 -o stdout | lame -b 192 -r -S --signed --bitwidth 16 --little-endian -s 44.1 - - | tee $2 | ezstream -c ezstream_stdin_mp3.xml

    and ezstream_stdin_mp3.xml is a config file modified from the ezstream example folder for the relevant server. In this case, an icecast server which is configured to over-ride the airtime stream when the live show connects.

    hope this helps, or maybe you are not recording your live input? - I'm interested in other improvements/alternatives too!

    James
  • I have had a problem with the fall back music switching back to the standard airtime stream. originally i set a folder for airtime to play if it detected silence (a bunch of long CC files), and it switches to these songs smoothly, but occasionally when it switches back to the the Airtime stream it either plays both songs (really annoying) or ignores the airtime stream.

    I think this may have been do to CPU load so i removed the .ogg stream and am only streaming MP3, and the problem has been solved. I just wanted to see if anybody else has had this problem.



    Camerin
  • - fixed already -
    Post edited by McHollander at 2012-08-31 15:19:05
  • Solution found!



    Thanks RadioA6 and liquidsoap docs



    To set up some random music on air, when nothing is scheduled in Airtime, I had to edit the file
    /usr/lib/airtime/pypo/bin/scripts/ls_script.liq




    * SMART NOTES *

    Create a backup copy of the original file before editing it.

    Create a copy of the resulting file, cause it can be replaced by future Airtime updates.




    Find there lines ##27-28:
    default = amplify(0.00001, noise())
    default = rewrite_metadata([("artist","Airtime"), ("title", "offline")],default)


    These two lines define what is transmitted when AirTime is silent. For now it is a noise at a very low volume.



    To play random mp3 files from a certain folder replace those two lines with the following:
    default = playlist(mode='random', "/srv/music/")


    A couple of handy commands.

    To check if your new .liq is valid and has no errors:
    sudo /usr/lib/airtime/pypo/bin/liquidsoap/liquidsoap --check /usr/lib/airtime/pypo/bin/scripts/ls_script.liq


    If above outputs no errors, restart liquidsoap with:
    sudo /usr/lib/airtime/pypo/bin/airtime-pypo-stop
    sudo /usr/lib/airtime/pypo/bin/airtime-pypo-start


    For the endless possibilities that liquidsoap opens, again, please see the liquidsoap documentation and their cookbook


    Does anyone know if this works with Airtime 2.5 ?
  • There are quite a few scripts that do exactly this trick in the Airtime Hacks and Airtime support forums, notably posted by Voisses.
    No longer using Airtime or Libretime.
  • Yes I have noticed. I have spent a day pouring over all of them, however they all vary and some counterdict each other, some are just vague. can you guide me to the most current or reasonable solution?
  • For all those who are not able to run the procedure in version 2.5, follow the tutorial but change this line: 

    default = playlist(mode='random', "/srv/music/")

    to:

    default = (mksafe(normalize(playlist(mode='random', "/srv/music/"))))