Plz help raspbian stretch pi3 + SDL2 -X11 + kmsdrm

please can somebody help me how to correctly install SDL2 on raspbian latest lite ver, without X11 (only GLES)?
I have followed a pair of some useful blogs, but something seems wrong with latest raspbian and SDL2 2.08 compile
Feel free to catch me at, or can we build a script together to reach a correct setup?
thank you
Best r.

The steps over here should still be mostly valid: RenderTarget texture got deleted between RenderPresent

I’d also recommend to disable the rpi driver with --disable-video-rpi if you don’t use it.

There’s also the possibility to build a Debian package, but I don’t have any experience with that.

Hello, thanks for your help

I followed your instructions line by line on a fresh raspbian stretch lite pi3 (no rpi, yes kms), running app I get 3 times:

MESA-LOADER: failed to retrieve device information -> on createwindow

Can be a matter of path?

I did export LD_LIBRARY_PATH=/usr/local/lib

Any hint to a newbie? :blush:

btw. hello world with this simple sequence:

SDL_CreateWindow(‘Window1’, 0, 0, 1920, 1080, SDL_WINDOW_FULLSCREEN )

maybe some options to change instead of fullscreen?

You can probably ignore those warnings. I get them every time I run my app on the Raspberry Pi (under X11), but it nevertheless runs perfectly well.

These messages are supposedly from a limitation in Mesa when it gets some device information. It’s nothing critical and should not affect the SDL driver.

Does it now work for you? Can you draw something with the render API? The current SDL KMSDRM video driver can only do fullscreen, if that’s what you’re asking.

works, thank you!

The problem was with libsdl2_image, don’t know why, but don’t load jpgs, wants png.

In your experience the kms driver SDL2 is reliable as the rpi under X?


The KMSDRM driver is currently in an experimental state. It should work reasonably well but may have some limitations.

Perhaps do you have any hint or direction for playing ffplay (ffmpeg) from a SDL2 app? (or ffmpeg play API() or equivalent)?


ffplay is already using SDL. Perhaps you can get some inspiration from its source code. :wink: