Bug 248 - http://server:9000/stream.mp3 is several seconds behind 'real time'
: http://server:9000/stream.mp3 is several seconds behind 'real time'
Status: RESOLVED WONTFIX
Product: Logitech Media Server
Classification: Unclassified
Component: Streaming From SlimServer
: 5.x or older
: PC Windows XP
: P5 minor with 3 votes (vote)
: Future
Assigned To: Blackketter Dean
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2004-04-10 07:19 UTC by John Gorst
Modified: 2008-10-02 14:57 UTC (History)
1 user (show)

See Also:
Category: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description John Gorst 2004-04-10 07:19:09 UTC
There seems to be a buffer within the slimserver http stream (in addition to
that in WinAmp) that causes a long lag between pressing, for example, pause in
the web interface and the music actually pausing.

Should it be possible to reduce the size of this buffer as an option for those
wanting minimal latency with a high bandwidth network which does not require a
buffer?
Comment 1 Blackketter Dean 2004-04-10 10:10:12 UTC
Actually, SlimServer doesn't buffer data at all. The buffering is in the client.  Sorry.
Comment 2 Blackketter Dean 2004-04-10 16:50:13 UTC
I was wrong.  We do buffer up to 32k of data in the server before sending.  We could clear out this 
buffer on a song change.
Comment 3 Martin R. Ehmsen 2007-05-24 02:37:34 UTC
It seems very strange that you buffer (that much) in the server. It would only make sense if you thought that the file which the music is read from can become unavailable for some short periods of time. It seems very unlikely and would mean a problem with the disc the files are on.
I don't see any reason to buffer on the server side, or am I missing something?
Comment 4 Blackketter Dean 2007-10-22 16:56:06 UTC
Not much we can do about this.
Comment 5 Martin R. Ehmsen 2007-10-22 18:44:31 UTC
Why isn't there anything you can do about this? Could you please elaborate?
Is the 32k for crossfading?
At the very least could you point me to where the buffer is in the source, then I can change the thing myself?
Comment 6 Blackketter Dean 2007-10-22 20:02:35 UTC
There's no intentional buffering of data on the server side, it's just that SlimServer reads up to 32k to get started.  That, plus the buffers in TCP on both the server side and client, coupled with the fact that the playback chain and the control chain are completely independent means that there's no control over latency.  If you try to stop, pause or change songs, any unsent data is immediately deleted.

If latency is a problem for you, your best bet is to use SoftSqueeze.

That said, if you still really want to try to tweak numbers, the value of MAXCHUNKSIZE in server/slim/web/HTTP.pm is the closest thing you have to a tunable value.  I doubt that it will have much effect.