From: Romain B. <to...@ra...> - 2011-04-28 01:26:10
|
Hi! Le 8 avril 2011 04:24, LinkRage <lin...@gm...> a écrit : > Hi. First of all I want to thank you for the incredible liquidsoap you've > done. You've managed to help me with liquidsoap in IRC about an year ago > (special thanks to Romain btw!!!) so no I found that I really need your > advice since I was unable to find (or think of) such a solution. I'm using > liquidsoap (which is custom compiled from recent code I got via Mecurial) in > combination with Airtime 1.7.0 stable > ( http://www.sourcefabric.org/en/products/airtime_overview/ ). > Everything is fine and working as expected but I have just on issue. > I've set backup fallback stream named "default" which loops a m3u playlist > because I want to be sure that even if Airtime fails to push to liquidsoap > (or if I forget to make schedule in Airtime) listeners are going to hear the > backup pls instead just blank silence for example. The problem is that when > playing tracks pushed by Airtime it *always* falls back to the "default" > backup stream between the tracks. > This is the log from liquidsoap+pypo: > @400000004d9ecdca06da18d4 2011/04/08 11:56:32 [decoder:3] Method > "MP3/LIBMAD" accepted > "/opt/pypo/cache/scheduler/2011-04-08-11-53-00/e79776e77f515b7b5e02b87e5aebec46.mp3". > @400000004d9ecdca2f95b97c 2011/04/08 11:56:32 [queue:3] Finished with > "/opt/pypo/cache/scheduler/2011-04-08-11-53-00/cbdf111a3bd0eaafede1eb2dace57aa5.mp3". > @400000004d9ecdca2f95c14c 2011/04/08 11:56:32 [src_5353:3] End of the > current overriding. > @400000004d9ecdca2f95c91c 2011/04/08 11:56:32 [fallback_5377:3] Switch to > cross_5365 with forgetful transition. > @400000004d9ecdcd2933bcb4 2011/04/08 11:56:35 [queue:3] Prepared > "/opt/pypo/cache/scheduler/2011-04-08-11-53-00/e79776e77f515b7b5e02b87e5aebec46.mp3" > (RID 3). > @400000004d9ecdcd2933c484 2011/04/08 11:56:35 [fallback_5377:3] Switch to > cross_5372 with transition. > > One of the options I guess would be to make sure there are *no* gaps between > the tracks (which is something I was unable to do for the push queue) > So I'm trying to think of workaround for that. Any suggestions are > extremely appreciated! Sorry for that very late reponse...! So if I understand you issue correctly, the problem is that the fallback goes back in the middle of a track. In this case you might be interested by the fallback.skip operator. If you need a more evolved solution, you may be inspired by its code: # Special track insensitive fallback that # always skip current song before switching. # @category Source / Track Processing # @param ~input The input source # @param f The fallback source def fallback.skip(~input,f) def transition(a,b) = source.skip(a) # This eats the last remaining frame from a sequence([a,b]) end fallback(track_sensitive=false,transitions=[transition,transition],[input,f]) end Finally, I want to remind that skipping at the very last moment is not easy to deal with. For once thing, it generates a lot of load (for that reason we cannot use it on radiopi when a live ends: reloading one song * 10 streams is just too heavy). Also, if the song is not prepared quickly enought (for instance if it is downloaded) then you may get a gap in between the tracks.. Romain > > Here is my full ls_script.liq file: > =================================================================== > %include "library/pervasives.liq" > %include "/etc/airtime/liquidsoap.cfg" > set("log.file.path", log_file) > set("log.stdout", true) > set("server.telnet", true) > set("server.telnet.port", 1234) > set("tag.encodings",["UTF-8","CP1251"]) > queue = request.queue(id="queue", length=0.5) > queue = audio_to_stereo(queue) > pypo_data = ref '0' > web_stream_enabled = ref false > stream_metadata_type = ref 0 > station_name = ref '' > show_name = ref '' > %include "ls_lib.liq" > server.register(namespace="vars", "pypo_data", fun (s) -> begin pypo_data := > s "Done" end) > server.register(namespace="vars", "web_stream_enabled", fun (s) -> begin > web_stream_enabled := (s == "true") string_of(!web_stream_enabled) end) > server.register(namespace="vars", "stream_metadata_type", fun (s) -> begin > stream_metadata_type := int_of_string(s) s end) > server.register(namespace="vars", "show_name", fun (s) -> begin show_name := > s s end) > server.register(namespace="vars", "station_name", fun (s) -> begin > station_name := s s end) > > live = input.harbor(id="live", password=harbor_pass, "live") > #default = amplify(0.00001, noise()) > default = mksafe(playlist(mode="random",reload_mode="300","/default.m3u")) > default = rewrite_metadata([("artist","BG Metal"), ("title", > "Radio")],default) > > def append_bgmr(m) = > title = m["title"] > # Return a new title metadata > [("title","#{title} <<< StationName" )] > end > > def transfade(a,b) > add(normalize=false, > [ sequence([ blank(duration=5.), > fade.initial(duration=10.,b) ]), > fade.final(duration=10.,a) ]) > end > enable_replaygain_metadata () > default = amplify(1.,override="replay_gain",default) > queue = amplify(1.,override="replay_gain",queue) > queue = map_metadata(append_title, queue) > live = map_metadata(append_bgmr, live) > queue = map_metadata(append_bgmr, queue) > default = map_metadata(append_bgmr, default) > default = crossfade(default) > queue = crossfade(queue) > s = fallback(track_sensitive=false, > transitions=[transfade,transfade,transfade], [live, queue, default]) > s = on_metadata(notify, s) > add_skip_command(s) > # Attach a skip command to the source s: > #web_stream_source = input.http(id="web_stream", autostart = false, > buffer=0.5, max=20., "") > #once the stream is started, give it a sink so that liquidsoap doesn't > #create buffer overflow warnings in the log file. > #output.dummy(fallible=true, web_stream_source) > #s = switch(track_sensitive = false, > # transitions=[to_live,to_live], > # [ > # ({ !web_stream_enabled }, web_stream_source), > # ({ true }, s) > # ] > #) > > if output_sound_device then > out_device = out(s) > end > if output_icecast_mp3 then > out_mp3 = output.icecast(%mp3, > host = icecast_host, port = icecast_port, > password = icecast_pass, mount = mount_point_mp3, > fallible = true, > restart = true, > restart_delay = 5, > url = icecast_url, > description = icecast_description, > genre = icecast_genre, > s) > end > if output_icecast_aacplus then > out_vorbis = output.icecast(%aacplus(channels=2, samplerate=44100, > bitrate=64), > host = icecast_host, port = icecast_port, > password = icecast_pass, mount = > mount_point_aacplus, > fallible = true, > restart = true, > restart_delay = 5, > url = icecast_url, > description = icecast_description, > genre = icecast_genre, > s) > end > =================================================================== > Keep up the awesome work guys! > Best regards, > Zdravko > ------------------------------------------------------------------------------ > Xperia(TM) PLAY > It's a major breakthrough. An authentic gaming > smartphone on the nation's most reliable network. > And it wants your games. > http://p.sf.net/sfu/verizon-sfdev > _______________________________________________ > Savonet-users mailing list > Sav...@li... > https://lists.sourceforge.net/lists/listinfo/savonet-users > > |