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

[Issue]: Brutal mouse latency #1245

Open
Chacal1988 opened this issue Sep 4, 2023 · 40 comments
Open

[Issue]: Brutal mouse latency #1245

Chacal1988 opened this issue Sep 4, 2023 · 40 comments
Labels

Comments

@Chacal1988
Copy link

Describe the bug

Mouse latency its about 100-120ms laggy wich makes any game unplayable, only maybe desktop use is tolerable.
I´ve tryed everything but nothing fixes this problem.
Maybe using the Android cursor is could be a solution. At least fow desktop usage and real time strategy games.
I can make the Android cursor apear by windowing the Moonlight app on my tablet with Android 13. That mitigates the latency but makes the screen so small that is useless.

Steps to reproduce

ALways

Affected games

All

Other Moonlight clients

PC

Moonlight adjusted settings

Yes

Moonlight adjusted settings (please complete the following information)

Non

Moonlight default settings

Yes

Gamepad-related connection issue

Yes

Gamepad-related input issue

Yes

Gamepad-related streaming issue

Yes

Android version

13

Device model

Lenovo Tab 13

Server PC OS version

Win 10

Server PC GeForce Experience version

Last

Server PC Nvidia GPU driver version

Last

Server PC antivirus and firewall software

Windows

Screenshots

No response

Relevant log output

No response

Additional context

No response

@Chacal1988 Chacal1988 added the bug label Sep 4, 2023
@cgutman
Copy link
Member

cgutman commented Sep 5, 2023

That's terrible latency. Can you enable the performance overlay and see what decoding time is? Is the issue limited to only mouse input or does it also affect gamepad input?

Can you compare with the host display to see if the latency is the mouse input going from the client to the host or the video going from the host to the client?

@Chacal1988
Copy link
Author

@cgutman Excelent questions, ill answer them:
Decoding timen is super low (less than 5ms always).
Issue is related to mouse only, everything else is ultra fast.
Host display is laggy too, and if i move the USB mouse from the host computer i can see the movement instantly happening in the Android 13 tablet client with less than 30ms. (I can perfectly measure the input lag by filming the screen and the physical mouse at the same time with 240fps camera and checking the time distance between the mouse movement and the cursor response on the screens).

@Chacal1988
Copy link
Author

@cgutman i have a phone with Android 12 too, and mouse latency is exactly the same.
Network and decoding speeds are super fast! Less than 5ms both

@Chacal1988
Copy link
Author

Chacal1988 commented Sep 5, 2023

@cgutman i will try to explain better: Lag is only happening when i move the mouse in the client android device. Everithing else like video transmision, decoding times, network times, and gamepad input is ultra fast!

@hoonlight
Copy link

Do you use a wireless mouse? Bluetooth or wifi?

@Chacal1988
Copy link
Author

@archive-r i try all. Wifi, bt, and usb. And multiple brands too. Gaming mouses and standar mouses.
Bt mouses have some extra 10ms latency but all mouses are above 100ms.

@Chacal1988
Copy link
Author

Latency is very reduce when using Nvidia software in the server windows PC.
Latency is brutal only when using Sunshine. I try touching every option, every config, but no luck. Using Sunshine always add brutal mouse latency no matter what i do, what client, or Android version, or server or software, it just adds a lot of latency.

@cgutman
Copy link
Member

cgutman commented Sep 29, 2023

What version of Sunshine are you using? The nightly build has some input batching code that's not present in v0.20.

@sambuev
Copy link

sambuev commented Mar 31, 2024

Please help me too, I run Sunshine on my PC and Moonlight on my Android Tablet with mouse and keyboard, it works perfectly with Parsec, but with Moonlight the delay is huge and very significant, I looking for solution, I remember I tested moonlight back in 2022 and now it's 2024 and the issue is still here. I feel so bad. Test it on your Android and you'll see the issue with mouse.

@Chacal1988
Copy link
Author

Please help me too, I run Sunshine on my PC and Moonlight on my Android Tablet with mouse and keyboard, it works perfectly with Parsec, but with Moonlight the delay is huge and very significant, I looking for solution, I remember I tested moonlight back in 2022 and now it's 2024 and the issue is still here. I feel so bad. Test it on your Android and you'll see the issue with mouse.

There is no fix for that. Sorry :(

@sambuev
Copy link

sambuev commented Apr 7, 2024

I actually found solution:
Ctrl+Alt+Shift+C - makes my mouse visible.
and Ctrl+Alt+Shift+N hides the remote-mouse.

Works perfectly for me on Android Client and I read it also works for PC client.

@angieEncoded
Copy link

Well, that masks the problem. It does 'work' in that it tricks our brains, but behind the scenes the lag still exists.

It's very strange that it's only present with mouse input - bluetooth gamepad has no noticeable lag. Very responsive. For now I have been using the workaround on my portable setup. Samsung S9 Ultra running Android 14 and OneUI 6.1. The mouse and keyboard combo I am using is the ProtoArc XKM01. The gamepad is an 8bitdo 80DB. The PC running Sunshine is a Windows 10 desktop host and it is running Sunshine version: v0.23.1 which is the latest as of this post.

No lag with keyboard, no lag with gamepad, only a problem with the mouse.

I'm happy to provide any other details, logs, etc. Anything that might help. Thanks.

@pranil60
Copy link

After trying everything. I just changed USB port of my pc mouse. Solved the stutter issue

@appleseedexm
Copy link

After trying everything. I just changed USB port of my pc mouse. Solved the stutter issue

I'll try this later, but did this solve general stutter, or did this fix stutter that was only in moonlight? And I assume you changed the mouse port on the client, not the host?

I dont have such huge numbers like OP, but I'd estimate somewhere around 50ms, which is still very noticeable and would not work for some games.

@pranil60
Copy link

After trying everything. I just changed USB port of my pc mouse. Solved the stutter issue

I'll try this later, but did this solve general stutter, or did this fix stutter that was only in moonlight? And I assume you changed the mouse port on the client, not the host?

I dont have such huge numbers like OP, but I'd estimate somewhere around 50ms, which is still very noticeable and would not work for some games.

Well obviously host.. And my problem was not lag. I am using moonlight in android to stream games from pc usung nvidia gamestream. Actual problem was whenever I try to move mouse it was so stuttery, for small movement mouse moved from one point to other after half second and when I tried circular movememts at normal speed, it took 1 second and with stutter like you see in ninja movies.
Problem was not only limited upto mouse only but playing with controller, we have to use different buttons alternatively, and while doing that it did the stutters in games and delays but not as frequently as it did in case of mouse.
So specificly it was Stutter+Latency issue overall.

@pranil60
Copy link

Also changing and removing different USB devices in client could help.

@ClassicOldSong
Copy link

For anyone who is experiencing mouse stuttering issue, you try my fork that may have solved the issue: https://github.com/ClassicOldSong/moonlight-android/releases

Uncheck Enable battery status report for gamepad in the settings.

@pranil60
Copy link

pranil60 commented Jul 17, 2024 via email

@ClassicOldSong
Copy link

The on screen keyboard is not implemented by me. I started this fork for solving issues I have met, including track pad support and the stuttering fix. I might completely rewrite the on screen keyboard if I have enough motivation for that since I use a physical keyboard connected to my tablet to type. I'm looking into the fps limit issue right now, might have a look at the keyboard later.

IIRC you still can toggle the default virtual keyboard in the game back menu.

@ClassicOldSong
Copy link

@pranil60 I've just released a new version. The sticky modifier keys are now implemented.

@pranil60
Copy link

@pranil60 I've just released a new version. The sticky modifier keys are now implemented.

Great

@ClassicOldSong
Copy link

Oh, you have to use the latest latest version I just released(with hotfix), there was a typo that prevented the option to disable battery status report from functioning...

@pranil60
Copy link

pranil60 commented Jul 18, 2024 via email

@ClassicOldSong
Copy link

You'll need to enter the inverted width and height by using the "manual resolution" option if you want to keep the original aspect ratio for video stream. Portrait mode should be used with screen rotation option on the host or with Widecar.

@pranil60
Copy link

pranil60 commented Jul 18, 2024 via email

@pranil60
Copy link

pranil60 commented Jul 18, 2024 via email

@ClassicOldSong
Copy link

@pranil60 Would you please try the latest version?

I'm not sure what you want but I find it might suit your need, and it's a useful feature to have, so here it is: https://github.com/ClassicOldSong/moonlight-android/releases/tag/v12.1-noir-240721

@pranil60
Copy link

pranil60 commented Jul 20, 2024 via email

@pranil60
Copy link

pranil60 commented Jul 20, 2024 via email

@ClassicOldSong
Copy link

You need to enter your monitor's resolution in reverse like 1080x1920 for 1920x1080 to be used in portrait mode

@pranil60
Copy link

pranil60 commented Jul 20, 2024 via email

@ClassicOldSong
Copy link

Panning and zooming is available by disabling touchscreen mouse emulation.

@ClassicOldSong
Copy link

did that

Then there should be no more black bars unless you're using a phone with a notch.

You have to activate the resolution you entered by exiting the settings and entering again, then select the resolution you entered from the resolution list.

@pranil60
Copy link

pranil60 commented Jul 21, 2024 via email

@pranil60
Copy link

pranil60 commented Jul 21, 2024 via email

@pranil60
Copy link

pranil60 commented Jul 21, 2024 via email

@pranil60
Copy link

pranil60 commented Jul 21, 2024 via email

@pranil60
Copy link

pranil60 commented Jul 21, 2024 via email

@ClassicOldSong
Copy link

That couldn't be happening.

I think your device might be a little bit old...

@pranil60
Copy link

pranil60 commented Jul 22, 2024 via email

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

No branches or pull requests

8 participants