Skip to content
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

Gamepad being reported twice on Linux #90795

Open
jlogostini opened this issue Apr 17, 2024 · 18 comments
Open

Gamepad being reported twice on Linux #90795

jlogostini opened this issue Apr 17, 2024 · 18 comments

Comments

@jlogostini
Copy link

jlogostini commented Apr 17, 2024

Tested versions

  • Reproducible in: v4.2.1.stable.gentoo [b09f793], v4.2.1.stable.official [b09f793]

System information

Gentoo Linux - Godot v4.2.1.stable

Issue description

Wean on Linux Gamepads are beeing reported twice in all cases this behavior is not present on Windows this messes up gamepad detection on cross platform code bases in my case I have one PS4 and one PS5 controller plugged in via USB this also occurs with two PS5 controllers

Output on Gentoo Linux
Gamepad 0 = PS5 Controller
Gamepad 1 = PS5 Controller
Gamepad 2 = PS4 Controller
Gamepad 3 = PS4 Controller
Gamepad 4 =
Gamepad 5 =

Output on Windows
Gamepad 0 = PS5 Controller
Gamepad 1 = PS4 Controller
Gamepad 2 =
Gamepad 3 =
Gamepad 4 =
Gamepad 5 =

Steps to reproduce

Step - 1
Plugin any 2 Gamepads I have tested PS4 and PS5 controllers they both do the same thing

Step - 2
Add the following code to your GDScript this will print the names of your first 5 joypad devices
print("Gamepad 0 = " + Input.get_joy_name(0))
print("Gamepad 1 = " + Input.get_joy_name(1))
print("Gamepad 2 = " + Input.get_joy_name(2))
print("Gamepad 3 = " + Input.get_joy_name(3))
print("Gamepad 4 = " + Input.get_joy_name(4))
print("Gamepad 5 = " + Input.get_joy_name(5))

Minimal reproduction project (MRP)

Linux_Gamepad_Bug.tar.gz

@AThousandShips
Copy link
Member

Could you try with [4.2.(https://github.com/godotengine/godot-builds/releases/tag/4.2.2-stable)?

@jlogostini
Copy link
Author

jlogostini commented Apr 17, 2024

Same exact output in 4.2

@AThousandShips
Copy link
Member

@jlogostini
Copy link
Author

So is it treating the Gyroscope like a second input device on Linux?

@AThousandShips
Copy link
Member

No clue if it's the same issue, could be as it's using the same library AFAIK, at least the same basic systems

@jlogostini
Copy link
Author

Looking in my KDE settings that looks like the case

@AThousandShips
Copy link
Member

So that'd make it likely a driver side issue, but we could fix the false reporting by somehow filtering out dummy devices, but the reported device is on the OS side

@jlogostini
Copy link
Author

KDE

@jlogostini
Copy link
Author

Yeah so that's a chat with the Linux devs problem then

@AThousandShips
Copy link
Member

Does the gyroscope work on the first copy? Otherwise this would be a bit harder to fix

@jlogostini
Copy link
Author

In KDE yes but I don't know how to test that in Godot

@jlogostini
Copy link
Author

Output from dmseg

[ 2754.376216] playstation 0003:054C:0CE6.0013: hidraw7: USB HID v1.11 Gamepad [Sony Interactive Entertainment DualSense Wireless Controller] on usb-0000:25:00.3-1/input3
[ 2754.433627] input: Sony Interactive Entertainment DualSense Wireless Controller as /devices/pci0000:20/0000:20:08.1/0000:25:00.3/usb5/5-1/5-1:1.3/0003:054C:0CE6.0013/input/input52
[ 2754.433867] input: Sony Interactive Entertainment DualSense Wireless Controller Motion Sensors as /devices/pci0000:20/0000:20:08.1/0000:25:00.3/usb5/5-1/5-1:1.3/0003:054C:0CE6.0013/input/input53
[ 2754.434066] input: Sony Interactive Entertainment DualSense Wireless Controller Touchpad as /devices/pci0000:20/0000:20:08.1/0000:25:00.3/usb5/5-1/5-1:1.3/0003:054C:0CE6.0013/input/input54
[ 2754.435258] playstation 0003:054C:0CE6.0013: Registered DualSense controller hw_version=0x00000313 fw_version=0x01090002

@AThousandShips
Copy link
Member

Ah yes sorry that isn't supported for controllers at the moment, only the built in one in phones, then not a problem (presently)

@jlogostini
Copy link
Author

jlogostini commented Apr 17, 2024

Output from dmseg just from plugging in the PS5 Controller

[ 2929.965929] usb 5-1: new high-speed USB device number 6 using xhci_hcd
[ 2930.108045] usb 5-1: New USB device found, idVendor=054c, idProduct=0ce6, bcdDevice= 1.00
[ 2930.108053] usb 5-1: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[ 2930.108057] usb 5-1: Product: DualSense Wireless Controller
[ 2930.108060] usb 5-1: Manufacturer: Sony Interactive Entertainment
[ 2930.148274] playstation 0003:054C:0CE6.0017: hidraw6: USB HID v1.11 Gamepad [Sony Interactive Entertainment DualSense Wireless Controller] on usb-0000:25:00.3-1/input3
[ 2930.203619] input: Sony Interactive Entertainment DualSense Wireless Controller as /devices/pci0000:20/0000:20:08.1/0000:25:00.3/usb5/5-1/5-1:1.3/0003:054C:0CE6.0017/input/input66
[ 2930.203832] input: Sony Interactive Entertainment DualSense Wireless Controller Motion Sensors as /devices/pci0000:20/0000:20:08.1/0000:25:00.3/usb5/5-1/5-1:1.3/0003:054C:0CE6.0017/input/input67
[ 2930.204020] input: Sony Interactive Entertainment DualSense Wireless Controller Touchpad as /devices/pci0000:20/0000:20:08.1/0000:25:00.3/usb5/5-1/5-1:1.3/0003:054C:0CE6.0017/input/input68
[ 2930.207347] playstation 0003:054C:0CE6.0017: Registered DualSense controller hw_version=0x00000313 fw_version=0x01090002

@jlogostini
Copy link
Author

This is what KDE sees with only the PS5 Controller connected
KDE_2

@jlogostini
Copy link
Author

However the PS4 controller only outputs as one device arqarting to KDE?
KDE_3

@jlogostini
Copy link
Author

Output from dmseg just from plugging in the PS4 Controller

[ 3438.089126] usb 9-3.4: new full-speed USB device number 13 using xhci_hcd
[ 3438.218958] usb 9-3.4: New USB device found, idVendor=054c, idProduct=09cc, bcdDevice= 1.00
[ 3438.218966] usb 9-3.4: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[ 3438.218970] usb 9-3.4: Product: Wireless Controller
[ 3438.218973] usb 9-3.4: Manufacturer: Sony Interactive Entertainment
[ 3438.516587] playstation 0003:054C:09CC.0019: hidraw6: USB HID v1.11 Gamepad [Sony Interactive Entertainment Wireless Controller] on usb-0000:4b:00.3-3.4/input3
[ 3438.580025] input: Sony Interactive Entertainment Wireless Controller as /devices/pci0000:40/0000:40:01.1/0000:41:00.0/0000:42:08.0/0000:4b:00.3/usb9/9-3/9-3.4/9-3.4:1.3/0003:054C:09CC.0019/input/input69
[ 3438.580202] input: Sony Interactive Entertainment Wireless Controller Motion Sensors as /devices/pci0000:40/0000:40:01.1/0000:41:00.0/0000:42:08.0/0000:4b:00.3/usb9/9-3/9-3.4/9-3.4:1.3/0003:054C:09CC.0019/input/input70
[ 3438.580316] input: Sony Interactive Entertainment Wireless Controller Touchpad as /devices/pci0000:40/0000:40:01.1/0000:41:00.0/0000:42:08.0/0000:4b:00.3/usb9/9-3/9-3.4/9-3.4:1.3/0003:054C:09CC.0019/input/input71
[ 3438.580653] playstation 0003:054C:09CC.0019: Registered DualShock4 controller hw_version=0x0000b408 fw_version=0x0000a00a

@jlogostini
Copy link
Author

jlogostini commented Apr 17, 2024

This problem was fixed in this Pull Request [52eff38]

Output
Gamepad 0 = DualSense Wireless Controller
Gamepad 1 = PS4 Controller
Gamepad 2 =
Gamepad 3 =
Gamepad 4 =
Gamepad 5 =

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants