-
Notifications
You must be signed in to change notification settings - Fork 733
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
Can you add support for mobile gyroscope? #1155
Comments
Not support with host. Motion sensing not possible yet with rtsp. |
Rewasd junior app can using the mobile gyroscope as ns pro/DS4 controller gyro by IP connecting.But moonlight-steam's virtual controller always occupy the first place in my PC lead to Rewasd junior app fail.Can you add a setting let the user choose not to open the moonlight-steam's virtual handle? |
Seems like moonlight-qt supports gyroscope/motion now. Any chance this can be adopted on the Android version? |
hello @cgutman Edit1: Couldn't get host to read the gyro data from my client thought... Tested with: Client: latest main branch debug build (nvidia shield pro) Tried emulating with ds4 on sunshine gamepads config and with forced moonlight gamepad driver checked and unchecked... Note 1: I can confirm that the shield detects the gyro when the gamepad is connected through usb Am I missing something? Edit2:
The code disables it for sdk versions < 31, and the shield is level 30... @cgutman is there any fallback method that can be implemented on sdk versions < 31? thanks |
I couldn't make it work on an Android 12 phone (Pixel 3) neither with However, I managed to make it work using moonlight-qt on another PC with an Nintendo Switch Pro Controller. So, at least my host-side with Sunshine works. Are the any other requirement except from having Android 12? EDIT 1: Apparently, according to my debugging, the Switch Pro Controller's acceleration sensor is not detected by the SensorManager. EDIT 2: 8bitdo sf30pro doesn't work either. |
I wasn't able to get this working either, installed sunshine nightly as well as built the up to date android app. Doing some debugging it seems to not even be detecting that the android device has a gyro sensor (this is on an abxylute handheld streaming device). |
Exactly, while debugging the provided InputDevice's SensorManager doesnt return any sensor at all. I wasn't able to verify thats Android supports gyro sensors of gamepads at all. Neither I could find definite documentation on this nor verify it with other games using my Switch Pro Controller and 8bitdo SF30 Pro. |
@baflo & @cgutman i was able to make it work after tinkering a bit with it, inspired by https://github.com/Williangalvani/moonlight-android/tree/gyro_to_mouse_cleaned. SensorManager won't return a sensor if you don't register a sensor event listener from the device itself.
Afterwards, pass them on to controllerHandler.onGyro(), where instead of sending controllerInputPacket, i simply send controllerMotionEvent.
I didn't fork anything, i just rebuilt the apk locally, because as @cgutman said, it's just a starting point. At the moment it doesn't have a fallback if the device doesn't have motion sensors, nor does it take into account device orientation, not to mention that the sensor listener will impact battery life since it's permanently registered... |
Oh, and any nightly greater than 5c6eaf2 , tested with a DS4 controller, and gyro data is passed through flawlessly (as long as sunshine host emulates a ds4 controller) |
Would you please create a fork of what you created? I tried to implemented what you said you did, but I couldn't get it to work. There weren't any errors, the gyro just still didn't work. I've also got a razer kishi and it would be awesome if it had motion controls. |
@curtisfletcher have you worked with @william Gavani’s joystick build? Does this work as is, or do I need to add your code to it as well? Also, have tried to pass this on to ‘DS Windows’? |
@curtisfletcher make sure sunshine emulates a DS4 controller. |
Thanks. I did try that but I think I just butchered the code. The functions you edited looked different in the version of moonlight I downloaded. It's okay, Im happy to use a ds4 for now until this is added as a feature. |
Can I use the motion control of the switch pro controller on a TV with Android 10.0? I tried it but it doesn't seem to work |
I couldn't get it to work either (but with a ds4) I think it might require android 12. https://github.com/moonlight-stream/moonlight-android/releases/tag/v12.0 |
Can't this one be closed ? V12.0 release says gyro has been implemented? |
I'm not sure. The release notes claim to have native support for PS4/5 controllers. At least for me it works neither with a Switch Pro Controller nor with an Android phone's integrated gyro. Can anybody else confirm? |
I can confirm that Gyro works on an Ayn Odin 2 Android device. |
Can you add support for mobile gyroscope?
The text was updated successfully, but these errors were encountered: