moonlight-stream / moonlight-qt

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

Frame pacing always enabled in exclusive fullscreen mode when vsync is on. #1447

Open slash128gnr opened 4 weeks ago

slash128gnr commented 4 weeks ago

Describe the bug When you run moonlight in fullscreen mode with vsync enabled and frame pacing disabled the frame queue delay spikes up to 5-10ms. In borderless fullscreen mode with the same settings the frame queue delay is below 1ms with no screen tearing.

Steps to reproduce Set moonlight to run in full screen mode with vsync on and frame pacing disabled and observe the frame queue delay spike.

Affected games This seems to affect most games but was easily observable in Dark Souls.

Moonlight settings (please complete the following information) image

Client PC details (please complete the following information)

Server PC details (please complete the following information)

Moonlight Logs (please attach) Moonlight-1729305425.log

xenophobentx commented 2 weeks ago

I can confirm the same behaviour in fullscreen the frame queue is increasing.

ody commented 5 days ago

I see the same behavior on macOS but in both Fullscreen and Borderless windowed with vsync enabled. I assume because on macOS these two modes do the same thing. It’ll recover to ~0.01 for a minute then spike up close to 15ms. I’ve only recently been streaming with vsync enabled on macOS, up until now I’ve been streaming with it disabled so only noticed while testing something else.

ody commented 5 days ago

Went looking through code. The behavior described in the original report looks like it may in fact be by design. https://github.com/moonlight-stream/moonlight-qt/blob/master/app/streaming/video/ffmpeg-renderers/d3d11va.cpp#L1187-L1196. The increasing queue I see on macOS is probably not related...

ody commented 4 days ago

I am additionally thinking that metric is more than just time in the pacer queue. I built a debug moonlight and ran a session in a terminal, log output is showing that pacing is disabled and the number while streaming continues to increase