Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Raspberry Pi Performance
#1
This is not a support question, so much as it is advice for anyone exploring Tilengine.

I was experimenting with some SDL+OpenGL coding on my Raspberry Pi 3 last night, and discovered something that could be of help. If you are planning on using or trying Tilengine on the RPi, don't use the package manager to install SDL2. For whatever reason, the version of SDL2 that the apt-get package manager pulls down runs terribly if you try to compile Tilengine applications with it. We're talking less than a frame a second, really bad stuff.

But during my trials last night, I downloaded the latest stable version of SDL2, and built it from source on my RPi. On a whim, I went back to the Tilengine samples and tried building and running them again. They went from running terribly to running as smooth as butter. The silky-smooth 60 fps I was hoping for was there, and my RPi's system resources weren't even being pushed past 50%, it hovered comfortably in the 28% range.

Now I'm tackling the challenge of running SDL2 applications from the CLI. But I've got Tilengine in my back pocket as one of the most viable rendering engine's I've seen on the Raspberry Pi.
Reply
#2
Hi Richard!

I was aware of the issues regarding performance on the RPi with SDL2. If I remember correctly, the default pre-packaged SDL2 is compiled without OpenGL/ES support, that's what the proprietary graphics driver of the RPi supports. Then, the driver reverts to software-based OpenGL emulation, causing the slow rendering. There are two solutions:
  • Build SDL2 from source, enabling the switch to support OpenGL/ES that's not enabled by default
  • Use raspi-config to choose the graphics driver to "Experimental OpenGL", that brings hardware acceleration to standard desktop OpenGL.
I had this issue with other cross-platform applications that use GLFW3 as window provider, requiring the "experimental" being enabled.

Thanks for pointing this!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)