Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.arch.embedded > #26619

Re: Sync to Android frame rate

From rickman <gnuarm@gmail.com>
Newsgroups comp.arch.embedded
Subject Re: Sync to Android frame rate
Date 2017-05-18 21:53 -0400
Organization A noiseless patient Spider
Message-ID <oflj0l$ml5$1@dont-email.me> (permalink)
References <ofipi2$n4g$1@gioia.aioe.org> <ofkqto$1pv4$1@gioia.aioe.org>

Show all headers | View raw


On 5/18/2017 2:59 PM, John Speth wrote:
>> I'm looking for a way to synchronize some code activity to the Android
>> display frame rate. It's a short bit of code that will simply set the
>> color of a small display region, nothing more. Is there some sort of
>> method or hook that I can exploit for this purpose?
>
> I'll answer my own question, partially that is.  It appears one solution
> is to use the Choreographer class which provides a way to hook a
> callback function into the frame rate.  Below is the code.  It executes
> but the timing is sloppy.
>
> I can time the calls to doFrame() using System.nanoTime().  A little
> testing shows me the timing of calls to doFrame() is not uniform
> (ranging from 12 msec to 20 msec, expecting about 16 msec).  The
> callback argument is rock steady (about 16 msec) which makes me think
> it's a value that is computed at initialization time.
>
> It's a solution but it's not doing what I wanted because the callback is
> not timing precisely enough.  Still seeking advice, thank you.

I know nothing about Android, but it seems to me there should be a 
graphics library that provides this sort of functionality.  I would 
think your code would provide a buffer of data to be presented to the 
screen and a graphics call would hand it to the graphic processor which 
in turn copies that buffer in a highly synchronized manner.

Trying to run user code synchronized to the frame update would be 
difficult to say the least.

-- 

Rick C

Back to comp.arch.embedded | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Sync to Android frame rate John Speth <johnspeth@yahoo.com> - 2017-05-17 17:23 -0700
  Re: Sync to Android frame rate John Speth <johnspeth@yahoo.com> - 2017-05-18 11:59 -0700
    Re: Sync to Android frame rate rickman <gnuarm@gmail.com> - 2017-05-18 21:53 -0400
      Re: Sync to Android frame rate Theo Markettos <theom+news@chiark.greenend.org.uk> - 2017-05-19 18:28 +0100
        Re: Sync to Android frame rate rickman <gnuarm@gmail.com> - 2017-05-19 13:47 -0400
        Re: Sync to Android frame rate John Speth <johnspeth@yahoo.com> - 2017-05-19 12:47 -0700
    Re: Sync to Android frame rate John Speth <johnspeth@yahoo.com> - 2017-05-19 12:51 -0700
      Re: Sync to Android frame rate Theo Markettos <theom+news@chiark.greenend.org.uk> - 2017-05-22 11:00 +0100
        Re: Sync to Android frame rate John Speth <johnspeth@yahoo.com> - 2017-05-22 09:24 -0700
          Re: Sync to Android frame rate Theo Markettos <theom+news@chiark.greenend.org.uk> - 2017-05-22 22:30 +0100

csiph-web