moonlight-stream / moonlight-qt

GameStream client for PCs (Windows, Mac, Linux, and Steam Link)
GNU General Public License v3.0
9.39k stars 552 forks source link

cursor tracking sometimes ignores down and left movement #814

Open wezel opened 2 years ago

wezel commented 2 years ago

Describe the bug

Hi, I ran into some strange behavior while running moonlight via snap on pop-os 22.04. For some reason moonlight doesn't always send the correct cursor delta's to the streaming host (sunshine on pop-os 22.04) I've run some test:

The issue is most noticeable when moving the cursor slowly. I've checked what exactly happens on the host side and the received numbers indeed seem to agree with the above found behavior.

I've tested a self build version and app image which both didn't have this issue. (They did have other issues which I'm still trying to work out.)

Steps to reproduce install the snap package on pop-os 22.04 I think the issue was already there when I still was on 21.10 but I didn't realized it at that point. The issue is most likely also there on ubuntu 22.04 (since pop is ubuntu with extra's) but I haven't tested this.

Screenshots sorry no screenshot

Affected games I only used it on the standard desktop but I presume the issue is with everything

Other Moonlight clients No It's specific to the snap build

Moonlight settings (please complete the following information) settings don't matter it happens right out of the box. When the mouse tracking is set to desktop mode the issue is gone but sadly it's not possible to game with the cursor in this setting.

Gamepad-related issues (please complete if problem is gamepad-related) No.

Client PC details (please complete the following information)

Server PC details (please complete the following information)

Moonlight Logs (please attach) log.txt

Additional context No sorry not that I can think of.

cgutman commented 2 years ago

Hmm, very strange.

Can you run with the environment variable SDL_EVENT_LOGGING=2 set and see if the mouse deltas in the logged events correspond with your findings?

wezel commented 2 years ago

It gives similar output as when I ran sunshine in debug mode: cursortopright-bottomleft.log This is the output from me attempting to go from the top right corner to the bottom left. I created the movement by placing my mouse at angle along on side of my mouse path to be sure it moves in a straight line. I also first tested it on my local display to make sure it went roughly from one corner to the other. As can be seen in the output the cursor doesn't move down that much and you can see that the yrel=0 most of the time.

This is the log from trying to go from down left to top right in the same way: cursorbottomleft-topright.log The cursor heavily favors going up above going to the right.

For reference this is the output of the self build version I've created (this one was created by normally dragging the mouse): cursor-selfbuild-bottomleft-topright.log. What is noticeable is that in this version the delta's are also higher for roughly the same movement.

Moving up and down is even harder to determine with the output: but I feel that I moved the mouse (so not the cursor) faster down than up to create this log: cursorupanddown.log An easier test for this was to place the mouse at the edge of my mouse pad -> move down until the cursor hits the bottom of the screen -> move back up again until the cursor hits the top of the screen. Cursor acceleration is "off" on both systems so this should ~roughly put me back at the top of the mouse pad but it doesn't (there is a good 3 or 4 cm left to go).

Noticeable is that in both the x and y direction it is the movement in the negative delta that is faster.

side note about the self build version (and also AppImage): I found another bug/inconvenience. On my laptop It favors decoding with the intel integrated graphics above the dedicated nvidia card. This resulted in roughly 50% of the frames to be dropped making games unplayable. By simply removing the intel decoder library it is fixed however this is of-course not an ideal solution. (My guess is that this doesn't happen for the snap version because it isn't allowed to access the intel decoder folder?) Should I create a bug report for this too?