[hatari-devel] Slow sound buffer

npomarede at corp.free.fr npomarede at corp.free.fr
Thu May 13 11:13:53 CEST 2010


On Wed, 12 May 2010, David Savinkoff wrote:

> Hi Nicolas,
> 
> > If you want to force "samples" instead of using 1024, you can specify
> > a value between 10 and 100 ms. A value of 20 ms ...
> >
> 
> I tested this just now at 20 ms and it worked (tos206uk 11025 Hz 20 ms),
> but when I changed settings to 44100 Hz buffer sync was lost.
> A quick fix to reduce symptoms would be to reduce MIXBUFFER_SIZE also.
> Defining MIXBUFFER_SIZE  to 2048 has much less delay when buffer sync
> is lost, as loss of buffer sync loss is in several hundreds of milliseconds.
> 
> David Savinkoff
>

As I previously explained reducing MIXBUFFER_SIZE doesn't fix 
anything, it just hide the problem because you're looping through a 
shorter buffer using modulo.

As you say, a loss of buffer sync would be less noticeable, but the real 
question is "why does the OS/driver lose sync ?". The real cause should be 
fixed, not hidden.

And 2048 is too short when playing sound at 50 kHz, we need to have 4-5 
frames ahead of sound, so that would mean at least 5000 samples.

(in your case it's like if your sound card had some kind of latency when 
sound freq is changed and several frames were dropped)

Nicolas


More information about the hatari-devel mailing list