Re: Answers to some comments about frame synchronization



On fre, 2013-02-15 at 09:21 +0100, Alexander Larsson wrote:
On tor, 2013-02-14 at 16:18 -0500, Owen Taylor wrote:
On Thu, 2013-02-14 at 15:35 -0500, Alexander Larsson wrote:

I did a bunch of research on this, see the g_get_monitonic_time() win32
implementation for it. I definately don't think we can just rely on QPC
as is. Its not monotonic, it will drift over time and i believe over e.g.
cpu sleeps. If we use it we should slave it to the lower precision clock
in some kind of PLL (this is what firefox does). I just couldn't be
bothered with the complexity last time...

The Firefox bug linked to from the GLib comments is 5 years old, and
in following through to various links, all the problems people were
describing were with Windows XP. I'm not convinced that this is a
current problem. DwmGetCompositionTimingInfo() which is the primary
interface we might want to interact with uses QPC time, so my impression
is that Microsoft's view of QPC is that it gives you sane timestamps
along the lines of CLOCK_MONOTONIC on Linux, and not uninterpreted rdtsc
values.

That might be true, although we still support XP. All the official MS
docs on this are really unclear though, which is kinda strange.

http://msdn.microsoft.com/en-us/windows/hardware/gg463266.aspx seems to
have some details though. It talks a bout timer coalescing too, which we
should perhaps make the g_timeout_add_seconds calls use.

Here are some other references:
http://www.belshe.com/2010/06/04/chrome-cranking-up-the-clock/
http://gamedev.stackexchange.com/questions/32183/high-resolution-timer-options-in-windows
http://stackoverflow.com/questions/5559985/handling-the-game-loop-with-os-timers



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]