-
Notifications
You must be signed in to change notification settings - Fork 113
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
Installing xpadneo and using Xbox One Controller over Bluetooth flips X+Y buttons and Start+Select buttons stop functioning until uninstalled. Over USB is fine. #303
Comments
That your SDL string starting with To confirm this problem, try the following steps:
If this is fixes your problem, our work-around doesn't seem to apply. It used to work in previous versions then because SDL2 wasn't using the hidraw device back then. Cross references: |
It works just fine for me. But well, the main problem may be the hidraw support in the first place. How does it render the controller unusable? |
Thanks for getting back to me on this. For clarification, when unticking Xbox Configuration Support in Big Picture it seems to be hit and miss for which titles will work. For example, Mortal Kombat 11 running through GloriousEggroll's Proton 6.1 works with it unticked in Big Picture but Linux-native game "One Step From Eden" can see the controller present but does not respond to controller input anymore. As for your instructions above for the hidraw device:
Trying OSFE again after revoking hidraw11's permissions with chmod the game accepted no controller input. I unticked Xbox Configuration Support in Big Picture again and still no change on relaunch. MK11 was happy to use the controller after revoking the permissions of /dev/hidraw11 and also even after unticking Xbox Configuration Support in Big Picture and trying again. It seems to be hit and miss? Though I wonder if Proton helps MK11 being a Windows-only title. |
There are a few titles which actually need Steam Input to properly work with all controllers. Usually, such titles come with an override option set by default in the game properties. I think Horizon Zero Dawn is such a title. |
I'm seeing something similar. Immediately after installing xpadneo, Steam's "Big Picture" mode has some interesting swaps for me:
If "Xbox Controller Support" is enabled in Big Picture mode, two things happen:
None of this happens when connected over USB. If I remove the module with |
@c-x-berger This is probably because SDL uses the hidraw device directly. Our HID report format is a bit different than what SDL expects (because xpadneo uses the same bitmap format across all controller models and SDL doesn't look at the report size to decide for a bitmap format but at the VID/PID instead, and then it even looks at the wrong one which we cannot work around). This also explains why the rumble goes crazy: xpadneo has a protection against a race condition in the controller firmware but we cannot apply that in the hidraw layer. If rumble data is sent too fast, the motors will stop responding to commands and spin for minutes before they eventually stop. The controller firmware may even reboot or not recover from that at all until you pull the batteries. I quick fix would be to look at I'm currently planning on re-implementing the whole hidraw interface to be compatible with SDLs assumptions but we would probably still not be able to protect against the rumble race. But as far as I know that's fixed in newer SDL versions. Buttons X and Y shift by one position because different Xbox controller models have different sparse bitmap formats, even within the same model depending on some strange firmware quirks. The original wired controller has bits A,B,X,Y,LB,... for the buttons, the wireless controllers have A,B,C,X,Y,Z,LB,... where C and Z are even not buttons on the gamepad. That's why the buttons move. The buttons that come after the initial bits may be even more messed up. This has been documented here: #286 It's for historic reasons why xpadneo handles the device the way it does. With current SDL versions, this is probably no longer necessary. But I'm planning on adding wired and dongle support in HID mode and need to find a way to cover all cases. Please report a uninstall bug separately - including the output you get. |
One more idea: Update the controller to the latest firmware, SDL may apply wrong assumptions about the model if the firmware is too old (because MS messes with the HID report format between firmware versions, and SDL absolutely doesn't care about HID descriptors at all, it just assumes nothing ever changes in the format). |
Probably to the thumb stick buttons and the guide button. BTW: Select is left, start is right. As a memory hook: left goes back (to the selection menu), right goes forward (starting the game). |
I am also experiencing this issue, have downloaded the latest firmware from the xbox app. The sticks don't map to start and select as I would expect. Will use the hidraw device workaround until this is cleaned up |
Also fixes Steam Input which apparently also uses SDL2. The bug shows up when SDL identifies the controller as being on USB instead of Bluetooth (SDL Gamepad ID starts with `03` instead of `05`) which then messes with SDL's expectations for the contents of hidraw. This fixes two SDL problems: * Wrong mappings in hidraw (buttons shifted to other buttons) * SDL2 doesn't properly throttle rumble commands (endless rumble) See-also: atar-axis#286 Maybe-fixes: atar-axis#303 Maybe-fixes: atar-axis#311 Maybe-fixes: atar-axis#314 Signed-off-by: Kai Krakow <[email protected]>
Also fixes Steam Input which apparently also uses SDL2. The bug shows up when SDL identifies the controller as being on USB instead of Bluetooth (SDL Gamepad ID starts with `03` instead of `05`) which then messes with SDL's expectations for the contents of hidraw. This fixes two SDL problems: * Wrong mappings in hidraw (buttons shifted to other buttons) * SDL2 doesn't properly throttle rumble commands (endless rumble) See-also: #286 Maybe-fixes: #303 Maybe-fixes: #311 Maybe-fixes: #314 Signed-off-by: Kai Krakow <[email protected]>
This should actually be fixed, please confirm. |
Also fixes Steam Input which apparently also uses SDL2. The bug shows up when SDL identifies the controller as being on USB instead of Bluetooth (SDL Gamepad ID starts with `03` instead of `05`) which then messes with SDL's expectations for the contents of hidraw. This fixes two SDL problems: * Wrong mappings in hidraw (buttons shifted to other buttons) * SDL2 doesn't properly throttle rumble commands (endless rumble) See-also: atar-axis#286 Maybe-fixes: atar-axis#303 Maybe-fixes: atar-axis#311 Maybe-fixes: atar-axis#314 Signed-off-by: Kai Krakow <[email protected]>
I was having a similar issue with the buttons being mapped wrong in steam games. This was due to the
I did some more digging and found out that there was a udev rule that was overriding the one that was installed by xpadneo. I had installed a rule into If anyone else if having issues, here is how I was able to find what rules where being loaded:
This should give you a little more info about what rules could be interfering. |
@Andrew-Fahmy Can you remember which one actually has been the conflicting rule? I think the following may happen: Someone installs xpadneo from source, which installs rules to Maybe we'd need some |
In my case I manually installed the conflicting rule from qmk firmware as their Do you think that I should open an issue about this with qmk? Also I think an |
Actually, this line should not be there:
It's a security mess, don't make hidraw device just readable to every user in a group (plugdev) or every user logged into a local session (uaccess), and I'm not even sure what "udev-acl" is supposed to do. This rule is bad. It allows any local process in your session to spy on any hidraw device (even when unrelated to your session), which is almost every input device in the world, thus allowing to record keypresses, pin entries, or more generally: secrets. Don't do that. Meanwhile, in Discord, we discovered that OpenRGB installs a similar problematic rule. Access to hidraw devices MUST be guarded by conditionals for the specific devices which should get this ACL (uaccess). |
That is a really good point. I had not thought about it from the security perspective. I'll open an issue with qmk about this. For now what do you think about adding some info about the udev rules to the troubleshooting page? Also I want to thank you for all the work you have done on this project and responding to all my questions and concerns quickly and thoroughly! |
Actually, we can make it compatible even with exposed hidraw device. This conflict just uncovered questionable security issues in other software. The change to re-enable xpadneo hidraw and make in compatible with SDL is planned for v0.10 or v0.11. Until then, xpadneo doesn't add uaccess rules to hidraw. But if other software does it unconditionally, it conflicts with our configuration - no matter whether it's a security problem. So it's bad already from two different views. I'm pretty sure it's an oversight. It should be fixed or at least considered in some way, no matter if xpadneo managed to work around it or restored SDL-hidraw compatibility. OTOH, I don't like the hidraw approach of SDL very much, it re-implements logic that's already done at the kernel level, without proper checks if mapping fixups were already done (i.e., it doesn't look at the HID descriptor, it just assumes some format of the HID reports). |
I'll follow up on this with a PR when we fully understand the problem. I'm pretty sure we almost see the whole picture. I now need some confirmation that uninstalling those rules (aka the package that installed them) actually fixes what we are seeing. It's a long standing bug, I don't know yet if it is the same problem in each issue because we have no documentation about what other software is installed, or which custom udev rules may exist. We are probably running races we cannot win, I'd need to fix our hidraw reports anyways (which makes controller mapping fixups much more complicated in xpadneo). |
They have fixed it, they have another repo dedicated to generating the rules that I was not aware of
For me removing those rules fixed all the problems |
This is exactly how OpenRGB should also fix their world-accessible hidraw rule. |
I can confirm that uninstalling qmk rules fixed the problem for me as well. |
Deferring this to v0.11 as it is probably about hidraw interaction with OpenRGB and SDL. This can probably be solved by #286. |
Some feedback from upstream. The blanket hidraw rule was removed when udev rules were moved to compile time generation. This assumes that there are no xpadneo devices that would require an OpenRGB rule. I would test to confirm this however I don't have a relevant XBone controller so please let me know if this is still an issue with OpenRGB. |
Also fixes Steam Input which apparently also uses SDL2. The bug shows up when SDL identifies the controller as being on USB instead of Bluetooth (SDL Gamepad ID starts with `03` instead of `05`) which then messes with SDL's expectations for the contents of hidraw. This fixes two SDL problems: * Wrong mappings in hidraw (buttons shifted to other buttons) * SDL2 doesn't properly throttle rumble commands (endless rumble) See-also: #286 Maybe-fixes: #303 Maybe-fixes: #311 Maybe-fixes: #314 Signed-off-by: Kai Krakow <[email protected]>
Came here to bump this, I have installed QMK relatively recently and the rule that Andrew-Fahmy mentioned was present in my It is worth mentioning that I am relatively inexperienced with these things and the documentation makes no mention of this, so I spent quite a bit of time messing with configuration and environmental variables before finally finding this bug report. If it is the right thing, I would be willing to open a separate bug report for docs or contribute the fix myself. |
According to the commit discussions around that topic, this file should no longer be needed and there should be an identical named file in User settings for QMK should go to As far as I understand, the conflicting part of the rule is about some debugging console only, so if you're not a developer, you should not need it anyways, and commenting it out should not impact your usage of the software. I suggest moving this part of the discussion to your distribution tracker or QMK itself, as I don't use that software and cannot support it. Alternatively, you may find users of QMK in our Discord channels. If you continue discussion somewhere else, feel free to leave a link here, so other users finding their way here can follow the link. I also accept PRs which add instructions to the docs. Thanks. :-) |
Important note
This is a continuation of my documented experience in this issue: ValveSoftware/steam-for-linux#7531
Continuing template..
Version of xpadneo
Experienced in:
Controller Model
Connection mode
Installed Software
Severity / Impact
Describe the Bug
As title. Installing xpadneo either directly from here or via an available AUR repo package for Archlinux and using my Xbox One Controller over Bluetooth flips the X+Y buttons in all titles. It seems my Start+Select buttons are also ignored. USB is fine but xpadneo claims it isn't supported yet, so using USB is likely just not using xpadneo.
This is only something I wanted to report as this all used to work just fine. Utilities like
jstest /dev/input/js0
clearly show the buttons responding so I feel like it's a Steam or xpadneo thing.I'm not sure if this is an issue of my system configuration, xpadneo, or something like Steam's controller recognition when xpadneo is active. Yet.
I've also noticed Steam will vibrate my controller indefinitely sometimes. I worked around this by disabling rumble for my controller under Big Picture mode in Steam, but ... upon installing xpadneo the infinite rumble bug I'm also experiencing has returned. Further making me wonder if Steam thinks it's a "different" controller.. or something.
Steps to Reproduce
Closing the game, uninstalling xpadneo and reconnecting the controller only to open game of choice again.. and the issue is gone.
Expected Behavior
(Not confident the infinite rumble bug while Steam running is xpadneo's problem)
Screenshots / GIFs / Videos
System Information
Controller and Bluetooth Information
xpadneo-dmesg.txt
xpadneo-btmon.txt
xpadneo-lsusb.txt
Additional Context
Toggling Steam Beta Participation and restarting Steam changes nothing.
Unticking Xbox Controller Support in Big Picture just renders my controller unusable in games.
The text was updated successfully, but these errors were encountered: