More: Buffer length in MME

James Joseph Clark clark at Athena.McRCIM.McGill.EDU
Tue Sep 8 15:07:28 EDT 1998


> 
> A follow up to my first post.
> 
> As well as stereo, it seems I can add other extra processing (e.g. Reverb
> and filters) to the sound and it still doesn't seem to affect the minimum
> buffer length.  In other words, the buffer length needed doesn't appear to
> be realted to the processing required for the synthesis.
> 

The latency (and hence the number of buffers needed) depends mostly on
the latency of the Windows operating system in handling messages (such
as WOM_DONE). It has nothing to do with what processing you do, as
long as your processing doesn't take longer than the operating system
latency. In particular, reducing the amount of processing won't let
you reduce the latency below the minimum mandated by the operating system.

> My initial thoughts were that it was something to do with my cheap soundcard
> (poor drivers, hardware).  But Rebirth allows under 50ms before underruns
> happen (MME driver).  I'm only managing 90ms, but as I say, it doesn't seem
> to be dependent on the amount of processing.  Is Rebirth fibbing about the
> time or are they accessing the card more effectively.
> 

Rebirth uses DirectX for their sound output, which allows lower
latency than the MME drivers. (The latency of DirectX sound capture,
however, is no better than that of the MME drivers).

oops, you said Rebirth under the MME driver. Well, one thing you could
try is to reduce the number of buffers, but make them longer. This way
fewer messages (callbacks or windows messages) need to be handled by
the OS, and so the OS latency might be reduced.

> I was wondering whether the use of  WAVE_FORMAT_DIRECT in WaveOutOpen is the
> way to go.  Thing is, WaveOutOpen fails when I use this flag so I don't know
> if its useful.  If it is, how do I go about using it?
> 
> Thanks
> 
> 
> Joe Wright - joe.wright at pipemedia.co.uk

Jim Clark
clark at cim.mcgill.ca






More information about the music-dsp mailing list