seraxis / lr2oraja-endlessdream

A featureful fork of beatoraja
https://github.com/seraxis/lr2oraja-endlessdream/releases
GNU General Public License v3.0
48 stars 11 forks source link

Game won't launch - the return value of "org.lwjgl.glfw.GLFW.glfwGetJoystickButtons(int)" is null #15

Closed radiden closed 7 months ago

radiden commented 9 months ago

I've always had issues with controllers on stock beatoraja (the game won't detect them and will just not let me bind them), so I decided to try this fork, the game will not launch at all because of the error in the title.

Arch Linux, tried with versions 8 (won't launch because wayland), 17, 21 of the full liberica JDK.

I have at one point had it working I think on this install, however I have no idea what I did to make it work (quite sure it randomly started working and now stopped).

Launch script:

#!/bin/bash
export _JAVA_OPTIONS="'-Dsun.java2d.opengl=true -Dawt.useSystemAAFontSettings=on -Dswing.aatext=true -Dswing.defaultlaf=com.sun.java.swing.plaf.gtk.GTKLookAndFeel' -Dfile.encoding=UTF-8"
cd "$(dirname "$0")"
exec java -Xms1g -Xmx4g -cp beatoraja.jar:ir/* bms.player.beatoraja.MainLoader

Full log:

Picked up _JAVA_OPTIONS: '-Dsun.java2d.opengl=true -Dawt.useSystemAAFontSettings=on -Dswing.aatext=true -Dswing.defaultlaf=com.sun.java.swing.plaf.gtk.GTKLookAndFeel' -Dfile.encoding=UTF-8
Jan 31, 2024 3:02:17 AM bms.player.beatoraja.launcher.PlayConfigurationView initialize
INFO: 初期化時間(ms) : 0
Jan 31, 2024 3:02:26 AM bms.player.beatoraja.MainController$SystemSoundManager <init>
INFO: 検出されたBGM Set : 1 Sound Set : 1
java.lang.NullPointerException: Cannot invoke "java.nio.ByteBuffer.limit()" because the return value of "org.lwjgl.glfw.GLFW.glfwGetJoystickButtons(int)" is null
    at bms.player.beatoraja.controller.Lwjgl3Controller.<init>(Lwjgl3Controller.java:30)
    at bms.player.beatoraja.controller.Lwjgl3ControllerManager.pollState(Lwjgl3ControllerManager.java:48)
    at bms.player.beatoraja.controller.Lwjgl3ControllerManager.<init>(Lwjgl3ControllerManager.java:24)
    at bms.player.beatoraja.modmenu.ImGuiRenderer.init(ImGuiRenderer.java:47)
    at bms.player.beatoraja.MainController.create(MainController.java:331)
    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:193)
    at com.badlogic.gdx.backends.lwjgl3.Lwjgl3Application.<init>(Lwjgl3Application.java:167)
    at bms.player.beatoraja.MainLoader.play(MainLoader.java:162)
    at bms.player.beatoraja.launcher.PlayConfigurationView.start(PlayConfigurationView.java:678)
    at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104)
    at java.base/java.lang.reflect.Method.invoke(Method.java:578)
    at com.sun.javafx.reflect.Trampoline.invoke(MethodUtil.java:72)
    at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104)
    at java.base/java.lang.reflect.Method.invoke(Method.java:578)
    at javafx.base/com.sun.javafx.reflect.MethodUtil.invoke(MethodUtil.java:270)
    at javafx.fxml/com.sun.javafx.fxml.MethodHelper.invoke(MethodHelper.java:84)
    at javafx.fxml/javafx.fxml.FXMLLoader$MethodHandler.invoke(FXMLLoader.java:1855)
    at javafx.fxml/javafx.fxml.FXMLLoader$ControllerMethodEventHandler.handle(FXMLLoader.java:1726)
    at javafx.base/com.sun.javafx.event.CompositeEventHandler.dispatchBubblingEvent(CompositeEventHandler.java:86)
    at javafx.base/com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:232)
    at javafx.base/com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:189)
    at javafx.base/com.sun.javafx.event.CompositeEventDispatcher.dispatchBubblingEvent(CompositeEventDispatcher.java:59)
    at javafx.base/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:58)
    at javafx.base/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
    at javafx.base/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
    at javafx.base/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
    at javafx.base/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
    at javafx.base/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
    at javafx.base/com.sun.javafx.event.EventUtil.fireEventImpl(EventUtil.java:74)
    at javafx.base/com.sun.javafx.event.EventUtil.fireEvent(EventUtil.java:49)
    at javafx.base/javafx.event.Event.fireEvent(Event.java:198)
    at javafx.graphics/javafx.scene.Node.fireEvent(Node.java:8944)
    at javafx.controls/javafx.scene.control.Button.fire(Button.java:203)
    at javafx.controls/com.sun.javafx.scene.control.behavior.ButtonBehavior.mouseReleased(ButtonBehavior.java:207)
    at javafx.controls/com.sun.javafx.scene.control.inputmap.InputMap.handle(InputMap.java:274)
    at javafx.base/com.sun.javafx.event.CompositeEventHandler$NormalEventHandlerRecord.handleBubblingEvent(CompositeEventHandler.java:247)
    at javafx.base/com.sun.javafx.event.CompositeEventHandler.dispatchBubblingEvent(CompositeEventHandler.java:80)
    at javafx.base/com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:232)
    at javafx.base/com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:189)
    at javafx.base/com.sun.javafx.event.CompositeEventDispatcher.dispatchBubblingEvent(CompositeEventDispatcher.java:59)
    at javafx.base/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:58)
    at javafx.base/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
    at javafx.base/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
    at javafx.base/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
    at javafx.base/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
    at javafx.base/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
    at javafx.base/com.sun.javafx.event.EventUtil.fireEventImpl(EventUtil.java:74)
    at javafx.base/com.sun.javafx.event.EventUtil.fireEvent(EventUtil.java:54)
    at javafx.base/javafx.event.Event.fireEvent(Event.java:198)
    at javafx.graphics/javafx.scene.Scene$MouseHandler.process(Scene.java:3980)
    at javafx.graphics/javafx.scene.Scene.processMouseEvent(Scene.java:1890)
    at javafx.graphics/javafx.scene.Scene$ScenePeerListener.mouseEvent(Scene.java:2704)
    at javafx.graphics/com.sun.javafx.tk.quantum.GlassViewEventHandler$MouseEventNotification.run(GlassViewEventHandler.java:411)
    at javafx.graphics/com.sun.javafx.tk.quantum.GlassViewEventHandler$MouseEventNotification.run(GlassViewEventHandler.java:301)
    at java.base/java.security.AccessController.doPrivileged(AccessController.java:400)
    at javafx.graphics/com.sun.javafx.tk.quantum.GlassViewEventHandler.lambda$handleMouseEvent$2(GlassViewEventHandler.java:450)
    at javafx.graphics/com.sun.javafx.tk.quantum.QuantumToolkit.runWithoutRenderLock(QuantumToolkit.java:424)
    at javafx.graphics/com.sun.javafx.tk.quantum.GlassViewEventHandler.handleMouseEvent(GlassViewEventHandler.java:449)
    at javafx.graphics/com.sun.glass.ui.View.handleMouseEvent(View.java:551)
    at javafx.graphics/com.sun.glass.ui.View.notifyMouse(View.java:937)
    at javafx.graphics/com.sun.glass.ui.gtk.GtkApplication._runLoop(Native Method)
    at javafx.graphics/com.sun.glass.ui.gtk.GtkApplication.lambda$runLoop$11(GtkApplication.java:316)
    at java.base/java.lang.Thread.run(Thread.java:1623)
Jan 31, 2024 3:02:26 AM bms.player.beatoraja.MainLoader play
SEVERE: java.lang.NullPointerException : Cannot invoke "java.nio.ByteBuffer.limit()" because the return value of "org.lwjgl.glfw.GLFW.glfwGetJoystickButtons(int)" is null
seraxis commented 8 months ago

I'd like to debug this issue more thoroughly with you but any Java Runtime version above 8 is not officially supported.

That being said this doesn't look like an issue with your java version, what controller are you using? what firmware? This might be a bug with upstream Lwjgl's wayland input support since I think it uses xinput under the hood

bidoooof commented 7 months ago

I'm having a very similar issue, it was working just fine yesterday and now it crashes every time after I click "Play" on the config menu. The only thing I remember doing between then is messing around trying to get my Xbox controller to work on bluetooth and rebooting, though I'm pretty sure my controller was turned off by the time I went to launch Beatoraja since I play that on keyboard.

On Arch Linux 8.7.8-arch1-1 with Hyprland and liberica-jdk-8-full (works just fine with Wayland, just gotta add GDK_BACKEND=x11 before exec in the launch parameters so it launches through Xwayland).

My beatoraja-config.command file:

#!/bin/bash
export _JAVA_OPTIONS='-Dsun.java2d.opengl=true -Dawt.useSystemAAFontSettings=on -Dswing.aatext=true -Dswing.defaultlaf=com.sun.java.swing.plaf.gtk.GTKLookAndFeel -Dfile.encoding="UTF-8"'
cd "$(dirname "$0")"
GDK_BACKEND=x11 exec java -Xms2g -Xmx16g -jar beatoraja.jar 

Things I've tried so far:

Here's the error stack with -verbose, starting from right before it loads LWjgl3 stuff:

[Loaded imgui.gl3.ImGuiImplGl3$1 from file:/mnt/software/Beatoraja/beatoraja.jar]
[Loaded imgui.ImVec4 from file:/mnt/software/Beatoraja/beatoraja.jar]
[Loaded com.badlogic.gdx.controllers.ControllerManager from file:/mnt/software/Beatoraja/beatoraja.jar]
[Loaded bms.player.beatoraja.controller.Lwjgl3ControllerManager from file:/mnt/software/Beatoraja/beatoraja.jar]
[Loaded com.badlogic.gdx.controllers.Controller from file:/mnt/software/Beatoraja/beatoraja.jar]
[Loaded java.lang.invoke.LambdaForm$DMH/333320042 from java.lang.invoke.LambdaForm]
[Loaded bms.player.beatoraja.controller.Lwjgl3ControllerManager$$Lambda$560/1798313211 from bms.player.beatoraja.controller.Lwjgl3ControllerManager]
[Loaded bms.player.beatoraja.controller.Lwjgl3Controller from file:/mnt/software/Beatoraja/beatoraja.jar]
[Loaded com.badlogic.gdx.backends.lwjgl3.Lwjgl3Cursor from file:/mnt/software/Beatoraja/beatoraja.jar]
[Loaded java.lang.Throwable$PrintStreamOrWriter from /usr/lib/jvm/liberica-jdk-8-full/jre/lib/rt.jar]
[Loaded java.lang.Throwable$WrappedPrintStream from /usr/lib/jvm/liberica-jdk-8-full/jre/lib/rt.jar]
java.lang.NullPointerException
    at bms.player.beatoraja.controller.Lwjgl3Controller.<init>(Lwjgl3Controller.java:30)
    at bms.player.beatoraja.controller.Lwjgl3ControllerManager.pollState(Lwjgl3ControllerManager.java:48)
    at bms.player.beatoraja.controller.Lwjgl3ControllerManager.<init>(Lwjgl3ControllerManager.java:24)
    at bms.player.beatoraja.modmenu.ImGuiRenderer.init(ImGuiRenderer.java:47)
    at bms.player.beatoraja.MainController.create(MainController.java:331)
    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:193)
    at com.badlogic.gdx.backends.lwjgl3.Lwjgl3Application.<init>(Lwjgl3Application.java:167)
    at bms.player.beatoraja.MainLoader.play(MainLoader.java:162)
    at bms.player.beatoraja.launcher.PlayConfigurationView.start(PlayConfigurationView.java:678)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at sun.reflect.misc.Trampoline.invoke(MethodUtil.java:72)
    at sun.reflect.GeneratedMethodAccessor1.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at sun.reflect.misc.MethodUtil.invoke(MethodUtil.java:276)
    at javafx.fxml.FXMLLoader$MethodHandler.invoke(FXMLLoader.java:1771)
    at javafx.fxml.FXMLLoader$ControllerMethodEventHandler.handle(FXMLLoader.java:1657)
    at com.sun.javafx.event.CompositeEventHandler.dispatchBubblingEvent(CompositeEventHandler.java:86)
    at com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:238)
    at com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:191)
    at com.sun.javafx.event.CompositeEventDispatcher.dispatchBubblingEvent(CompositeEventDispatcher.java:59)
    at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:58)
    at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
    at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
    at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
    at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
    at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
    at com.sun.javafx.event.EventUtil.fireEventImpl(EventUtil.java:74)
    at com.sun.javafx.event.EventUtil.fireEvent(EventUtil.java:49)
    at javafx.event.Event.fireEvent(Event.java:198)
    at javafx.scene.Node.fireEvent(Node.java:8411)
    at javafx.scene.control.Button.fire(Button.java:185)
    at com.sun.javafx.scene.control.behavior.ButtonBehavior.mouseReleased(ButtonBehavior.java:182)
    at com.sun.javafx.scene.control.skin.BehaviorSkinBase$1.handle(BehaviorSkinBase.java:96)
    at com.sun.javafx.scene.control.skin.BehaviorSkinBase$1.handle(BehaviorSkinBase.java:89)
    at com.sun.javafx.event.CompositeEventHandler$NormalEventHandlerRecord.handleBubblingEvent(CompositeEventHandler.java:218)
    at com.sun.javafx.event.CompositeEventHandler.dispatchBubblingEvent(CompositeEventHandler.java:80)
    at com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:238)
    at com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:191)
    at com.sun.javafx.event.CompositeEventDispatcher.dispatchBubblingEvent(CompositeEventDispatcher.java:59)
    at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:58)
    at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
    at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
    at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
    at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
    at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
    at com.sun.javafx.event.EventUtil.fireEventImpl(EventUtil.java:74)
    at com.sun.javafx.event.EventUtil.fireEvent(EventUtil.java:54)
    at javafx.event.Event.fireEvent(Event.java:198)
    at javafx.scene.Scene$MouseHandler.process(Scene.java:3760)
    at javafx.scene.Scene$MouseHandler.access$1500(Scene.java:3488)
    at javafx.scene.Scene.impl_processMouseEvent(Scene.java:1765)
    at javafx.scene.Scene$ScenePeerListener.mouseEvent(Scene.java:2497)
    at com.sun.javafx.tk.quantum.GlassViewEventHandler$MouseEventNotification.run(GlassViewEventHandler.java:394)
    at com.sun.javafx.tk.quantum.GlassViewEventHandler$MouseEventNotification.run(GlassViewEventHandler.java:295)
    at java.security.AccessController.doPrivileged(Native Method)
    at com.sun.javafx.tk.quantum.GlassViewEventHandler.lambda$handleMouseEvent$2(GlassViewEventHandler.java:432)
    at com.sun.javafx.tk.quantum.QuantumToolkit.runWithoutRenderLock(QuantumToolkit.java:389)
    at com.sun.javafx.tk.quantum.GlassViewEventHandler.handleMouseEvent(GlassViewEventHandler.java:431)
    at com.sun.glass.ui.View.handleMouseEvent(View.java:555)
    at com.sun.glass.ui.View.notifyMouse(View.java:937)
    at com.sun.glass.ui.gtk.GtkApplication._runLoop(Native Method)
    at com.sun.glass.ui.gtk.GtkApplication.lambda$null$10(GtkApplication.java:245)
    at java.lang.Thread.run(Thread.java:750)
Mar 09, 2024 10:06:09 AM bms.player.beatoraja.MainLoader play
SEVERE: java.lang.NullPointerException : null
seraxis commented 7 months ago

OP's issues was resolved in DM's after some troubleshooting, and appeared to be a misbehaving USB hub or some other USB device, a workaround was added in the 0.2.0 release of Endless Dream in 4b7320de

It's unsurprising that upstream raja does not have this issue as they both use different backends for controller input handling.

If you'd like to reach out on discord my profile is mips64 but as OPs issue has been resolved I'm closing this issue, to anyone else reading this feel free to re-open in another issue