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

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

Merged
merged 1 commit into from
Oct 19, 2021

Conversation

kakra
Copy link
Collaborator

@kakra kakra commented May 22, 2021

Remaining issues:

  • Validate that the mode preset actually works on Raspberry Pi

@crwxrws
Copy link

crwxrws commented Jun 17, 2021

@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
Copy link
Collaborator Author

kakra commented Jun 17, 2021

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
Copy link

crwxrws commented Jun 17, 2021

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.

@kakra kakra force-pushed the fixes/issue-291 branch 2 times, most recently from 41768d1 to e241455 Compare June 23, 2021 02:52
@kakra kakra added this to the v0.10 milestone Jun 23, 2021
@AlexandreLaborde
Copy link

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
Copy link
Collaborator Author

kakra commented Jun 27, 2021

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

Steam Link has access to the hidraw device using the input group, thus
revoke all access bits from the device to work around the issue.

Fixes: atar-axis#291
Signed-off-by: Kai Krakow <[email protected]>
@codeclimate
Copy link

codeclimate bot commented Oct 18, 2021

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

View more on Code Climate.

@kakra
Copy link
Collaborator Author

kakra commented Oct 18, 2021

@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
Copy link

This works the way I expected. 👍
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
Copy link
Collaborator Author

kakra commented Oct 19, 2021

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

@Mskeffington
Copy link

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 kakra merged commit 2900363 into atar-axis:master Oct 19, 2021
@kakra
Copy link
Collaborator Author

kakra commented Oct 19, 2021

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.

@kakra kakra deleted the fixes/issue-291 branch October 19, 2021 06:40
@kakra kakra restored the fixes/issue-291 branch November 7, 2021 17:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants