Page 2 of 2

Re: LibGDX on RPi

Posted: Mon Feb 12, 2018 9:37 am
by clicky
Hi, I have encountered same problem as you are right now and I've done something to overcome it. I just cannot remember what was it. I suspect I just upgraded distro at the end as that seemed the simplest. Box that might have all of it is due to circumstances not on the net at the moment - I'll attach it in aprox. 4 hours form now and I'll be able to have a quick look and I'll let you know...

Re: LibGDX on RPi

Posted: Mon Feb 12, 2018 10:10 am
by msx80
Don't worry, i actually managed to solve the problem, it was indeed a mismatch in shipped with your rpi-enabled libgdx.
Maybe you cross-compiled them or indeed hade some different distro before/after. Btw, i'm not a c/c++ expert so maybe i'm talking nonsense, but are we sure we need to link to ? If it's possible at all to avoid, it would be great becouse i'm afraid new versions of Raspbian/Retropie would require recompilation and that's pretty bad.

Anyway, to solve it i compiled the .so directly on the raspberry using your (which btw has a copy/paste typo you should fix (double ant -f), i hope that's not the ultimate source of the problem :P). It outputted some valid version of the libraries, i copied them on rpi-enabled libgdx, built it and it worked!

Great job clicky! I can report that:
  • * gdx-controllers works great, but the event based version fire events continuously even if nothings is touched, while regular desktop version fires only if the controller was moved (not sure if the problem is in the controllers driver or in some point inside libgdx).
    * JoglNewtApplication/JoglNewtApplicationConfiguration don't seem to honor the foregroundFPS and backgroundFPS. Are you the author of the jogl backend?
Another question, do you think rpi support will ever be merged into official libgdx ?

Re: LibGDX on RPi

Posted: Mon Feb 12, 2018 10:24 am
by clicky
Good to hear you've sorted it. :) You've intrigued me and I'll check what I've done + update example to work with the latest + move version to stable 1.9.8 and 1.9.9 snapshot. Ah, only question when! LOL

To answer your questions:
1. I am not C/C++ expert by any means. Not even apprentice or enthusiast. So there are two of use - blind leading blind
2. I am not author of anything LibGDX. I wouldn't know more than you do about joystick support. At one point I started looking into what is happening with OSX impl, but I don't know anything about OSX works, C/C++...
3. I am not JOGL author nor associated with them. Work here is mere derivative of what @xranby (he might be closer to jogl) and others (one of the topics: viewtopic.php?f=81&t=112806) did...
4. I don't think this will be merged back to LibGDX. Current build system there is quite convoluted and they've rejected some half way solutions like this one is and there is nobody willing to put together full/proper solution - hence my fork :(

Re: LibGDX on RPi

Posted: Tue Feb 20, 2018 10:13 am
by msx80
Hi there, i managed to make everything work decently. I was wondering if you could update your repository with a working version (that is, with the correct ) of either 1.9.8 or 1.9.9? That way people could build our projects without having to build the whole libgdx.

If anybody needs it, to make audio work, the quickest way is to run a "sudo modprobe snd_pcm_oss". This will load a wrapper library to make alsa interoperate with oss, since libgdx uses OpenAL and OpenAL uses oss. I tryed to make OpenAL talk to Alsa directly but couldn't, and i was warried that something else could break somewhere else so gave up :P

Re: LibGDX on RPi

Posted: Sat May 05, 2018 2:23 pm
by alexis-puska
Hi all,

I follow this instruction to create a project and a subproject for my raspberry pi. I create the jar and that run correctly. But i continue the development of my game, and when i used freeType, i package the project test on my pi, and i get trouble with the
Caught GdxRuntimeException : Couldn't load shared library ''

I read that a developper add to libgdx all stuff to compile libgdx freeType for arm, i have found the github repository, but nothing on the description to compile. The library is outdated 1.9.5 -> current 1.9.8. How can i compile and use the compilation in my project ?


Re: LibGDX on RPi

Posted: Wed Sep 12, 2018 10:41 am
by barkholt

Can we get access to your 1.9.7/8 builds? The link ... /mvn-repo/ you posted is not valid?

I'm kinda depending on the great work you have been doing, and would really like it if we could get some kind of stable tracking of the primary repo going.

Re: LibGDX on RPi

Posted: Sun Oct 07, 2018 8:09 pm
by clicky
Apologies for the late response - I've just tested it and it seems to be working.

I've picked my 'test' project:

Updated versions (of almost everything that has something to do with gradle - eh) - including LibGDX to be 1.9.8.rpi and - it fetched all and built without issues...

Want to give it a go and let me know?

Re: LibGDX on RPi

Posted: Sun Nov 04, 2018 6:45 pm
by alexis-puska
Hi all,

I've tested your dev, that work, i follow your build.gradle add your repository to update jogl backend to the 1.9.8-rpi.SNAPSHOT version.

i have a problem with the controllers... Each time when i resize the app, we need to clear listeners and add listeners on controllers for get work. I made a controller mapper for network controllers, local controllers , keyboard event and i have a problems when i try to get the all controllers connected.

Get list of controller

Code: Select all

Array<Controller> controllers = Controllers.getControllers();
clear listener, wait add listeners on controller

Code: Select all

public void resize(int width, int height) {
		this.viewport.update(width, height, true);, "RESIZE");
		try {
		} catch (InterruptedException e) {"MultiBomberman", "Resize thread error");

the libgdx program crash with this stack trace :

Exception in thread "main-Animator#00" com.jogamp.opengl.util.AnimatorBase$UncaughtAnimatorException: com.jogamp.opengl.GLException: Caught NoSuchFieldError: JoglGL on thread main-Animator#00
at com.jogamp.opengl.util.DefaultAnimatorImpl.display(
at com.jogamp.opengl.util.AnimatorBase.display(
at com.jogamp.opengl.util.Animator$
Caused by: com.jogamp.opengl.GLException: Caught NoSuchFieldError: JoglGL on thread main-Animator#00
at com.jogamp.opengl.GLException.newGLException(
at jogamp.opengl.GLDrawableHelper.invokeGLImpl(
at jogamp.opengl.GLDrawableHelper.invokeGL(
at com.jogamp.newt.opengl.GLWindow.display(
at com.jogamp.opengl.util.DefaultAnimatorImpl.display(
... 3 more
Caused by: java.lang.NoSuchFieldError: JoglGL
at com.badlogic.gdx.backends.jogamp.JoglGraphicsBase.getType(
at com.badlogic.gdx.controllers.Controllers.initialize(
at com.badlogic.gdx.controllers.Controllers.clearListeners(
at com.mygdx.main.MultiBombermanGame.resize(
at com.badlogic.gdx.backends.jogamp.JoglGraphicsBase.reshape(
at jogamp.opengl.GLDrawableHelper.reshape(
at jogamp.opengl.GLAutoDrawableBase$
at jogamp.opengl.GLDrawableHelper.invokeGLImpl(
... 6 more
AL lib: (WW) FreeContext: (0x668c4c30) Deleting 16 Source(s)
AL lib: (WW) FreeDevice: (0x668cfac0) Deleting 18 Buffer(s)
EGLDisplayUtil.EGLDisplays: Shutdown (open: 1)
EGLDisplayUtil: Open EGL Display Connections: 1
EGLDisplayUtil: Open[0]: 0x1: EGLDisplayRef[0x1: refCnt 2]

If any body have an idez i take it.

my project :


Edit :
I think that this line of code the problem inside the JoGL librarie code :

Code: Select all

	public GraphicsType getType () {
		return GraphicsType.Jogl;
Inside the Libgdx source code this value is note inside the enum class :

Code: Select all

public interface Graphics {
	/** Enumeration describing different types of {@link Graphics} implementations.
	 * @author mzechner */
	public enum GraphicsType {
		AndroidGL, LWJGL, WebGL, iOSGL, JGLFW, Mock, LWJGL3
Issue open with libgdx :

Re: LibGDX on RPi

Posted: Sun Nov 04, 2018 7:51 pm
by clicky
Honestly - no idea. Maybe what you suggested would help - adding JOGL to the list of enums. Do let me know if you need help with recompiling all on RPi after those changes... You can always manually move changed jar to your app and see if it works...

Re: LibGDX on RPi

Posted: Sun Nov 04, 2018 8:17 pm
by alexis-puska
I don't know what is the specification of the libgdx package for raspberry pi that you made, can you say me what is the change with the official package and how you compile it ? i think you use gradle assemble ?

Re: LibGDX on RPi

Posted: Sun Nov 04, 2018 8:34 pm
by clicky
The easiest is to clone repo ( and go from there... Branch 'rpi' has the latest in that repo.

There's a script `` that builds RPi specific stuff...

Rest is linked at the top of this thread...

Re: LibGDX on RPi

Posted: Sun Nov 04, 2018 9:17 pm
by alexis-puska
This fork use maven ?

When i read the build.gradle, this is always stay in 1.9.5 version... i see a pom.xml and the goal compilation is 1.9.8 ?

filename too long for 2 file... great with windows... go install a VM....

Re: LibGDX on RPi

Posted: Sun Nov 04, 2018 10:09 pm
by clicky
I've done the same as original - I think it was maven...

Re: LibGDX on RPi

Posted: Tue Nov 06, 2018 9:54 am
by alexis-puska
I have succed to compile it directly on Rpi ! on cross compilation so many problems...
JoGl is outdated and deprecated by libgdx... but maintenaned on third party like the repository like natdan repo... for LTS it's not the best solution...