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

Add Support for iPhone/iPad internal motion sensor #579

Open
Danos0100 opened this issue Sep 9, 2023 · 8 comments
Open

Add Support for iPhone/iPad internal motion sensor #579

Danos0100 opened this issue Sep 9, 2023 · 8 comments

Comments

@Danos0100
Copy link

Is your feature request related to a problem? Please describe.
When building from source (the commit is yet to be added into the build on the App Store), you can access the DS4/DS5 gyro and acceleration sensor and use it for a virtual DS4 Controller in Sunshine (nightly). However, there are controllers, whose motion input is not supported (Switch Pro Controller) or who don't have a dedicated motion sensor ("Switch Style" iPhone Gamepads like the Razer Kishi for example). In that case, no motion data is transferred.

Describe the solution you'd like
Offering a fallback if no motion input is exposed by the iOS Controller API would seem a pretty straightforward solution. That way, the iPhone's own acceleration and gyro would be used, thus removing the need for a separate controller with motion control (Steam Link does this as well, but for some reason, its FPS performance is way worse than Sunshine/Moonlight, although my system should handle it just fine. Plus Sunshine offers HDR)

@Danos0100
Copy link
Author

As motion has been added to the stable channels of Sunshine and Moonlight, I'd like to push this issue/request. Maybe one could have a toggle to choose which gyro to use, just like it's the case with the on screen controller buttons. Something like
Gyro
(Controller (if available) | Phone | Auto | Off)

@louisdefromont
Copy link

It looks like the gyro is being used for android devices (moonlight-stream/moonlight-android#1155). Hopefully, something similar can be done for iOS

@Danos0100
Copy link
Author

It looks like the gyro is being used for android devices (moonlight-stream/moonlight-android#1155). Hopefully, something similar can be done for iOS

Having taken a quick look at how Moonlight handles gyro input, it should definitely be possible to implement something similar on Moonlight iOS, by using the correspondig APIs. Unfortunately I am far from skilled enough to implement such a thing :(

@systox
Copy link

systox commented Aug 21, 2024

Bump. Need this also.

@Danos0100
Copy link
Author

I actually managed to implement it, however this still needs an UI implementation, because my Controller Grip (GameSir G8) emulates a DS5, thus sending dummy motion data (0,0,0,0,0,0) towards the iPhone. Because of this, it needs a toggle to overwrite the Allegedly motion data from the G8 with the iPhone motion data (so a switch to always use iPhone motion data even if there is a controller connected).

if anybody could help me out with implementing a three state switch (auto [controller if connected, else iPhone], always controller, always iPhone) to the UI (the positions seem pretty hardcoded?), we could get this working!

@Danos0100
Copy link
Author

(Bump, i'd really like to get this going, but UI still looks kinda hard to understand for me)

@Danos0100
Copy link
Author

Okay, finally managed to understand the UI and the settings. It works. (Whohoooo!) Some Cleanup and I got to read into getting this into a pull request. As moonlight-ios seems pretty on halt atm, I will try to get this working in the https://github.com/Moonlight-the-Fried-Fish/moonlight-ios-NativeMultiTouchPassthrough fork, which seems to get updated more regularly at the moment.

@Danos0100
Copy link
Author

Enjoy #664 (comment)

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

No branches or pull requests

3 participants