ValveSoftware / steam-for-linux

Issue tracking for the Steam for Linux beta client
4.26k stars 175 forks source link

X and Y buttons reversed in Steam when using wired Xbox One controller. #7531

Open ghost opened 3 years ago

ghost commented 3 years ago

Hello everyone. I just reinstalled Linux Mint on my system and my controller works fine except for my X and Y buttons (and no other buttons) are reversed. I also can't re-map the controller because the remapping process does not keep the buttons from performing their previous menu functions, i.e., when prompted for a controller button to map, if I press B, Steam will back out of the controller remapping menu.

All other buttons function normally. Only X and Y are reversed.

Steps for reproducing this issue:

  1. Use Steam with my wired Xbox One Controller
  2. X and Y buttons are reversed.
kisak-valve commented 3 years ago

Hello @Skaalgard, this sounds like something that can be manipulated with the SDL_GAMECONTROLLERCONFIG environment variable. There are a couple tools out there to figure out what you can set it to for your controller like https://generalarcade.com/gamepadtool/.

There's a chance that there's a snafu in upstream SDL's controller database causing your issue.

Possibly helpful guide: https://www.reddit.com/r/linux_gaming/comments/9cf6ip/guide_how_to_make_all_of_your_controllers_work_at/

ghost commented 3 years ago

I will attempt these solutions and report back. If successful, I will detail how I have resolved this issue.

ghost commented 3 years ago

I downloaded the gamepadtool and my controller is correctly configured there as well. X and Y show normally in this tool. Can I directly edit the SDL_GAMECONTROLLERCONFIG variable to switch these buttons temporarily until a potential future update fixes it?

kisak-valve commented 3 years ago

As far as I know, you should be able to run Steam with SDL_GAMECONTROLLERCONFIG="your controller config from the tool" steam in a terminal or set it in one of the various system config locations and it should get used.

ghost commented 3 years ago

The string I get is "03000000c62400003a54000001010000,TuxBox Controller,platform:Linux,a:b0,b:b1,x:b2,y:b3,back:b6,guide:b8,start:b7,leftstick:b9,rightstick:b10,leftshoulder:b4,rightshoulder:b5,dpup:h0.1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,leftx:a0,lefty:a1,rightx:a3,righty:a4,lefttrigger:a2,righttrigger:a5," do I use this whole string in that argument?

ghost commented 3 years ago

I ran steam SDL_GAMECONTROLLERCONFIG="03000000c62400003a54000001010000" and Steam completely ignored the mapping I had set up in the Gamepad Tool.

ghost commented 3 years ago

Then I tried SDL_GAMECONTROLLERCONFIG="03000000c62400003a54000001010000" steam and this also ignored the mapping I had set up.

ghost commented 3 years ago

After this, I used the Gamepad Tool's option to set the mapping as the SDL_GAMECONTROLLERCONFIG variable. Steam still ignores it. It seems hellbent on treating X as Y and Y as X.

kisak-valve commented 3 years ago

"03000000c62400003a54000001010000" would just be the unique name for your controller's model, you need the entire string.

ghost commented 3 years ago

Running SDL_GAMECONTROLLERFIG="03000000c62400003a54000001010000,TuxBox Controller,platform:Linux,a:b0,b:b1,x:b2,y:b3,back:b6,guide:b8,start:b7,leftstick:b9,rightstick:b10,leftshoulder:b4,rightshoulder:b5,dpup:h0.1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,leftx:a0,lefty:a1,rightx:a3,righty:a4,lefttrigger:a2,righttrigger:a5," steam yields the same behavior. X and Y are still reversed.

ghost commented 3 years ago

I even manually edited the configuration in (Steam directory)/config/config.vdf. It previously showed: "SDL_GamepadBind" "03000000c62400003a54000001010000,PowerA XBox One Controller,a:b0,b:b1,x:b3,y:b2,back:b6,guide:b8,start:b7,leftstick:b9,rightstick:b10,leftshoulder:b4,rightshoulder:b5,dpup:h0.1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,leftx:a0,lefty:a1,rightx:a3,righty:a4 03000000c62400003a54000001010000,PowerA XBox One Controller,a:b0,b:b1,x:b3,y:b2,back:b6,guide:b8,start:b7,leftstick:b9,rightstick:b10,leftshoulder:b4,rightshoulder:b5,dpup:h0.1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,leftx:a0,lefty:a1,rightx:a3,righty:a4 03000000de280000ff11000001000000,Steam Virtual Gamepad,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3, 03000000c62400003a54000001010000,PowerA XBox One Controller,a:b0,b:b1,x:b3,y:b2,back:b6,guide:b8,start:b7,leftstick:b9,rightstick:b10,leftshoulder:b4,rightshoulder:b5,dpup:h0.1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,leftx:a0,lefty:a1,rightx:a3,righty:a4 03000000de280000fc11000001000000,Steam Controller,a:b0,b:b1,back:b6,dpdown:b14,dpleft:b15,dpright:b13,dpup:b12,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3," "streaming"

I manually switched X to button 2 and Y to button 3 in this configuration, and when I started Steam again, it had re-set this configuration to have X as button 3 and Y as button 2. I think I'm out of ideas.

ghost commented 3 years ago

@kisak-valve I'm not going to be able to fix this, am I?

ghost commented 3 years ago

Okay, so, I was finally able to fix this but I'm not entirely sure why, so I have to apologize to anyone coming to this thread looking for an answer. The Steam controller remapping tool finally allowed me to re-map my controller and switch the X and Y buttons back where they were supposed to be. Don't remap the whole thing, just the two buttons that are switched, and you'll have to use the mouse, not the controller, to select the buttons to switch. The Steam controller remapping tool is the answer, as frustrating as it is, for this particular issue.

ipaqmaster commented 3 years ago

Using my Xbox One controller over bluetooth presents the same problem. It also seems the Back and Start buttons of the controller (Middle left and right respectively) are also ignored entirely when playing games through Steam, plus XY being swapped.

Using jstest /dev/input/js0 it can clearly see when these 4 buttons are being pressed and X+Y aren't backwards either. No idea why Steam is doing this lately. Steam even pops up saying it detected my Xbox One controller when I connect it over Bluetooth. Its custom configuration section shows X=X and Y=Y so it's nothing obvious like that.

Problem not present when I connect directly with USB. But my mobility is limited with the cable.

sgaxr commented 3 years ago

I have the same issue using a wired xbox one controller.

ipaqmaster commented 3 years ago

As a drastic attempt, I took a snapshot of my home dataset to roll back to after and ran # rm -rfv .local/share/Steam/. Logging in again, re-configuring my library, enabling Xbox controller support again and selecting an example game STILL had flipped X/Y and unresponsive Start/Select buttons. There's also a chance Steam fetched my existing broken "Controller Configuration" from the cloud, or this is just a bug larger than fresh installations but it's speculation.


E1: I should've suspected this sooner. My system has hid-xpadneo (currently version 0.9.r78.g4fa679b) installed for better Xbox controller support. For fun I tried removing the xpadneo-dkms-git package I installed from the AUR and my issue with the X/Y flip and start/select being unresponsive over bluetooth has been resolved. I might play around with older xpadneo versions as it's something I want installed for a better experience and it's never been a problem in the past but for now my controller's working great.

E2: Reinstalled xpadneo dkms, same build version as above and rebooted just to make sure it's loaded correctly and the issue has not come back. But just in case it helps anyone else.. I've had this issue ongoing for a month or two and the only thing that seems to have solved it for me is removing xpadneo. I've now reinstalled it again with no controller trouble. Perhaps something else related to xpadneo were fixed by reinstalling it.

E3: It happened again a few days later so I've turned off the controller, uninstalled xpadneo and reconnected it which removed the issue once more and without even needing a game restart.

kakra commented 3 years ago

I'm the maintainer of xpadneo, such an issue should not be there. For E2, I would have suspected that you may have had some older configuration artifact left over by an update, but E2 suggests that you're seeing a different configuration problem. Maybe you should move over to the xpadneo issue tracker so we can resolve that. You may actually be hitting the hidraw bug which currently confuses SDL2, latest xpadneo git has a work-around for that.

Also, try disabling Xbox controller support in Steam Input. You only need it if you want to remap controls for some games and you can still enable that support via a per-game setting. Steam input and SDL2 try to bypass the xpadneo driver which can conflict with some features we implemented.

ipaqmaster commented 3 years ago

Thanks for your input especially as a maintainer. I'll try cleaning up its configs in /etc and see if it happens again. At the moment it is not installed.

I wasn't able to use my controller at all without Steam's Xbox controller support enabled but that is likely a different problem on my end. Will report back.