-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Joystick regression since SDL 2.0.16, Windows 11 #8227
Comments
Pygame on Windows 2.4.0 uses SDL 2.26.4, pygame 2.5.1 uses SDL 2.28.2, and pygame 2.5.0 uses SDL 2.28.0. Tested by installing those versions and checking the support prompt. So as far as I can tell this issue should read joystick regression between 2.26.4 and 2.28.0. |
Looks like it could be this commit on SDL's end: d42c303 |
This commit d42c303 also breaks my pedals on Windows 10 and linux because they have axes but no buttons. Button boxes will also break because they have buttons but no axes. The right way to fix the problem this commit is trying to fix is to add the problem device to the black list. This commit should be reverted. |
Linux is broken for my pedals but that must be a different problem. |
The linux problem is similar. SDL_EVDEV_GuessDeviceClass assumes a joystick with 3 axes but no buttons is an accelerometer. My pedals have 3 axes and no buttons so it's ignored. |
Also seeing this problem with 2.28.3, don't think we had it when using 2.24.1 (which easily pre-dates the suspicious commit you've called out). Is it worth putting up a merge request that reverts that commit? |
@smcv, thoughts? |
I think d42c303 should be reverted. There is code elsewhere that already solves the same problem. The linux problem is more complicated. One way would be to add a PEDALS joystick type and add a whitelist for known devices or add a blacklist for known accelerometers. Both are maintenance nightmares keeping the lists up to date. |
I've rolled back to v2.26.5 and all controllers are working again (Windows test environment). |
Right, there's really no good answer to this: evdev doesn't tell us what a device is, only what capabilities it has, but evdev capabilities are not enough to distinguish between a 3-axis accelerometer and 3-axis pedals because both are simply reported as (X, Y, Z). I think the best long term answer would be for the kernel (which has better information) to report what a device is. There is already a way for it to report that a device is definitely an accelerometer, by setting |
That commit should only affect Windows, and Windows games running on Linux via a compatibility layer like Wine/Proton. It should have no effect on native Linux versions of SDL. Is that what you mean? |
Yes. There are 2 separate bugs. One is in Windows and one is in linux specific code. They both make assumptions for the joystick type using the number of buttons and axes that are wrong. The result is the same for windows and linux. The same problem probably exists in other interface code. Extending the existing platform independent whitelist/blacklist code to handle this problem is probably the correct way to fix this. Adding the ability for the application to add to the device lists would help work around bugs like this for unknown hardware. |
I reverted d42c303 locally and my pedals were recognized and worked on Windows 10. |
This fixes incorrectly detecting the ROG CHAKRAM X mouse as a game controller on Windows 10 (cherry picked from commit 642504b)
Reverted, thanks! |
I managed to get my pedals working on linux by adding a udev rule that set the permissions properly and changed the device type from ACCELEROMETER to JOYSTICK. |
This reverts commit e5a15f9. It turns out removing this check allows mice like the ROG PUGIO II to show up as game controllers. We need to find a different way to differentiate between gaming mice and pedals. Since these mice show up as controllers, and potentially causing games to use them instead of real controllers, we'll go ahead revert this change for now. Reopens #8227
This reverts commit e5a15f9. It turns out removing this check allows mice like the ROG PUGIO II to show up as game controllers. We need to find a different way to differentiate between gaming mice and pedals. Since these mice show up as controllers, and potentially causing games to use them instead of real controllers, we'll go ahead revert this change for now. Reopens #8227 (cherry picked from commit ad0af48)
This reverts commit e5a15f9. It turns out removing this check allows mice like the ROG PUGIO II to show up as game controllers. We need to find a different way to differentiate between gaming mice and pedals. Since these mice show up as controllers, and potentially causing games to use them instead of real controllers, we'll go ahead revert this change for now. Reopens #8227 (cherry picked from commit ad0af48) (cherry picked from commit 20ecd2a)
Why reopen and reapply the bug? |
Because this fix caused a bunch of other bugs. As noted in the commit, we need to find a better way to distinguish between gaming mice and pedals. |
Ah ok... I guess it's a matter of point of view because for me everything worked perfectly before this modification (and I have a lot of "game components" as simracer) |
Yep, I have the Pugio mouse ordered, so I'll see if there's a better fix. If nothing else then we can create a list of game components and explicitly allow them (which would work for Linux as well) |
mouse is a game component !? |
You need to add the devices to ignore to SDL_ShouldIgnoreJoystick. Hard coded lists are not future proof but that's a whole other issue. You could add more hard coded lists for pedals and button boxes. You shouldn't be making assumptions like this in driver/os dependent code so reverting the revert is wrong no matter how it eventually gets fixed. The hard coded lists should be moved to a file in the future to fix this problem. |
…d axes" This reverts commit ad0af48. It turns out the ROG PUGIO II actually enumerates as a gamepad, so this change didn't have any effect anyway. We're getting lots of reports of people's racing pedals and similar devices no longer showing up, so we'll revert this again. Fixes #8227 Fixes #8484 (cherry picked from commit 2c1fbe1)
…d axes" This reverts commit ad0af48. It turns out the ROG PUGIO II actually enumerates as a gamepad, so this change didn't have any effect anyway. We're getting lots of reports of people's racing pedals and similar devices no longer showing up, so we'll revert this again. Fixes #8227 Fixes #8484 (cherry picked from commit 2c1fbe1) (cherry picked from commit cc20d01)
Some time after SDL 2.0.16, some game devices disappeared (pedals and 2 of my 3 button boxes).
Here are the results for the pygame code :
SDL 2.0.16 with pygame 2.4.0 result :
SDL 2.28.0 with pygame 2.5.1 result :
pygame issue here : [https://github.com/pygame/pygame/issues/3942]
The text was updated successfully, but these errors were encountered: