Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Version 2.1.0 does not work on Raspberry Pi (Buster) #1407

Closed
Rak1ta opened this issue Jun 7, 2023 · 19 comments
Closed

Version 2.1.0 does not work on Raspberry Pi (Buster) #1407

Rak1ta opened this issue Jun 7, 2023 · 19 comments

Comments

@Rak1ta
Copy link

Rak1ta commented Jun 7, 2023

Upgraded from 2.0.2 to 2.1.0 and encountered a startup error.

OS: Raspbian GNU/Linux 10 (buster)
OS architecture: 32-bit
Kernel: armv7l 5.10.103-v7l+
Device model: Raspberry Pi 4 Model B Rev 1.2 
Cpu name: Cortex-A72
Ram size: 3.65 GB
Raspberry Pi OS image version: 2021-05-07
Language: en_US.UTF-8
pi@raspberrypi:~ $ /usr/lib/jvm/java-11-openjdk-armhf/bin/java -jar /home/pi/.local/bin/ShatteredPD-Desktop.jar
[GAME] com.badlogic.gdx.utils.GdxRuntimeException: Error creating controller manager: com.badlogic.gdx.controllers.desktop.JamepadControllerManager
	at com.badlogic.gdx.controllers.Controllers.initialize(Controllers.java:118)
	at com.badlogic.gdx.controllers.Controllers.addListener(Controllers.java:64)
	at com.watabou.noosa.Game.create(Game.java:106)
	at com.shatteredpixel.shatteredpixeldungeon.ShatteredPixelDungeon.create(ShatteredPixelDungeon.java:70)
	at com.badlogic.gdx.backends.lwjgl3.Lwjgl3Window.initializeListener(Lwjgl3Window.java:416)
	at com.badlogic.gdx.backends.lwjgl3.Lwjgl3Window.update(Lwjgl3Window.java:366)
	at com.badlogic.gdx.backends.lwjgl3.Lwjgl3Application.loop(Lwjgl3Application.java:192)
	at com.badlogic.gdx.backends.lwjgl3.Lwjgl3Application.<init>(Lwjgl3Application.java:166)
	at com.shatteredpixel.shatteredpixeldungeon.desktop.DesktopLauncher.main(DesktopLauncher.java:192)
Caused by: com.badlogic.gdx.utils.SharedLibraryLoadRuntimeException: Couldn't load shared library 'libjamepadarm.so' for target: Linux, ARM, 32-bit
	at com.badlogic.gdx.utils.SharedLibraryLoader.load(SharedLibraryLoader.java:128)
	at com.studiohartman.jamepad.ControllerManager.<init>(ControllerManager.java:68)
	at com.studiohartman.jamepad.ControllerManager.<init>(ControllerManager.java:52)
	at com.badlogic.gdx.controllers.desktop.JamepadControllerManager.<init>(JamepadControllerManager.java:32)
	at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
	at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
	at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:490)
	at java.base/java.lang.Class.newInstance(Class.java:584)
	at com.badlogic.gdx.utils.reflect.ClassReflection.newInstance(ClassReflection.java:93)
	at com.badlogic.gdx.controllers.Controllers.initialize(Controllers.java:116)
	... 8 more
Caused by: com.badlogic.gdx.utils.SharedLibraryLoadRuntimeException: java.lang.UnsatisfiedLinkError: /tmp/libgdxpi/615224bb/libjamepadarm.so: /lib/arm-linux-gnueabihf/libm.so.6: version `GLIBC_2.29' not found (required by /tmp/libgdxpi/615224bb/libjamepadarm.so)
	at com.badlogic.gdx.utils.SharedLibraryLoader.loadFile(SharedLibraryLoader.java:325)
	at com.badlogic.gdx.utils.SharedLibraryLoader.load(SharedLibraryLoader.java:124)
	... 18 more
Caused by: java.lang.UnsatisfiedLinkError: /tmp/libgdxpi/615224bb/libjamepadarm.so: /lib/arm-linux-gnueabihf/libm.so.6: version `GLIBC_2.29' not found (required by /tmp/libgdxpi/615224bb/libjamepadarm.so)
	at java.base/java.lang.ClassLoader$NativeLibrary.load0(Native Method)
	at java.base/java.lang.ClassLoader$NativeLibrary.load(ClassLoader.java:2445)
	at java.base/java.lang.ClassLoader$NativeLibrary.loadLibrary(ClassLoader.java:2501)
	at java.base/java.lang.ClassLoader.loadLibrary0(ClassLoader.java:2700)
	at java.base/java.lang.ClassLoader.loadLibrary(ClassLoader.java:2630)
	at java.base/java.lang.Runtime.load0(Runtime.java:768)
	at java.base/java.lang.System.load(System.java:1837)
	at com.badlogic.gdx.utils.SharedLibraryLoader.loadFile(SharedLibraryLoader.java:331)
	at com.badlogic.gdx.utils.SharedLibraryLoader.loadFile(SharedLibraryLoader.java:300)
	... 19 more

[LWJGL] Failed to load a library. Possible solutions:
	a) Add the directory that contains the shared library to -Djava.library.path or -Dorg.lwjgl.librarypath.
	b) Add the JAR that contains the shared library to the classpath.
[LWJGL] Enable debug mode with -Dorg.lwjgl.util.Debug=true for better diagnostics.
[LWJGL] Enable the SharedLibraryLoader debug mode with -Dorg.lwjgl.util.DebugLoader=true for better diagnostics.

Exception: java.lang.UnsatisfiedLinkError thrown from the UncaughtExceptionHandler in thread "main"

Is that a mistake?

Caused by: com.badlogic.gdx.utils.SharedLibraryLoadRuntimeException: Couldn't load shared library 'libjamepadarm.so' for target: Linux, ARM, 32-bit
Caused by: com.badlogic.gdx.utils.SharedLibraryLoadRuntimeException: java.lang.UnsatisfiedLinkError: /tmp/libgdxpi/615224bb/libjamepadarm.so: /lib/arm-linux-gnueabihf/libm.so.6: version `GLIBC_2.29' not found (required by /tmp/libgdxpi/615224bb/libjamepadarm.so)
Caused by: java.lang.UnsatisfiedLinkError: /tmp/libgdxpi/615224bb/libjamepadarm.so: /lib/arm-linux-gnueabihf/libm.so.6: version `GLIBC_2.29' not found (required by /tmp/libgdxpi/615224bb/libjamepadarm.so)
@Rak1ta Rak1ta changed the title Version 2.1.0 does not work on Raspberry Pi Version 2.1.0 does not work on Raspberry Pi (Buster) Jun 7, 2023
@00-Evan
Copy link
Owner

00-Evan commented Jun 7, 2023

This looks to be caused by a dependency update in v2.1.0 that causes the game's controller library to no longer work with 32-bit linux (and possibly 32-bit windows and 32-bit macOS).

In general I am not going to try and go out of my way to support 32-bit devices, but this should be a relatively easy fix in v2.1.1. Controller functionality will not work anymore, but the game won't crash on launch ether.

@theofficialgman
Copy link

In general I am not going to try and go out of my way to support 32-bit devices, but this should be a relatively easy fix in v2.1.1. Controller functionality will not work anymore, but the game won't crash on launch ether.

doubt it is 32bit specific. the error is clear

Caused by: com.badlogic.gdx.utils.SharedLibraryLoadRuntimeException: java.lang.UnsatisfiedLinkError: /tmp/libgdxpi/615224bb/libjamepadarm.so: /lib/arm-linux-gnueabihf/libm.so.6: version `GLIBC_2.29' not found (required by /tmp/libgdxpi/615224bb/libjamepadarm.so)

who built the binary libjamepadarm.so? It needs to be re-built on an older distro (debian stretch or bionic) so that the GLIBC version is lowered to something like 2.17 for compatability.

@theofficialgman
Copy link

found upstream, you should report the issue there https://github.com/libgdx/Jamepad as its a dependency of https://github.com/libgdx/gdx-controllers . @MrStahlfelge runs both repos. Can you explain what system you used to build these native binaries it? They aren't widely compatible and I suggest either installing an older distro like ubuntu bionic/debian stretch to build on, or using a chroot with those versions.

@00-Evan
Copy link
Owner

00-Evan commented Jun 8, 2023

Apologies, I saw 32-bit and assumed it was relating to that, as I've seen issues on 32-bit systems before.

Would be nice to get this fixed at the source, but I have at least taken steps to mitigate this and future crashes of the sort in Shattered. Controller support isn't necessary for the game to work, obviously, so in v2.1.1 if initialization fails the game will catch the error and just turn controller support off.

@MrStahlfelge
Copy link

Can you explain what system you used to build these native binaries it?

GitHub actions, see the commit history for relevant changes and feel free to submit PRs changing what you need.

@theofficialgman
Copy link

@MrStahlfelge I plan on it. got ARM64/ARMhf working with minimum GLIBC 2.17 already. https://github.com/theofficialgman/Jamepad . Having issues with x86 and x86_64 currently.

@MrStahlfelge
Copy link

The build should run on GitHub actions, otherwise I would suggest to make an own fork.

@theofficialgman
Copy link

Yup these are actions changes, guess you didn't actually look at it https://github.com/theofficialgman/Jamepad/blob/master/.github/workflows/pushaction.yml Patches to libc just like chromium does for their sysroots so that the resultant builds link to older GLIBC versions.

@theofficialgman
Copy link

PR is complete. this issue can be closed if @MrStahlfelge merges it and creates a new release and then @00-Evan publishes a new version using it.

@00-Evan
Copy link
Owner

00-Evan commented Jun 10, 2023

I plan to close this after releasing v2.1.1, which includes a mitigation for the crash, but obviously I'll be happy to also update gdx-controllers when that's available.

@MrStahlfelge
Copy link

Probably using an older version (compiled on an older ubuntu version) would work as well.

@00-Evan
Copy link
Owner

00-Evan commented Jun 13, 2023

fixed in commit e9ccd79

@00-Evan 00-Evan closed this as completed Jun 13, 2023
@theofficialgman
Copy link

@hyppyp please post the terminal log when you try to launch here showing that 2.1.1 crashes on launch

@hyppyp
Copy link

hyppyp commented Jun 14, 2023 via email

@theofficialgman
Copy link

theofficialgman commented Jun 14, 2023

You just run it via terminal according to the pi-apps description for the app.

/usr/lib/jvm/java-11-openjdk-arm64/bin/java -jar $HOME/.local/bin/ShatteredPD-Desktop.jar

@theofficialgman
Copy link

Made a typo. See edit on GitHub website. (I am writing this since I see you are responding via email).

@hyppyp
Copy link

hyppyp commented Jun 14, 2023 via email

@00-Evan
Copy link
Owner

00-Evan commented Jun 14, 2023

Yeah I'm dumb and missed a 'return false'. Will properly correctly in v2.1.2 shortly

@00-Evan 00-Evan reopened this Jun 14, 2023
@00-Evan 00-Evan modified the milestones: v2.1.1, v2.1.2 Jun 14, 2023
@00-Evan
Copy link
Owner

00-Evan commented Jun 16, 2023

fixed (properly this time) in commit aede0d6

@00-Evan 00-Evan closed this as completed Jun 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants