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

[Deck] hidapi support for Steam Virtual Gamepad #6068

Closed
flibitijibibo opened this issue Aug 16, 2022 · 4 comments
Closed

[Deck] hidapi support for Steam Virtual Gamepad #6068

flibitijibibo opened this issue Aug 16, 2022 · 4 comments
Labels
enhancement New feature or request

Comments

@flibitijibibo
Copy link
Collaborator

I keep forgetting to write this down, so I'm just doing this now... obviously not a 2.24 requirement, but:

Right now the virtual gamepad is strictly a baseline XInput device - it even claims to be an Xbox 360 controller depending on who's asking. Problem is, this actually hides a lot about the device, specifically the gyro data. Other elements like the touchpads aren't that big of a deal since the mouse simulation can be made to work with either absolute or relative motion, but gyro is definitely a blind spot. This can be an issue for applications like Citra, which have full support for SDL_sensor but can't see them on Deck!

Ignoring my distaste for the virtual gamepads (RIP Steam's old gamecontrollerdb exports), I wonder if SDL can read the virtual gamepad via hidapi as its own device, rather than as an XInput device, so that non-SDL games aren't affected but those that do use SDL can see all the hardware available, without having to resort to Steam Input which may have licensing conflicts (Citra is one such case, being GPL-licensed).

This is probably 50% SDL and 50% Valve but it would definitely be nice for us to expose all the hardware to third-party applications, if possible.

@flibitijibibo flibitijibibo added the enhancement New feature or request label Aug 16, 2022
@flibitijibibo
Copy link
Collaborator Author

Something else that's come to mind... by being able to read the device more directly, it would also allow us to dig up a lot of data about the hardware behind it. As an example: Initialization could encode the SDL_GameControllerType into the input stream, and would allow us to show the right glyphs without having to force Steam Input off (something that's bothered me pretty much since the beginning!).

@slouken
Copy link
Collaborator

slouken commented Aug 17, 2022

As far as I know uinput doesn't allow passing metadata like the original game controller type through the interface, but Steam did recently add the slot index to the end of the name, and could potentially add some controller type metadata there. However, Steam moves devices around in slots and the virtual devices can't be renamed, so really using the Steam API to query the current state of things seems like the best approach for that.

It might be possible for uinput to create a gyro input device, I'm not sure how that works, but even if that happened, SDL doesn't currently support opening a controller via separate devices for different functionality. Adding support for the gyro on PlayStation controllers using the Linux input driver might be a good first step towards prototyping this.

@mubinulhaque
Copy link

Has anyone looked into the #streetpea/chiaki-ng#7 code? It seems they have managed to reverse-engineer gyro controls on Steam Deck, which could potentially fix this issue.

@slouken
Copy link
Collaborator

slouken commented Nov 7, 2023

We haven't come up with a solution for passing metadata through uinput. I'm going to close this for now, feel free to reopen it if you have any ideas!

@slouken slouken closed this as not planned Won't fix, can't repro, duplicate, stale Nov 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants