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

Add Support For Xbox Elite Series 2 Wireless #144

Closed
wants to merge 2 commits into from

Conversation

duganchen
Copy link
Contributor

@duganchen duganchen commented Nov 24, 2019

For #142

On my Fedora 31 system, this does get xpadneo working with my Xbox Elite Series 2 over Bluetooth. "udevadm info -a -n /dev/input/js0" and "hwinfo" both show that xpadneo is indeed the driver being used for gamepad.

I confirmed with evtest that every button on the gamepad generates events.

Are the control mappings right? No, but that should be fixed in userspace (using SDL2's controller mappings) and not in the kernel driver.

@@ -22,3 +22,8 @@ ACTION=="add", \
KERNEL=="0005:045E:02FD.*|0005:045E:02E0.*", \
SUBSYSTEM=="hid", \
RUN:="/bin/sh -c 'echo xpadneo udev: $kernel > /dev/kmsg; modprobe hid_xpadneo; echo $kernel > /sys/bus/hid/drivers/hid-generic/unbind; echo $kernel > /sys/bus/hid/drivers/microsoft/unbind; echo $kernel > /sys/bus/hid/drivers/xpadneo/bind; echo xpadneo udev: ok > /dev/kmsg'"

ACTION=="add", \
KERNEL=="0005:045E:0B05.*|0005:045E:0B05.*", \
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe there is no need for double add action. You can extend hardware addresses in 1st rule

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think so too, could you please change that?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done :)

@atar-axis
Copy link
Owner

I would need the HID report descriptor too, please provide me sudo find "/sys/kernel/debug/hid/" -name "0005:045E:*" -exec sh -c 'echo "{}"

@duganchen
Copy link
Contributor Author

I'm not really sure what that command-line is supposed to do, but here's the contents of /sys/kernel/debug/hid/0005:045E:0B05.000A/rdesc:

05 01 09 05 a1 01 85 01 09 01 a1 00 09 30 09 31 15 00 27 ff ff 00 00 95 02 75 10 81 02 c0 09 01 a1 00 09 32 09 35 15 00 27 ff ff 00 00 95 02 75 10 81 02 c0 05 02 09 c5 15 00 26 ff 03 95 01 75 0a 81 02 15 00 25 00 75 06 95 01 81 03 05 02 09 c4 15 00 26 ff 03 95 01 75 0a 81 02 15 00 25 00 75 06 95 01 81 03 05 01 09 39 15 01 25 08 35 00 46 3b 01 66 14 00 75 04 95 01 81 42 75 04 95 01 15 00 25 00 35 00 45 00 65 00 81 03 05 09 19 01 29 0f 15 00 25 01 75 01 95 0f 81 02 15 00 25 00 75 01 95 01 81 03 05 0c 0a 24 02 15 00 25 01 95 01 75 01 81 02 15 00 25 00 75 07 95 01 81 03 05 0c 09 01 a1 01 0a 81 00 15 00 26 ff 00 95 01 75 04 81 02 15 00 25 00 95 01 75 04 81 03 0a 84 00 15 00 26 ff 00 95 01 75 04 81 02 15 00 25 00 95 01 75 04 81 03 0a 85 00 15 00 26 ff 00 95 01 75 08 81 02 0a 99 00 15 00 26 ff 00 95 01 75 04 81 02 15 00 25 00 95 01 75 04 81 03 0a 9e 00 15 00 26 ff 00 95 01 75 08 81 02 0a a1 00 15 00 26 ff 00 95 01 75 08 81 02 0a a2 00 15 00 26 ff 00 95 01 75 08 81 02 0a a3 00 15 00 26 ff 00 95 01 75 08 81 02 0a a4 00 15 00 26 ff 00 95 01 75 08 81 02 0a b9 00 15 00 26 ff 00 95 01 75 08 81 02 0a ba 00 15 00 26 ff 00 95 01 75 08 81 02 0a bb 00 15 00 26 ff 00 95 01 75 08 81 02 0a be 00 15 00 26 ff 00 95 01 75 08 81 02 0a c0 00 15 00 26 ff 00 95 01 75 08 81 02 0a c1 00 15 00 26 ff 00 95 01 75 08 81 02 0a c2 00 15 00 26 ff 00 95 01 75 08 81 02 0a c3 00 15 00 26 ff 00 95 01 75 08 81 02 0a c4 00 15 00 26 ff 00 95 01 75 08 81 02 0a c5 00 15 00 26 ff 00 95 01 75 08 81 02 0a c6 00 15 00 26 ff 00 95 01 75 08 81 02 0a c7 00 15 00 26 ff 00 95 01 75 08 81 02 0a c8 00 15 00 26 ff 00 95 01 75 08 81 02 c0 05 0c 09 01 85 02 a1 01 05 0c 0a 23 02 15 00 25 01 95 01 75 01 81 02 15 00 25 00 75 07 95 01 81 03 c0 05 0f 09 21 85 03 a1 02 09 97 15 00 25 01 75 04 95 01 91 02 15 00 25 00 75 04 95 01 91 03 09 70 15 00 25 64 75 08 95 04 91 02 09 50 66 01 10 55 0e 15 00 26 ff 00 75 08 95 01 91 02 09 a7 15 00 26 ff 00 75 08 95 01 91 02 65 00 55 00 09 7c 15 00 26 ff 00 75 08 95 01 91 02 c0 05 06 09 20 85 04 15 00 26 ff 00 75 08 95 01 81 02 06 00 ff 09 01 a1 02 85 06 09 01 15 00 25 64 75 08 95 01 b1 02 09 02 15 00 25 64 75 08 95 01 b1 02 09 03 15 00 26 ff 00 75 08 95 01 b1 02 09 04 26 ff 00 75 08 95 3c b2 02 01 c0 06 00 ff 09 02 a1 02 85 07 09 05 15 00 25 64 75 08 95 01 b1 02 09 06 15 00 25 64 75 08 95 01 b1 02 09 07 15 00 25 64 75 08 95 01 b1 02 c0 06 00 ff 09 03 a1 02 85 08 09 08 15 00 25 64 75 08 95 01 b1 02 09 09 15 00 25 64 75 08 95 01 b1 02 09 0a 15 00 26 ff 00 75 08 95 01 b1 02 c0 06 00 ff 09 04 a1 01 85 09 09 0b 15 00 25 64 75 08 95 01 b1 02 09 0c 15 00 25 64 75 08 95 01 b1 02 09 0d 15 00 25 64 75 08 95 01 b1 02 09 0e 15 00 26 ff 00 75 08 95 01 b1 02 09 0f 26 ff 00 75 08 95 3c b2 02 01 c0 06 00 ff 09 05 a1 01 85 0a 09 10 15 00 27 ff ff ff 7f 75 20 95 01 81 02 09 11 15 00 27 ff ff ff 7f 75 20 95 01 81 02 09 12 15 00 26 ff 00 75 08 95 02 81 02 09 13 15 00 26 ff 00 75 08 95 01 81 02 c0 06 00 ff 09 06 a1 02 85 0b 09 14 15 00 25 64 75 08 95 01 b1 02 c0 c0 05 01 09 06 a1 01 85 05 05 07 19 e0 29 e7 15 00 25 01 75 01 95 08 81 02 95 01 75 08 81 03 95 06 75 08 15 00 25 65 05 07 19 00 29 65 81 00 c0 00 

  INPUT(1)[INPUT]
    Field(0)
      Physical(GenericDesktop.Pointer)
      Application(GenericDesktop.GamePad)
      Usage(2)
        GenericDesktop.X
        GenericDesktop.Y
      Logical Minimum(0)
      Logical Maximum(65535)
      Report Size(16)
      Report Count(2)
      Report Offset(0)
      Flags( Variable Absolute )
    Field(1)
      Physical(GenericDesktop.Pointer)
      Application(GenericDesktop.GamePad)
      Usage(2)
        GenericDesktop.Z
        GenericDesktop.Rz
      Logical Minimum(0)
      Logical Maximum(65535)
      Report Size(16)
      Report Count(2)
      Report Offset(32)
      Flags( Variable Absolute )
    Field(2)
      Application(GenericDesktop.GamePad)
      Usage(1)
        Simulation.00c5
      Logical Minimum(0)
      Logical Maximum(1023)
      Report Size(10)
      Report Count(1)
      Report Offset(64)
      Flags( Variable Absolute )
    Field(3)
      Application(GenericDesktop.GamePad)
      Usage(1)
        Simulation.00c4
      Logical Minimum(0)
      Logical Maximum(1023)
      Report Size(10)
      Report Count(1)
      Report Offset(80)
      Flags( Variable Absolute )
    Field(4)
      Application(GenericDesktop.GamePad)
      Usage(1)
        GenericDesktop.HatSwitch
      Logical Minimum(1)
      Logical Maximum(8)
      Physical Minimum(0)
      Physical Maximum(315)
      Unit(English Rotation : Degrees)
      Report Size(4)
      Report Count(1)
      Report Offset(96)
      Flags( Variable Absolute NullState )
    Field(5)
      Application(GenericDesktop.GamePad)
      Usage(15)
        Button.0001
        Button.0002
        Button.0003
        Button.0004
        Button.0005
        Button.0006
        Button.0007
        Button.0008
        Button.0009
        Button.000a
        Button.000b
        Button.000c
        Button.000d
        Button.000e
        Button.000f
      Logical Minimum(0)
      Logical Maximum(1)
      Report Size(1)
      Report Count(15)
      Report Offset(104)
      Flags( Variable Absolute )
    Field(6)
      Application(GenericDesktop.GamePad)
      Usage(1)
        Consumer.0224
      Logical Minimum(0)
      Logical Maximum(1)
      Report Size(1)
      Report Count(1)
      Report Offset(120)
      Flags( Variable Absolute )
    Field(7)
      Application(Consumer.0001)
      Usage(1)
        Consumer.0081
      Logical Minimum(0)
      Logical Maximum(255)
      Report Size(4)
      Report Count(1)
      Report Offset(128)
      Flags( Variable Absolute )
    Field(8)
      Application(Consumer.0001)
      Usage(1)
        Consumer.0084
      Logical Minimum(0)
      Logical Maximum(255)
      Report Size(4)
      Report Count(1)
      Report Offset(136)
      Flags( Variable Absolute )
    Field(9)
      Application(Consumer.0001)
      Usage(1)
        Consumer.0085
      Logical Minimum(0)
      Logical Maximum(255)
      Report Size(8)
      Report Count(1)
      Report Offset(144)
      Flags( Variable Absolute )
    Field(10)
      Application(Consumer.0001)
      Usage(1)
        Consumer.0099
      Logical Minimum(0)
      Logical Maximum(255)
      Report Size(4)
      Report Count(1)
      Report Offset(152)
      Flags( Variable Absolute )
    Field(11)
      Application(Consumer.0001)
      Usage(1)
        Consumer.009e
      Logical Minimum(0)
      Logical Maximum(255)
      Report Size(8)
      Report Count(1)
      Report Offset(160)
      Flags( Variable Absolute )
    Field(12)
      Application(Consumer.0001)
      Usage(1)
        Consumer.00a1
      Logical Minimum(0)
      Logical Maximum(255)
      Report Size(8)
      Report Count(1)
      Report Offset(168)
      Flags( Variable Absolute )
    Field(13)
      Application(Consumer.0001)
      Usage(1)
        Consumer.00a2
      Logical Minimum(0)
      Logical Maximum(255)
      Report Size(8)
      Report Count(1)
      Report Offset(176)
      Flags( Variable Absolute )
    Field(14)
      Application(Consumer.0001)
      Usage(1)
        Consumer.00a3
      Logical Minimum(0)
      Logical Maximum(255)
      Report Size(8)
      Report Count(1)
      Report Offset(184)
      Flags( Variable Absolute )
    Field(15)
      Application(Consumer.0001)
      Usage(1)
        Consumer.00a4
      Logical Minimum(0)
      Logical Maximum(255)
      Report Size(8)
      Report Count(1)
      Report Offset(192)
      Flags( Variable Absolute )
    Field(16)
      Application(Consumer.0001)
      Usage(1)
        Consumer.00b9
      Logical Minimum(0)
      Logical Maximum(255)
      Report Size(8)
      Report Count(1)
      Report Offset(200)
      Flags( Variable Absolute )
    Field(17)
      Application(Consumer.0001)
      Usage(1)
        Consumer.00ba
      Logical Minimum(0)
      Logical Maximum(255)
      Report Size(8)
      Report Count(1)
      Report Offset(208)
      Flags( Variable Absolute )
    Field(18)
      Application(Consumer.0001)
      Usage(1)
        Consumer.00bb
      Logical Minimum(0)
      Logical Maximum(255)
      Report Size(8)
      Report Count(1)
      Report Offset(216)
      Flags( Variable Absolute )
    Field(19)
      Application(Consumer.0001)
      Usage(1)
        Consumer.00be
      Logical Minimum(0)
      Logical Maximum(255)
      Report Size(8)
      Report Count(1)
      Report Offset(224)
      Flags( Variable Absolute )
    Field(20)
      Application(Consumer.0001)
      Usage(1)
        Consumer.00c0
      Logical Minimum(0)
      Logical Maximum(255)
      Report Size(8)
      Report Count(1)
      Report Offset(232)
      Flags( Variable Absolute )
    Field(21)
      Application(Consumer.0001)
      Usage(1)
        Consumer.00c1
      Logical Minimum(0)
      Logical Maximum(255)
      Report Size(8)
      Report Count(1)
      Report Offset(240)
      Flags( Variable Absolute )
    Field(22)
      Application(Consumer.0001)
      Usage(1)
        Consumer.00c2
      Logical Minimum(0)
      Logical Maximum(255)
      Report Size(8)
      Report Count(1)
      Report Offset(248)
      Flags( Variable Absolute )
    Field(23)
      Application(Consumer.0001)
      Usage(1)
        Consumer.00c3
      Logical Minimum(0)
      Logical Maximum(255)
      Report Size(8)
      Report Count(1)
      Report Offset(256)
      Flags( Variable Absolute )
    Field(24)
      Application(Consumer.0001)
      Usage(1)
        Consumer.00c4
      Logical Minimum(0)
      Logical Maximum(255)
      Report Size(8)
      Report Count(1)
      Report Offset(264)
      Flags( Variable Absolute )
    Field(25)
      Application(Consumer.0001)
      Usage(1)
        Consumer.00c5
      Logical Minimum(0)
      Logical Maximum(255)
      Report Size(8)
      Report Count(1)
      Report Offset(272)
      Flags( Variable Absolute )
    Field(26)
      Application(Consumer.0001)
      Usage(1)
        Consumer.00c6
      Logical Minimum(0)
      Logical Maximum(255)
      Report Size(8)
      Report Count(1)
      Report Offset(280)
      Flags( Variable Absolute )
    Field(27)
      Application(Consumer.0001)
      Usage(1)
        Consumer.00c7
      Logical Minimum(0)
      Logical Maximum(255)
      Report Size(8)
      Report Count(1)
      Report Offset(288)
      Flags( Variable Absolute )
    Field(28)
      Application(Consumer.0001)
      Usage(1)
        Consumer.00c8
      Logical Minimum(0)
      Logical Maximum(255)
      Report Size(8)
      Report Count(1)
      Report Offset(296)
      Flags( Variable Absolute )
  INPUT(2)[INPUT]
    Field(0)
      Application(Consumer.0001)
      Usage(1)
        Consumer.0223
      Logical Minimum(0)
      Logical Maximum(1)
      Report Size(1)
      Report Count(1)
      Report Offset(0)
      Flags( Variable Absolute )
  INPUT(4)[INPUT]
    Field(0)
      Application(GenericDesktop.GamePad)
      Usage(1)
        GenericDeviceControls.BatteryStrength
      Logical Minimum(0)
      Logical Maximum(255)
      Report Size(8)
      Report Count(1)
      Report Offset(0)
      Flags( Variable Absolute )
  INPUT(10)[INPUT]
    Field(0)
      Application(ff00.0005)
      Usage(1)
        ff00.0010
      Logical Minimum(0)
      Logical Maximum(2147483647)
      Report Size(32)
      Report Count(1)
      Report Offset(0)
      Flags( Variable Absolute )
    Field(1)
      Application(ff00.0005)
      Usage(1)
        ff00.0011
      Logical Minimum(0)
      Logical Maximum(2147483647)
      Report Size(32)
      Report Count(1)
      Report Offset(32)
      Flags( Variable Absolute )
    Field(2)
      Application(ff00.0005)
      Usage(2)
        ff00.0012
        ff00.0012
      Logical Minimum(0)
      Logical Maximum(255)
      Report Size(8)
      Report Count(2)
      Report Offset(64)
      Flags( Variable Absolute )
    Field(3)
      Application(ff00.0005)
      Usage(1)
        ff00.0013
      Logical Minimum(0)
      Logical Maximum(255)
      Report Size(8)
      Report Count(1)
      Report Offset(80)
      Flags( Variable Absolute )
  INPUT(5)[INPUT]
    Field(0)
      Application(GenericDesktop.Keyboard)
      Usage(8)
        Keyboard.00e0
        Keyboard.00e1
        Keyboard.00e2
        Keyboard.00e3
        Keyboard.00e4
        Keyboard.00e5
        Keyboard.00e6
        Keyboard.00e7
      Logical Minimum(0)
      Logical Maximum(1)
      Report Size(1)
      Report Count(8)
      Report Offset(0)
      Flags( Variable Absolute )
    Field(1)
      Application(GenericDesktop.Keyboard)
      Usage(102)
        Keyboard.0000
        Keyboard.0001
        Keyboard.0002
        Keyboard.0003
        Keyboard.0004
        Keyboard.0005
        Keyboard.0006
        Keyboard.0007
        Keyboard.0008
        Keyboard.0009
        Keyboard.000a
        Keyboard.000b
        Keyboard.000c
        Keyboard.000d
        Keyboard.000e
        Keyboard.000f
        Keyboard.0010
        Keyboard.0011
        Keyboard.0012
        Keyboard.0013
        Keyboard.0014
        Keyboard.0015
        Keyboard.0016
        Keyboard.0017
        Keyboard.0018
        Keyboard.0019
        Keyboard.001a
        Keyboard.001b
        Keyboard.001c
        Keyboard.001d
        Keyboard.001e
        Keyboard.001f
        Keyboard.0020
        Keyboard.0021
        Keyboard.0022
        Keyboard.0023
        Keyboard.0024
        Keyboard.0025
        Keyboard.0026
        Keyboard.0027
        Keyboard.0028
        Keyboard.0029
        Keyboard.002a
        Keyboard.002b
        Keyboard.002c
        Keyboard.002d
        Keyboard.002e
        Keyboard.002f
        Keyboard.0030
        Keyboard.0031
        Keyboard.0032
        Keyboard.0033
        Keyboard.0034
        Keyboard.0035
        Keyboard.0036
        Keyboard.0037
        Keyboard.0038
        Keyboard.0039
        Keyboard.003a
        Keyboard.003b
        Keyboard.003c
        Keyboard.003d
        Keyboard.003e
        Keyboard.003f
        Keyboard.0040
        Keyboard.0041
        Keyboard.0042
        Keyboard.0043
        Keyboard.0044
        Keyboard.0045
        Keyboard.0046
        Keyboard.0047
        Keyboard.0048
        Keyboard.0049
        Keyboard.004a
        Keyboard.004b
        Keyboard.004c
        Keyboard.004d
        Keyboard.004e
        Keyboard.004f
        Keyboard.0050
        Keyboard.0051
        Keyboard.0052
        Keyboard.0053
        Keyboard.0054
        Keyboard.0055
        Keyboard.0056
        Keyboard.0057
        Keyboard.0058
        Keyboard.0059
        Keyboard.005a
        Keyboard.005b
        Keyboard.005c
        Keyboard.005d
        Keyboard.005e
        Keyboard.005f
        Keyboard.0060
        Keyboard.0061
        Keyboard.0062
        Keyboard.0063
        Keyboard.0064
        Keyboard.0065
      Logical Minimum(0)
      Logical Maximum(101)
      Report Size(8)
      Report Count(6)
      Report Offset(16)
      Flags( Array Absolute )
  OUTPUT(3)[OUTPUT]
    Field(0)
      Logical(PhysicalInterfaceDevice.0021)
      Application(GenericDesktop.GamePad)
      Usage(1)
        PhysicalInterfaceDevice.0097
      Logical Minimum(0)
      Logical Maximum(1)
      Report Size(4)
      Report Count(1)
      Report Offset(0)
      Flags( Variable Absolute )
    Field(1)
      Logical(PhysicalInterfaceDevice.0021)
      Application(GenericDesktop.GamePad)
      Usage(4)
        PhysicalInterfaceDevice.0070
        PhysicalInterfaceDevice.0070
        PhysicalInterfaceDevice.0070
        PhysicalInterfaceDevice.0070
      Logical Minimum(0)
      Logical Maximum(100)
      Report Size(8)
      Report Count(4)
      Report Offset(8)
      Flags( Variable Absolute )
    Field(2)
      Logical(PhysicalInterfaceDevice.0021)
      Application(GenericDesktop.GamePad)
      Usage(1)
        PhysicalInterfaceDevice.0050
      Logical Minimum(0)
      Logical Maximum(255)
      Unit Exponent(-2)
      Unit(SI Linear : Seconds)
      Report Size(8)
      Report Count(1)
      Report Offset(40)
      Flags( Variable Absolute )
    Field(3)
      Logical(PhysicalInterfaceDevice.0021)
      Application(GenericDesktop.GamePad)
      Usage(1)
        PhysicalInterfaceDevice.00a7
      Logical Minimum(0)
      Logical Maximum(255)
      Unit Exponent(-2)
      Unit(SI Linear : Seconds)
      Report Size(8)
      Report Count(1)
      Report Offset(48)
      Flags( Variable Absolute )
    Field(4)
      Logical(PhysicalInterfaceDevice.0021)
      Application(GenericDesktop.GamePad)
      Usage(1)
        PhysicalInterfaceDevice.007c
      Logical Minimum(0)
      Logical Maximum(255)
      Report Size(8)
      Report Count(1)
      Report Offset(56)
      Flags( Variable Absolute )
  FEATURE(6)[FEATURE]
    Field(0)
      Logical(ff00.0001)
      Application(GenericDesktop.GamePad)
      Usage(1)
        ff00.0001
      Logical Minimum(0)
      Logical Maximum(100)
      Report Size(8)
      Report Count(1)
      Report Offset(0)
      Flags( Variable Absolute )
    Field(1)
      Logical(ff00.0001)
      Application(GenericDesktop.GamePad)
      Usage(1)
        ff00.0002
      Logical Minimum(0)
      Logical Maximum(100)
      Report Size(8)
      Report Count(1)
      Report Offset(8)
      Flags( Variable Absolute )
    Field(2)
      Logical(ff00.0001)
      Application(GenericDesktop.GamePad)
      Usage(1)
        ff00.0003
      Logical Minimum(0)
      Logical Maximum(255)
      Report Size(8)
      Report Count(1)
      Report Offset(16)
      Flags( Variable Absolute )
    Field(3)
      Logical(ff00.0001)
      Application(GenericDesktop.GamePad)
      Usage(60)
        ff00.0004
        ff00.0004
        ff00.0004
        ff00.0004
        ff00.0004
        ff00.0004
        ff00.0004
        ff00.0004
        ff00.0004
        ff00.0004
        ff00.0004
        ff00.0004
        ff00.0004
        ff00.0004
        ff00.0004
        ff00.0004
        ff00.0004
        ff00.0004
        ff00.0004
        ff00.0004
        ff00.0004
        ff00.0004
        ff00.0004
        ff00.0004
        ff00.0004
        ff00.0004
        ff00.0004
        ff00.0004
        ff00.0004
        ff00.0004
        ff00.0004
        ff00.0004
        ff00.0004
        ff00.0004
        ff00.0004
        ff00.0004
        ff00.0004
        ff00.0004
        ff00.0004
        ff00.0004
        ff00.0004
        ff00.0004
        ff00.0004
        ff00.0004
        ff00.0004
        ff00.0004
        ff00.0004
        ff00.0004
        ff00.0004
        ff00.0004
        ff00.0004
        ff00.0004
        ff00.0004
        ff00.0004
        ff00.0004
        ff00.0004
        ff00.0004
        ff00.0004
        ff00.0004
        ff00.0004
      Logical Minimum(0)
      Logical Maximum(255)
      Report Size(8)
      Report Count(60)
      Report Offset(24)
      Flags( Variable Absolute BufferedByte )
  FEATURE(7)[FEATURE]
    Field(0)
      Logical(ff00.0002)
      Application(GenericDesktop.GamePad)
      Usage(1)
        ff00.0005
      Logical Minimum(0)
      Logical Maximum(100)
      Report Size(8)
      Report Count(1)
      Report Offset(0)
      Flags( Variable Absolute )
    Field(1)
      Logical(ff00.0002)
      Application(GenericDesktop.GamePad)
      Usage(1)
        ff00.0006
      Logical Minimum(0)
      Logical Maximum(100)
      Report Size(8)
      Report Count(1)
      Report Offset(8)
      Flags( Variable Absolute )
    Field(2)
      Logical(ff00.0002)
      Application(GenericDesktop.GamePad)
      Usage(1)
        ff00.0007
      Logical Minimum(0)
      Logical Maximum(100)
      Report Size(8)
      Report Count(1)
      Report Offset(16)
      Flags( Variable Absolute )
  FEATURE(8)[FEATURE]
    Field(0)
      Logical(ff00.0003)
      Application(GenericDesktop.GamePad)
      Usage(1)
        ff00.0008
      Logical Minimum(0)
      Logical Maximum(100)
      Report Size(8)
      Report Count(1)
      Report Offset(0)
      Flags( Variable Absolute )
    Field(1)
      Logical(ff00.0003)
      Application(GenericDesktop.GamePad)
      Usage(1)
        ff00.0009
      Logical Minimum(0)
      Logical Maximum(100)
      Report Size(8)
      Report Count(1)
      Report Offset(8)
      Flags( Variable Absolute )
    Field(2)
      Logical(ff00.0003)
      Application(GenericDesktop.GamePad)
      Usage(1)
        ff00.000a
      Logical Minimum(0)
      Logical Maximum(255)
      Report Size(8)
      Report Count(1)
      Report Offset(16)
      Flags( Variable Absolute )
  FEATURE(9)[FEATURE]
    Field(0)
      Application(ff00.0004)
      Usage(1)
        ff00.000b
      Logical Minimum(0)
      Logical Maximum(100)
      Report Size(8)
      Report Count(1)
      Report Offset(0)
      Flags( Variable Absolute )
    Field(1)
      Application(ff00.0004)
      Usage(1)
        ff00.000c
      Logical Minimum(0)
      Logical Maximum(100)
      Report Size(8)
      Report Count(1)
      Report Offset(8)
      Flags( Variable Absolute )
    Field(2)
      Application(ff00.0004)
      Usage(1)
        ff00.000d
      Logical Minimum(0)
      Logical Maximum(100)
      Report Size(8)
      Report Count(1)
      Report Offset(16)
      Flags( Variable Absolute )
    Field(3)
      Application(ff00.0004)
      Usage(1)
        ff00.000e
      Logical Minimum(0)
      Logical Maximum(255)
      Report Size(8)
      Report Count(1)
      Report Offset(24)
      Flags( Variable Absolute )
    Field(4)
      Application(ff00.0004)
      Usage(60)
        ff00.000f
        ff00.000f
        ff00.000f
        ff00.000f
        ff00.000f
        ff00.000f
        ff00.000f
        ff00.000f
        ff00.000f
        ff00.000f
        ff00.000f
        ff00.000f
        ff00.000f
        ff00.000f
        ff00.000f
        ff00.000f
        ff00.000f
        ff00.000f
        ff00.000f
        ff00.000f
        ff00.000f
        ff00.000f
        ff00.000f
        ff00.000f
        ff00.000f
        ff00.000f
        ff00.000f
        ff00.000f
        ff00.000f
        ff00.000f
        ff00.000f
        ff00.000f
        ff00.000f
        ff00.000f
        ff00.000f
        ff00.000f
        ff00.000f
        ff00.000f
        ff00.000f
        ff00.000f
        ff00.000f
        ff00.000f
        ff00.000f
        ff00.000f
        ff00.000f
        ff00.000f
        ff00.000f
        ff00.000f
        ff00.000f
        ff00.000f
        ff00.000f
        ff00.000f
        ff00.000f
        ff00.000f
        ff00.000f
        ff00.000f
        ff00.000f
        ff00.000f
        ff00.000f
        ff00.000f
      Logical Minimum(0)
      Logical Maximum(255)
      Report Size(8)
      Report Count(60)
      Report Offset(32)
      Flags( Variable Absolute BufferedByte )
  FEATURE(11)[FEATURE]
    Field(0)
      Logical(ff00.0006)
      Application(GenericDesktop.GamePad)
      Usage(1)
        ff00.0014
      Logical Minimum(0)
      Logical Maximum(100)
      Report Size(8)
      Report Count(1)
      Report Offset(0)
      Flags( Variable Absolute )

GenericDesktop.X ---> Absolute.X
GenericDesktop.Y ---> Absolute.Y
GenericDesktop.Z ---> Absolute.Z
GenericDesktop.Rz ---> Absolute.Rz
Simulation.00c5 ---> Absolute.Brake
Simulation.00c4 ---> Absolute.Gas
GenericDesktop.HatSwitch ---> Absolute.Hat0X
Button.0001 ---> Key.BtnA
Button.0002 ---> Key.BtnB
Button.0003 ---> Key.BtnC
Button.0004 ---> Key.BtnX
Button.0005 ---> Key.BtnY
Button.0006 ---> Key.BtnZ
Button.0007 ---> Key.BtnTL
Button.0008 ---> Key.BtnTR
Button.0009 ---> Key.BtnTL2
Button.000a ---> Key.BtnTR2
Button.000b ---> Key.BtnSelect
Button.000c ---> Key.BtnStart
Button.000d ---> Key.BtnMode
Button.000e ---> Key.BtnThumbL
Button.000f ---> Key.BtnThumbR
Consumer.0224 ---> Key.Back
Consumer.0081 ---> Key.Unknown
Consumer.0084 ---> Key.Enter
Consumer.0085 ---> Key.Unknown
Consumer.0099 ---> Key.Unknown
Consumer.009e ---> Key.Unknown
Consumer.00a1 ---> Key.Unknown
Consumer.00a2 ---> Key.Unknown
Consumer.00a3 ---> Key.Unknown
Consumer.00a4 ---> Key.Unknown
Consumer.00b9 ---> Key.Shuffle
Consumer.00ba ---> Key.Unknown
Consumer.00bb ---> Key.Unknown
Consumer.00be ---> Key.Unknown
Consumer.00c0 ---> Key.Unknown
Consumer.00c1 ---> Key.Unknown
Consumer.00c2 ---> Key.Unknown
Consumer.00c3 ---> Key.Unknown
Consumer.00c4 ---> Key.Unknown
Consumer.00c5 ---> Key.Unknown
Consumer.00c6 ---> Key.Unknown
Consumer.00c7 ---> Key.Unknown
Consumer.00c8 ---> Key.Unknown
Consumer.0223 ---> Key.HomePage
GenericDeviceControls.BatteryStrength ---> Power.?
ff00.0010 ---> Sync.Report
ff00.0011 ---> Sync.Report
ff00.0012 ---> Sync.Report
ff00.0012 ---> Sync.Report
ff00.0013 ---> Sync.Report
Keyboard.00e0 ---> Key.LeftControl
Keyboard.00e1 ---> Key.LeftShift
Keyboard.00e2 ---> Key.LeftAlt
Keyboard.00e3 ---> Key.LeftMeta
Keyboard.00e4 ---> Key.RightCtrl
Keyboard.00e5 ---> Key.RightShift
Keyboard.00e6 ---> Key.RightAlt
Keyboard.00e7 ---> Key.RightMeta
Keyboard.0000 ---> Sync.Report
Keyboard.0001 ---> Sync.Report
Keyboard.0002 ---> Sync.Report
Keyboard.0003 ---> Sync.Report
Keyboard.0004 ---> Key.A
Keyboard.0005 ---> Key.B
Keyboard.0006 ---> Key.C
Keyboard.0007 ---> Key.D
Keyboard.0008 ---> Key.E
Keyboard.0009 ---> Key.F
Keyboard.000a ---> Key.G
Keyboard.000b ---> Key.H
Keyboard.000c ---> Key.I
Keyboard.000d ---> Key.J
Keyboard.000e ---> Key.K
Keyboard.000f ---> Key.L
Keyboard.0010 ---> Key.M
Keyboard.0011 ---> Key.N
Keyboard.0012 ---> Key.O
Keyboard.0013 ---> Key.P
Keyboard.0014 ---> Key.Q
Keyboard.0015 ---> Key.R
Keyboard.0016 ---> Key.S
Keyboard.0017 ---> Key.T
Keyboard.0018 ---> Key.U
Keyboard.0019 ---> Key.V
Keyboard.001a ---> Key.W
Keyboard.001b ---> Key.X
Keyboard.001c ---> Key.Y
Keyboard.001d ---> Key.Z
Keyboard.001e ---> Key.1
Keyboard.001f ---> Key.2
Keyboard.0020 ---> Key.3
Keyboard.0021 ---> Key.4
Keyboard.0022 ---> Key.5
Keyboard.0023 ---> Key.6
Keyboard.0024 ---> Key.7
Keyboard.0025 ---> Key.8
Keyboard.0026 ---> Key.9
Keyboard.0027 ---> Key.0
Keyboard.0028 ---> Key.Enter
Keyboard.0029 ---> Key.Esc
Keyboard.002a ---> Key.Backspace
Keyboard.002b ---> Key.Tab
Keyboard.002c ---> Key.Space
Keyboard.002d ---> Key.Minus
Keyboard.002e ---> Key.Equal
Keyboard.002f ---> Key.LeftBrace
Keyboard.0030 ---> Key.RightBrace
Keyboard.0031 ---> Key.BackSlash
Keyboard.0032 ---> Key.BackSlash
Keyboard.0033 ---> Key.Semicolon
Keyboard.0034 ---> Key.Apostrophe
Keyboard.0035 ---> Key.Grave
Keyboard.0036 ---> Key.Comma
Keyboard.0037 ---> Key.Dot
Keyboard.0038 ---> Key.Slash
Keyboard.0039 ---> Key.CapsLock
Keyboard.003a ---> Key.F1
Keyboard.003b ---> Key.F2
Keyboard.003c ---> Key.F3
Keyboard.003d ---> Key.F4
Keyboard.003e ---> Key.F5
Keyboard.003f ---> Key.F6
Keyboard.0040 ---> Key.F7
Keyboard.0041 ---> Key.F8
Keyboard.0042 ---> Key.F9
Keyboard.0043 ---> Key.F10
Keyboard.0044 ---> Key.F11
Keyboard.0045 ---> Key.F12
Keyboard.0046 ---> Key.SysRq
Keyboard.0047 ---> Key.ScrollLock
Keyboard.0048 ---> Key.Pause
Keyboard.0049 ---> Key.Insert
Keyboard.004a ---> Key.Home
Keyboard.004b ---> Key.PageUp
Keyboard.004c ---> Key.Delete
Keyboard.004d ---> Key.End
Keyboard.004e ---> Key.PageDown
Keyboard.004f ---> Key.Right
Keyboard.0050 ---> Key.Left
Keyboard.0051 ---> Key.Down
Keyboard.0052 ---> Key.Up
Keyboard.0053 ---> Key.NumLock
Keyboard.0054 ---> Key.KPSlash
Keyboard.0055 ---> Key.KPAsterisk
Keyboard.0056 ---> Key.KPMinus
Keyboard.0057 ---> Key.KPPlus
Keyboard.0058 ---> Key.KPEnter
Keyboard.0059 ---> Key.KP1
Keyboard.005a ---> Key.KP2
Keyboard.005b ---> Key.KP3
Keyboard.005c ---> Key.KP4
Keyboard.005d ---> Key.KP5
Keyboard.005e ---> Key.KP6
Keyboard.005f ---> Key.KP7
Keyboard.0060 ---> Key.KP8
Keyboard.0061 ---> Key.KP9
Keyboard.0062 ---> Key.KP0
Keyboard.0063 ---> Key.KPDot
Keyboard.0064 ---> Key.102nd
Keyboard.0065 ---> Key.Compose
PhysicalInterfaceDevice.0097 ---> Sync.Report
PhysicalInterfaceDevice.0070 ---> Sync.Report
PhysicalInterfaceDevice.0070 ---> Sync.Report
PhysicalInterfaceDevice.0070 ---> Sync.Report
PhysicalInterfaceDevice.0070 ---> Sync.Report
PhysicalInterfaceDevice.0050 ---> Sync.Report
PhysicalInterfaceDevice.00a7 ---> Sync.Report
PhysicalInterfaceDevice.007c ---> Sync.Report

@atar-axis
Copy link
Owner

thanks, that's the HID report descriptor ;) it tells us how to handle the new buttons on the new controller

@duganchen
Copy link
Contributor Author

I should probably mention that this is with the hid-microsoft driver on kernel 5.4.8.

@atar-axis
Copy link
Owner

That's not a problem, the report descriptor is the same - the driver just cares about the "how to interpret the descriptor"

@codeclimate
Copy link

codeclimate bot commented Jan 15, 2020

Code Climate has analyzed commit 896ebce and detected 0 issues on this pull request.

View more on Code Climate.

@kakra
Copy link
Collaborator

kakra commented Feb 29, 2020

Are the control mappings right? No, but that should be fixed in userspace (using SDL2's controller mappings) and not in the kernel driver.

Actually, I think that's not true for xpadneo. Xpadneo already fixes the mappings for the controllers supported, so it should also do it for this.

Fixing it in user-space doesn't work correctly because all the fixes at different layers sometimes collide with each other (Steam, native SDL, and Wine pop into mind), and apps using the old js interface can't be fixed at all when not doing it at the kernel level.

If you don't want to fix the mappings at kernel level, xpadneo should not be your first choice of driver. In the end it fixes the problem that the controller exposes different mappings depending on whether it was linked via Bluetooth in Windows or in Linux (you could actually link the controller in Windows, then copy over the BT authorization from the registry to the Linux BT stack and it would be paired there and expose a different mapping). I guess it would also expose the "correct" mapping when used via USB cable. So, xpadneo is working around this difference.

Apparently, SDL and Chrome already started fixing this in user space, Steam brought it's own mappings, Wine games in Steam sometimes didn't see those. It's a mess. Chrome ignores our device serial hack, so xpadneo cannot be used with Stadia.

@hibes
Copy link

hibes commented Mar 24, 2020

I'm on this branch. The controller works for like 30s after I follow the instructions in docs/README.md#Connection, but after that, I can see it disconnect in bluetoothctl and then reconnect. After reconnecting, it is still recognized in games even if I launch a new one, but it doesn't actually do anything anymore.

Any thoughts?

[20551.660741] xpadneo udev: 0005:045E:0B05.0001
[20551.663198] xpadneo: hello there!
[20551.663780] xpadneo 0005:045E:0B05.0001: unknown main item tag 0x0
[20571.738610] input: Xbox Elite Wireless Controller as /devices/pci0000:00/0000:00:14.0/usb1/1-14/1-14:1.0/bluetooth/hci0/hci0:256/0005:045E:0B05.0001/input/input26
[20571.739003] xpadneo 0005:045E:0B05.0001: input,hidraw0: BLUETOOTH HID v9.03 Gamepad [Xbox Elite Wireless Controller] on 5c:80:b6:70:8b:5d
[20572.725241] xpadneo udev: ok
[20575.789424] xpadneo 0005:045E:0B05.0002: unknown main item tag 0x0
[20575.790872] xpadneo udev: 0005:045E:0B05.0002
[20575.792244] xpadneo udev: ok
[20606.593860] input: Xbox Elite Wireless Controller as /devices/pci0000:00/0000:00:14.0/usb1/1-14/1-14:1.0/bluetooth/hci0/hci0:256/0005:045E:0B05.0002/input/input27
[20606.594662] xpadneo 0005:045E:0B05.0002: input,hidraw0: BLUETOOTH HID v9.03 Gamepad [Xbox Elite Wireless Controller] on 5c:80:b6:70:8b:5d

@hibes
Copy link

hibes commented Mar 24, 2020

Side note, could you tell me what driver it uses in USB mode? If I had that, I'd just use it plugged in. I don't need bluetooth_, though it would be nice. Mine just tries to use a generic driver (which doesn't work at all) and I can't figure out how to make it use something else.

[21000.166961] usb 1-3: new full-speed USB device number 13 using xhci_hcd
[21000.320470] usb 1-3: New USB device found, idVendor=045e, idProduct=0b00, bcdDevice= 4.07
[21000.320475] usb 1-3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[21000.320479] usb 1-3: Product: Controller
[21000.320482] usb 1-3: Manufacturer: Microsoft
[21000.320485] usb 1-3: SerialNumber: 3032363330303330383835393335
[21000.322280] input: Generic X-Box pad as /devices/pci0000:00/0000:00:14.0/usb1/1-3/1-3:1.0/input/input28

@kakra
Copy link
Collaborator

kakra commented Mar 24, 2020

It seems to me that Xbox controller BT connections have become more unstable in later kernel versions... But with my Xbox One S controller it's connecting more reliable again with latest 5.4 series kernel and updated bluez lib. So maybe it depends also on updated bluez lib?

@hibes
Copy link

hibes commented Mar 24, 2020

I think I'm stuck on Linux kernel 5.3 right now. Hopefully 20.04 will come out soon.

@kakra
Copy link
Collaborator

kakra commented Mar 24, 2020

I think I'm stuck on Linux kernel 5.3 right now. Hopefully 20.04 will come out soon.

There should be a PPA available for 5.4 or 5.5... But you'd probably also need a newer bluez.

@duganchen
Copy link
Contributor Author

Side note, could you tell me what driver it uses in USB mode?

xpad

@adamdmoss
Copy link

I'm using a similar patch locally for Elite 2 Series over Bluetooth.

FYI I'm using this SDL mapping: SDL_GAMECONTROLLERCONFIG='050000005e040000050b000030110000,Xbox Elite Wireless Controller,platform:Linux,a:b0,b:b1,x:b3,y:b4,back:b136,start:b11,leftstick:b13,rightstick:b14,leftshoulder:b6,rightshoulder:b7,dpup:h0.1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,leftx:a9,lefty:a1,rightx:a2,righty:a5,lefttrigger:a8,righttrigger:a7,' ... which miraculously appears to work under both Steam and lutris->wine, unlike the non-xpadneo mapping which works under Steam but not wine (!?).

The biggest annoyance is that I have to disable all rumble; if I play Borderlands 3 with rumble in lutrix->wine then the controller appears to hang the first time I get a rumble while pulling the left trigger. The game, BT stack and xpadneo don't seem to notice a disconnect or report anything unusual, but the controller stops responding in this or any other program until I force a reconnect from blueman-manager.

@adamdmoss
Copy link

the controller appears to hang the first time I get a rumble

FYI I'm happy to report this as an issue but it seemed premature to report a bug in a controller which xpadneo doesn't even officially support yet. :)

kakra pushed a commit to kakra/xpadneo that referenced this pull request May 3, 2020
This commit may be incomplete as we may need to fix button mappings
specifically for this controller.

This squashes the pull request consisting of:

commit 3f3860b ("Add Support For Xbox Elite Series 2 Wireless")
commit 896ebce ("Add support for the Xbox Elite 2 controller")

Closes: atar-axis#144
Affects: atar-axis#142
kakra pushed a commit to kakra/xpadneo that referenced this pull request May 4, 2020
This commit may be incomplete as we may need to fix button mappings
specifically for this controller.

This squashes the pull request consisting of:

commit 3f3860b ("Add Support For Xbox Elite Series 2 Wireless")
commit 896ebce ("Add support for the Xbox Elite 2 controller")

Closes: atar-axis#144
Affects: atar-axis#142
Signed-off-by: Kai Krakow <[email protected]>
kakra pushed a commit to kakra/xpadneo that referenced this pull request May 4, 2020
This commit may be incomplete as we may need to fix button mappings
specifically for this controller.

This squashes the pull request consisting of:

commit 3f3860b ("Add Support For Xbox Elite Series 2 Wireless")
commit 896ebce ("Add support for the Xbox Elite 2 controller")

Closes: atar-axis#144
Affects: atar-axis#142
Signed-off-by: Kai Krakow <[email protected]>
kakra pushed a commit to kakra/xpadneo that referenced this pull request May 5, 2020
This commit may be incomplete as we may need to fix button mappings
specifically for this controller.

This squashes the pull request consisting of:

commit 3f3860b ("Add Support For Xbox Elite Series 2 Wireless")
commit 896ebce ("Add support for the Xbox Elite 2 controller")

Closes: atar-axis#144
Affects: atar-axis#142
Signed-off-by: Kai Krakow <[email protected]>
kakra pushed a commit to kakra/xpadneo that referenced this pull request May 5, 2020
This commit may be incomplete as we may need to fix button mappings
specifically for this controller.

This squashes the pull request consisting of:

commit 3f3860b ("Add Support For Xbox Elite Series 2 Wireless")
commit 896ebce ("Add support for the Xbox Elite 2 controller")

Closes: atar-axis#144
Affects: atar-axis#142
Signed-off-by: Kai Krakow <[email protected]>
kakra pushed a commit to kakra/xpadneo that referenced this pull request May 5, 2020
This commit may be incomplete as we may need to fix button mappings
specifically for this controller.

This squashes the pull request consisting of:

commit 3f3860b ("Add Support For Xbox Elite Series 2 Wireless")
commit 896ebce ("Add support for the Xbox Elite 2 controller")

Closes: atar-axis#144
Affects: atar-axis#142
Signed-off-by: Kai Krakow <[email protected]>
kakra pushed a commit to kakra/xpadneo that referenced this pull request May 5, 2020
This commit may be incomplete as we may need to fix button mappings
specifically for this controller.

This squashes the pull request consisting of:

commit 3f3860b ("Add Support For Xbox Elite Series 2 Wireless")
commit 896ebce ("Add support for the Xbox Elite 2 controller")

Closes: atar-axis#144
Affects: atar-axis#142
Signed-off-by: Kai Krakow <[email protected]>
kakra pushed a commit to kakra/xpadneo that referenced this pull request May 5, 2020
This commit may be incomplete as we may need to fix button mappings
specifically for this controller.

This squashes the pull request consisting of:

commit 3f3860b ("Add Support For Xbox Elite Series 2 Wireless")
commit 896ebce ("Add support for the Xbox Elite 2 controller")

Closes: atar-axis#144
Affects: atar-axis#142
Signed-off-by: Kai Krakow <[email protected]>
kakra pushed a commit to kakra/xpadneo that referenced this pull request May 6, 2020
This commit may be incomplete as we may need to fix button mappings
specifically for this controller.

This squashes the pull request consisting of:

commit 3f3860b ("Add Support For Xbox Elite Series 2 Wireless")
commit 896ebce ("Add support for the Xbox Elite 2 controller")

Closes: atar-axis#144
Affects: atar-axis#142
Signed-off-by: Kai Krakow <[email protected]>
@kakra
Copy link
Collaborator

kakra commented May 6, 2020

The biggest annoyance is that I have to disable all rumble; if I play Borderlands 3 with rumble in lutrix->wine then the controller appears to hang the first time I get a rumble while pulling the left trigger. The game, BT stack and xpadneo don't seem to notice a disconnect or report anything unusual, but the controller stops responding in this or any other program until I force a reconnect from blueman-manager.

A very similar or even the same problem exists with my "Xbox One S" controller and I'm trying to improve this in #178 but currently it looks like a issue between the BT dongle and the controller itself: Whenever the rumble problem occurs (and this doesn't need pulling any trigger, the directional rumble test program included in the repo is enough to reproduce most of the times) and looking in Wireshark BT monitor, it seems to make some sort of incomplete reconnect. The BT stack no longer syncs and after a timeout, the host side will initiate a reconnect successfully.

kakra pushed a commit to kakra/xpadneo that referenced this pull request May 6, 2020
This commit may be incomplete as we may need to fix button mappings
specifically for this controller.

This squashes the pull request consisting of:

commit 3f3860b ("Add Support For Xbox Elite Series 2 Wireless")
commit 896ebce ("Add support for the Xbox Elite 2 controller")

Closes: atar-axis#144
Affects: atar-axis#142
Signed-off-by: Kai Krakow <[email protected]>
kakra pushed a commit to kakra/xpadneo that referenced this pull request May 6, 2020
This commit may be incomplete as we may need to fix button mappings
specifically for this controller.

This squashes the pull request consisting of:

commit 3f3860b ("Add Support For Xbox Elite Series 2 Wireless")
commit 896ebce ("Add support for the Xbox Elite 2 controller")

Closes: atar-axis#144
Affects: atar-axis#142
Signed-off-by: Kai Krakow <[email protected]>
kakra pushed a commit to kakra/xpadneo that referenced this pull request May 6, 2020
This commit may be incomplete as we may need to fix button mappings
specifically for this controller.

This squashes the pull request consisting of:

commit 3f3860b ("Add Support For Xbox Elite Series 2 Wireless")
commit 896ebce ("Add support for the Xbox Elite 2 controller")

Closes: atar-axis#144
Affects: atar-axis#142
Signed-off-by: Kai Krakow <[email protected]>
kakra pushed a commit to kakra/xpadneo that referenced this pull request May 7, 2020
This commit may be incomplete as we may need to fix button mappings
specifically for this controller.

This squashes the pull request consisting of:

commit 3f3860b ("Add Support For Xbox Elite Series 2 Wireless")
commit 896ebce ("Add support for the Xbox Elite 2 controller")

Closes: atar-axis#144
Affects: atar-axis#142
Signed-off-by: Kai Krakow <[email protected]>
kakra pushed a commit to kakra/xpadneo that referenced this pull request May 7, 2020
This commit may be incomplete as we may need to fix button mappings
specifically for this controller.

This squashes the pull request consisting of:

commit 3f3860b ("Add Support For Xbox Elite Series 2 Wireless")
commit 896ebce ("Add support for the Xbox Elite 2 controller")

Closes: atar-axis#144
Affects: atar-axis#142
Signed-off-by: Kai Krakow <[email protected]>
kakra pushed a commit to kakra/xpadneo that referenced this pull request May 7, 2020
This commit may be incomplete as we may need to fix button mappings
specifically for this controller by faking the correct Windows mode
device PID. The mapping itself should be okay after a follow-up commit
as it was derived from the device descriptor.

This squashes the pull request consisting of:

commit 3f3860b ("Add Support For Xbox Elite Series 2 Wireless")
commit 896ebce ("Add support for the Xbox Elite 2 controller")

Closes: atar-axis#144
Affects: atar-axis#142
Signed-off-by: Kai Krakow <[email protected]>
kakra pushed a commit to kakra/xpadneo that referenced this pull request May 7, 2020
This commit may be incomplete as we may need to fix button mappings
specifically for this controller by faking the correct Windows mode
device PID. The mapping itself should be okay after a follow-up commit
as it was derived from the device descriptor.

This squashes the pull request consisting of:

commit 3f3860b ("Add Support For Xbox Elite Series 2 Wireless")
commit 896ebce ("Add support for the Xbox Elite 2 controller")

Closes: atar-axis#144
Affects: atar-axis#142
Signed-off-by: Kai Krakow <[email protected]>
@kakra kakra closed this in 409742c May 8, 2020
@hibes hibes mentioned this pull request May 12, 2020
@schmitmd
Copy link

schmitmd commented Sep 6, 2020

I hate to necro-bump, but I'm seeing this this same behavior on the latest master. (041e8d8).
Running Arch w/ kernel v.5.8.7 with the Xbox Elite Series 2 and it's on the latest firmware from Microsoft as of yesterday. Standard bluetooth bind directly to laptop's builtin Bluetooth (no dongle). lsusb shows the laptop chip as 8087:0aaa Intel Corp. Bluetooth 9460/9560 Jefferson Peak (JfP).
I use Lutris and the behavior occurs in all games (Borderlands2 is the one easiest to reproduce in. Exactly the same "holding left trigger, rumble" and the controller stops responding, sometimes also accompanied by the axes going all the way to the max, specifically the left stick gets stuck repeating "down" input, right stick same but going up). I thought it might be part of #171 or #122 , but adamdmoss's last comment above describes what I'm seeing exactly, so I figured maybe here's the place. Disabling rumble via echo 2 > /sys/module/hid_xpadneo/parameters/trigger_rumble_mode does indeed fix it.

Any idea what might be happening? Happy to provide btmon log/dmesg stuff as mentioned in the debugging guide, just need to know what would be most useful.

@kakra
Copy link
Collaborator

kakra commented Sep 7, 2020

We should really open an new issue for this. This report was about adding support, not working around bugs in the firmware.

But here are a few tips you could test out while opening a new report: Disabling trigger rumble mode may work around this (as you probably already found out). Personally, since we worked around a firmware bug, I no longer see this bug on XB1S. But XBE2 may need a different timing. You could adjust the timing at around line 110 with this define:

#define XPADNEO_RUMBLE_THROTTLE_DELAY   (10L * HZ / 1000)

The value 10L means sending rumble commands at intervals of at least 10ms. I suggest starting with a value of 20ms (20L), if it still shows the problem, try 50ms. If it doesn't show the problem, try going back to the average of the known bad lower and the new known good value, as in 15ms (10+20) or 30ms (10+50).

Any higher value than 50ms makes no sense and we're chasing a different problem then. 50ms would be only 20 rps (rumbles per second) - you will really feel a lag then, that's probably not intended by the makers of the firmware - while 100 rps (10ms intervals) is probably reasonable.

FWIW, this is probably purely about the rumble itself. There's no relation to using the trigger rumble, it just happens we're sending a lot more rumble commands in trigger rumble mode, and probably also more packets due to the triggers being in motion. So the problem may still occur with trigger rumble disabled. OTOH, we may need to use higher intervals for trigger rumble...

Put your findings into the new report. Thanks.

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

Successfully merging this pull request may close these issues.

7 participants