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
'Y' and 'R' button not detected by SDL applications #228
Comments
The log seems strange. Did you mix different xpadneo versions? |
Probably bad copy paste, I was trying to know if it's a regression but it doesn't seem to be the case. |
Did you manually make some SDL mappings in the past? E.g., look in |
This comment has been minimized.
This comment has been minimized.
I unset the |
This comment has been minimized.
This comment has been minimized.
This ID will also match your new controller and apply the same remapping to it. That may be the problem. During v0.8 we will add a remapping capability right into the driver in a way that it will detect the exact device. It will even work correctly with two identical models and still see them as different devices with different mappings. You should clear the mappings from the file and env and retry. I can add a controller quirk to use Nintendo mapping for the buttons. So A,B,X,Y will match with your controller. Do all 8Bitdo controllers use Nintendo mappings? |
Hmm that's weird I tried it again and while the ID for both the SN30pro+ and the zero2 are the same, they are now different from what they were before (030000005e040000e002000000006800,Xbox One S Controller).
I think so. I guess now that you implemented quirks for these devices it makes sense to fix this within the driver?
I would think so as they are first intended to be used on nintendo games. |
SDL matches by ID only. The name is just what is presented to the application, you can rename your controller there if you'd want to. The first part If you confirm that all buttons work correctly (aside from being swapped) after you removed the mappings, I'll implement a quirk handler for that. After all, xpadneo should work OOTB without any mappings. |
I rebooted after removing SDL_GAMECONTROLLERCONFIG and confirmed it with the absence of anything SDL related within |
Fixes: atar-axis#228 Signed-off-by: Kai Krakow <kai@kaishome.de>
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
There are controllers which are not 100% compatible with Xbox One S because they are not switching to Linux mode when connected to Linux. We can detect such devices at HID parse time and set a flag when we detect Linux mode. With this commit, we no longer shift the button bits when we detect a controller in native Windows mode. Fixes: atar-axis#228 Signed-off-by: Kai Krakow <kai@kaishome.de>
Controllers with Nintendo layout actually have button A swapped with B and button X swapped with Y but they still report the same position. See-also: atar-axis#228 Signed-off-by: Kai Krakow <kai@kaishome.de>
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
There are controllers which are not 100% compatible with Xbox One S because they are not switching to Linux mode when connected to Linux. We can detect such devices at HID parse time and set a flag when we detect Linux mode. With this commit, we no longer shift the button bits when we detect a controller in native Windows mode. Fixes: atar-axis#228 Signed-off-by: Kai Krakow <kai@kaishome.de>
Controllers with Nintendo layout actually have button A swapped with B and button X swapped with Y but they still report the same position. See-also: atar-axis#228 Signed-off-by: Kai Krakow <kai@kaishome.de>
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
To set things up you can contact me on Telegram (@terencode),Matrix or Discord (Terence#2723) .
Yep that's what I tried but no difference unfortunately.
Nope (using intel Wireless-AC 9260).
Thanks tried it but nothing stands out except confirmation it is not finding any gamecontrollerdb file: |
I had some problems with this chipset lately - but on Windows, and for Wifi... It needed a driver update to work correctly. But whatever that problem is and where it is located - it should not affect this specific problem. But maybe worth keeping that in mind.
Let's see if strace can tell us which event or other files from |
|
here you go: sdl2-jstest-strace.txt |
An strace of an SDL application would be useful, including |
Only one controller is connected (zero 2). |
Hmm, I wonder if that's because it's opening |
What does it say if you just run |
|
I'm not even sure how that could come from xpadneo because xpadneo exposes 11 buttons at most. Are you sure that this controller is handled by xpadneo? Is there something sitting in between that grabs the device from xpadneo and exposes it differently? Maybe a user space daemon, i.e. the Steam controller daemon that's coming with Steam? You could try turning that off in the Steam client. See if anything has the device open: |
I would think so because 1) I set it to be in X input mode which emulates an Xbox 360 (https://support.8bitdo.com/faq/sn30-pro.html) and 2) xpadneo picks it up as shown in the different dmseg I posted:
I had already thought it could conflict but it shouldn't be the case due to the fact steam isn't running.
I used BTW: I joined the discord server. |
This is actually used by SDL to create the ID number, it would make By looking at the SDL source code, it copies that straight from whatever udev provides. But then it does some magic: It looks if there's a default or xinput mapping available in the controller DB, and if it then cannot find the device, it tries to fall back to one of the two default mappings (it uses the xinput mapping if it finds a hint for Xbox controllers in the device name). But neither "xinput" nor "default" have the button map you're seeing. Also, your GUID is not in the SDL upstream controller DB. Something remotely related only exists in the MacOS version of SDL ( Could you run Which SDL version are you running? Did you compile and install SDL yourself? Could you run Does you environment set In #228 (comment) you wrote that the controller ID changed, and I'm guessing that means from Did you accidentally or on purpose modify a system-installed file of SDL? Does your distribution patch SDL in a strange way? Or doesn't link to udev? |
I think this may be antimicro... It is probably implemented as a uinput client: It needs to grab the controller and expose it as a new device. But then it should be on the virtual bus (bus 6). I wasn't able to reproduce such a behavior, the only device I was seeing was a virtual mouse. Maybe post |
I didn't do much besides upgrading the system regularly, then noticing my gamepad had a different behaviour. I found something very interesting though. Look at the the diff of the last packaged version: https://git.archlinux.org/svntogit/packages.git/commit/trunk?h=packages/sdl2&id=b77621a8fbe14a4e06ba640e2b687e8d6092d526 I reverted this and it's working as before! With the revert, the guid is Where do we go from here? I still answered your other questions just in case:
I already tried that and many times, nothing relevant shows up (not used). locate.txt
No. |
I'm not sure what SDL is doing there exactly... But it seems bypassing any drivers, so xpadneo is not used. But this may also be related to b8ab951#diff-3cf66395a395dccd435d6973f8f96d68 which exposes the device as a hidraw device that SDL may then access directly when this patch is applied. In But I'll have to look at that patch more deeply. I don't think SDL should try to read devices directly without going through a driver. |
If I chmod 0000 the hidraw device SDL behaves correctly. |
So maybe I should revert that patch or we find some other way to exclude that from special handling in SDL... I'll have to dive deep into the patch first. |
Please try setting SDL 2.0.12 introduced a patch that talks to HID devices directly, bypassing drivers. It also doesn't pass the bus number, so it appears on bus 3 in SDL. This patch may be useful but it is quite bad for several reasons: It bypasses fixes that are implemented in drivers, such as that Xbox controllers need to throttle the rumble packets. Also, our fixes for buttons become messed up, the implementation cannot know that we fix the buttons in the HID reports. With this feature, it will not be possible to use some of the additional features we are going to add. IOW, it duplicates a lot of work and bugfixes: SDL would now have to solve the same problems we solved in xpadneo. The new feature should be off by default, or only use the new implementation as a fallback if the device isn't supported by an OS driver. OTOH, SDL implements a user-space driver for any device regardless of the kernel driver support which isn't too bad. This is similar to how xow implements a user-space driver just that SDL bypasses the Linux HID layer that way. I'm still on libsdl-2.0.10, let's see what we do about this when I'm upgraded, too. Maybe we need to revert the patch that allows direct raw HID access. I'm not sure how this is meant to work correctly when SDL doesn't take the bus ID of the device into account because clearly Xbox controllers behave differently based on the bus number. Also, it should query the driver name and make that part of the controller mappings. And it should query and match the number of buttons it gets from the HID descriptor because only then it can know the button mappings to use. If you disable the HID API of SDL, your controller should show up on bus 5 again and work correctly. Could you test? |
Working. I now added it to my env :)
If you mean when using It has the same effect as reverting to the unpatched SDL. |
The unpatched SDL has a bug that prevented HID API from fully working with some versions of libusb, I believe. So I think we'll just document the issue with SDL 2.0.12 and can then finally close this? |
Alright. |
I'll reopen this to close it with a documentation update... |
Oups, didn't get your comment about the documentation right, sorry. |
Closes: atar-axis#228 Signed-off-by: Kai Krakow <kai@kaishome.de>
Closes: #228 Signed-off-by: Kai Krakow <kai@kaishome.de>
There are controllers which are not 100% compatible with Xbox One S because they are not switching to Linux mode when connected to Linux. We can detect such devices at HID parse time and set a flag when we detect Linux mode. With this commit, we no longer shift the button bits when we detect a controller in native Windows mode. Fixes: #228 Signed-off-by: Kai Krakow <kai@kaishome.de>
Controllers with Nintendo layout actually have button A swapped with B and button X swapped with Y but they still report the same position. See-also: #228 Signed-off-by: Kai Krakow <kai@kaishome.de>
Version of xpadneo
v0.8.r515.g715c2e9
Describe the bug
When connecting an 8bitdo controller (tested with both the zero 2 and SN30 pro+) in X Input Mode over bluetooth,
the keys labeled 'Y' and 'R' are not registered in sdl controllermap and antimicrox.
Steps to Reproduce
Expected behavior
All the buttons should be detected.
System information
Controller and Bluetooth information (for the zero2)
xpadneo-btmon.txt
xpadneo-dmesg.txt
The text was updated successfully, but these errors were encountered: