On Tue, Apr 17, 2018 at 9:09 PM, H. Nikolaus Schaller <h...@goldelico.com> 
wrote:
>
> Am 17.04.2018 um 21:05 schrieb H. Nikolaus Schaller <h...@goldelico.com>:
>
> Hi Sven,
>
> Am 17.04.2018 um 16:31 schrieb Sven Dyroff <s.dyr...@phytec.de>:
>
> Hello Nikolaus,
>
>> It looks as if it is much more often reporting accelerometer events (ca.
>> 15ms) than the 4.16 kernel (ca. 100-200ms).
>
>> But neither change has the effect of making the graphics faster and
>> smoother.
>
>> So there is likely a third factor involved when comparing to GTA02.
>
> no, I think you've found the cause!
>
> 100-200ms results in a frame rate of 5 to 10 Hz which is awfully slow!
>
>
> Unfortunately no. Would be too simple...
>
> There is a background thread that reads the accelerometer every now and then
> and
> simply returns the last value each time it is called. So these speeds are
> completely
> decoupled! QtMaze does not see any delay in code when calling getacx(). This
> returns the value of a global variable that is updated by the background
> thread.
>
> The accelerometer delay can only be recognized by a delayed reaction but
> has no influence on the frame rate. So graphics should not have small jumps
> if
> you don't move the device...
>
> So we still have to dig deeper into it... For example someone could look
> into the sources of QtMaze how the display redrawing is done.
>
>
> It is here:
>
> http://git.goldelico.com/?p=gta04-qtmoko.git;a=tree;f=src/3rdparty/games/qtmaze;h=38f4df583bba2a4712baf40915bc0026fb16dc8d;hb=398d5c957571fed6b63174cfd2e4b6d57aeff9a4

>From a quick glance at the code (form.cpp) is looks like the ball is
moved only in the MoveBall method, which is called only in the
callback from accelerometer thread (and in some other function too,
but that function is also called only from that same callback).
In the library, accel_work (the accelerometer thread) calls
accelerometer_moo in a while loop until it gets a measurement and only
then calls the QtMaze's callback, which seems to be the only way to
actually update the ball's position.

It shouldn't really work that way, and I there's a possibility that
I'm mistaken since I just had a few minutes look into a codebase I
never seen before, but it does really seem that by lowering the
accelerometer read rate you'll get lowered ball movement frame rate in
QtMaze :)

-- 
Sebastian Krzyszkowiak, dos
https://dosowisko.net/
_______________________________________________
Gta04-owner mailing list
Gta04-owner@goldelico.com
http://lists.goldelico.com/mailman/listinfo.cgi/gta04-owner

Reply via email to