Pypo 100% CPU using.
  • Hi!
    I have big problem with CPU usage.
    When I set bitrate in ogg monit show me that liquidsoap using 40% CPU. And the stream (whatever mp3 or gg) hang up sometimes for a moment.

    So, my question is how to set OGG quality/bitrate correctly?

    My configuration
    %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)
    
    
    
    def streamcrossfade(a,b)
      add(normalize=false,
    	  [ sequence([ blank(duration=0.1),
    	               fade.initial(duration=2.,b) ]),
    	    fade.final(duration=2.,a) ])
    end
    
    
    
    
    queue = audio_to_stereo(request.queue(id="queue", length=0.5))
    queue = cue_cut(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)
    
    #music = playlist(mode='random', "/home/realizator/Pulpit/Random")
    #jingles = playlist(mode='random', "/home/realizator/Pulpit/Jingles")
    #default = rotate(weights=[1,3], [jingles, music])
    
    jingles = playlist(mode='random', "/home/server/muzyka/jingles")
    music_zaiks = playlist(mode='random', "/home/server/muzyka/zaiks")
    music_cc = playlist(mode='random', "/home/server/muzyka/cc")
    default_zaiks = rotate(weights=[1,3], [jingles, music_zaiks])
    default_cc = rotate(weights=[1,3], [jingles, music_cc])
    default = switch(track_sensitive=false, transitions=[streamcrossfade,streamcrossfade], [ ({0h-16h}, default_cc), ({16h-24h}, default_zaiks) ])
    
    
    s = fallback(track_sensitive=false,transitions=[streamcrossfade,streamcrossfade], [queue, default])
    
    
    
    
    s = on_metadata(notify, s)
    s = crossfade(s)
    # Attach a skip command to the source s:
    
    web_stream_source = input.http(id="web_stream", autostart = false, buffer=0.5, max=20., "http://localhost:8000/studio.mp3")
    
    #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=[streamcrossfade,streamcrossfade],
        [
          ({ !web_stream_enabled }, mksafe(web_stream_source)),
          ({ true }, s)
        ]
    )
    
    add_skip_command(s)
    s = map_metadata(append_title, s)
    
    
    if output_sound_device then
        ignore(output.alsa(s))
    end
    
    if output_icecast_mp3 then
    
        #format = %mp3(bitrate=128, samplerate=44100, stereo=true)
        ignore(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_vorbis then
        if output_icecast_vorbis_metadata then
            ignore(output.icecast(%vorbis.cbr(samplerate=44100, channels=2, bitrate=64),
                    host = icecast_host,
                    port = icecast_port,
                    password = icecast_pass,
                    mount = mount_point_vorbis,
                    fallible = true,
                    restart = true,
                    restart_delay = 5,
                    url = icecast_url,
                    description = icecast_description,
                    genre = icecast_genre,
                    s)
                )
        else
            #remove metadata from ogg source and merge tracks to fix bug
            #with vlc and mplayer disconnecting at the end of every track
            s = add(normalize=false, [amplify(0.00001, noise()),s])
            ignore(output.icecast(%vorbis.cbr(samplerate=44100, channels=2, bitrate=64),
                    host = icecast_host,
                    port = icecast_port,
                    password = icecast_pass,
                    mount = mount_point_vorbis,
                    fallible = true,
                    restart = true,
                    restart_delay = 5,
                    url = icecast_url,
                    description = icecast_description,
                    genre = icecast_genre,
                    s)
                )
        end
    end
    
    if output_shoutcast then
        ignore(output.shoutcast(%mp3,
                host = shoutcast_host,
                port = shoutcast_port,
                password = shoutcast_pass,
                fallible = true,
                restart = true,
                restart_delay = 5,
                url = shoutcast_url,
                genre = shoutcast_genre,
                s)
            )
    end


    http://dl.dropbox.com/u/17392916/forum/ogg.png
  • 3 Comments sorted by
  • Your settings look OK,

    What is your system configuration (RAM, CPU)

    Martin
    Airtime Pro Hosting: http://airtime.pro
  • Please

    CPU                            = AMD Athlon(tm) II X4 620 Processor
    Total RAM                      = 2059932 kB
    Free RAM                       = 77760 kB
    OS                             = Ubuntu 11.04 Intel 80386
    
  • Vote Up0Vote Down Jakub GórnickiJakub Górnicki
    Posts: 134Member, Administrator, Sourcefabric Team
    Hey,

    are you still having problems with this issue?

    Jakub