Rockbox.org home
release
dev builds
extras
themes manual
wiki
device status forums
mailing lists
IRC bugs
patches
dev guide



Rockbox mail archive

Subject: Re: X11 simulator clock runs too fast
From: Daniel Stenberg (daniel_at_haxx.se)
Date: 2003-03-06


On Wed, 5 Mar 2003, c s wrote:

> While developing a mod to the wps, I noticed that the X11 simulator clock
> was running much faster than the actual clock does on the Archos.

It certainly does. And it runs differently on different computers as well.

The reasoning behind this is that the simulator will never resemble the
target when it comes to time or speed. Thus, we've mainly focused in getting
the timer to run, not to be accurate.

> I wrote a better fix that uses a separate thread that does nothing but
> increment current_tick every 10ms, however there is a problem with it
> because on many (most?) Linux systems the shortest wait you can do with a
> call to poll() (or usleep(), or nanosleep() ) is 20ms. This makes
> current_tick run at only 50Hz on systems that canít do a suspended wait of
> only 10ms.

I think you're overdoing the accuracy of the tick slightly.

I think you should do whatever sleep you can do, and then read out the actual
time it took and increase the tick counter accordingly. Then it doesn't
matter if your system supports 10, 20 or 200 ms sleep accuracy.

> Also I believe that similar problems exist in the win32 specific simulator
> code, but I didn't look into details or fixes for the win32 code.

I'm positive the problem is very similar there too, yes.

> Is there any interest in using or improving the other fixes that I have
> discussed? I have included some of the code that I wrote below if anyonone
> is interested in the details of what I discussed above.

I don't like the busy-sleep approach, but I'm certainly interested in
improving this situation.

-- 
 Daniel Stenberg -- http://rockbox.haxx.se/ -- http://daniel.haxx.se/



Page was last modified "Jan 10 2012" The Rockbox Crew
aaa