# OpenGL: Frame partially jumps back and forth [closed]

I'm working on a project with SDL and OpenGL. The game works great on Windows, Linux, OS X and iOS. However, the Android version is showing a problem on my phone in particular. I have tested another device and there it works great as well.

The problem I'm facing is a visual glitch. It happens in bursts: for example: 90 frames okay and then 40 frames the glitch. The glitch itself is kind of hard to describe but I'll try. The screen is being updated partially correct (from the top of my phone to approximately halfway down) and partially flickering. The flickering effect is some sort of back and forth jumping. I'm thinking that it is related to double buffering. I think that because what I get to see on the screen is jumping back and forth every frame. It is like half of the screen is one frame in time and the next frame 2 frames late. Pretty much like a procession of Echternach, I guess you could say. If I plot it in a chart where time goes on when moving down the chart, I think I'm seeing this (numbers in the table are the indices of the frames in my game loop I am actually seeing):

          left half | right half  (phone is in landscape)
------------------------
time  1 |      1           1
time  2 |      2           2
time  3 |      3           1
time  4 |      4           4
time  5 |      5           3
time  6 |      6           6
time  7 |      7           5
time  8 |      8           8
time  9 |      9           7


So the right half is one frame in time, and the next frame, it shows the previous frame. This is supports my theory that there is a problem with double buffering. It looks like it somehow doesn't get to completely update the backbuffer before it is put on the screen, or something.

Also, the split between good and glitch on the screen is different from frame to frame, which points I think proves it is a synchronisation issue and heavily depends on timing of what is going on. Adding glFinish(); before the SDL_GL_SwapWindow(); call doesn't help.

Version info: SDL reports vsync to be turned on. However, I believe that this isn't tearing. My phone a Samsung Galaxy S3 mini and is running Android 5.1.1 (CM12) and the GPU (Mali-400) supports OpenGL ES 2.0. Other games run okay on my phone.

## closed as off-topic by DMGregory♦Jan 15 '18 at 22:04

This question appears to be off-topic. The users who voted to close gave this specific reason:

• "Questions about debugging a problem must provide a minimal, complete, verifiable example of the issue so that readers can diagnose it without needing to guess, read all of your code, or engage in extensive back-and-forth dialog. For more information, see this meta thread." – DMGregory
If this question can be reworded to fit the rules in the help center, please edit the question.

• What is the phone model ? – concept3d Oct 25 '15 at 18:28
• Samsung Galaxy S3 mini. Running CyanogenMod 12. – Martijn Courteaux Oct 25 '15 at 18:33
• I discovered it's everywhere in my phone, but more subtle. Even in the system UI scrolling through menus. – Martijn Courteaux Nov 11 '15 at 12:43
• This sound more like a bug in your phone. My guess is a firmware update is the most likely way to solve it. – rolobo Dec 9 '15 at 12:27
• @rolobo: Yes, indeed. However I'm very happy with everything else and my phone is just a test device for this project and not part of my main development process. – Martijn Courteaux Dec 9 '15 at 16:56