[hatari-devel] Slow sound buffer

npomarede at corp.free.fr npomarede at corp.free.fr
Thu May 6 00:13:28 CEST 2010


On Wed, 5 May 2010, David Savinkoff wrote:

> Hi,
> 
> I use CentOS 5.4 linux, Alsa 1.0, SDL 1.2.13. I've tried different
> sound daemons OSS ESD Alsa. Hatari (all versions) has this
> delay and VICE 2.2 --with-sdl on this same system has No delay.
> 
> This problem should not be quickly dismissed. I believe we will
> find a solution (I think this one is just waiting to be found).
> 
> David Savinkoff
>

This is strange, I use alsa too and never noticed this (it would surely 
have bothered me when rewriting ym emulation).
Have you tried pulseaudio ?

What you describe is as if the audio system had a buffer of say 40000 
bytes and ouput sound when this buffer is full. In that case, it's clear 
that the lower frequency used, the more time it will take to fill the 
buffer (as there're less bytes per vbl) and you get an increasing delay 
when frequency is lowered.

Well, if VICE has a solution to make it work under your system, I guess we 
can have a look at it and see how they init sdl audio.

Nicolas


> 
> May 5, 2010 12:01:49 PM, hatari-devel at lists.berlios.de wrote:
>       On Mon, 3 May 2010, David Savinkoff wrote:
>
>       > Hi,
>       >
>       > I noticed that the sound buffering in hatari has a noticeable
>       > delay that is longer at low sampling rates. Just press a key
>       > and wait for the 'ding' to sound, try it at different sample
>       > rates on the ST or STE or any other setting.
>       >
>       > My suggestion is to do what the C64 VICE emulator appears
>       > to do. VICE has 8000, 11025, 22050, 44100 and 48000 Hz
>       > sample rates. Furthermore, VICE has user selectable Audio
>       > Buffer sizes of 0.02, 0.025, 0.03, 0.04, 0.05, 0.075, 0.10,
>       > 0.20, 0.30, and 0.35 seconds (Note: seconds).
>       >
>       > I use 44100 Hz and 0.02 seconds with good results on my
>       > old pentium3 1GHz.
>       >
>       > David Savinkoff
>       >
>       >
>
>       Hello,
>
>       except for the sound quality I can't hear any delay when changing from
>       11025 to 50000 Hz for example.
>
>       As far as I remember, Hatari as a ring buffer that should be equivalent to
>       2 vbl, whatever output frequency you choose, this shouldn't cause a
>       different delay.
>
>       What you describe is more like something with the sound system of you
>       machine that would buffer the output of hatari (could be sdl or the OS
>       sound system)
>
>       Are you running windows or linux ? If linux, do you use alsa, pulse audio,
>       others ?
> 
>
>       Nicolas
>
>       _______________________________________________
>       hatari-devel mailing list
>       hatari-devel at lists.berlios.de
>       https://lists.berlios.de/mailman/listinfo/hatari-devel
> 
> 
>



More information about the hatari-devel mailing list