-
-
Notifications
You must be signed in to change notification settings - Fork 678
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
Immediate crash when running gamepad example locally #1229
Comments
Hi, Are you using a PS4 controller? |
Unfortunately this seems an issue in GLFW, not Ebiten. |
Yeah I am using a PS4 controller. Thanks for the info, I'll make the issue there. |
Thanks! It'd be the best if you could reproduce the issue with GLFW without Ebiten, since the GLFW team doesn't know anything about Ebiten. |
Sounds good. |
This might be already fixed after d08f57e, but I am not sure. |
At least for me, the error still occurs. In addition, I noticed that my trackpad will be recognized as a controller, which is pretty weird and might be attached to the error. |
Acknowledged. I still think this is an issue in GLFW, unfortunately. |
To solve this issue completely, I'd need to remove the dependency on GLFW, maybe :-/ |
Hmm, I'm running into this problem as well when attempting to run my own project with my controller (8BitDo's SN30 Pro+). Oddly, the mapping (050000005e040000e002000003090000) does seem to exist in the mappings.h file, so it should be found in the controller database...? |
What kind of error messages did you see? |
Pretty similar to @semilin's:
|
Well, GLFW's gamepad detection is not good in terms of these issues. I'm thinking to start to fork the GLFW's joypad part to mitigate this issue. |
@semilin @SolarLune @corfe83 Now the Ebiten on master has GLFW 3.3.3. Does the latest Ebiten still cause the issue? |
Hello, sorry for the late reply! Yes, I'm still seeing a crash when launching a game or during play if a controller GLFW doesn't support is connected, and this is after building with ebiten from master (v2.1.0-alpha, according to Fortunately, for my controller (8BitDo SN30 Pro+) I found that there's another mode of connection that allows me to use it with Ebiten while not causing crashes. I feel like it might be good for me to investigate a bit more to see if it's really crashing because of the controller not being found, or if something else is the issue. It might be simpler to add any missing controller profiles manually (assuming that is the cause) than invest time into a custom gamepad solution that works on all platforms. |
FYI this error means that your gamepad has fewer buttons than the gamecontrollerdb.txt entry references for this gamepad. WEIRD. |
Ironically, though the crash was due to SDL's database, SDL's gamepad detection instead of GLFW's doesn't cause this crash. @SolarLune is that correct? |
If that's true, migrating to SDL (#172) would make more sense. |
Oh wow, this was fixed on GLFW side: glfw/glfw#1763 |
Does anyone try the latest commit? This issue should be already fixed. |
I get a slightly different error now...
|
Oops we found the latest commit doesn't fix the issue... Sorry I'll work on it soon |
OK could you try |
Hello! I also tested with my same 8BitDo SN30 Pro+ gamepad on Linux (Manjaro) on the latest commit mentioned, and got another crash, unfortunately. However, things are slightly better. If I connect via bluetooth while my project is running, it crashes with the same error (I think?):
However, if I have my controller connected from the beginning, the game no longer crashes, but still lists the controller as having an invalid button mapping:
|
This now works for me on RPi 4/400 \o/ No crash, and I can detect gamepad buttons now <3 EDIT: I did not test plugging in while running. I'll try now. EDIT 2: I can confirm SolarLune - works when already connected, but crashes if plugged in while running. |
Thank you for reporting! Apparently the same fix is needed not only at |
Just wanted to add that I can't detect buttons from my gamepad when there's no crash and it's connected via bluetooth, in case that's useful in any way. EDIT: I've found that this is incorrect - the first gamepad (0) on my system isn't connected (?), while the second (1) is my gamepad, and I can detect buttons from it just fine. Very good news! |
Updated to suppress errors on PollEvents |
Fantastic; I'm able to read gamepad inputs now without any crashes, either when the gamepad is connected during play or if it's already plugged in when the game starts. Very nice work, @hajimehoshi, and everybody else involved!! (As an aside, it's interesting that I get the message that the controller has invalid mappings only if the gamepad is plugged in when the game starts; if the gamepad is connected during play, I don't get the message anymore.) |
I think this is a known issue in GLFW. Apparently GLFW uses an old joystick table. Now GLFW owner is investigating the issue. |
OK let me close this issue. @SolarLune, @TheMightyGit, thank you for confirming this issue fixed!! |
I just wanted to say thanks a ton for working on this, again; I know gamepad support has been a pain, and I applaud all of the work you put in to track this down! In my opinion, it's one of those features that gamedev frameworks just need, and I'm glad to see ebiten improve on that front. |
I'm running Void Linux. I copied the code for the gamepad example and removed the
// +build example jsgo
. It compiles, but upon running it immediately crashes.Error Log
The text was updated successfully, but these errors were encountered: