[hatari-devel] Slow sound buffer

David Savinkoff dsavnkff at telus.net
Tue Jan 18 06:39:44 CET 2011


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

BTW while testing and playing with my patch and the latest
Hatari, it feels like the Falcon and Dsp are faster with
Fractal Flight and Pac Them.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: hatari.sound.sync.patch
Type: application/octet-stream
Size: 5817 bytes
Desc: not available
URL: <https://lists.berlios.de/pipermail/hatari-devel/attachments/20110117/3c348db0/attachment.obj>


More information about the hatari-devel mailing list