MidnightControls

MidnightControls

447k Downloads

Controller Issues: Xbox Elite S1 & S2

Snoaux248 opened this issue · 21 comments

commented

I am using a M1 Macbook air with the native arm64 java 17 distribution

Xbox Elite S2 causes game crash on Bluetooth connection or if it is connected before launch it fails to launch the game

neither my Elite S1 or S2 will work in wired mode same for the 1s/x controller
DualShock 4 will work both through wired and wireless

commented

Could you please send me the crash log?

commented

I was able to confirm this myself. I'll send over a crash log. @Motschen

commented

In my case plugging in the controller (with both USB and Bluetooth) even after the game fully launches crashes Minecraft.

commented

Link to log: https://mclo.gs/nLyggxD
This part of the logs seem very relevant:

#
# A fatal error has been detected by the Java Runtime Environment:
#
#  SIGSEGV (0xb) at pc=0x00000001811fb3b4, pid=4350, tid=259
#
# JRE version: OpenJDK Runtime Environment Temurin-19.0.1+10 (19.0.1+10) (build 19.0.1+10)
# Java VM: OpenJDK 64-Bit Server VM Temurin-19.0.1+10 (19.0.1+10, mixed mode, tiered, compressed oops, compressed class ptrs, g1 gc, bsd-aarch64)
# Problematic frame:
# 
C  [CoreFoundation+0x203b4]  CFArrayGetCount+0x8
#
# No core dump will be written. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again
#
# An error report file with more information is saved as:
# /Users/youngchief/Library/Application Support/PolyMC/instances/1.19.3/.minecraft/hs_err_pid4350.log
#
# If you would like to submit a bug report, please visit:
#   https://github.com/adoptium/adoptium-support/issues
# The crash happened outside the Java Virtual Machine in native code.
# See problematic frame for where to report the bug.
#
commented
commented

Please send me a copy of this file: "/Users/youngchief/Library/Application Support/PolyMC/instances/1.19.3/.minecraft/hs_err_pid4350.log"

commented

Works with the latest version of MidnightControls. In terms of the Xbox Elite Series 2 controller, it seems to work with no custom controller mapping needed (sometimes).

If it doesn't work for anyone, the custom mapping string that works for me is: 030000005e040000220b000013050000,Xbox Wireless Controller 2,platform:Mac OS X,a:b0,b:b1,x:b3,y:b4,back:b10,guide:b12,start:b11,leftstick:b13,rightstick:b14,leftshoulder:b6,rightshoulder:b7,dpup:h0.1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,leftx:a0,lefty:a1,rightx:a2,righty:a3,lefttrigger:a5,righttrigger:a4,

commented

Works with the latest version of MidnightControls. In terms of the Xbox Elite Series 2 controller, it seems to work with no custom controller mapping needed (sometimes).

If it doesn't work for anyone, the custom mapping string that works for me is: 030000005e040000220b000013050000,Xbox Wireless Controller 2,platform:Mac OS X,a:b0,b:b1,x:b3,y:b4,back:b10,guide:b12,start:b11,leftstick:b13,rightstick:b14,leftshoulder:b6,rightshoulder:b7,dpup:h0.1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,leftx:a0,lefty:a1,rightx:a2,righty:a3,lefttrigger:a5,righttrigger:a4,

I came here for a solution as I was having the same problem, but no crash report. The controller was just not working, and this custom mapping string worked exactly as it should! Thank you so much!

commented

Glad to be of help! :)

commented

@Lisoph It appears to be accessed through LWJGL so the fix will take a while to get pulled in.

commented

@SnowKitten248 just FYI, it looks like we're having the same problem. It appears like it's a bug inside GLFW itself. I've raised an issue: glfw/glfw#2320.

commented

@Lisoph Thanks for looking into this further! I'll keep an eye on the issue. Quite an interesting bug!

commented

@youngchief-btw I've also made a PR for the fix: glfw/glfw#2321. It looks good to me, now we just wait for a review and merge.

Actually, thinking about it, does anyone know how MidnightControls is accessing GLFW? Does it just use the version shipped with Minecraft, through LWJGL? Because then it might take a while, before the bugfix arrives from upstream GLFW.

commented

We might be able to patch it somehow without waiting on upstream.

commented

Controlify seems to use a different method to access the controllers, I'd recommend trying if it works there.

commented

We might be able to patch it somehow without waiting on upstream.

@youngchief-btw I'm new to the codebase, any idea how this could be achieved? I'm not sure if this is possible, because this bug is triggered as soon as glfw tries to access the the controller, I believe. Maybe showing a warning message on macOS is the best course of action for now?

"Warning: because of a bug in GLFW, please make sure that you grant Minecraft input monitoring access in your macOS privacy settings. Otherwise, Minecraft is going to crash." -> Abort / I understand and have done so.

Or maybe there's some way in Java land to figure out if Minecraft has access, and to only enable gamepad input if so?

commented

We'd probably have to import a modified GLFW but I wonder how that will play with Minecraft's GLFW 🤔
We could probably figure something out for checking if Minecraft has access or not but I have some doubts.

commented

@youngchief-btw The bug has been fixed in upstream GLFW. Commit: 2c1d310.

commented
commented
commented

@SnowKitten248 Have you tried my custom mapping string yet? Seems to be working pretty well.