moonlight-stream / moonlight-ios

GameStream client for iOS/tvOS
GNU General Public License v3.0
990 stars 247 forks source link

Add Support for iPhone/iPad internal motion sensor #579

Open Danos0100 opened 8 months ago

Danos0100 commented 8 months ago

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 commented 4 months ago

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 commented 2 months ago

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

Danos0100 commented 2 months ago

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 :(