MostHated
Posts: 13
Joined: Mon Mar 28, 2016 6:00 pm

How to install and use OpenGL ES 2 on stripped down distro?

Sat Apr 02, 2016 12:28 am

Hello all, I am using a distro called Minibian that is very stripped down for speed, but I am using an x11 session and I want it to utilize OpenGL ES (which it does not seem to be). When I use normal full Raspbian and open the app I want to use and it is smooth with only 35% cpu usage, but when I run Minibian headless, launching an x11 session which loads the same app, it uses 80-85% cpu and does not get very good frame rate. I am guessing eitther OpenGL ES is not installed, or it is just not using it. How can I check if I have it installed already (dont know the package names I would need as every where I look, people say "Raspbian already has OpenGL ES installed", but this is an extremely minimal build which probably has it disable or not installed), or what packages do I need to install / configs do I need to change to utilize this in a Java application?
Thanks all!

User avatar
MarkHaysHarris777
Posts: 1820
Joined: Mon Mar 23, 2015 7:39 am
Location: Rochester, MN
Contact: Website

Re: How to install and use OpenGL ES 2 on stripped down dist

Sat Apr 02, 2016 6:23 am

MostHated wrote:Hello all, I am using a distro called Minibian that is very stripped down for speed, but ...
Your intro is interesting; because, 'stripping down' a distro (whatever we mean by that) usually does not provide speed improvement directly; it saves space (probably) and it may use a smaller memory footprint (which indirectly may affect speed somewhat) but by-and-large a minimal distro is simply going to lack function (which seems to be what you're complaining about).

Start here with this blog. Do some investigation on-line with the minibian community.

I recommend minimal distributions for studying gnu+linux, development, experimentation, and embedded systems... but, for what you're after, just use Raspbian; it works great, and will have the functionality that you are after. Play with minibian ( it has some uses, and its fun ) and why stop with just one install ( SD cards are relatively inexpensive, and the new HDD options are making it easy to boot into multiple OSs for experimentation.
marcus
:ugeek:

User avatar
PeterO
Posts: 5829
Joined: Sun Jul 22, 2012 4:14 pm

Re: How to install and use OpenGL ES 2 on stripped down dist

Sat Apr 02, 2016 7:00 am

MostHated wrote:Hello all, I am using a distro called Minibian that is very stripped down for speed, but I am using an x11 session and I want it to utilize OpenGL ES (which it does not seem to be). When I use normal full Raspbian and open the app I want to use and it is smooth with only 35% cpu usage, but when I run Minibian headless, launching an x11 session which loads the same app, it uses 80-85% cpu and does not get very good frame rate. I am guessing eitther OpenGL ES is not installed, or it is just not using it. How can I check if I have it installed already (dont know the package names I would need as every where I look, people say "Raspbian already has OpenGL ES installed", but this is an extremely minimal build which probably has it disable or not installed), or what packages do I need to install / configs do I need to change to utilize this in a Java application?
Thanks all!
Here's an "on topic" reply :roll:

The long standing openGL ES support does not work in conjunction with X11. openGL ES applications are run form a text console and they take over the whole screen.

I believe the latest (still experimentaal) openGL drivers from Eric Anholt also support openGL ES but I have not yet got round to trying this out.

At the bare minimum I would exppect you will need to add some of the libraries from /opt/vc/lib to get openGL ES working on your stripped down build.

PeterO
Discoverer of the PI2 XENON DEATH FLASH!
Interests: C,Python,PIC,Electronics,Ham Radio (G0DZB),1960s British Computers.
"The primary requirement (as we've always seen in your examples) is that the code is readable. " Dougie Lawson

MostHated
Posts: 13
Joined: Mon Mar 28, 2016 6:00 pm

Re: How to install and use OpenGL ES 2 on stripped down dist

Sat Apr 02, 2016 3:57 pm

MarkHaysHarris777 wrote:
MostHated wrote:Hello all, I am using a distro called Minibian that is very stripped down for speed, but ...
Your intro is interesting; because, 'stripping down' a distro (whatever we mean by that) usually does not provide speed improvement directly; it saves space (probably) and it may use a smaller memory footprint (which indirectly may affect speed somewhat) but by-and-large a minimal distro is simply going to lack function (which seems to be what you're complaining about).

Start here with this blog. Do some investigation on-line with the minibian community.

I recommend minimal distributions for studying gnu+linux, development, experimentation, and embedded systems... but, for what you're after, just use Raspbian; it works great, and will have the functionality that you are after. Play with minibian ( it has some uses, and its fun ) and why stop with just one install ( SD cards are relatively inexpensive, and the new HDD options are making it easy to boot into multiple OSs for experimentation.
I am purposely using a stripped down headless OS for maximum boot time because my project is loading simply 1 java application, and it needs to load it as fast as it can as it is for a digital dashboard replacement for my project car, so it is important that it is up and running and displaying data asap. With normal Raspbian the boot time in to the application is near 45 seconds, with Minibian it is 12 seconds. Which is why I would like to try to get OpenGL ES working with my single x11 session.

I have 8 SD cards all with different distros I have been trying, and unfortunately I am not exactly sure why a initial setup link would be relevant. I was having the same issue with all distros, which is what lead me to investigating further, and does not seem to be Minibian specific but as the gentleman above me mentioned, if OpenGL ES doesn't get utilized in X11, I have to find another route to go.
Last edited by MostHated on Sat Apr 02, 2016 5:21 pm, edited 1 time in total.

User avatar
topguy
Posts: 6466
Joined: Tue Oct 09, 2012 11:46 am
Location: Trondheim, Norway

Re: How to install and use OpenGL ES 2 on stripped down dist

Sat Apr 02, 2016 4:22 pm

Like PeterO said, using OpenGLES will take over the whole screen. So if you make a pure OpenGLES application you don't even have to start X, thus reducing bootup time even more.

I have not big experience with Java on the Pi, but I believe that using the special Oracle version for Raspberry Pi will give you JavaFX in fullscreen without X.
https://wiki.openjdk.java.net/display/O ... spberry+Pi

MostHated
Posts: 13
Joined: Mon Mar 28, 2016 6:00 pm

Re: How to install and use OpenGL ES 2 on stripped down dist

Sat Apr 02, 2016 5:21 pm

topguy wrote:Like PeterO said, using OpenGLES will take over the whole screen. So if you make a pure OpenGLES application you don't even have to start X, thus reducing bootup time even more.

I have not big experience with Java on the Pi, but I believe that using the special Oracle version for Raspberry Pi will give you JavaFX in fullscreen without X.
https://wiki.openjdk.java.net/display/O ... spberry+Pi
Thank you for this, I will definitely start reading up on it! Does an application need to be made with JavaFX in order to be run using it? I tried to follow the guide you posted, and can not seem to launch the app. I just keep getting the error of " Could not find or load main class TunerStudio.jar" using the following :

Code: Select all

 /opt/jdk-9/bin/java -cp -jar TunerStudioMS.jar    
Though I just found out that JavaFX only works if the application is made for it. I am trying to simply run an already made application better. : / I did not make it, I am just trying to I suppose find an x11 alternative now that will run OpenGL ES.

ghans
Posts: 7882
Joined: Mon Dec 12, 2011 8:30 pm
Location: Germany

Re: How to install and use OpenGL ES 2 on stripped down dist

Sun Apr 03, 2016 9:33 am

There is no way a Java application can be automagically
hardware-accelerated if it wasn't written with hardware-
accleration in mind (JavaFX /Java3D / JOGL etc).

A Swing app therefore already runs as fast as it can on a
Pi.

ghans
• Don't like the board ? Missing features ? Change to the prosilver theme ! You can find it in your settings.
• Don't like to search the forum BEFORE posting 'cos it's useless ? Try googling : yoursearchtermshere site:raspberrypi.org

Return to “OpenGLES”