Android SDL3 SDL_GL_SwapWindow() causes flickering on Samsung Tab S10+

Hi! A weird situation I’m running into only on my Tab S10+. I haven’t tried building with SDL2 so I can’t tell you if it’s a new issue, but when my application calls SDL_GL_SwapWindow(), it’s causing this error in Logcat:

[SurfaceView[com.xx/org.libsdl.app.SDLActivity]@0#1](f:1,a:4) acquireNextBufferLocked: Failed to acquire a buffer, err=NO_BUFFER_AVAILABLE

Sometimes rendering’s fine with this error, but usually the screen’s flickering. The same program runs well on my Windows computers and my S22+ phone (no errors), but this tablet is consistently having this problem. Has anyone seen this error before or have ideas for resolving it? I’m not seeing any errors from SDL nor OpenGL, so I don’t know what else to try. I’m setting the framebuffer to 0 and the context should be current. I’ll try building with one of the newer SDL2 releases soon.

From looking at Logcat, it looks like the tablet’s causing the error every other swap. Rotating the screen/invalidating the render device resolves the screen flickering but not the error, so maybe it’s related to my rendering/window initialization code?

Thanks!

Edit: I wonder if the flickering and the error message are actually related. I can see the error message happens when SDL swaps the buffer, but I can’t know that’s the cause of the flickering especially because invalidating the render device stops the flickering even though swapping continues to cause the error message.