Hi,

I'm currently using liquidsoap to read from an icecast server.  I also  
have a local playlist on the computer which goal is to avoid loss of  
sound when the server is unavailable.  The script is running on a  
debian lenny computer (PIV, 192Mo for RAM - no GUI !).  I'm getting a  
little problem :

I'm using metadata to launch a little script (with the metadata on  
arguments) with the on_metadata operator.  The problem is that on  
every metadata update received from the icecast server, I'm getting a  
small alsa underrun (but can be heard...).  I thinked it was due to my  
script but, when I'm running on the backup playlist, I don't have any  
underrun...  Here is the script :

-------------------------
# importation
%include "config.liq.aux"


# fonction pratique

def crossfade(cur,next)
   add(id=source.id(next), normalize=false,
          [ sequence([ blank(duration=1.),
                       fade.initial(duration=2.,next)]),
            fade.final(duration=2.,cur) ])
end

def updateStatus(meta)
        # Le script qui sera exécuté ici devra être RAPIDE car tournant dans  
le thread principal!
        # system()
        x = string.ref("")
        get = fst(x)
        set = snd(x)
        def makeArgs(meta)
                def replacer(txt)
                        "<apo/>"
                end
                txt = "<Tag>"^fst(meta)^"="^snd(meta)^"</Tag>"
                txt = string.replace(pattern="'", replacer, txt)
                set("'"^txt^"' "^get())
        end
        list.iter(makeArgs, meta)
        log(get())
        system(metaUpdaterCommand^" "^get()^" &")
end

# Structure radio

playlist = playlist.safe(reload=86400, DB^"/safe/songs/")

secours=playlist
main = strip_blank(length=15., threshold=-60.,  
input.http(id="mainStream", buffer=3., max=5., mainStream))

radio= fallback(transitions = [crossfade, crossfade],  
track_sensitive=false, [main, secours])

# This allow the use of metaData for title updates and commands
out = on_metadata(updateStatus, radio)

# sortie son
%include "out.liq.aux"
-----------------------------------------------------------------------------------------


It's important that the metadata are used for this purpose so I can't  
avoid this use.

Is there any configuration tweaking that could be used to avoid this  
lazy behaviour?  (maybe having greater buffer?)


Another problem is that this script switch sometimes to the backup  
playlist for less than 10 seconds without any apparent reason.  Could  
it be dur to an empty buffer for the http input?

Thanks for your help,

Simon
------------------------------------------------------------------------------
This SF.Net email is sponsored by the Verizon Developer Community
Take advantage of Verizon's best-in-class app development support
A streamlined, 14 day to market process makes app distribution fast and easy
Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev 
_______________________________________________
Savonet-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/savonet-users

Reply via email to