> Using callbacks or pulsing the event, the latency is not only too high,
> but it is not consistent. There is no way to measure the latency of a
> machine and then adjust for it, because it is fairly inconsistent.

Thanks for finding this out so time writing code is not wasted trying to
measure it! It probably varies over time anyway.

> So, what might work is a hybrid approach: we get events that tell us when
> to start polling and when to stop polling. We can poll using
> QueryPerformanceCounter (or add the old usleep.c back into the project)
> for greater than microsecond resolution on most CPUs. We could also take
> another look at the DirectX 8.x high resolution timers, but I'd rather not
> put that burden on users.

Two things - I thought that events increased latency because of having to
wait for them? Also as I mentioned previously, what ms value will you use
for timeSetEvent() to decide on whether to begin polling? (Or maybe this
could be specified by the user in the config file? Again - messy!)

Don't bother about DirectX, I followed that through to its final conclusion.
QueryPerformanceCounter() offers the same features.

> This article provided a lot of insight:
> http://www.codeproject.com/system/simpletime.asp
>
> After reading this, I realised that the Sleep(1) in the polled_ss_win32.c
> would mean it would probably sleep too long upon startup in most
> instances! Changing it to Sleep(0) makes FreeSCI use 99% CPU, but does
> seem to help accuracy. I'm not really sure what to do here.. opinions from
> the list?

Yes this is a very good article, I've previously posted that link to this
list. As minimum latency on Win9x is 55ms then Sleep(1) would take 55ms.
Surely Sleep(0) is not doing anything hence the 99% CPU.

I'd really like you to try implementing something Matt, but personally I
find it hard to believe that we will end up with a good solution. I'm sure
there's more important stuff that needs to be done. After release I'll knock
up that new sound server which passes everything to MCI. That should only
take a couple of days and could fix all of the problems, leaving the hard
work that both of us have and will put in as time better spent.

Cheers,

Alex.




Reply via email to