RE: [GD-Windows] WaitForSingleObject sleep granularity
Brought to you by:
vexxed72
From: Jon W. <hp...@mi...> - 2002-04-02 16:53:56
|
You didn't say what OS (98/NT/XP/...). I've found the Windows scheduler to be very jittery with a minimum useable resolution of 10 milliseconds or so for a highest-priority thread. However, even so you may suddenly get 100 millisecond drop-outs. These numbers are a bit better on NT based kernels, as their device drivers are somewhat more well behaved. There's also the problem that many consumer audio cards just don't want to deal with audio buffers smaller than 20 milliseconds, so any attempt to go lower than that will fail, and even higher "target latencies" may suffer from being quantized to whatever buffer size the card uses internally (yes, there are lots of cards that use a fixed size granularity!) Your best bet is to write a program which times the MAXIMUM difference between when you want to wake up and when you actually wake up, and run it while you do other things on the machine (FTP, surf the web, WinAmp, play Quake, whatever) and see what comes out. Plot this maximum number over a minute of activity against the different thread priorities and different Windows OS-es and different sound cards to give you enough data to make a good decision. Cheers, / h+ > -----Original Message----- > From: gam...@li... > [mailto:gam...@li...]On Behalf Of > Brian Hook > Sent: Monday, April 01, 2002 4:56 PM > To: gam...@li... > Subject: [GD-Windows] WaitForSingleObject sleep granularity > > > Any ideas what the sleep granularity on WFSO is? Whilst working on my > audio mixer I've found that I'm running into some clicking/popping which > _might_ be related to the WFSO that I do in between buffer fill-ups. > With a 250ms buffer I tend to WFSO for about 60ms...any chance that the > WFSO gets exploded into something horrendously huge? > > Thanks, > > Brian > > > _______________________________________________ > Gamedevlists-windows mailing list > Gam...@li... > https://lists.sourceforge.net/lists/listinfo/gamedevlists-windows > Archives: > http://sourceforge.net/mailarchive/forum.php?forum_id=555 > |