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

app, config, ctrl, motion: CemuHookUDP support (SteamDeckGyroDSU support on Steam Deck) #3235

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

popsUlfr
Copy link

@popsUlfr popsUlfr commented Mar 3, 2024

Hi,

This pull requests adds basic CemuHookUDP protocol support to enable gyro input and is supposed to be used in conjunction with https://github.com/kmicki/SteamDeckGyroDSU on the Steam Deck.
The source files udp_client.h, udp_client.cpp, udp_protocol.h, udp_protocol.cpp were taken from the yuzu project and modified and simplified to better integrate with the Vita3K codebase.

Here's a video of the working gyro in Gravity Rush, I raised the default sensitivity a bit since filming this:

https://photos.app.goo.gl/iSKQyuFCZ9CYM9h1A

There are two new configuration options:

  • cemuhookudp-address: expects an address in the form of 127.0.0.1:26760
  • cemuhookudp-gyro-scale-divider: modifies the gyro sensitivity. The calculation is done like this: gyro.x/y/z * (1.0 / cemuhookudp-gyro-scale-divider). So the higher the value the lower the sensitivity and the lower the. value the higher the sensitivity. The default is 39. A value of 1 maps gyro input 1:1.

They are not configurable through the interface yet but exist in the configuration file.

So in effect to get Vita3K with working gyro on the Steam Deck:

  1. Install SteamDeckGyroDSU: https://github.com/kmicki/SteamDeckGyroDSU (EmuDeck has an option to install it in its interface if you are already using it)
  2. Apply this pull request and compile Vita3K.
  3. In Steam Input set Touchscreen Native Support to always on for multi-touch support.

In the controller interface if the SteamDeckGyroDSU server has replied to the CemuHookUDP client, motion support will be marked as such:

Screenshot_20240303_123937

* 'cemuhookudp-address': expects an address in the form of '127.0.0.1:26760'
* 'cemuhookudp-gyro-scale-divider': modifies the gyro sensitivity. The
  calculation is done like this:
  gyro.x/y/z * (1.0 / cemuhookudp-gyro-scale-divider)
  So the higher the value the lower the sentivity and the lower the
  value the higher the sensitivity. The default is '39'.
  A value of 1 maps gyro input 1:1.
@github-actions github-actions bot added build Related to the build process app config ctrl motion labels Mar 3, 2024
@popsUlfr
Copy link
Author

popsUlfr commented Mar 4, 2024

I hopefully fixed the CI building for windows and macos builds.

Copy link
Contributor

@Macdu Macdu left a comment

Choose a reason for hiding this comment

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

Thank you very much for this PR, I believe if/when we migrate to SDL3 it won't be needed anymore.

vita3k/ctrl/src/udp_client.cpp Outdated Show resolved Hide resolved
@popsUlfr
Copy link
Author

popsUlfr commented Mar 4, 2024

Thank you very much for this PR, I believe if/when we migrate to SDL3 it won't be needed anymore.

Ah, so SDL3 can expose the Steam Deck's gyro directly ? Looking at the discussion here libsdl-org/SDL#9148 it seems that one would still need to manually query the gyro values.

@nn9dev
Copy link
Contributor

nn9dev commented Mar 5, 2024

Thank you very much for this PR, I believe if/when we migrate to SDL3 it won't be needed anymore.

DSU is helpful for a lot of non-SDL gyro stuff, not just Steam Deck. Wiimotes, JoyCons, and I believe even some VR Controllers. It's definitely very nice to have as an option. I'm not sure if SDL3 plans to support any or all of these in a verbose manner, but again, very nice to have.

@bookmist
Copy link
Contributor

bookmist commented Mar 5, 2024

If now more boost modules are used, then this modules should be added into BOOST_MODULES_TO_FIND in main CMakeLists.txt
It used for windows compilation without vcpkg

@popsUlfr
Copy link
Author

popsUlfr commented Mar 5, 2024

If now more boost modules are used, then this modules should be added into BOOST_MODULES_TO_FIND in main CMakeLists.txt It used for windows compilation without vcpkg

Ok, thank you, I'll add them there.

EDIT: I think asio and crc are already part of the system cmake boost component but please correct me if I'm wrong.
@bookmist

@Macdu
Copy link
Contributor

Macdu commented Mar 9, 2024

If now more boost modules are used, then this modules should be added into BOOST_MODULES_TO_FIND in main CMakeLists.txt It used for windows compilation without vcpkg

Ok, thank you, I'll add them there.

EDIT: I think asio and crc are already part of the system cmake boost component but please correct me if I'm wrong. @bookmist

Cmake is missing some boost components. That's not really an issue (if you don't have the asio or crc component you'll always get an error at some point). However, the fallback repository https://github.com/Vita3K/ext-boost does not have boost crc. It needs to be updated before this PR is merged or Vita3K will break for people not having an existing boost library availble (@Zangetsu38 )

@popsUlfr
Copy link
Author

@Macdu Should I try to submit a pull request to the https://github.com/Vita3K/ext-boost repo to get the crc module in ?

@Macdu
Copy link
Contributor

Macdu commented Mar 20, 2024

Yes you can (except if @Zangetsu38 wants to do it first), that's the only thing preventing this PR from being merged.

@Zangetsu38
Copy link
Contributor

oh, i have not see sory, i can yes 🆗

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

Successfully merging this pull request may close these issues.

None yet

5 participants