atar-axis / xpadneo

Advanced Linux Driver for Xbox One Wireless Controller (shipped with Xbox One S)
https://atar-axis.github.io/xpadneo/
GNU General Public License v3.0
1.92k stars 111 forks source link

Fix issues with Steam Link mapping and Consumer Control detection #292

Closed kakra closed 2 years ago

kakra commented 3 years ago

Remaining issues:

crwxrws commented 3 years ago

@kakra I can confirm that an extra "keyboard" input appears, and both the Xbox button and the Share button send events.

The Xbox button (KEY_MODE) sends a pair of key-down and key-up events exactly when the Xbox button is released. It does nothing until I release the button, i.e. it doesn't send a key-down event when I first press it.

The Share button (KEY_RECORD) sends a pair of key-down and key-up events exactly when it is pressed. It does nothing when released.

kakra commented 3 years ago

The Xbox button (KEY_MODE) sends a pair of key-down and key-up events exactly when the Xbox button is released. It does nothing until I release the button, i.e. it doesn't send a key-down event when I first press it.

Yes, this is expected: I implemented it this way to make it act as a shift key. If you press and hold it, then press A, B, X, or Y, it will switch to a different mapping profile (you can watch this event with dmesg -w). In that case, the Xbox button will not send an event when released. The different mappings itself are not implemented yet, tho. It's part of the profile emulation I'm planning to get feature parity with the Xbox Elite 2 controller which has a native profile switcher.

This will also be used to activate mouse mode which is a mode to control your mouse pointer from the couch.

The Share button (KEY_RECORD) sends a pair of key-down and key-up events exactly when it is pressed. It does nothing when released.

This is a solution to a technical problem because your model reports the Share key on the gamepad device but we need it on the consumer device for compatibility among all the models. The Xbox Elite 2 and Xbox One S controller both have a separate gamepad and consumer sub device, your model doesn't, so it's emulated/synthesized. It's too difficult to maintain button state across both a real and a synthetic device but I may look into that again later. We probably need a way to differentiate between short and long press anyways at some point, where short press would make a screenshot, and long press would record a video clip - just as an example.

crwxrws commented 3 years ago

Amazing! Thank you very much for putting so much effort into this project. I'm already very happy with its current state. Even though personally I have no need for these two buttons, it's nice to see that they may become more useful. You can ping me if you need more input or testing, I will help if I have time.

AlexandreLaborde commented 3 years ago

Hi @kakra its me from #291 😀 My controller's firmware just updated to 5.7.2688.0 and it causing issues with some Bluetooth devices. Let me know if you want/need my help to troubleshoot things on a Pi4. Thanks for the great work!

kakra commented 3 years ago

Let me know if you want/need my help to troubleshoot things on a Pi4.

I don't think this belongs here... There are a number of Pi4-related issues about Bluetooth connection problems already, you should comment there. Also, this is most likely not something that xpadneo can solve, you could ask in our Discord community, or check the bluez project. I should probably make getting a Pi4 one of the next goals in ko-fi so I can better support issues with that hardware.

Here's a starting point: https://github.com/atar-axis/xpadneo/projects/11

codeclimate[bot] commented 2 years ago

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

View more on Code Climate.

kakra commented 2 years ago

@Mskeffington Can you confirm that fixes the hidraw permissions? This is only a work-around currently, I'll add a proper fix with correct hidraw mappings post v0.10.

Mskeffington commented 2 years ago

This works the way I expected. :+1: Another quirk is that the XBOX / share buttons are still not getting picked up by the Steamlink... possibly because they are on the second uevent device. The Steamlink doesn't use those for anything so its not a big deal but still worth mentioning.

kakra commented 2 years ago

Did you test on a RPi so we can get that checkbox done in the first post?

Mskeffington commented 2 years ago

Oh, yes, sorry, I missed your whole checkbox system. All my testing has been on RPi 3. My RPi 4 is giving me a weird bluez failure so I cant pair the controller correctly.

I have not tested this on x86 because my series X controller doesn't pair correctly.

kakra commented 2 years ago

Okay, that's all I needed to know. The permission issue this one had left is some OS-thing. The Bluetooth problem is some kernel thing probably and not tracked by this issue. There's a project on the project tab about Bluetooth problems. But xpadneo cannot do much more about it, it's a HID driver and knows nothing about Bluetooth. But I think I've seen reports about this in the bluez project.

Merged.