paroj / xpad

Linux Kernel Driver for the Xbox/ Xbox 360/ Xbox One Controllers
823 stars 182 forks source link

GameSir T4 Cyclone support #273

Closed qwelias closed 5 months ago

qwelias commented 6 months ago

I've got Gamesir Cyclone T4 controller.

It is capable of working in DInput or XInput modes.

When I connect under Linux it only works in DInput, when I connect it under Windows it is able to switch to XInput. If I then reboot into Linux, the gamepad stays in XInput mode.

lsusb in DInput: 3537:1006 GameSir GameSir-Cyclone lsusb in XInput: 3537:1014 Microsoft Xbox 360 for Windows Controller

I've tried recompiling linux xpad driver with added 1014 id (https://github.com/torvalds/linux/pull/834) But it didn't work, tho I may have made a mistake somewhere

qwelias commented 6 months ago

journalctl when connecting:

Apr 04 01:12:34 extmaze kernel: usb 1-6.4: new full-speed USB device number 8 using xhci_hcd
Apr 04 01:12:34 extmaze kernel: usb 1-6.4: unable to read config index 0 descriptor/start: -71
Apr 04 01:12:34 extmaze kernel: usb 1-6.4: can't read configurations, error -71
Apr 04 01:12:35 extmaze kernel: usb 1-6.4: new full-speed USB device number 10 using xhci_hcd
Apr 04 01:12:36 extmaze kernel: usb 1-6.4: New USB device found, idVendor=3537, idProduct=1006, bcdDevice= 1.00
Apr 04 01:12:36 extmaze kernel: usb 1-6.4: New USB device strings: Mfr=1, Product=2, SerialNumber=0
Apr 04 01:12:36 extmaze kernel: usb 1-6.4: Product: GameSir-Cyclone
Apr 04 01:12:36 extmaze kernel: usb 1-6.4: Manufacturer: GameSir
Apr 04 01:12:36 extmaze kernel: input: GameSir GameSir-Cyclone as /devices/pci0000:00/0000:00:14.0/usb1/1-6/1-6.4/1-6.4:1.0/0003:3537:1006.0009/input/input30
Apr 04 01:12:36 extmaze kernel: hid-generic 0003:3537:1006.0009: input,hidraw7: USB HID v1.10 Gamepad [GameSir GameSir-Cyclone] on usb-0000:00:14.0-6.4/input0
Apr 04 01:12:36 extmaze kernel: input: GameSir GameSir-Cyclone System Control as /devices/pci0000:00/0000:00:14.0/usb1/1-6/1-6.4/1-6.4:1.1/0003:3537:1006.000A/input/input31
Apr 04 01:12:36 extmaze kernel: input: GameSir GameSir-Cyclone Consumer Control as /devices/pci0000:00/0000:00:14.0/usb1/1-6/1-6.4/1-6.4:1.1/0003:3537:1006.000A/input/input32
Apr 04 01:12:36 extmaze kernel: hid-generic 0003:3537:1006.000A: input,hidraw8: USB HID v1.01 Device [GameSir GameSir-Cyclone] on usb-0000:00:14.0-6.4/input1
Apr 04 01:12:36 extmaze kernel: input: GameSir GameSir-Cyclone as /devices/pci0000:00/0000:00:14.0/usb1/1-6/1-6.4/1-6.4:1.2/0003:3537:1006.000B/input/input33
Apr 04 01:12:36 extmaze kernel: hid-generic 0003:3537:1006.000B: input,hidraw9: USB HID v1.11 Keyboard [GameSir GameSir-Cyclone] on usb-0000:00:14.0-6.4/input2
Apr 04 01:12:36 extmaze mtp-probe[8911]: checking bus 1, device 10: "/sys/devices/pci0000:00/0000:00:14.0/usb1/1-6/1-6.4"
Apr 04 01:12:36 extmaze mtp-probe[8911]: bus: 1, device: 10 was not an MTP device
Apr 04 01:12:36 extmaze systemd-logind[1301]: Watching system buttons on /dev/input/event28 (GameSir GameSir-Cyclone System Control)
Apr 04 01:12:36 extmaze systemd-logind[1301]: Watching system buttons on /dev/input/event30 (GameSir GameSir-Cyclone)
Apr 04 01:12:36 extmaze mtp-probe[8945]: checking bus 1, device 10: "/sys/devices/pci0000:00/0000:00:14.0/usb1/1-6/1-6.4"
Apr 04 01:12:36 extmaze mtp-probe[8945]: bus: 1, device: 10 was not an MTP device
qwelias commented 6 months ago

Also tried with:

diff --git a/xpad.c b/xpad.c
index 43985dd..bb0ce9a 100644
--- a/xpad.c
+++ b/xpad.c
@@ -385,6 +385,9 @@ static const struct xpad_device {
        { 0x31e3, 0x1230, "Wooting Two HE (ARM)", 0, XTYPE_XBOX360 },
        { 0x31e3, 0x1300, "Wooting 60HE (AVR)", 0, XTYPE_XBOX360 },
        { 0x31e3, 0x1310, "Wooting 60HE (ARM)", 0, XTYPE_XBOX360 },
+       { 0x3537, 0x1004, "GameSir T4 Kaleid", 0, XTYPE_XBOX360 },
+       { 0x3537, 0x1006, "GameSir T4 Cyclone", 0, XTYPE_XBOX360, QUIRK_360_START_PKT_3 },
+       { 0x3537, 0x1014, "GameSir T4 Cyclone", 0, XTYPE_XBOX360, QUIRK_360_START_PKT_3 },
        { 0x3285, 0x0607, "Nacon GC-100", 0, XTYPE_XBOX360 },
        { 0x3285, 0x0614, "Nacon Pro Compact", 0, XTYPE_XBOXONE },
        { 0x3767, 0x0101, "Fanatec Speedster 3 Forceshock Wheel", 0, XTYPE_XBOX },
@@ -527,6 +530,7 @@ static const struct usb_device_id xpad_table[] = {
        XPAD_XBOXONE_VENDOR(0x2e24),            /* Hyperkin Duke X-Box One pad */
        XPAD_XBOXONE_VENDOR(0x2e95),            /* SCUF Gaming Controller */
        XPAD_XBOX360_VENDOR(0x2f24),            /* GameSir Controllers */
+       XPAD_XBOX360_VENDOR(0x3537),            /* GameSir Controllers */
        XPAD_XBOX360_VENDOR(0x31e3),            /* Wooting Keyboards */
        XPAD_XBOX360_VENDOR(0x3285),            /* Nacon GC-100 */
        XPAD_XBOXONE_VENDOR(0x3285),            /* Nacon XBOX Series S/X Controllers */

Including without quirks and with QUIRK_360_START/QUIRK_360_START_PKT_{1,2,3} Got same logs in journalctl

qwelias commented 5 months ago

firmware update via mobile app fixed it