[LAU] Buffering, soundcard clocks, synchronization, streaming

David Olofson david at olofson.net
Thu Nov 6 18:00:59 UTC 2014


On Thu, Nov 6, 2014 at 6:13 PM, Ken Restivo <ken at restivo.org> wrote:
[...]
> I'm told there's a new experimental buffering.adaptive operator in liquidsoap, too. It tries to avoid dropouts by time-shifting the input. Of course, it will probably produce audible effects, like someone putting their finger on a vynil turntable to slow it down. I have a bluetooth adapter here somewhere that takes that strategy for dealing with synchronization, constantly, it's annoying.
[...]

Well, that sounds more like an emergency solution that might be better
than brutal drop-outs on buffer underflows. You're not supposed to
timeshift anything in the situation you're describing. :-)

What's happening is that the incoming data was not actually sampled at
the 44.1 kHz rate you're assuming. That means, if you play it back at
exactly 44.1 kHz, the pitch is going to be slightly off! So, if the
receiving code changes the rate (and therefore also the pitch, as long
as it's plain resampling) to keep the buffer on a steady level, it's
actually *correcting* the problem, making sure that the audio plays
back at the sample rate it was actually captured at.

Now, with this method, if there are connection issues, fluctuations in
buffer level may result in subtle (as far as that applies to the
trained ear) pitch variations, which is why it might actually be a
better idea to do it the simple way, and just drop or insert samples
instead. In an ideal world, resampling is the correct solution,
though.


-- 
//David Olofson - Consultant, Developer, Artist, Open Source Advocate

.--- Games, examples, libraries, scripting, sound, music, graphics ---.
|   http://consulting.olofson.net          http://olofsonarcade.com   |
'---------------------------------------------------------------------'


More information about the Linux-audio-user mailing list