Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Right stick joypad Input not working properly with Xbox Controller on Linux with 4.2.beta1 #83552

Closed
Mikeysax opened this issue Oct 18, 2023 · 11 comments · Fixed by #83845
Closed

Comments

@Mikeysax
Copy link

Mikeysax commented Oct 18, 2023

Godot version

Godot_v4.2-beta1_linux.x86_64

System information

PopOS 22.04, Linux 6.5.4-76060504-generic x86_64, Ryzen 6800h, Radeon 6700m, amdgpu, Vulkan

Issue description

When trying to map inputs on the right stick on an Xbox controller (Elite or non-elite), the mappings are incorrect still on Linux.

This is related to #81816

I commented in the above issue when it was active but the changes made did not fix the issue in Linux.

This happens on two machines and also has happened across multiple Linux distros like Fedora, Ubuntu, PopOS, Manjaro.

This also happens regardless if I used xpadone, xone, etc... and regardless of if this is over bluetooth, wired, or xbox wireless dongle

Also, the Steam output is correct and I've attached a video of it below.

Steps to reproduce

When moving the right joystick:

Down:

joystick_down_outputs_random

Left:

joystick_left_outputs_joystick_up

Right:
joystick_right_outputs_joystick_down

Up:

joystick_up_outputs_joystick_2_left


xinput output:

Screenshot from 2023-10-18 07-18-31

Bluetooth:

godot_4 2_beta1_controller_test_bluetooth

Video of Steam Output which is correct:

godot_4.2_beta1_controller_test.mp4

Minimal reproduction project

N/A

@Mikeysax Mikeysax changed the title Input not working properly with Xbox Wireless Controller Right stick joypad Input not working properly with Xbox Wireless Controller Oct 18, 2023
@Mikeysax Mikeysax changed the title Right stick joypad Input not working properly with Xbox Wireless Controller Right stick joypad Input not working properly with Xbox Wireless Controller on Linux Oct 18, 2023
@Mikeysax Mikeysax changed the title Right stick joypad Input not working properly with Xbox Wireless Controller on Linux Right stick joypad Input not working properly with Xbox Wireless Controller on Linux with 4.2.beta1 Oct 18, 2023
@Mikeysax Mikeysax changed the title Right stick joypad Input not working properly with Xbox Wireless Controller on Linux with 4.2.beta1 Right stick joypad Input not working properly with Xbox Controller on Linux with 4.2.beta1 Oct 18, 2023
@akien-mga
Copy link
Member

What's the exact model of the controller(s) you're testing with?

Can you retrieve the UUID(s) and mapping using one of the tools described here? https://github.com/gabomdq/SDL_GameControllerDB#mapping-tools

It might be that it's just missing in SDL_GameControllerDB, or that we need to sync the past couple of weeks of additions.

@Mikeysax
Copy link
Author

Mikeysax commented Oct 18, 2023

What's the exact model of the controller(s) you're testing with?

Can you retrieve the UUID(s) and mapping using one of the tools described here? https://github.com/gabomdq/SDL_GameControllerDB#mapping-tools

It might be that it's just missing in SDL_GameControllerDB, or that we need to sync the past couple of weeks of additions.

I followed the guide and took this directly from the config.vdf in Steam:

"SDL_GamepadBind"

"050000005e0400008e02000030110000,Xbox 360 Controller,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,crc:f003,platform:Linux,"

Is this enough?

I'm using an Elite Series 2 model Xbox controller. The same happens for the Xbox Wireless Controller. They both seem to show up as the same entry in the config.vdf in Steam

@akien-mga
Copy link
Member

This mapping seems to be missing in https://github.com/gabomdq/SDL_GameControllerDB, so it should probably be PR'ed to add to their list, which we'll then also get in Godot next time I sync.

I'm just puzzled that it's described at "Xbox 360 Controller", this might be Steam Input giving it a generic name.
Might be worth checking if one of the other listed tools in https://github.com/gabomdq/SDL_GameControllerDB#mapping-tools would infer a more specific name. But the SDL_GameControllerDB might have further advice about how to ensure the mapping is as accurate as possible.

