[Icecast] Controlling Buffer Lengths

Robert McAuley rmcauley at gmail.com
Fri Jul 8 16:23:53 PDT 2005


Hello all.  This email comes with a huge explanation.  You can skip to
the final line for the short version of it.

I am wondering how I can control buffer lengths with Icecast.  I can't
see any information in the documentation related to buffers.  I also
cannot seem to find a mailing list search function and Google is not
helping.

The problem is this.  We are trying to run an Unreal Tournament 2004
"Unreal TV" broadcast.  Unreal TV allows up to 40-50 people to watch
an Unreal match while using a fraction of the bandwidth compared to
what they'd use if they were spectating the match themselves.  Unreal
TV has, on our server, a delay of 20 seconds to prevent any watchers
from giving the players tips over a communications program such as
Teamspeak.

We are trying to get an MP3 and a Vorbis stream of play-by-play
commentary to sync up as best as possible to Unreal TV.  My tests vary
wildly.  We have 3 servers: 1 Ogg Vorbis server, 1 MP3 server, and a
2nd MP3 server that's relaying (using a single-mount relay since the
1st MP3 server has fallbacks configured) from the 1st MP3 server.  I
am using Winamp 5 with stock streaming settings (64kbyte buffer with
45% prebuffer) to test, as that is what most listeners use.  I am not
using Icecast's burst-on-connect feature to try and keep buffers as
manageable as possible.

How I test is simple.  I load up Foobar2000 with Oddcastv3, and stream
music to the server.  I then use Winamp to play the stream back.  All
stock settings as far as buffers go.  Vorbis is a q0 mono stream,
giving about 55kbps VBR.  MP3 is a 32kbps mono stream CBR.  I let
Winamp play the stream for about 5 minutes before timing the
difference between when Foobar switches to the next song and when
Winamp gets the change.  What Foobar reports as the time since the
song started is what I consider to be the delay.

So in the end: what options can I use in Icecast to control delay
length?  At these settings, Winamp buffers between 1-2 seconds, which
is a negligible amount compared to the wildly varying results I get
from testing.  So far, my tests have come to the conclusion that the
1st MP3 Server has a delay of 2-3 seconds.  The relay has a 15 second
delay.  The Vorbis stream has a 14-18 second delay. (variable due to
the VBR nature I assume)

I'm not understanding why the buffering is winding up so varied.  Does
it have anything to do with the queue-size option?  Reading the docs
it sounds like the queue is only used when the client falls behind. 
In the burst on connect buffer length section of the docs, it mentions
the usual delay to a client being in the realm of 2 seconds.  Would
using a master/slave relay setup change any of this?

Is it possible to configure delay length in Icecast, that is, the time
between when 1 note of audio comes in from the source and that note of
audio goes out to the client?

Thanks.

- Robert


More information about the Icecast mailing list