mdqinc / SDL_GameControllerDB

A community sourced database of game controller mappings to be used with SDL2 Game Controller functionality
http://libsdl.org
zlib License
1.38k stars 521 forks source link

New Xbox series X mapping for Linux after update #664

Closed PKGaspi closed 1 year ago

PKGaspi commented 1 year ago

After updating my Xbox series X controller's firmware, the mapping is broken for Linux. This is the new mapping:

030000005e040000120b00000f050000,Microsoft Xbox Series S|X Controller,a:b0,b:b1,y:b3,x:b2,start:b7,back:b6,leftstick:b9,rightstick:b10,leftshoulder:b4,rightshoulder:b5,dpup:b12,dpleft:b14,dpdown:b13,dpright:b15,leftx:a0,lefty:a1,rightx:a3,righty:a4,lefttrigger:a2,righttrigger:a5,platform:Linux
offalynne commented 1 year ago

7d416272d904e2d53eed353abda7468ba4fd023c

2000Slash commented 1 year ago

Hey I have a quick question about this. (I don't really know if I should open a new issue). My Xbox Series X Controller with the exact same guid and the newest version still uses the hat input for the dpad instead of buttons, just like the other Xbox Series Controllers.

dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1

instead of

dpdown:b13,dpleft:b14,dpright:b15,dpup:b12

Since the entry for this controller was added, the dpad does not work for me in some programs (pcsx2). I use the xpad driver and face this issue on my main arch system and a fresh ubuntu install.

offalynne commented 1 year ago

Can you try removing the xpad driver and seeing if the pad still connects/enumerates ?

2000Slash commented 1 year ago

Just tried it, but since xpad is the default driver for arch and I don't have another, it just doesn't get recognized anymore.

offalynne commented 1 year ago

Can you try with the "fresh ubuntu install", please ?

offalynne commented 1 year ago

@PKGaspi can you provide any insight as to what your setup is like to compare? What distro you're on, what driver might be handling the Xbox pad, etc?

2000Slash commented 1 year ago

I just tried in on a fresh ubuntu live and it is exactly the same as on my arch machine. The driver seems to be xpad. When I try to run pcsx2 the input is only accepted when I use the hat mappings. When I unload xpad the controller is not recognized anymore

offalynne commented 1 year ago

Last thing, can you please confirm either with an Xbox Console or on Windows with the Xbox Accessories app that your controller is on the latest firmware? If so please open a PR with the relevant mapping change, and I'll put it through.

2000Slash commented 1 year ago

Yup just tried to update it on my windows pc, but it says its on the newest version.

PKGaspi commented 1 year ago

@PKGaspi can you provide any insight as to what your setup is like to compare? What distro you're on, what driver might be handling the Xbox pad, etc?

For testing I relied on my Arch system with the xpadneo driver. At the time, this was the only driver that supported bluetooth conection with the newest xbox controller. Doing further testing, I realized that the mappings are still wrong when the gamepad is used wireless with xpadneo, although they're great when cabled.

After uninstalling xpadneo and restarting (using xpad I suppose but don't know how to check) the controller works fine in both cases and I can't reproduce the issue @2000Slash mentions.

I'm testing with the stable Godot 4.0.1 release. I have 2 controllers to test, updated the same day. Perhaps they're missing a newer update? I can check later for sure with the Xbox Accessories app.

2000Slash commented 1 year ago

You can check if xpad is loaded with lsmod | grep xpad. If should show xpad on the left and then some other stuff. You can unload the module with sudo rmmod xpad. Then the controller stopped working for me. I used the controller with cable so when I plugged it back in the xpad driver reloaded and the controller inputs worked again (except the dpad). Edit: I only tried it with cable until now maybe this also changes things 🤔

offalynne commented 1 year ago

@2000Slash please see @PKGaspi's note. Try xpadneo and see how you get on.

2000Slash commented 1 year ago

Hmm I just tried it wireless without xpadneo just to check and it worked. But also xpad was not loaded until I plugged it in with a usb cable. And then it didn't recognise the dpad anymore. I think it's handled differently if your using usb or bluetooth. Would be interesting to know whether it also works for @PKGaspi with usb without xpadneo but nevertheless I think its a driver issue (either on my side or something else is going wrong with them) and this issue can probably be closed