Re: [Savonet-users] [Savonet] #303: Large tracks take long to load
Hello ! Le jeudi 10 septembre 2009 15:55:55, vous avez écrit : > When all is done, I'll be sure to send you guys a success story for > Liquidsoap! > > Thanks again for helping me!!! :) Heh, thanks for you patience. It is always very nice to read comments like this ! Don't hesitate to come again if you need some help later ! Romain -- Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july ___ Savonet-users mailing list Savonet-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/savonet-users
Re: [Savonet-users] [Savonet] #303: Large tracks take long to load
Romain, Just to give you guys a heads up, I already built a DJ Cron, which takes care of everything for us... It even tells us: Now Playing Last Played Next to Play Records listener peak information during the set, and on finish, and will also be responsible next to make sure we have a perfect schedule down to the second, by carefully choosing what to play on the main stream. When all is done, I'll be sure to send you guys a success story for Liquidsoap! Thanks again for helping me!!! :) Nathan -Original Message- From: Romain Beauxis [mailto:to...@rastageeks.org] Sent: Wednesday, September 09, 2009 9:43 PM To: Nathan Huebner Cc: savonet-users@lists.sourceforge.net Subject: Re: [Savonet] #303: Large tracks take long to load Le mercredi 9 septembre 2009 21:32:15, vous avez écrit : > Liquidsoap says, ok I'll load this, and Oh since I see this is the main > fallback for receiving music, I'll go ahead and load it again! Now I have > two of the same track ready to play (...).. > > I just need to know how to tell Liquidsoap what to load. I don't know SH > programming, I'm actually a pure PHP programmer. Ok, please apologize for my previous assumption then... > But it's a real mystery > here what your software wants to receive, and how it should be received. > It's been a guessing game. The thing is that liquidsoap wants to keep in advance a queue of some requests in order to make sure that it will always have something to play. Hence the two songs that you see on the initial startup. Provided you have liquidsoap 0.9.1, you can however, use the new behaviour which will allow only one song to be requested at once. What you need is to do: request.dynamic(conservative=false, length=5., (...) That way, liquidsoap will estimate the length of the current song and only query for a new one when there are 5 (estimated) seconds remaining. The reason for this being an estimation is because mp3 format, for instance, does not allow a reliable length computation, hence computing the total length needs the decoding of the whole song, which we want to avoid :) > Once I can dynamically talk to liquidsoap using the request.create (without > every request being a duplicate, and without liquidsoap needing a new > fallback to facilitate it during this dynamic method), I'll add a fallback > playlist later. Right now I'm focusing on how to have full control over > liquidsoap using request.dynamic, so I can begin writing a scheduler in > PHP. Ok. I hope that with the above settings, you should have the full control of the scheduling in liquidsoap. I wish you success in writing a scheduler in PHP :-) Romain -- Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july ___ Savonet-users mailing list Savonet-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/savonet-users
Re: [Savonet-users] [Savonet] #303: Large tracks take long to load
Romain (aka Toots?), Thanks for the support ! And for the code :) Ok so if I do this, how are jingles handled? Because we still want to use jingles. Can the dynamic request still use all my fallback stuff? Basically s is the Playlist ? What about Meta Data? What about Live? What about Fallbacks? What will removing the playlist do for our jingle transitions? Will there be any prebuffering like with playlist.safe? Here's our script, can you tell me how I can keep it pretty much exactly the same, except without playlist functionality? set("log.file.path", "nfm.log") set("server.telnet",true) def transition(j,a,b) add(normalize=false, [ fade.initial(b), sequence(merge=true, [blank(duration=1.),j,fallback([])]), fade.final(a) ]) end live = input.http(id="live", buffer=10., autostart=false, "http://localhost:8000/live";) live = insert_metadata(id="livemeta",clear_metadata(live)) live = strip_blank(length=10.,live) # Playlist playlist = mksafe(playlist(mode="normal", reload=100, reload_mode="seconds", "/home/nocturnal/playlists/main.pls")) playlist = rewrite_metadata( [("artist",("[Nocturnal.FM Main] "^"$(artist)")), ("title",("$(title) "^"[The best trance & progressive] "^"$(album) ")), ("album","")],playlist) # Transitions & Jingle jingle = normalize( single ("/home/nocturnal/tunes/JINGLE/NFM-Jingle-20090904.mp3") ) # Fallbacks radio = fallback(track_sensitive = false, [request.queue(id="request"), playlist, blank()]) # Transitions def fade(jingles,s) fade_in = 12. fade_out = 10. start_next = 3. def fader(from,to) from = fade.out(duration=fade_out,from) to = fade.in(duration=fade_in,to) add(normalize=false, [ to, sequence([ jingles, fallback([]) ]), from ]) end cross(duration=start_next,fader,s) end radio = fade(jingle,radio) # Outputs output.icecast.vorbis ( , radio) -Original Message- From: Romain Beauxis [mailto:to...@rastageeks.org] Sent: Wednesday, September 09, 2009 6:56 PM To: Nathan Huebner Cc: savonet-users@lists.sourceforge.net Subject: Re: [Savonet] #303: Large tracks take long to load Hi ! Le mercredi 9 septembre 2009 17:48:58, vous avez écrit : > What I was hoping to see: > > Start your liquidsoap with a playlist designed to fit x # of hours. Put in > a variable assuming that the first track is the track I want to play next > (obviously common sense in every situation of listing things in a fresh > manner of speaking), when the playlist has reloaded (and detected as a NEW > playlist ie: ANYTHING changed... Size, Shape, Order, whatever I don't > think it matters) ie: changes made to the playlist, but while starting at > the top of the playlist "after" the track that is playing has finished. > This would allow us to create day long playlists, and then updating the > new playlist in the evening, rather than do substring cutting, and > searching through a playlist file to see what has been playing. > > Thanks! > > Sorry if I sound like I'm complaining, this stuff is kind of difficult if > you just learned linux a week ago :) No problem, you're much welcome ! However, please try to use the mail adress dedicated to user's support, which is: savonet-users@lists.sourceforge.net About your issue, my guess is that your needs will not fit the playlist design. The playlist in liquidsoap is really designed to be something flexible, where you put a bunch of songs to be played. If you need a more precise control over what you play, the best would be to have liquidsoap call an external script. Such a source can be created using the request.dynamic operator. Using this operator, each time liquidsoap needs to queue a new song, it will call any script that you provide it and use the returned value. That way, you can work out all your constraints outside of liquidsoap, using your prefered language etc.. All you need to do it to code a script that returns the new song to queue. A usage example would be: # Request function def request () = request.create(audio=true, list.hd(get_process_lines("/path/to/script")) end # The dynamic source: s = request.dynamic(request) The first part of the code is a function that calls the script "/path/to/script" and creates a new request using the the first line of its output. The second part is a source that calls the function "request" in order to get its new songs. Please don't hesitate to ask for more details if you need ! Romain -- Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do be
Re: [Savonet-users] [Savonet] #303: Large tracks take long to load
Romain, Ok so I have put the dynamic request in, and it points to a file.. ( a script )... But I put in the script the MP3 to play, and this was spammed so much that it kicked me out of SSH lol: /home/nocturnal/track.txt: line 1: /home/nocturnal/tunes/_TODAY/10.today.mp3: cannot execute binary file Your site examples are great, but none actually show the script I use, and how It should respond to my LIQ file to be a valid response. What do I name my script file? What do I put in it? Do I need to do a "Single", and echo back something? Can you help. Thanks Nathan -Original Message- From: Romain Beauxis [mailto:to...@rastageeks.org] Sent: Wednesday, September 09, 2009 6:56 PM To: Nathan Huebner Cc: savonet-users@lists.sourceforge.net Subject: Re: [Savonet] #303: Large tracks take long to load Hi ! Le mercredi 9 septembre 2009 17:48:58, vous avez écrit : > What I was hoping to see: > > Start your liquidsoap with a playlist designed to fit x # of hours. Put in > a variable assuming that the first track is the track I want to play next > (obviously common sense in every situation of listing things in a fresh > manner of speaking), when the playlist has reloaded (and detected as a NEW > playlist ie: ANYTHING changed... Size, Shape, Order, whatever I don't > think it matters) ie: changes made to the playlist, but while starting at > the top of the playlist "after" the track that is playing has finished. > This would allow us to create day long playlists, and then updating the > new playlist in the evening, rather than do substring cutting, and > searching through a playlist file to see what has been playing. > > Thanks! > > Sorry if I sound like I'm complaining, this stuff is kind of difficult if > you just learned linux a week ago :) No problem, you're much welcome ! However, please try to use the mail adress dedicated to user's support, which is: savonet-users@lists.sourceforge.net About your issue, my guess is that your needs will not fit the playlist design. The playlist in liquidsoap is really designed to be something flexible, where you put a bunch of songs to be played. If you need a more precise control over what you play, the best would be to have liquidsoap call an external script. Such a source can be created using the request.dynamic operator. Using this operator, each time liquidsoap needs to queue a new song, it will call any script that you provide it and use the returned value. That way, you can work out all your constraints outside of liquidsoap, using your prefered language etc.. All you need to do it to code a script that returns the new song to queue. A usage example would be: # Request function def request () = request.create(audio=true, list.hd(get_process_lines("/path/to/script")) end # The dynamic source: s = request.dynamic(request) The first part of the code is a function that calls the script "/path/to/script" and creates a new request using the the first line of its output. The second part is a source that calls the function "request" in order to get its new songs. Please don't hesitate to ask for more details if you need ! Romain -- Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july ___ Savonet-users mailing list Savonet-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/savonet-users
Re: [Savonet-users] [Savonet] #303: Large tracks take long to load
Romain, The latest problem is that LiquidSoap automatically loads up the same file when I do dynamic requests. So In order for 1 song to play, and then the next correct song, liquidsoap will play each one 2 times. I tried echoing back 2 lines, but liquidsoap doesn’t error, it just... doesn’t do anything... Track.sh: (try # 1 success, infinitely repeats the track) echo "/home/nocturnal/tunes/_TODAY/13.today.mp3" Track.sh (Doesn't error or anything, just doesn't stream -- mainly because I don’t have a fallback, because I don't want one (at least until I get everything running through this dynamic request system)) echo "/home/nocturnal/tunes/_TODAY/13.today.mp3" echo "/home/nocturnal/tunes/_TODAY/14.today.mp3" Thanks Nathan -Original Message- From: Romain Beauxis [mailto:to...@rastageeks.org] Sent: Wednesday, September 09, 2009 8:19 PM To: Nathan Huebner Cc: savonet-users@lists.sourceforge.net Subject: Re: [Savonet] #303: Large tracks take long to load Le mercredi 9 septembre 2009 19:59:01, Nathan Huebner a écrit : > Ok so I have put the dynamic request in, and it points to a file.. ( a > script )... Hmm.. This file has to be an executable script.. > But I put in the script the MP3 to play, and this was spammed > so much that it kicked me out of SSH lol: > > /home/nocturnal/track.txt: line 1: > /home/nocturnal/tunes/_TODAY/10.today.mp3: cannot execute binary file > > > Your site examples are great, but none actually show the script I use, and > how It should respond to my LIQ file to be a valid response. What do I > name my script file? What do I put in it? Do I need to do a "Single", and > echo back something? Can you help. Well the script should be some sort of program of your own, all liquidsoap requires is that it writes to its standard output the name of the next song to queue. Then you can put all the details you need on this script. The dummy example to start with could be: 8<-->8 #/bin/sh # Dummy script that always returns the same song... echo "/home/nocturnal/tunes/_TODAY/10.today.mp3" 8<-->8 You save this content to a file, say /tmp/test.sh and then do: chmod +x /tmp/test.sh which will make it executable. Then on the previous code example I gave you, you replace "/path/to/script" by "/tmp/test.sh". However, this is a stupid script, in order to have the scheduling you need you will need to write your custom script that returns exactly the song you want to play. The advantage of this method is that you are free to use whatever language you feel comfortable with, and you will not have to cope with the details about playlists in liquidsoap. Hope this helps.. Romain -- Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july ___ Savonet-users mailing list Savonet-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/savonet-users
Re: [Savonet-users] [Savonet] #303: Large tracks take long to load
Romain, To give you a recap for your records, here's what we got going! First off, your solution worked beautifully! But keep in mind, 5 seconds is "way" too short, especially for a 400 MB file to prepare. So here's my modified version, for using request.dynamic as our primary fallback stream (for the moment until an emergency playlist is setup)... radio = fallback(track_sensitive = false, [request.dynamic(default_duration=120., conservative=false, length=30., request), blank()]) Hopefully my assumptions here were taken into account of the default_duration. Assuming liquidsoap isn't perfect with length of tracks, I assumed every song is "at least" 120 seconds long. Honestly, nothing on our station is under 3 minutes of length. This will give our request.dynamic 120 seconds (in case liquidsoap assumed 0 length), to still get that next request in. It's our responsibility to keep broken sets out of our rotation & archive, so I won't hold any burden on Liquidsoap to do all that. I set it to 30 seconds length, so that gives plenty of time for the next song to load. And it did! 2009/09/10 04:14:44 [root:3] Broadcast starts up! 2009/09/10 04:14:44 [src_4440:3] Switch to src_4439. 2009/09/10 04:14:44 [decoder:3] Decoder MP3 chosed for "/home/nocturnal/tunes/_TODAY/7.today.mp3" 2009/09/10 04:14:44 [src_4438:3] Prepared "/home/nocturnal/tunes/_TODAY/7.today.mp3" -- RID 1 2009/09/10 04:14:44 [src_4440:3] Switch to src_4438 with transition. 2009/09/10 04:14:44 [src_4435:3] Prepared "/home/nocturnal/tunes/JINGLE/NFM-Jingle-20090904.mp3" -- RID 0 2009/09/10 04:14:54 [src_4435:3] Finished with "/home/nocturnal/tunes/JINGLE/NFM-Jingle-20090904.mp3" 2009/09/10 04:17:12 [server:3] New client: localhost 2009/09/10 04:17:38 [decoder:3] Decoder MP3 chosed for "/home/nocturnal/tunes/DJ/Gabriel-Setis/Tribute-to-Melody-Episode-38.mp3" This worked beautifully! Here's our full code, and thank you again for your help Romain. Apologies if I seemed a bit pushy or upset, you have no idea how stressful my experience has been so far. But mainly just due to me inexperience. I was honestly willing to pull all my hair out to get this working because I know it works, and it works great for what we need! I had no doubt you guys could help us fix this :) Here's the script: (hopefully someone else can use it), we'll send you a better one once it's 100% finalized.. # This is track_now.sh, where we will basically setup what to tell liquidsoap to play # It's very basic, but you have 30 seconds before the track playing ends to update this file. # You can turn this into a script (possibly a heavier load), or just have a script write to this file. # Notes from Romain: make sure you chmod +x track_now.sh for execute permissions ### # INCLUDED FILE: track_now.sh ### # Contents ### echo "/path/to/file.mp3" ### # LIQUIDSOAP LIQ FILE ### # Contents ### set("log.file.path", "nfm.log") set("server.telnet",true) ### # This is where you set the track_now.sh location ### def request () = request.create(audio=true,list.nth(get_process_lines("/path/to/track_now.sh"),0)) end ### # This is to fade your jingle over the next track in track_now.sh ### def fade(jingles,s) fade_in = 12. fade_out = 10. start_next = 3. def fader(from,to) from = fade.out(duration=fade_out,from) to = fade.in(duration=fade_in,to) add(normalize=false, [ to, sequence([ jingles, fallback([]) ]), from ]) end cross(duration=start_next,fader,s) end ### # If you need Live, this hasn't been fully refined, but it's a start # You will need some .sh files to work with this. ### live = input.http(id="live", buffer=10., autostart=false, "http://localhost:8000/live";) live = insert_metadata(id="livemeta",clear_metadata(live)) live = strip_blank(length=10.,live) ### # Transitions & Jingle ### jingle = normalize( single ("/home/nocturnal/tunes/JINGLE/NFM-Jingle-20090904.mp3") ) ### # Fallbacks ### radio = fallback(track_sensitive = false, [request.dynamic(default_duration=120., conservative=false, length=30., request), blank()]) ### # This adds the fade() function between Jingle and Radio ##
Re: [Savonet-users] [Savonet] #303: Large tracks take long to load
Romain, Well to put it simple enough... You gave us a way to feed tracks into liquidsoap dynamically. Liquidsoap is doubling up on the request.create as its next song (instantly when it loads the song). First, can you explain to me how I'm supposed to comfortably feed songs to liquidsoap when its playing each one two times? Is there a way to pass a Playlist... or perhaps 2 songs at once, so that gives me till the current song ends to get new returned when request.create calls on the script. Basically: Request.create receives the MP3. Liquidsoap says, ok I'll load this, and Oh since I see this is the main fallback for receiving music, I'll go ahead and load it again! Now I have two of the same track ready to play (...).. I just need to know how to tell Liquidsoap what to load. I don't know SH programming, I'm actually a pure PHP programmer. But it's a real mystery here what your software wants to receive, and how it should be received. It's been a guessing game. Once I can dynamically talk to liquidsoap using the request.create (without every request being a duplicate, and without liquidsoap needing a new fallback to facilitate it during this dynamic method), I'll add a fallback playlist later. Right now I'm focusing on how to have full control over liquidsoap using request.dynamic, so I can begin writing a scheduler in PHP. Here's the script so far: #set("init.daemon", true) set("log.file.path", "nfm.log") set("server.telnet",true) def request () = request.create(audio=true, list.hd(get_process_lines("/home/nocturnal/track.sh"))) end def fade(jingles,s) fade_in = 12. fade_out = 10. start_next = 3. def fader(from,to) from = fade.out(duration=fade_out,from) to = fade.in(duration=fade_in,to) add(normalize=false, [ to, sequence([ jingles, fallback([]) ]), from ]) end cross(duration=start_next,fader,s) end live = input.http(id="live", buffer=10., autostart=false, "http://localhost:8000/live";) live = insert_metadata(id="livemeta",clear_metadata(live)) live = strip_blank(length=10.,live) # Transitions & Jingle jingle = normalize( single ("/home/nocturnal/tunes/JINGLE/NFM-Jingle-20090904.mp3") ) # Fallbacks radio = fallback(track_sensitive = false, [request.dynamic(request), blank()]) # Add Jingle radio = fade(jingle,radio) # Outputs output.icecast.vorbis ( *, radio) -Original Message- From: Romain Beauxis [mailto:to...@rastageeks.org] Sent: Wednesday, September 09, 2009 9:13 PM To: Nathan Huebner Cc: savonet-users@lists.sourceforge.net Subject: Re: [Savonet] #303: Large tracks take long to load Le mercredi 9 septembre 2009 20:54:06, vous avez écrit : > The latest problem is that LiquidSoap automatically loads up the same file > when I do dynamic requests. > > So In order for 1 song to play, and then the next correct song, liquidsoap > will play each one 2 times. > > I tried echoing back 2 lines, but liquidsoap doesn’t error, it just... > doesn’t do anything... > > Track.sh: (try # 1 success, infinitely repeats the track) > > echo "/home/nocturnal/tunes/_TODAY/13.today.mp3" > > Track.sh (Doesn't error or anything, just doesn't stream -- mainly > because I don’t have a fallback, because I don't want one (at least until > I get everything running through this dynamic request system)) > > echo "/home/nocturnal/tunes/_TODAY/13.today.mp3" > echo "/home/nocturnal/tunes/_TODAY/14.today.mp3" Heh.. The problem, I guess is that you have never written a script so far, have you ? :-) The problem that you will run into now is that you need to consider all that you want for your system. By that I mean write down exactly the specifications that you want for the songs to be played. Then, you will need to implement them, which means choose a language and write a program that finds the correct song according to the specifications. However, this should not be too difficult. I could try to help. Could you please try to write what exactly you want to do for selecting a new song. Try to answer as simply as possible to the question: "Hey, I am liquidsoap. I need to queue a new song, which file should I add ?" :-) Le mercredi 9 septembre 2009 20:57:15, vous avez écrit : > Here's what our playlist metadata did... > > > #playlist = rewrite_metadata( > # [("artist",("[Nocturnal.FM Main] > "^"$(artist)")), #("title",("$(title) "^"[The > best trance & progressive] "^"$(album) ")), > # ("album","")],playlist) > > > Basically, > > [Nocturnal.FM] Romain Beauxis - Liquidsoap Trance (Original Mix) [The best > trance & progressive] $(album) > > The same way we had our playlist setup... I'm sorry I don't know how to do > any of this stuff :( Well, you can do exactly the same ! In the code you show, playlist is a variable, so it could
Re: [Savonet-users] [Savonet] #303: Large tracks take long to load
Le mercredi 9 septembre 2009 21:32:15, vous avez écrit : > Liquidsoap says, ok I'll load this, and Oh since I see this is the main > fallback for receiving music, I'll go ahead and load it again! Now I have > two of the same track ready to play (...).. > > I just need to know how to tell Liquidsoap what to load. I don't know SH > programming, I'm actually a pure PHP programmer. Ok, please apologize for my previous assumption then... > But it's a real mystery > here what your software wants to receive, and how it should be received. > It's been a guessing game. The thing is that liquidsoap wants to keep in advance a queue of some requests in order to make sure that it will always have something to play. Hence the two songs that you see on the initial startup. Provided you have liquidsoap 0.9.1, you can however, use the new behaviour which will allow only one song to be requested at once. What you need is to do: request.dynamic(conservative=false, length=5., (...) That way, liquidsoap will estimate the length of the current song and only query for a new one when there are 5 (estimated) seconds remaining. The reason for this being an estimation is because mp3 format, for instance, does not allow a reliable length computation, hence computing the total length needs the decoding of the whole song, which we want to avoid :) > Once I can dynamically talk to liquidsoap using the request.create (without > every request being a duplicate, and without liquidsoap needing a new > fallback to facilitate it during this dynamic method), I'll add a fallback > playlist later. Right now I'm focusing on how to have full control over > liquidsoap using request.dynamic, so I can begin writing a scheduler in > PHP. Ok. I hope that with the above settings, you should have the full control of the scheduling in liquidsoap. I wish you success in writing a scheduler in PHP :-) Romain -- Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july ___ Savonet-users mailing list Savonet-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/savonet-users
Re: [Savonet-users] [Savonet] #303: Large tracks take long to load
Le mercredi 9 septembre 2009 20:54:06, vous avez écrit : > The latest problem is that LiquidSoap automatically loads up the same file > when I do dynamic requests. > > So In order for 1 song to play, and then the next correct song, liquidsoap > will play each one 2 times. > > I tried echoing back 2 lines, but liquidsoap doesn’t error, it just... > doesn’t do anything... > > Track.sh: (try # 1 success, infinitely repeats the track) > > echo "/home/nocturnal/tunes/_TODAY/13.today.mp3" > > Track.sh (Doesn't error or anything, just doesn't stream -- mainly > because I don’t have a fallback, because I don't want one (at least until > I get everything running through this dynamic request system)) > > echo "/home/nocturnal/tunes/_TODAY/13.today.mp3" > echo "/home/nocturnal/tunes/_TODAY/14.today.mp3" Heh.. The problem, I guess is that you have never written a script so far, have you ? :-) The problem that you will run into now is that you need to consider all that you want for your system. By that I mean write down exactly the specifications that you want for the songs to be played. Then, you will need to implement them, which means choose a language and write a program that finds the correct song according to the specifications. However, this should not be too difficult. I could try to help. Could you please try to write what exactly you want to do for selecting a new song. Try to answer as simply as possible to the question: "Hey, I am liquidsoap. I need to queue a new song, which file should I add ?" :-) Le mercredi 9 septembre 2009 20:57:15, vous avez écrit : > Here's what our playlist metadata did... > > > #playlist = rewrite_metadata( > # [("artist",("[Nocturnal.FM Main] > "^"$(artist)")), #("title",("$(title) "^"[The > best trance & progressive] "^"$(album) ")), > # ("album","")],playlist) > > > Basically, > > [Nocturnal.FM] Romain Beauxis - Liquidsoap Trance (Original Mix) [The best > trance & progressive] $(album) > > The same way we had our playlist setup... I'm sorry I don't know how to do > any of this stuff :( Well, you can do exactly the same ! In the code you show, playlist is a variable, so it could be named anything else. For instance: s = request.dynamic(...) s = rewrite_metadata( [("artist",("[Nocturnal.FM Main] "^" $(artist)")), ("title",("$(title) "^" [The best trance & progressive] "^" $(album) ")), ("album","")], s) Here I have replace "playlist" by "s", but you could also use any variable name that you like.. Romain -- Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july ___ Savonet-users mailing list Savonet-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/savonet-users
Re: [Savonet-users] [Savonet] #303: Large tracks take long to load
Le mercredi 9 septembre 2009 19:59:01, Nathan Huebner a écrit : > Ok so I have put the dynamic request in, and it points to a file.. ( a > script )... Hmm.. This file has to be an executable script.. > But I put in the script the MP3 to play, and this was spammed > so much that it kicked me out of SSH lol: > > /home/nocturnal/track.txt: line 1: > /home/nocturnal/tunes/_TODAY/10.today.mp3: cannot execute binary file > > > Your site examples are great, but none actually show the script I use, and > how It should respond to my LIQ file to be a valid response. What do I > name my script file? What do I put in it? Do I need to do a "Single", and > echo back something? Can you help. Well the script should be some sort of program of your own, all liquidsoap requires is that it writes to its standard output the name of the next song to queue. Then you can put all the details you need on this script. The dummy example to start with could be: 8<-->8 #/bin/sh # Dummy script that always returns the same song... echo "/home/nocturnal/tunes/_TODAY/10.today.mp3" 8<-->8 You save this content to a file, say /tmp/test.sh and then do: chmod +x /tmp/test.sh which will make it executable. Then on the previous code example I gave you, you replace "/path/to/script" by "/tmp/test.sh". However, this is a stupid script, in order to have the scheduling you need you will need to write your custom script that returns exactly the song you want to play. The advantage of this method is that you are free to use whatever language you feel comfortable with, and you will not have to cope with the details about playlists in liquidsoap. Hope this helps.. Romain -- Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july ___ Savonet-users mailing list Savonet-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/savonet-users
Re: [Savonet-users] [Savonet] #303: Large tracks take long to load
Hi ! Le mercredi 9 septembre 2009 17:48:58, vous avez écrit : > What I was hoping to see: > > Start your liquidsoap with a playlist designed to fit x # of hours. Put in > a variable assuming that the first track is the track I want to play next > (obviously common sense in every situation of listing things in a fresh > manner of speaking), when the playlist has reloaded (and detected as a NEW > playlist ie: ANYTHING changed... Size, Shape, Order, whatever I don't > think it matters) ie: changes made to the playlist, but while starting at > the top of the playlist "after" the track that is playing has finished. > This would allow us to create day long playlists, and then updating the > new playlist in the evening, rather than do substring cutting, and > searching through a playlist file to see what has been playing. > > Thanks! > > Sorry if I sound like I'm complaining, this stuff is kind of difficult if > you just learned linux a week ago :) No problem, you're much welcome ! However, please try to use the mail adress dedicated to user's support, which is: savonet-users@lists.sourceforge.net About your issue, my guess is that your needs will not fit the playlist design. The playlist in liquidsoap is really designed to be something flexible, where you put a bunch of songs to be played. If you need a more precise control over what you play, the best would be to have liquidsoap call an external script. Such a source can be created using the request.dynamic operator. Using this operator, each time liquidsoap needs to queue a new song, it will call any script that you provide it and use the returned value. That way, you can work out all your constraints outside of liquidsoap, using your prefered language etc.. All you need to do it to code a script that returns the new song to queue. A usage example would be: # Request function def request () = request.create(audio=true, list.hd(get_process_lines("/path/to/script")) end # The dynamic source: s = request.dynamic(request) The first part of the code is a function that calls the script "/path/to/script" and creates a new request using the the first line of its output. The second part is a source that calls the function "request" in order to get its new songs. Please don't hesitate to ask for more details if you need ! Romain -- Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july ___ Savonet-users mailing list Savonet-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/savonet-users
Re: [Savonet-users] [Savonet] #303: Large tracks take long to load
Hi, Thanks for your script, it confirms what I said. Just change playlist.safe(..) into playlist(..) which will use a queue. If you do this, liquidsoap will refuse the script until you do something to deal with possible failures of track preparation. Easy solution: playlist=mksafe(playlist) somewhere after the first definition. Probably more likeable solution: jingle = single("failure.mp3") # a valid local file containing a short jingle playlist=fallback([jingle,playlist]) # plays jingle when playlist fails If the jingle is long, or in general if you want it to be aborted as soon as the playlist gets ready again, pass track_sensistive=false to the fallback. Otherwise, as it is, it will only give a chance for the playlist to come back at the end of a jingle. The lesson here is that playlist.safe() is trickier than it looks. Have fun, -- David -- Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july ___ Savonet-users mailing list Savonet-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/savonet-users
Re: [Savonet-users] [Savonet] #303: Large tracks take long to load
Savonet, Thanks for the reply. Yes I believe it is a setting issue, as you have so many successful individuals using your service. There's no lastfm submissions (I don't even know how that works or what its for). What I do know is that I have 10 sets at around 2 to 2 1/2 hours of length at 256 kbps to 320 kbps quality that will need to be played each day, and its currently prebuffering in winamp because it's loading on the liquidsoap service. To my understanding, you're saying we should edit the fallback, and add blank? Pretty much the scenario is this... The first set loads up (its fine if this one buffers), but then when that set finishes, the jingle will fade in, but, before the jingle even plays it has to load the next set, in which case we see Prebuffering 0% for about 4 to 5 seconds, and then the jingle starts, and then the set starts. You're saying that we can insert dead air over that prebuffering (or any prebuffering) ? I'd rather have dead air than prebuffering messages, but then again I'd also rather see these sets load up and play when they are supposed to. So perhaps is there a way to cache the next track? I will look into the playlist suggestion that was also made. In the mean-time, if you have any suggestions or code you could send me so I could stop asking for help (lol), it might save us both some time, as I'm quite new to this. Here is my script: set("server.telnet",true) set("log.file.path", "nfm.log") live = input.http(id="live", buffer=10., autostart=false, "http://localhost:8000/live";) live = insert_metadata(id="livemeta",clear_metadata(live)) live = strip_blank(length=10.,live) playlist = playlist.safe(reload=20, reload_mode="seconds", "/home/nocturnal/playlists/reload-test.pls", mode="normal") playlist = rewrite_metadata( [("artist",("[Nocturnal.FM] "^"$(artist)")), ("title",("$(title) "^"[The best trance & progressive] ")), ("album","")],playlist) # Transitions & Jingle jingle = normalize( single ("/home/nocturnal/tunes/JINGLE/NFM-Jingle-20090904.mp3") ) # Fallbacks radio = fallback(track_sensitive = false, [playlist]) # Jingle Fading def fade(jingles,s) fade_in = 12. fade_out = 10. start_next = 3. def fader(from,to) from = fade.out(duration=fade_out,from) to = fade.in(duration=fade_in,to) add(normalize=false, [ to, sequence([ jingles, fallback([]) ]), from ]) end cross(duration=start_next,fader,s) end radio = fade(jingle,radio) # Outputs # OMITTED for privacy output.icecast.vorbis (*** radio) - Also if you submit the songs to lastfm, it can trigger the computation of the length or the song, which costs a lot of compuation in the case of mp3. More generaly, the load may depend on the structure of your script. Hence, it would be easier to give an advice with the script. Also, keep in mind that the latency you expect may be observed at start- up, when liquidsoap is filling its queues. After some time, when the queues are correctly filled, the latency should not appear any more since the time needed to push a new file is covered by the remaining queued time. In particular, you have a parameter for each request-based operators which allows to control the length of this queue so that you can make it bigger in order to have a smoothest latency. I agree that it is not easy to find more than the documentation online. Our main communication channels are IRC and the mailing list. I believe that in your case, you issue is more a concern about setting things properly than a real bugs. Hence, I close this ticket, but I warmly invite you to follow this conversation by email, at savonet-users@lists.sourceforge.net or via IRC on the #savonet channel on freenode. Email, I guess, is the prefered alternative. -- Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july ___ Savonet-users mailing list Savonet-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/savonet-users