Thread: dropped frames
View Single Post
Old 07-26-11, 05:13 AM   #1
Registered User
Join Date: Jul 2011
Posts: 1
Default dropped frames


I have a problem with the timing of my frames. I use a vertical sync at 60 FPS, and sometimes the time between two frames is superior at 19 ms.
I have a simple test : i use glxgears application where i added this part of code :

static double current_time(void)
   struct timeval tv;
   struct timezone tz;
   (void) gettimeofday(&tv, &tz);
   return (double) tv.tv_sec + tv.tv_usec/1000000.0;

static void event_loop(...)
   // ...

   static double t1 = 0;
   static double t2 = 0;

      glXSwapBuffers(dpy, win);
   t2 = t1;
   t1 = current_time();

    printf("Elapsed time : %f\n", t2 - t1);

   // ...
Glxgears is a very basic application and i don't understand why the time between 2 frames can be superior at 1/60. This is the only application which is running in the server X.

Sometimes, it seems that glXSwapBuffers lagging, and the time for swap buffers is superior than the time of one frame !

My system is an Opensuse 11.1 kernel x86_64 with Nvidia Quadro FX 4600 (version 260.19.29).
Modeline "2048x2400" 327 2048 2096 2128 2208 2400 2403 2413 2469 +hsync -vsync

Thanks for your help
Patrice is offline   Reply With Quote