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

Xbox Elite 2 shows up as normal Xbox one controller #344

Closed
9 of 24 tasks
MNS26 opened this issue Mar 31, 2022 · 39 comments
Closed
9 of 24 tasks

Xbox Elite 2 shows up as normal Xbox one controller #344

MNS26 opened this issue Mar 31, 2022 · 39 comments
Labels
Milestone

Comments

@MNS26
Copy link

MNS26 commented Mar 31, 2022

Version of xpadneo

0.9.1-1 (from AUR)

Controller Model

  • Xbox One S controller
  • Xbox Elite 2 controller
  • Xbox Series X|S controller
  • Other:

Connection mode

  • Bluetooth connection
  • Xbox Dongle connection (not yet supported)
  • USB cable (not yet supported)

Installed Software

  • Steam Input (enabled by default via Steam Desktop client)
  • Steam Link (usually via Raspberry Pi or other micro computers)
  • xow (alternative driver using the Xbox dongle)
  • Anti-Micro (may affect button mappings)
  • netstick (shares input devices via network similar to Steam Link)
  • xboxdrv (user-space gamepad driver)

Severity / Impact

  • I've read the docs and the bug reporting instructions
  • I've applied the latest firmware update to the controller
  • It does not work at all
  • It used to work in a previous version
  • It mostly works but sometimes it doesn't
  • I found a work-around
  • I probably didn't figure it all out but it's too early to give up
  • I don't know how to ...
  • It's too complicated
  • Fantastic work but ...
  • I can code and I want to help

Describe the Bug

My Xbox Elite 2 controller show up as a "normal" Xbox controller when using xpadneo
but when not using it the controller shows as a Elite 2 but has 32 buttons in my system page (see screenshots)

Steps to Reproduce

not having xpadneo installed to show as Elite 2
having xpadneo installed to show as Xbox one

Expected Behavior

when xpadneo is installed for the controller to show up as a Elite 2 instead of a Xbox one controller

Screenshots / GIFs / Videos

 (without xpadneo)

image
image

(with xpadneo installed)
image
image

System Information

# uname -a
Linux ROG 5.16.11-xanmod0-rog-1 #1 SMP Thu, 10 Mar 2022 16:02:46 +0000 x86_64 GNU/Linux
# xxd -c20 -g1 /sys/module/hid_xpadneo/drivers/hid:xpadneo/0005:045E:*/report_descriptor | tee >(cksum)
00000000: 05 01 09 05 a1 01 85 01 09 01 a1 00 09 30 09 31 15 00 27 ff  .............0.1..'.
00000014: ff 00 00 95 02 75 10 81 02 c0 09 01 a1 00 09 33 09 34 15 00  .....u.........3.4..
00000028: 27 ff ff 00 00 95 02 75 10 81 02 c0 05 01 09 32 15 00 26 ff  '......u.......2..&.
0000003c: 03 95 01 75 0a 81 02 15 00 25 00 75 06 95 01 81 03 05 01 09  ...u.....%.u........
00000050: 35 15 00 26 ff 03 95 01 75 0a 81 02 15 00 25 00 75 06 95 01  5..&....u.....%.u...
00000064: 81 03 05 01 09 39 15 01 25 08 35 00 46 3b 01 66 14 00 75 04  .....9..%.5.F;.f..u.
00000078: 95 01 81 42 75 04 95 01 15 00 25 00 35 00 45 00 65 00 81 03  ...Bu.....%.5.E.e...
0000008c: 05 09 19 01 29 0c 15 00 25 01 75 01 95 0c 81 02 15 00 25 00  ....)...%.u.......%.
000000a0: 75 01 95 04 81 03 05 0c 0a 24 02 15 00 25 01 95 01 75 01 81  u........$...%...u..
000000b4: 02 15 00 25 00 75 07 95 01 81 03 05 01 09 01 a1 00 09 40 09  ...%.u............@.
000000c8: 41 15 00 27 ff ff 00 00 95 02 75 10 81 02 c0 05 01 09 01 a1  A..'......u.........
000000dc: 00 09 43 09 44 15 00 27 ff ff 00 00 95 02 75 10 81 02 c0 05  ..C.D..'......u.....
000000f0: 01 09 42 15 00 26 ff 03 95 01 75 0a 81 02 15 00 25 00 75 06  ..B..&....u.....%.u.
00000104: 95 01 81 03 05 01 09 45 15 00 26 ff 03 95 01 75 0a 81 02 15  .......E..&....u....
00000118: 00 25 00 75 06 95 01 81 03 05 01 09 37 15 01 25 08 35 00 46  .%.u........7..%.5.F
0000012c: 3b 01 66 14 00 75 04 95 01 81 42 75 04 95 01 15 00 25 00 35  ;.f..u....Bu.....%.5
00000140: 00 45 00 65 00 81 03 05 09 19 10 29 1e 15 00 25 01 75 01 95  .E.e.......)...%.u..
00000154: 0f 81 02 15 00 25 00 75 01 95 01 81 03 05 0c 0a 82 00 15 00  .....%.u............
00000168: 25 01 95 01 75 01 81 02 15 00 25 00 75 07 95 01 81 03 05 0c  %...u.....%.u.......
0000017c: 09 01 a1 01 0a 81 00 15 00 26 ff 00 95 01 75 04 81 02 15 00  .........&....u.....
00000190: 25 00 95 01 75 04 81 03 0a 84 00 15 00 26 ff 00 95 01 75 04  %...u........&....u.
000001a4: 81 02 15 00 25 00 95 01 75 04 81 03 0a 85 00 15 00 26 ff 00  ....%...u........&..
000001b8: 95 01 75 08 81 02 0a 99 00 15 00 26 ff 00 95 01 75 04 81 02  ..u........&....u...
000001cc: 15 00 25 00 95 01 75 04 81 03 0a 9e 00 15 00 26 ff 00 95 01  ..%...u........&....
000001e0: 75 08 81 02 0a a1 00 15 00 26 ff 00 95 01 75 08 81 02 0a a2  u........&....u.....
000001f4: 00 15 00 26 ff 00 95 01 75 08 81 02 0a a3 00 15 00 26 ff 00  ...&....u........&..
00000208: 95 01 75 08 81 02 0a a4 00 15 00 26 ff 00 95 01 75 08 81 02  ..u........&....u...
0000021c: 0a b9 00 15 00 26 ff 00 95 01 75 08 81 02 0a ba 00 15 00 26  .....&....u........&
00000230: ff 00 95 01 75 08 81 02 0a bb 00 15 00 26 ff 00 95 01 75 08  ....u........&....u.
00000244: 81 02 0a be 00 15 00 26 ff 00 95 01 75 08 81 02 0a c0 00 15  .......&....u.......
00000258: 00 26 ff 00 95 01 75 08 81 02 0a c1 00 15 00 26 ff 00 95 01  .&....u........&....
0000026c: 75 08 81 02 0a c2 00 15 00 26 ff 00 95 01 75 08 81 02 0a c3  u........&....u.....
00000280: 00 15 00 26 ff 00 95 01 75 08 81 02 0a c4 00 15 00 26 ff 00  ...&....u........&..
00000294: 95 01 75 08 81 02 0a c5 00 15 00 26 ff 00 95 01 75 08 81 02  ..u........&....u...
000002a8: 0a c6 00 15 00 26 ff 00 95 01 75 08 81 02 0a c7 00 15 00 26  .....&....u........&
000002bc: ff 00 95 01 75 08 81 02 0a c8 00 15 00 26 ff 00 95 01 75 08  ....u........&....u.
000002d0: 81 02 c0 05 0c 09 01 85 02 a1 01 05 0c 0a 23 02 15 00 25 01  ..............#...%.
000002e4: 95 01 75 01 81 02 15 00 25 00 75 07 95 01 81 03 c0 05 0f 09  ..u.....%.u.........
000002f8: 21 85 03 a1 02 09 97 15 00 25 01 75 04 95 01 91 02 15 00 25  !........%.u.......%
0000030c: 00 75 04 95 01 91 03 09 70 15 00 25 64 75 08 95 04 91 02 09  .u......p..%du......
00000320: 50 66 01 10 55 0e 15 00 26 ff 00 75 08 95 01 91 02 09 a7 15  Pf..U...&..u........
00000334: 00 26 ff 00 75 08 95 01 91 02 65 00 55 00 09 7c 15 00 26 ff  .&..u.....e.U..|..&.
00000348: 00 75 08 95 01 91 02 c0 05 06 09 20 85 04 15 00 26 ff 00 75  .u......... ....&..u
0000035c: 08 95 01 81 02 06 00 ff 09 01 a1 02 85 06 09 01 15 00 25 64  ..................%d
00000370: 75 08 95 01 b1 02 09 02 15 00 25 64 75 08 95 01 b1 02 09 03  u.........%du.......
00000384: 15 00 26 ff 00 75 08 95 01 b1 02 09 04 26 ff 00 75 08 95 3c  ..&..u.......&..u..<
00000398: b2 02 01 c0 06 00 ff 09 02 a1 02 85 07 09 05 15 00 25 64 75  .................%du
000003ac: 08 95 01 b1 02 09 06 15 00 25 64 75 08 95 01 b1 02 09 07 15  .........%du........
000003c0: 00 25 64 75 08 95 01 b1 02 c0 06 00 ff 09 03 a1 02 85 08 09  .%du................
000003d4: 08 15 00 25 64 75 08 95 01 b1 02 09 09 15 00 25 64 75 08 95  ...%du.........%du..
000003e8: 01 b1 02 09 0a 15 00 26 ff 00 75 08 95 01 b1 02 c0 06 00 ff  .......&..u.........
000003fc: 09 04 a1 01 85 09 09 0b 15 00 25 64 75 08 95 01 b1 02 09 0c  ..........%du.......
00000410: 15 00 25 64 75 08 95 01 b1 02 09 0d 15 00 25 64 75 08 95 01  ..%du.........%du...
00000424: b1 02 09 0e 15 00 26 ff 00 75 08 95 01 b1 02 09 0f 26 ff 00  ......&..u.......&..
00000438: 75 08 95 3c b2 02 01 c0 06 00 ff 09 05 a1 01 85 0a 09 10 15  u..<................
0000044c: 00 27 ff ff ff 7f 75 20 95 01 81 02 09 11 15 00 27 ff ff ff  .'....u ........'...
00000460: 7f 75 20 95 01 81 02 09 12 15 00 26 ff 00 75 08 95 02 81 02  .u ........&..u.....
00000474: 09 13 15 00 26 ff 00 75 08 95 01 81 02 c0 06 00 ff 09 06 a1  ....&..u............
00000488: 02 85 0b 09 14 15 00 25 64 75 08 95 01 b1 02 c0 c0 05 01 09  .......%du..........
0000049c: 06 a1 01 85 05 05 07 19 e0 29 e7 15 00 25 01 75 01 95 08 81  .........)...%.u....
000004b0: 02 95 01 75 08 81 03 95 06 75 08 15 00 25 65 05 07 19 00 29  ...u.....u...%e....)
000004c4: 65 81 00 c0                                                  e...
302767832 5688

Controller and Bluetooth Information

sudo btmon | tee xpadneo-btmon.txt
xpadneo-btmon.txt

dmesg | egrep -i 'hid|input|xpadneo' | tee xpadneo-dmesg.txt
xpadneo-dmesg.txt

lsusb
Bus 002 Device 003: ID 8564:7000 Transcend Information, Inc. StoreJet 25H3
Bus 002 Device 002: ID 05e3:0626 Genesys Logic, Inc. Hub
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 004: ID 13d3:56a2 IMC Networks USB2.0 HD UVC WebCam
Bus 001 Device 010: ID 045e:0b00 Microsoft Corp. Controller
Bus 001 Device 003: ID 04e8:a04b Samsung Electronics Co., Ltd Samsung Type-C to 3.5pi gender adapter
Bus 001 Device 002: ID 145f:024f Trust GXT 161 Gaming Mouse
Bus 001 Device 007: ID 8087:0aaa Intel Corp. Bluetooth 9460/9560 Jefferson Peak (JfP)
Bus 001 Device 009: ID 0c76:2018 JMTek, LLC. LCS USB Audio
Bus 001 Device 006: ID 05e3:0610 Genesys Logic, Inc. Hub
Bus 001 Device 005: ID 0b05:1866 ASUSTek Computer, Inc. N-KEY Device
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

N/A (bluetooth connection)

lsusb -v -s## | tee xpadneo-lsusb.txt
xpadneo-lsusb.txt
N/A (Bluetooth connection)

Additional Context

@kakra
Copy link
Collaborator

kakra commented Mar 31, 2022

This is mostly a cosmetic issue. However, we do not really support the paddle buttons yet, thus they won't show up. But they work as default mapped to A,B,X,Y. Paddle support should come during v0.9, cosmetic issues will be fixed in v0.10 or later.

Actually, xpadneo pretends to be a USB-connected Xbox One controller (10 buttons, 6 axes) to be compatible with as many games as possible. So you can think of it as a feature. We are still passing the correct model name but software may work differently and use their own names based on device IDs.

So I'll look into the Steam Input cosmetic issue after v0.10.

@kakra kakra added this to the v0.10 milestone Mar 31, 2022
@kakra kakra added 0 | type: enhancement New feature or request 0 | type: hardware support Support third-party hardware and clones labels Mar 31, 2022
@MNS26
Copy link
Author

MNS26 commented Mar 31, 2022

thanks for looking into it

i also just found out that the paddles do work in steam (removed xpadneo) i just had to reboot for some reason

@MNS26
Copy link
Author

MNS26 commented Mar 31, 2022

navigating just with the paddles mapped to the Dpad
https://streamable.com/2byaqw

@MNS26
Copy link
Author

MNS26 commented Mar 31, 2022

@kakra what also interesting is that the L joystick X axis (going L&R) acts as the simulator yaw axis when not using xpadneo
and the Dpad has the same shenanigans

@kakra
Copy link
Collaborator

kakra commented Mar 31, 2022

xpadneo has one additional axis behind the Xbox standard axes which combines the triggers into a rudder axis. It was asked as a feature some time ago. Do you mean that?

@MNS26
Copy link
Author

MNS26 commented Mar 31, 2022

yes thats the one

when i dont have xpadneo the rudder axis becomes the left joystick

@MNS26
Copy link
Author

MNS26 commented Mar 31, 2022

oh i also managed to get the stuff to work (for now) with Xpad and steam having "generic controller support" disabled
tho when i use rumble it crashes the BT connection (there is a issue about it already tho)

@kakra
Copy link
Collaborator

kakra commented Apr 1, 2022

Rumble commands need to be throttled below 100 Hz, otherwise the controller firmware crashes

@MNS26
Copy link
Author

MNS26 commented Apr 1, 2022

and how can it be throttled?

@kakra
Copy link
Collaborator

kakra commented Apr 1, 2022

xpadneo does it in the driver, SDL seems to do it, too, according to the source code, but from received reports I believe it doesn't work properly. The driver you're using has to implement it, it's not a setting you could adjust.

@MNS26
Copy link
Author

MNS26 commented Apr 1, 2022

ah ok, in that case i will keep it disabled for now and wait until xpadneo shows the controller as the Elite 2 (have the paddles maped to gear-shifter in most racing games)

kakra added a commit to kakra/xpadneo that referenced this issue Apr 5, 2022
kakra added a commit to kakra/xpadneo that referenced this issue Apr 5, 2022
We still silence the paddles when one of the profiles is selected, the
default profile setup maps the paddles to A, B, X, and Y.

The paddles are special because they are passed as one key by the HID
report. We need to manually remap those values to individual bits.

Maybe-affects: atar-axis#344
Closes: atar-axis#332
Signed-off-by: Kai Krakow <[email protected]>
kakra added a commit to kakra/xpadneo that referenced this issue Apr 5, 2022
kakra added a commit to kakra/xpadneo that referenced this issue Apr 5, 2022
We still silence the paddles when one of the profiles is selected, the
default profile setup maps the paddles to A, B, X, and Y.

The paddles are special because they are passed as one key by the HID
report. We need to manually remap those values to individual bits.

Maybe-affects: atar-axis#344
Closes: atar-axis#332
Signed-off-by: Kai Krakow <[email protected]>
kakra added a commit to kakra/xpadneo that referenced this issue Apr 5, 2022
We still silence the paddles when one of the profiles is selected, the
default profile setup maps the paddles to A, B, X, and Y.

The paddles are special because they are passed as one key by the HID
report. We need to manually remap those values to individual bits.

Maybe-affects: atar-axis#344
Closes: atar-axis#332
Signed-off-by: Kai Krakow <[email protected]>
kakra added a commit to kakra/xpadneo that referenced this issue Apr 5, 2022
We still silence the paddles when one of the profiles is selected, the
default profile setup maps the paddles to A, B, X, and Y.

The paddles are special because they are passed as one key by the HID
report. We need to manually remap those values to individual bits.

Maybe-affects: atar-axis#344
Closes: atar-axis#332
Signed-off-by: Kai Krakow <[email protected]>
@MNS26
Copy link
Author

MNS26 commented Apr 8, 2022

@kakra i see you've made some commits, is there any way i can help test/ provide extra information?

@MNS26
Copy link
Author

MNS26 commented Apr 8, 2022

ive also added the usb connection data to the 1st message

@kakra
Copy link
Collaborator

kakra commented Apr 8, 2022

From within the existing git checkout, run git remote add kakra https://github.com/kakra/xpadneo.git if you didn't do that before. Then run git remote update --prune to update all remote trees. You now see a queue branch for v0.10 to checkout.

@MNS26
Copy link
Author

MNS26 commented Apr 9, 2022

i have cloned the repo and added the remote branch and ran the install.sh file

what caught my eye in the journal was the line changed PID from 0x0B05 to 0x02E0
image

@kakra
Copy link
Collaborator

kakra commented Apr 10, 2022

The line you mentioned is really a way to work around an issue with SDL to not mess up our mapping fixups (because it doesn't look at the descriptor but uses hard-coded assumptions from controllerdb). Switching to 0x02E0 selects an SDL2 controllerdb entry which actually matches our mappings (and the of the original Xbox controller).

Back when we introduced this hack, it was the only way to have consistent mappings in old non-SDL games, SDL1 games, and SDL2 games across various versions. Most of this is gone my now thanks to improvements in SDL to actually load newer system SDL versions dynamically into games even when the games are statically linked with an old SDL version (unless it's just too old).

The plan is to remove the need for this during the next development cycle, see #286.

@MNS26
Copy link
Author

MNS26 commented Apr 12, 2022

oh an issue i found in the is branch was that the uninstall.sh didnt actually uninstalled the kernel modules (0 installs found) even though it was still there

kakra added a commit to kakra/xpadneo that referenced this issue Apr 16, 2022
We still silence the paddles when one of the profiles is selected, the
default profile setup maps the paddles to A, B, X, and Y.

The paddles are special because they are passed as one key by the HID
report. We need to manually remap those values to individual bits.

Maybe-affects: atar-axis#344
Closes: atar-axis#332
Signed-off-by: Kai Krakow <[email protected]>
kakra added a commit to kakra/xpadneo that referenced this issue Apr 30, 2022
kakra added a commit to kakra/xpadneo that referenced this issue Apr 30, 2022
We still silence the paddles when one of the profiles is selected, the
default profile setup maps the paddles to A, B, X, and Y.

The paddles are special because they are passed as one key by the HID
report. We need to manually remap those values to individual bits.

Maybe-affects: atar-axis#344
Closes: atar-axis#332
Signed-off-by: Kai Krakow <[email protected]>
@kakra
Copy link
Collaborator

kakra commented Apr 30, 2022

Could you retry now that we present the paddles to user-space?

@MNS26
Copy link
Author

MNS26 commented May 24, 2022

@kakra i totally forgot about xpadneo oops i will test it right now

@MNS26
Copy link
Author

MNS26 commented May 24, 2022

ok so i cant seem to install the github one, it throws

❯ sudo ./install.sh --verbose
* verbose mode enabled
+ source lib/installer.sh
++ '[' 0 -ne 0 ']'
+++ git rev-parse --show-toplevel
+++ true
++ GIT_ROOT=
+++ __version
+++ git describe --tags --dirty
++++ dirname lib/installer.sh
+++ sed '-res/v?(.*)/v\1/' lib/../VERSION
sed: can't read lib/../VERSION: No such file or directory
++ VERSION=
░▒▓  │   ~/De/G/xpadneo │    master ▓▒░ 

i will try the one from the AUR and see if that one works

@MNS26
Copy link
Author

MNS26 commented May 24, 2022

the AUR version

❯ pamac info xpadneo-dkms
Name                  : xpadneo-dkms
Version               : 0.9.1-1
Description           : Advanced Linux Driver for Xbox One Wireless Gamepad
URL                   : https://github.com/atar-axis/xpadneo
Licenses              : GPL
Repository            : AUR
Installed Size        : 45.3 kB
Groups                : --
Depends On            : dkms bluez bluez-utils
Optional Dependencies : --
Make Dependencies     : git
Check Dependencies    : --
Required By           : --
Optional For          : --
Provides              : --
Replaces              : --
Conflicts With        : --
Packager              : Unknown Packager
Maintainer            : vitor_hideyoshi
First Submitted       : Mon Jul 13 18:03:33 2020
Last Modified         : Sun Apr  4 02:29:29 2021
Votes                 : 7
Build Date            : Tue May 24 19:50:57 2022
Install Date          : Tue May 24 19:51:05 2022
Install Reason        : Explicitly installed
Validated By          : None
Backup files          : --

░▒▓  │   ~/De/G/xpadneo │    master ▓▒░  

doesnt seem to work... it still shows up as a Xbox one controller

@MNS26
Copy link
Author

MNS26 commented May 24, 2022

ok after reverting to a working branch (installable) it doesnt see the Elite controller correctly

oh and i had to manually delete the ko.zst file because the uninstaller doesnt seem to work

@MNS26
Copy link
Author

MNS26 commented May 24, 2022

for some reason it keeps reconnecting the controller too with a random delay in between disconnects

EDIT: it seems to be a driver issue (never had this on windows)

@kakra
Copy link
Collaborator

kakra commented May 25, 2022

ok so i cant seem to install the github one, it throws

I'm pretty sure this is due to #346 - please try cloning the repo as root, too.

doesnt seem to work... it still shows up as a Xbox one controller

I'm not sure what the problem is here. Where does it show up? In SDL apps (and thus Steam Input)? That's because SDL does not actually use device names from the kernel but uses one from its database. That doesn't mean that your model wouldn't work with all its functions. It's usually a cosmetic issue. It should be shown correctly in dmesg.

Usually, our driver should not have an entry in the SDL mapping database at all because it was made to actually match the generic controller mappings and show up as "Generic XInput controller". But people keep submitting controllerdb entries to the SDL project even when there's nothing wrong with the mapping, artificially limiting the number of buttons to the device of the submitter or whatever a driver offered at that time. That's like tilting at windmills, I've decided to go with just one SDL mapping that matches our HID reports.

To get an idea what the kernel sees, run evtest instead of looking at some high-level apps with sometimes very creative assumptions. If evtest is fine and shows the correct name and all buttons, then xpadneo is fine. It's up to the higher levels to make something useful from it.

oh and i had to manually delete the ko.zst file because the uninstaller doesnt seem to work

That's probably a packaging issue or when you mix and match installs via AUR and manually checked out from Github. The xpadneo project itself doesn't care at all about properly installing or uninstalling the files, it leaves that exercise to dkms because that's what is made for that task.

@MNS26
Copy link
Author

MNS26 commented May 25, 2022

the branch im currently on is master correct?

I'm pretty sure this is due to #346 - please try cloning the repo as root, too.

that was indeed the issue with it not installing

That's probably a packaging issue or when you mix and match installs via AUR and manually checked out from Github.

After i installed the github one (making sure the AUR one was fully removed) the uninstall.sh reported found 0 registered instance(s) on your system while after a reboot the driver was still there.

dmesg output

[ 6655.777300] xpadneo 0005:045E:0B05.0013: pretending XB1S Windows wireless mode (changed PID from 0x0B05 to 0x02E0)
[ 6655.777315] xpadneo 0005:045E:0B05.0013: report descriptor size: 1038 bytes
[ 6655.777321] xpadneo 0005:045E:0B05.0013: fixing up report descriptor size
[ 6655.777325] xpadneo 0005:045E:0B05.0013: fixing up Rx axis
[ 6655.777328] xpadneo 0005:045E:0B05.0013: fixing up Ry axis
[ 6655.777331] xpadneo 0005:045E:0B05.0013: fixing up Z axis
[ 6655.777334] xpadneo 0005:045E:0B05.0013: fixing up Rz axis
[ 6655.777337] xpadneo 0005:045E:0B05.0013: fixing up button mapping
[ 6655.778960] xpadneo 0005:045E:0B05.0013: battery detected
[ 6655.779015] xpadneo 0005:045E:0B05.0013: gamepad detected
[ 6655.779018] xpadneo 0005:045E:0B05.0013: enabling compliance with Linux Gamepad Specification
[ 6655.779704] input: Xbox Elite Wireless Controller as /devices/pci0000:00/0000:00:14.0/usb1/1-14/1-14:1.0/bluetooth/hci0/hci0:512/0005:045E:0B05.0013/input/input111
[ 6655.780605] xpadneo 0005:045E:0B05.0013: consumer control detected
[ 6655.780738] input: Xbox Elite Wireless Controller Consumer Control as /devices/pci0000:00/0000:00:14.0/usb1/1-14/1-14:1.0/bluetooth/hci0/hci0:512/0005:045E:0B05.0013/input/input112
[ 6655.780865] xpadneo 0005:045E:0B05.0013: mapping profiles detected
[ 6655.780877] xpadneo 0005:045E:0B05.0013: keyboard detected
[ 6655.780944] input: Xbox Elite Wireless Controller Keyboard as /devices/pci0000:00/0000:00:14.0/usb1/1-14/1-14:1.0/bluetooth/hci0/hci0:512/0005:045E:0B05.0013/input/input114
[ 6655.781233] xpadneo 0005:045E:0B05.0013: input,hidraw6: BLUETOOTH HID v9.03 Gamepad [Xbox Elite Wireless Controller] on 20:79:18:bf:94:96
[ 6655.781245] xpadneo 0005:045E:0B05.0013: controller quirks: 0x00000018
[ 6655.781248] xpadneo xpadneo_welcome_rumble start
[ 6656.768168] xpadneo xpadneo_welcome_rumble took 987ms
[ 6656.768175] xpadneo 0005:045E:0B05.0013: Xbox Elite Wireless Controller [f4:6a:d7:37:61:b9] connected
[ 6656.824913] xpadneo 0005:045E:0B05.0013: battery registered
[ 6657.245156] input: Microsoft X-Box 360 pad 0 as /devices/virtual/input/input115

evtest output

No device specified, trying to scan all of /dev/input/event*
Available devices:
/dev/input/event0:      Lid Switch
/dev/input/event1:      Sleep Button
/dev/input/event10:     HDA NVidia HDMI/DP,pcm=3
/dev/input/event11:     MOSART Semi. GXT 161 Gaming Mouse
/dev/input/event12:     MOSART Semi. GXT 161 Gaming Mouse
/dev/input/event13:     MOSART Semi. GXT 161 Gaming Mouse Consumer Control
/dev/input/event14:     MOSART Semi. GXT 161 Gaming Mouse System Control
/dev/input/event15:     MOSART Semi. GXT 161 Gaming Mouse
/dev/input/event16:     Asus WMI hotkeys
/dev/input/event17:     HDA NVidia HDMI/DP,pcm=9
/dev/input/event18:     HDA Intel PCH Headset Mic
/dev/input/event19:     HDA Intel PCH Headphone
/dev/input/event2:      Power Button
/dev/input/event20:     HDA Intel PCH HDMI/DP,pcm=3
/dev/input/event21:     Asus Keyboard
/dev/input/event22:     Asus Keyboard
/dev/input/event23:     HDA NVidia HDMI/DP,pcm=7
/dev/input/event24:     ELAN1200:00 04F3:307A Mouse
/dev/input/event25:     HDA NVidia HDMI/DP,pcm=8
/dev/input/event256:    HDA Intel PCH HDMI/DP,pcm=10
/dev/input/event257:    HD 450BT (AVRCP)
/dev/input/event258:    Xbox Elite Wireless Controller
/dev/input/event259:    Xbox Elite Wireless Controller Consumer Control
/dev/input/event26:     ELAN1200:00 04F3:307A Touchpad
/dev/input/event260:    Xbox Elite Wireless Controller Keyboard
/dev/input/event261:    Microsoft X-Box 360 pad 0             <---- this is the one only seen by steam
/dev/input/event27:     HDA NVidia HDMI/DP,pcm=10
/dev/input/event28:     Asus Keyboard
/dev/input/event29:     HDA Intel PCH HDMI/DP,pcm=7
/dev/input/event3:      Power Button
/dev/input/event30:     HDA Intel PCH HDMI/DP,pcm=8
/dev/input/event31:     HDA Intel PCH HDMI/DP,pcm=9
/dev/input/event4:      AT Translated Set 2 keyboard
/dev/input/event5:      Asus Wireless Radio Control
/dev/input/event6:      PC Speaker
/dev/input/event7:      Video Bus
/dev/input/event8:      Video Bus
/dev/input/event9:      USB2.0 HD UVC WebCam: USB2.0 HD
Select the device event number [0-261]: 261     
Input driver version is 1.0.1
Input device ID: bus 0x3 vendor 0x28de product 0x11ff version 0x1
Input device name: "Microsoft X-Box 360 pad 0"
Supported events:
  Event type 0 (EV_SYN)
  Event type 1 (EV_KEY)
    Event code 304 (BTN_SOUTH)
    Event code 305 (BTN_EAST)
    Event code 307 (BTN_NORTH)
    Event code 308 (BTN_WEST)
    Event code 310 (BTN_TL)
    Event code 311 (BTN_TR)
    Event code 314 (BTN_SELECT)
    Event code 315 (BTN_START)
    Event code 316 (BTN_MODE)
    Event code 317 (BTN_THUMBL)
    Event code 318 (BTN_THUMBR)
  Event type 3 (EV_ABS)
    Event code 0 (ABS_X)
      Value      0
      Min   -32767
      Max    32767
      Fuzz      16
      Flat     128
    Event code 1 (ABS_Y)
      Value      0
      Min   -32767
      Max    32767
      Fuzz      16
      Flat     128
    Event code 2 (ABS_Z)
      Value      0
      Min        0
      Max      255
    Event code 3 (ABS_RX)
      Value      0
      Min   -32767
      Max    32767
      Fuzz      16
      Flat     128
    Event code 4 (ABS_RY)
      Value      0
      Min   -32767
      Max    32767
      Fuzz      16
      Flat     128
    Event code 5 (ABS_RZ)
      Value      0
      Min        0
      Max      255
    Event code 16 (ABS_HAT0X)
      Value      0
      Min       -1
      Max        1
    Event code 17 (ABS_HAT0Y)
      Value      0
      Min       -1
      Max        1
  Event type 21 (EV_FF)
    Event code 80 (FF_RUMBLE)
Properties:
Testing ... (interrupt to exit)

running the uninstall

❯ sudo ./uninstall.sh --verbose
* verbose mode enabled
+ source lib/installer.sh
++ '[' 0 -ne 0 ']'
+++ git rev-parse --show-toplevel
++ GIT_ROOT=/home/noah/Desktop/Github/xpadneo
+++ __version
+++ git describe --tags --dirty
++ VERSION=v0.9-102-ga279cc4
+++ type -p dkms
++ DKMS_BIN=/usr/bin/dkms
++ : /usr/bin/dkms
++ INSTALLED=($(get_dkms_versions_installed))
+++ get_dkms_versions_installed
+++ /usr/bin/dkms status
+++ tr -s ':, ' ' '
+++ awk -- '$1 == "hid-xpadneo" { print $2 }'
+++ sort -nu
+ echo '* unloading current driver module'
* unloading current driver module
+ modprobe -r hid_xpadneo
+ echo '* looking for registered instances'
* looking for registered instances
+ echo 'found 0 registered instance(s) on your system'
found 0 registered instance(s) on your system
░▒▓  │   ~/Desktop/Github/xpadneo │    master ?1 ▓▒

and after reconnecting the controller

[ 6930.994832] hid-generic 0005:045E:0B05.0014: unknown main item tag 0x0
[ 6930.995217] input: Xbox Elite Wireless Controller as /devices/pci0000:00/0000:00:14.0/usb1/1-14/1-14:1.0/bluetooth/hci0/hci0:512/0005:045E:0B05.0014/input/input121
[ 6930.995743] input: Xbox Elite Wireless Controller Consumer Control as /devices/pci0000:00/0000:00:14.0/usb1/1-14/1-14:1.0/bluetooth/hci0/hci0:512/0005:045E:0B05.0014/input/input122
[ 6930.996022] input: Xbox Elite Wireless Controller Keyboard as /devices/pci0000:00/0000:00:14.0/usb1/1-14/1-14:1.0/bluetooth/hci0/hci0:512/0005:045E:0B05.0014/input/input124
[ 6930.996397] hid-generic 0005:045E:0B05.0014: input,hidraw6: BLUETOOTH HID v9.03 Gamepad [Xbox Elite Wireless Controller] on 20:79:18:bf:94:96
[ 6931.015566] loaded hid-xpadneo v0.9-102-ga279cc4
[ 6936.274074] xpadneo 0005:045E:0B05.0014: pretending XB1S Windows wireless mode (changed PID from 0x0B05 to 0x02E0)
[ 6936.274087] xpadneo 0005:045E:0B05.0014: report descriptor size: 1038 bytes
[ 6936.274093] xpadneo 0005:045E:0B05.0014: fixing up report descriptor size
[ 6936.274096] xpadneo 0005:045E:0B05.0014: fixing up Rx axis
[ 6936.274099] xpadneo 0005:045E:0B05.0014: fixing up Ry axis
[ 6936.274102] xpadneo 0005:045E:0B05.0014: fixing up Z axis
[ 6936.274105] xpadneo 0005:045E:0B05.0014: fixing up Rz axis
[ 6936.274107] xpadneo 0005:045E:0B05.0014: fixing up button mapping
[ 6936.275358] xpadneo 0005:045E:0B05.0014: battery detected
[ 6936.275408] xpadneo 0005:045E:0B05.0014: gamepad detected
[ 6936.275411] xpadneo 0005:045E:0B05.0014: enabling compliance with Linux Gamepad Specification
[ 6936.275526] input: Xbox Elite Wireless Controller as /devices/pci0000:00/0000:00:14.0/usb1/1-14/1-14:1.0/bluetooth/hci0/hci0:512/0005:045E:0B05.0014/input/input125
[ 6936.275954] xpadneo 0005:045E:0B05.0014: consumer control detected
[ 6936.276044] input: Xbox Elite Wireless Controller Consumer Control as /devices/pci0000:00/0000:00:14.0/usb1/1-14/1-14:1.0/bluetooth/hci0/hci0:512/0005:045E:0B05.0014/input/input126
[ 6936.276279] xpadneo 0005:045E:0B05.0014: mapping profiles detected
[ 6936.276292] xpadneo 0005:045E:0B05.0014: keyboard detected
[ 6936.276376] input: Xbox Elite Wireless Controller Keyboard as /devices/pci0000:00/0000:00:14.0/usb1/1-14/1-14:1.0/bluetooth/hci0/hci0:512/0005:045E:0B05.0014/input/input128
[ 6936.276731] xpadneo 0005:045E:0B05.0014: input,hidraw6: BLUETOOTH HID v9.03 Gamepad [Xbox Elite Wireless Controller] on 20:79:18:bf:94:96
[ 6936.276749] xpadneo 0005:045E:0B05.0014: controller quirks: 0x00000018
[ 6936.276754] xpadneo xpadneo_welcome_rumble start
[ 6937.263883] xpadneo xpadneo_welcome_rumble took 990ms
[ 6937.263888] xpadneo 0005:045E:0B05.0014: Xbox Elite Wireless Controller [f4:6a:d7:37:61:b9] connected
[ 6937.342957] xpadneo 0005:045E:0B05.0014: reverting to original product (changed PID from 0x02E0 to 0x0B05)
[ 6937.570828] xpadneo 0005:045E:0B05.0014: pretending XB1S Windows wireless mode (changed PID from 0x0B05 to 0x02E0)
[ 6937.570842] xpadneo 0005:045E:0B05.0014: report descriptor size: 1038 bytes
[ 6937.570848] xpadneo 0005:045E:0B05.0014: fixing up report descriptor size
[ 6937.570852] xpadneo 0005:045E:0B05.0014: fixing up Rx axis
[ 6937.570855] xpadneo 0005:045E:0B05.0014: fixing up Ry axis
[ 6937.570858] xpadneo 0005:045E:0B05.0014: fixing up Z axis
[ 6937.570863] xpadneo 0005:045E:0B05.0014: fixing up Rz axis
[ 6937.570866] xpadneo 0005:045E:0B05.0014: fixing up button mapping
[ 6937.571829] xpadneo 0005:045E:0B05.0014: battery detected
[ 6937.571863] xpadneo 0005:045E:0B05.0014: gamepad detected
[ 6937.571866] xpadneo 0005:045E:0B05.0014: enabling compliance with Linux Gamepad Specification
[ 6937.571954] input: Xbox Elite Wireless Controller as /devices/pci0000:00/0000:00:14.0/usb1/1-14/1-14:1.0/bluetooth/hci0/hci0:512/0005:045E:0B05.0014/input/input129
[ 6937.572249] xpadneo 0005:045E:0B05.0014: consumer control detected
[ 6937.572338] input: Xbox Elite Wireless Controller Consumer Control as /devices/pci0000:00/0000:00:14.0/usb1/1-14/1-14:1.0/bluetooth/hci0/hci0:512/0005:045E:0B05.0014/input/input130
[ 6937.572485] xpadneo 0005:045E:0B05.0014: mapping profiles detected
[ 6937.572495] xpadneo 0005:045E:0B05.0014: keyboard detected
[ 6937.572560] input: Xbox Elite Wireless Controller Keyboard as /devices/pci0000:00/0000:00:14.0/usb1/1-14/1-14:1.0/bluetooth/hci0/hci0:512/0005:045E:0B05.0014/input/input132
[ 6937.572794] xpadneo 0005:045E:0B05.0014: input,hidraw6: BLUETOOTH HID v9.03 Gamepad [Xbox Elite Wireless Controller] on 20:79:18:bf:94:96
[ 6937.572812] xpadneo 0005:045E:0B05.0014: controller quirks: 0x00000018
[ 6937.572817] xpadneo xpadneo_welcome_rumble start
[ 6938.559802] xpadneo xpadneo_welcome_rumble took 987ms
[ 6938.559808] xpadneo 0005:045E:0B05.0014: Xbox Elite Wireless Controller [f4:6a:d7:37:61:b9] connected
[ 6939.465146] xpadneo 0005:045E:0B05.0014: battery registered
[ 6939.828093] input: Microsoft X-Box 360 pad 0 as /devices/virtual/input/input133
[ 6970.998721] audit: type=1334 audit(1653477229.200:307): prog-id=50 op=LOAD

@kakra
Copy link
Collaborator

kakra commented May 25, 2022

/dev/input/event261: Microsoft X-Box 360 pad 0 <---- this is the one only seen by steam

Disable Steam Input, it sort of "steals" the device from the driver and takes over with user-space drivers implemented in SDL and Steam Input:

Input device ID: bus 0x3 vendor 0x28de product 0x11ff version 0x1

As far as I can tell, that's the device ID for Steam Input virtual devices. Disabling Steam Input support for Xbox controllers will disable this behavior and let games directly access xpadneo. It won't disable controller support for games. Otherwise, there's no point in using xpadneo at all because default hid-microsoft will support the controller more or less, and then Steam Input will make it work correctly for games (xpadneo does this right in the driver, using Steam Input can mess things up).

If you see mapping problems, check the permissions of the hidraw device belonging to the driver (see dmesg output) and try removing all permissions. If it fixes things, you should find the software that adds those permissions, we've seen OpenRGB doing that. User permissions for the raw device are currently not compatible with SDL because it assumes a wrong HID report format (it's not looking at the HID descriptor but uses the size only as a heuristic). That latter issue is outlined in #286.

the uninstall.sh reported found 0 registered instance(s) on your system while after a reboot the driver was still there.

Please check the output of dkms status, maybe it uses a list format that our uninstaller does not detect. Or dkms doesn't actually uninstall the driver completely and leaves files behind. Our uninstaller does not really uninstall files itself, it just uses dkms, and that doesn't have good error checking as outlined in #278 and dell/dkms#148.

@MNS26
Copy link
Author

MNS26 commented May 25, 2022

Disable Steam Input is always disabled, ive never touched the permissions (and havent looked into it and or what files)

dkms status shows (before manually removing it)

❯ sudo dkms status
[sudo] password for noah: 
hid-xpadneo-v0.9-100/g2b16d6f: installed
nvidia/515.43.04, 5.17.9-arch1-1, x86_64: installed

after i removed it from:

/var/lib/dkms/
/usr/lib/<kernel>/updates/dkms/  <--- ko.zst was here
/usr/lib/<kernel>/modules.alias
/usr/lib/<kernel>/modules.dep
/usr/lib/<kernel>/modules.order

dkms status

❯ sudo dkms status
nvidia/515.43.04, 5.17.9-arch1-1, x86_64: installed
░▒▓  │   ~ ▓▒░   

@kakra
Copy link
Collaborator

kakra commented May 25, 2022

hid-xpadneo-v0.9-100/g2b16d6f: installed
nvidia/515.43.04, 5.17.9-arch1-1, x86_64: installed

This is silly... Why does dkms status change its output syntax with every version? We had module: version and module, version already, and now it's module-version? Or it is module/version but somehow it makes v0.9-100 part of the module name... I'll look into it.

@kakra
Copy link
Collaborator

kakra commented May 25, 2022

I'm not sure how you got into the situation of having hid-xpadneo-v0.9-100/g... in the status line, I could not reproduce it, it always installed as hid-xpadneo/v0.9-100-g... for me. Did you fiddle around manually with dkms trying to add the module? In any case, I think I fixed the uninstall case, it works for me now. I'll push an update soon.

kakra added a commit that referenced this issue May 25, 2022
kakra added a commit to kakra/xpadneo that referenced this issue May 25, 2022
@MNS26
Copy link
Author

MNS26 commented May 25, 2022

nope i used the github install.sh to install it or via aur but that one also builds its automatically

@medusalix
Copy link

@kakra This is an Arch bug: https://bugs.archlinux.org/task/73194. It happens on every kernel upgrade...

@kakra
Copy link
Collaborator

kakra commented May 25, 2022

@medusalix This patch (greedy vs non-greedy) probably fixes nothing because we have hyphens in both the module name AND the version name. That's exactly what is hitting us here: git describe makes v0.9-100-gCOMMITHASH, so with non-greedy matching we get gCOMMITHASH as the version, with greedy matching we'd get xpadneo-v0.9-100-gCOMMITHASH as the version (and hid as the name) - both are bad. The hook should probably rather read PACKAGE_NAME and PACKAGE_VERSION from the dkms.conf file in that directory. The hook is just dumb, there's no sane way to infer name and version from the directory path. It even already matches for that very file, so why not read it in the first place?

What about

for path in "$source_tree"/*/dkms.conf; do
   ( source $path && echo "${PACKAGE_NAME}/${PACKAGE_VERSION}" )
fi

instead? Similar for the other location (except it's a while loop and should continue filtering for dkms.conf).

EDIT: Oh I just noticed the revised patch does exactly that, Flyspray is strange, I didn't even know it still exists. ;-)

@kakra
Copy link
Collaborator

kakra commented May 25, 2022

BTW, it works here in an arch container updated to latest versions:

[kakra@arch-linux xpadneo]$ sudo ./install.sh
* creating dkms.conf
* adding hid-xpadneo-v0.9-109-gf754f6e folder to /usr/src
* installing module (using DKMS)
Creating symlink /var/lib/dkms/hid-xpadneo/v0.9-109-gf754f6e/source -> /usr/src/hid-xpadneo-v0.9-109-gf754f6e
Error! Your kernel headers for kernel 5.15.41-gentoo cannot be found at /usr/lib/modules/5.15.41-gentoo/build or /usr/lib/modules/5.15.41-gentoo/source.
Please install the linux-headers-5.15.41-gentoo package or use the --kernelsourcedir option to tell DKMS where it's located.
[kakra@arch-linux xpadneo]$ dkms status
hid-xpadneo/v0.9-109-gf754f6e: added

So the arch bug seems fixed?

(ignore the kernel sources error)

kakra added a commit that referenced this issue May 26, 2022
Closes: #338
See-also: #344
Signed-off-by: Kai Krakow <[email protected]>
kakra added a commit that referenced this issue May 26, 2022
We still silence the paddles when one of the profiles is selected, the
default profile setup maps the paddles to A, B, X, and Y.

The paddles are special because they are passed as one key by the HID
report. We need to manually remap those values to individual bits.

Maybe-affects: #344
Closes: #332
Signed-off-by: Kai Krakow <[email protected]>
kakra added a commit that referenced this issue May 26, 2022
@medusalix
Copy link

The bug is only triggered by the pacman DKMS hooks (e.g. by upgrading the kernel). Normal installation always works fine.

@kakra
Copy link
Collaborator

kakra commented May 26, 2022

Ah okay, containers have no kernel so I cannot reproduce that here. Hopefully, the patch gets merged soon (though, the bug report exists since over a year).

@kakra
Copy link
Collaborator

kakra commented May 26, 2022

@MNS26 This report has deviated from the original report, I'm inclined to closing it. Are there any issues left?

@MNS26
Copy link
Author

MNS26 commented May 28, 2022

other thant it refusing to detect as the correct controller on steam my system no not that i know of

@MNS26
Copy link
Author

MNS26 commented May 28, 2022

and the uninstall works now (yay)
image

@kakra
Copy link
Collaborator

kakra commented May 28, 2022

other thant it refusing to detect as the correct controller

This is purely a cosmetic issue currently, fixing #286 may fix this in the future. It should have no function consequences because xpadeo itself is detecting your controller correctly.

@kakra kakra closed this as completed May 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants