loki-47-6F-64 / sunshine

Host for Moonlight Streaming Client
GNU General Public License v3.0
1.75k stars 155 forks source link

Current screen capturing method seems not suitable for gaming. #253

Open hksdpc255 opened 2 years ago

hksdpc255 commented 2 years ago

It seems that sunshine only send frames when the screen is updated. But some applications such as the windows lock screen do not properly inform sunshine after a screen update. I need to move the cursor manually, otherwise I can not see the screen update.

This mechanism also adds additional latency when sunshine starts to send frames.

Additionally, when I switch screen using CTRL+ALT+SHIFT+FX, I need to move my cursor to the new screen, otherwise the screen will stuck at the old screen until moonlight-qt complains that no video stream received and stops the connection.

I recommend to always send frames to the client even though the screen is not changed. The mechanism to detect screen update is not reliable and cause additional latency.

aclysma commented 2 years ago

I may be hitting the same problem. I just recently set up sunshine/moonlight on windows 10/3950x/5700XT. What I noticed is that if I use "desktop" applications like notepad or other basic windows UI (like text fields in control panel) it's really laggy. CTRL+ALT+SHIFT+S show that FPS is really low (like 1-5FPS.) But if I have any 3d app running in the background, I'm seeing 60FPS, causing all the "desktop" applications to be completely responsive.

Is there any way to force sending full frame rate at all times? Is it possible this issue was recently introduced? I'm having a good experience in the games I've tried, but outside of games, it's actually a worse experience than built-in RDP.

(This project is great, thanks to everyone who has put work into this!)

hksdpc255 commented 2 years ago

It seems that current screen capture method is introduced in this commit:

https://github.com/loki-47-6F-64/sunshine/commit/7ddf8bbe94ceb31dcc411dc28206399d81396a05

@aclysma So, If you don't need latest feature, version v0.9.0 might help.

jdancouga commented 2 years ago

@hksdpc250, I am glad you suggested v0.9.0. I reported low fps problem when gamestreaming in Discussions. I loaded up v0.9.0, and I no longer suffer from low fps issue. Thank you.

I hope this is screen capture method can become a user option in UI for future release.

falk4243 commented 2 years ago

It can be configured, in a way. You can also use the latest version and run "sudo setcap -r /usr/bin/sunshine". That way, it will automatically fall back to the old method.

hksdpc255 commented 2 years ago

@falk4243 How to configure it in windows?

falk4243 commented 2 years ago

My bad, I didn't assume you were using Windows. I don't think there is a "setcap" equivalent there, but if anybody knows better, feel free to chime in.