[Flac-dev] Synchronizing a streaming client to the server Was: Idea to possibly improve flac?
Tor-Einar Jarnbjo
tor-einar at jarnbjo.name
Fri Jan 7 14:58:59 PST 2011
Am 07.01.2011 23:38, schrieb David Richards:
> I'm also interested in another concept of lossless streaming with
> flac. Lets call it broadcast flac. A problem with streaming for long
> periods of time is that the sending and receiving computers clocks go
> out of sync, for example even if I stream myself on localhost, with
This is not a FLAC specific problem, but has to be handled in all
situations where the streaming server is in control of the transmitting
data rate. It's caused by a playback device, which actual sample rate is
slightly higher than the sample rate actually requested or a streaming
source, which system clock is running slowly. Since these parameters (at
least an exact playback sample rate) is hard to achieve, this is a
rather common problem. Or to shorten it: If the data has a sample rate
of 44100 and your sound card consumes more than 44100 samples per
"sender-time" second, your buffer will eventually exhaust. If it's the
other way around, your buffer may overflow if the client does not handle
these cases properly.
> Anyway what could happen is the client could do a little bit of
> re-sampling here or there to ensure its in sync with the servers
> clock.
That is how streaming clients usually solve this problem, although is
not really improving sound quality.
Tor
More information about the Flac-dev
mailing list