MidnightControls icon indicating copy to clipboard operation
MidnightControls copied to clipboard

Controller Issues: Xbox Elite S1 & S2

Open Snoaux248 opened this issue 3 years ago • 21 comments

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

Snoaux248 avatar Aug 11 '22 18:08 Snoaux248

Could you please send me the crash log?

Motschen avatar Aug 11 '22 21:08 Motschen

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

youngchief-btw avatar Dec 25 '22 18:12 youngchief-btw

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

youngchief-btw avatar Dec 25 '22 18:12 youngchief-btw

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.
#

youngchief-btw avatar Dec 25 '22 18:12 youngchief-btw

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

Motschen avatar Dec 25 '22 19:12 Motschen

Here you go. https://mclo.gs/XuTXoHa

youngchief-btw avatar Dec 25 '22 20:12 youngchief-btw

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,

youngchief-btw avatar Jan 03 '23 19:01 youngchief-btw

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!

Kenz1ee avatar Jan 15 '23 02:01 Kenz1ee

Glad to be of help! :)

youngchief-btw avatar Jan 15 '23 22:01 youngchief-btw

@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: https://github.com/glfw/glfw/issues/2320.

haudan avatar Apr 17 '23 19:04 haudan

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

youngchief-btw avatar Apr 26 '23 00:04 youngchief-btw

@youngchief-btw I've also made a PR for the fix: https://github.com/glfw/glfw/pull/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.

haudan avatar Apr 26 '23 08:04 haudan

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

youngchief-btw avatar Apr 26 '23 17:04 youngchief-btw

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

youngchief-btw avatar Apr 28 '23 00:04 youngchief-btw

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?

haudan avatar May 30 '23 16:05 haudan

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.

youngchief-btw avatar Jun 02 '23 15:06 youngchief-btw

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

Motschen avatar Jun 02 '23 17:06 Motschen

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

haudan avatar Dec 19 '23 21:12 haudan

you will have to give me some time, I need to redownload the mod.

On Thu, Aug 11, 2022 at 4:20 PM Martin Prokoph @.***> wrote:

Could you please send me the crash log?

— Reply to this email directly, view it on GitHub https://github.com/TeamMidnightDust/MidnightControls/issues/89#issuecomment-1212505463, or unsubscribe https://github.com/notifications/unsubscribe-auth/A2PP5A6PKUFRAI6QHZDCNPDVYVVCRANCNFSM56JFEPAA . You are receiving this because you authored the thread.Message ID: @.***>

Snoaux248 avatar Dec 19 '23 23:12 Snoaux248

This no longer crashes the game and the controller is recognized as controller 0 however it still doesn't recognize input.

On Tue, Dec 19, 2023 at 5:34 PM Nolan Jones @.***> wrote:

you will have to give me some time, I need to redownload the mod.

On Thu, Aug 11, 2022 at 4:20 PM Martin Prokoph @.***> wrote:

Could you please send me the crash log?

— Reply to this email directly, view it on GitHub https://github.com/TeamMidnightDust/MidnightControls/issues/89#issuecomment-1212505463, or unsubscribe https://github.com/notifications/unsubscribe-auth/A2PP5A6PKUFRAI6QHZDCNPDVYVVCRANCNFSM56JFEPAA . You are receiving this because you authored the thread.Message ID: @.***>

Snoaux248 avatar Dec 20 '23 00:12 Snoaux248

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

youngchief-btw avatar Jan 14 '24 05:01 youngchief-btw