BTW, you can test that mapping in Godot by passing it via the SDL_GAMECONTROLLERCONFIG environment variable:

SDL_GAMECONTROLLERCONFIG="050000005e0400008e02000030110000,Xbox 360 Controller,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,crc:f003,platform:Linux," godot

@Mikeysax
Copy link
Author

Mikeysax commented Oct 18, 2023

It worked; Caveat though that differs from the original string I provided which is a Elite 2 controller. I'm on a different PC now with a regular XBOX Wireless Controller. I pulled a different value from the config.vdf and then used it and it worked when playing the game.

"060000005e040000120b00000d050000,Xbox Series X Controller,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,misc1:b11,leftx:a0,lefty:a1,rightx:a3,righty:a4,lefttrigger:a2,righttrigger:a5,crc:9d50,platform:Linux" 

This was the output; there was an error talking about an input string:

SDL_GAMECONTROLLERCONFIG="060000005e040000120b00000d050000,Xbox Series X Controller,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,misc1:b11,leftx:a0,lefty:a1,rightx:a3,righty:a4,lefttrigger:a2,righttrigger:a5,crc:9d50,platform:Linux" ./Godot_v4.2-beta1_linux.x86_64 
Godot Engine v4.2.beta1.official.b1371806a - https://godotengine.org
ERROR: Unrecognized input string "9d50" in mapping:
060000005e040000120b00000d050000,Xbox Series X Controller,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,misc1:b11,leftx:a0,lefty:a1,rightx:a3,righty:a4,lefttrigger:a2,righttrigger:a5,crc:9d50,platform:Linux
   at: parse_mapping (core/input/input.cpp:1477)
OpenGL API 4.6 (Core Profile) Mesa 23.1.3-1pop0~1689084530~22.04~0618746 - Compatibility - Using Device: AMD - AMD Radeon RX 6900 XT (navi21, LLVM 15.0.7, DRM 3.52, 6.4.6-76060406-generic)

Ultimately, it worked when I used the env variable

@akien-mga
Copy link
Member

Seems like the crc: field is a known issue with one of the mapping apps: mdqinc/SDL_GameControllerDB#476 (comment)

So the crc:9d50, part should just be removed.

Would you be able to make a PR to https://github.com/gabomdq/SDL_GameControllerDB/blob/master/gamecontrollerdb.txt with your mappings?

@Mikeysax
Copy link
Author

Seems like the crc: field is a known issue with one of the mapping apps: gabomdq/SDL_GameControllerDB#476 (comment)

So the crc:9d50, part should just be removed.

Would you be able to make a PR to https://github.com/gabomdq/SDL_GameControllerDB/blob/master/gamecontrollerdb.txt with your mappings?

Sure, I can give that a shot

@Mikeysax
Copy link
Author

@akien-mga Looks like the bindings were merged. What happens after that?

@akien-mga
Copy link
Member

Thanks for the ping, I'll sync with the SDL repo.

@akien-mga akien-mga added this to the 4.2 milestone Oct 23, 2023
YuriSizov pushed a commit to YuriSizov/godot that referenced this issue Oct 24, 2023
akien-mga added a commit to akien-mga/godot that referenced this issue Oct 30, 2023
@Shashlik25
Copy link

Guys, help me solve this error,please, what do I need to do to make it go away? xbox series gamepad, I'm a newbie

@Hikitile
Copy link

Hikitile commented Dec 19, 2023

@Shashlik25 I use this workaround on flatpak with flatseal

  1. Open /home/yourusername/.var/app/com.valvesoftware.Steam/.local/share/Steam/config/config.vdf

  2. Copy the last line in "SDL_GamepadBind" without crc:1234

    Example:

030082795e040000ea02000001030000,Xbox One S Controller,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,crc:7982, platform:Linux,

  1. In Flatseal, add the environment variable GAMECONTROLLERCONFIG=<The text without crc>
  2. Start Steam

@Shashlik25
Copy link

@Hikitile Thanks, works for me. U saved my nervs

akien-mga added a commit to akien-mga/godot that referenced this issue Jan 30, 2024
# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants