Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Controlling Display Refresh Rate on Android Device

Tags:

android

Not yet a developer, just trying to find out if an android app can do what I need..

What I need:

Simple app that displays a full frame of a single color onscreen at a certain intensity at a fixed frequency! I need it for a synchronization purpose with as high a resolution as possible (achieved by changing an intensity in a known pattern with as high a fixed frequency as possible).

What questions I have:

  1. Does an android device run with a fixed display frequency or is there any way to set it to a fixed frequency of say 60fps?

  2. If the fixed frequency can be achieved, is there a vsync interrupt or something similar that lets me change the intensity on the screen at the right time.

  3. If the above two things can be achieved, which approach do I need to take. I'm thinking I need to look at OpenGL ES and perhaps NDK.... Could anyone please point me in the right direction....

like image 202
Mathias Avatar asked Oct 19 '10 08:10

Mathias


People also ask

How do I reduce the refresh rate on my Samsung?

Adjust the refresh rate on your phoneFrom Settings, search for and select Motion smoothness. Tap Motion smoothness again, and then choose your desired option.

How can I make my 60 Hz Android smoother?

Open the Settings app. Tap Display. Tap Advanced. Tap Smooth Display.


1 Answers

I would expect the refresh rate to be fixed at hardware or display driver level. There is an API for finding out what it is, but I doubt if you can set it.

I wrote a game which implemented a fixed framerate of 40fps. The basic technique was to draw everything to an off-screen buffer... something which happens automatically with GL but which has to be done by hand if using Canvas.

When the expensive and variable-length work of drawing your scene off-screen is completed, you can then block your rendering thread (or do other work) until it's time to render. Doing this will ensure each frame displays at even intervals. This gets you nice smooth motion with the bonus that you're not burning your battery by drawing too much (something a lot of GL-based apps do cos they use RENDERMODE_CONTINUOUSLY for no good reason).

like image 110
Reuben Scratton Avatar answered Sep 28 '22 05:09

Reuben Scratton