[hatari-devel] Slow sound buffer
Nicolas Pomarède
npomarede at corp.free.fr
Tue Jan 18 10:25:13 CET 2011
Le 18/01/2011 06:39, David Savinkoff a écrit :
> Hi,
>
> I found that making the timer delays more accurate helps with
> sound synchronization. In Main_WaitOnVbl(void) of main.c
> for example: nFrameDuration = 1000/nScreenRefreshRate
> results in 16 milliseconds when nScreenRefreshRate is 60Hz
> but it should be 16.66... This is a 100%*(16.66-16)/16 = 4.17%
> syncronization mismatch at 60 Hz. Solved, but CPU ticks are
> Not sound system sample rates (separate hardware with separate
> crystals). Thus hatari Must do more, and that is done in sound.c
>
> //fprintf ( stderr, "%d\n", nGeneratedSamples-len); was put in
> audio.c to display excess samples count for experimenting.
>
> Problem solved and the sound is perfect!
>
> Sincerely,
> David
>
thanks, I will look at this later (I'm a little busy these days) and
will try to commit some changes for video freq (it's indeed true that
60Hz gives more rounding error than 50 Hz with the various output freq).
From what I see, this improve rounding error for dma sound too, is that
right ?
Nicolas
More information about the hatari-devel
mailing list