How to improve latency between Sunshine and Moonlight #17
-
When comparing my Sunshine-Moonlight setup with the in-home streaming with two Steam instances or Steam-Steamlink, I see a much higher delay. This is totally fine for watching movies (what I mostly do) since the audio seems to be in sync, but would be unusable for gaming. Test setup
ObservationStuff happening on the first monitor happens earlier than the same stuff on Moonlight device. My guess the latency is around 100-200ms - not measured! I have tried a bunch of Sunshine settings but nothing yielded significant improvements. I also tried different machines, running Moonlight, both wired and wireless LAN. I don't even know if the delay is caused by Sunshine at all or if Moonlight is the culprit or both. Do you have any tips for better settings. Or how to debug this situation the best. Or is it simply not feasible (yet) to achieve same delays as e.g. Steam? |
Beta Was this translation helpful? Give feedback.
Replies: 0 comments 14 replies
-
The first thing I would do is identify where the lag is, encode/network/decode. ctrl-alt-shift-s should help with that. You don't say what OS or hardware you are using. If nvidia I would suggest things like ensuring NvFBC works properly (as steam can use). For me steam is absolutely terrible compared to sunshine/moonlight. I.e. 40ms lag with 1080p@60fps using steam compared to 1-2ms with1440p@120fps using moonlight/sunshine. |
Beta Was this translation helpful? Give feedback.
-
Thank you @KuleRucket. This is certainly a starting point. After you mentioning NvFBC I realized that I didn't even have installed CUDA and thus compiled without NvFBC. So I installed it. I had to run cmake like this But now with CUDA support compiled in, the very first log message I get from Sunshine is |
Beta Was this translation helpful? Give feedback.
-
I also use Arch with an RTX 3070 so can provide some relevant info. My client is an Intel NUC 11 with Intel Iris Xe integrated GPU.
If it's all fine you should see these info messages within the log output: For reference, this is the sort of performance I get on a wired LAN. |
Beta Was this translation helpful? Give feedback.
-
It's not possible to objectively, but CPU load on sunshine is very low and the GPU video encoder is only working at 50% according to nvtop so it's not working hard at all. |
Beta Was this translation helpful? Give feedback.
-
Is there maybe a up to date guide what settings you should use or how to improve performance and latency if you use AMD or Nvidia on a Sunshine host? Is it still possible to use NVFBC somehow on Windows, I read there was this hack but I dont know how that works or if it still works with latest Nvidia drivers. https://github.com/illnyang/nvlax/ I get around 20-30 less FPS if I stream with Sunshine with my RTX4080 compared to native play, which is a bit huge of a performance loss honestly. |
Beta Was this translation helpful? Give feedback.
I also use Arch with an RTX 3070 so can provide some relevant info. My client is an Intel NUC 11 with Intel Iris Xe integrated GPU.