Re: GtkGlArea render fps is different than monitor frame rate

Thanks for the answers!

I have found the root cause in my code: I realized that GtkGlArea render calls are not called automatically for each screen refresh, and the observed ~40Hz was coming from my program (a timer I already forgot triggered redraw with this rate).

What is the common way to request rendering for every screen refresh? Now I have added a gtk_widget_queue_draw() into my render callback itself; is this the best technique?

With this, I got ~59.2Hz, what seems ok, but also indicates that I have significant frame drops (>1%), even with reniced -19 priority process... As I mentioned, my rendering is very fast, <1ms.

It would be desirable if I could get info about the current frame counter, i.e., similar to one in page_flip_handler's sequence  in DRM world, because I would like to use some optimizations based on that. Is it possible to get this info?


On Sat, Feb 4, 2017 at 10:04 AM, Tarnyko <tarnyko tarnyko net> wrote:
Your program's rendering is slower than the monitor nominal refresh rate, which is perfectly possible if your scenes are heavy.
Please note that it could also render _faster_ (FPS higher than refresh rate).
Scenes FPS are not directly tied to your monitor, unless you enable what we call "VSync" : i.e. your FPS are higher than 60, but you programmatically force it down to 60. The benefit is avoiding what we call "tearing", which is a display artifact that your eye could notice.
Ferenc Engárd writes:
I have a strange issue with GtkGlArea under linux: it seems my program runs
with a different fps than the monitor's refresh rate. (The rendering itself
is fast, faster than 1ms.)
I use a 60Hz monitor mode, and the rendering fps is around 39.5Hz. I
verified my monitor refresh rate with xrandr, and even with another --
X11-EGL based -- program; it is really 60Hz.
I also measured the time interval between two render calls, and the min and
max is around 22ms and 28ms, so it seems that I even do not drop a frame.
I do not set anything special in GtkGlArea or opengl (glSwapInterval or
Did you encounter with such an issue? Any idea what can be the problem?
Ubuntu 16.04, unity, gtk+ 3.18.9

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