SDL2 / Android Surface error

Hello everyone,

I have encountered an issue with SDL2 on android. 20 seconds after the app has started the UI gets stuck and doest render anything. Although pressing buttons or using controls actually does work because I can see it on the device I am control with the app. So it seams like the screen isn’t java code is updating the screen while the c++ code is working fine.

I also get this error before it gets stuck.

E/Surface: queueBuffer: error queuing buffer to SurfaceTexture, -22

Greetings,

Are you calling SDL_PumpEvents or SDL_PollEvent? You need to pump the event queue in some way.

I am calling the SDL_PollEvents. Why do I need to pump the event queue?

SDL_PollEvents() implicitly calls SDL_PumpEvents().
Trent just wanted to make sure that you’re doing one of those so the
events get pumpsed in some way.

Ok, So any clue to why is this happening? Also I think I am using a 2.0.4/5 version not the latest, I tried to switch to the latest but it doesn’t even start the app anymore, crashing at startup.

Greetings

Are you sure that you are depleting the event queue?
doing "while (SDL_PollEvents() != 0 ) { …}

Yes, I am doing it this way:

void Poll(void) {
   SDL_Event   event;
   while ( SDL_PollEvent(&event) ) {
      ...
    }
}

So I am still fighting with this same issue, now gives me different error

I/Adreno: DequeueBuffer: dequeueBuffer failed

Any clue?

I think you are not providing enough information.
I would try to the latest version of SDL2 and make sure all android files that you use are also up to date.