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
MonoGame 3.8.1 turns off controller immediately after turning on #8082
Comments
After searching, I found someone encountered the same issue in the Ryujinx Switch emulator. So on MonoGame side, an update of SDL is needed. |
For reference, downloaded the first (non-RC) release after that commit of SDL (2.28.0) and put the DLL manually into my project, works perfectly, no issues and the controller does not turn off anymore. |
Well investigated @Bikonja ! I can confirm all of the above in DesktopGL, with a Wireless Xbox One Controller, on my end as well. In my case, I just tried the latest SDL2 DLL and that works as opposed to the latest MG-develop. |
As a result of this fix, it appears there is now a new issue. When you join in a player first with an XBox One controller using the wireless adapter and then connect another controller that isn't an XBox One controller, that controller joins in as two players instead of one. It appears there is a "ghost" controller added that shouldn't be there. Using a version of SDL prior to v2.28.0 does not reproduce this new issue. |
Ghost controllers are almost always due to third party controller drivers doing hacky stuff (x360ce, unofficial drivers...) or software to bind virtual keys (joy2key, vjoy, vxbox...), and sometime even remote desktop software messing up with drivers (Monect is notoriously breaking stuff). From my experience, even though it looks related to SDL, it's likely not. I mean, I can be proven wrong, but 100% of the times I've received such reports on our games, it's been due to local drivers/software. |
This is most definitely an SDL issue as I don't have to update MonoGame or anything else. Just switch to the latest version of SDL by modifying the nuget package itself, (making a backup before doing so), and switching between SDL versions to replicate the issue. |
Prerequisites
develop
branchMonoGame Version
MonoGame 3.8.1.303
Which MonoGame platform are you using?
MonoGame Cross-Platform Desktop Application (mgdesktopgl)
Operating System
Windows
Description
Even in a blank MonoGame project, if a MonoGame window is running, the controller (specifically using an Xbox One controller with the wireless adapter, not sure if it makes a difference) works initially, however if the controller is turned off while the game is running, then turned on again, the controller immediately turns off.
I verified my code isn't the issue by testing against a blank MonoGame app as well as the tutorial from the MonoGame website.
I also verified that this did not occur in MonoGame 3.8.0.1641 by taking the same project, downgrading MonoGame and running the project. The same issue with the controller does not occur (but due to other incompatibilities my game does not work correctly with the older version).
A little bit of extra info, I tried debugging my app to see what the state of "GamePad.GetState" is in this scenario and, while it didn't provide me with overly useful info, I was able to observe that if I'm stopped in the debugger while connecting the controller, and then resume the app after the controller has turned on, the controller does not turn off.
I am trying to run a local build of develop branch to see if the issue is present there, but am currently unable to do so, I'll post back if I'm able to get it running.I was able to run develop and yes, the problem is present in latest develop branch as well.
Steps to Reproduce
Minimal Example Repo
No response
Expected Behavior
The controller should now be on and ready to use with the game.
Resulting Behavior
The controller turns on and then immediately turns off.
Files
No response
The text was updated successfully, but these errors were encountered: