Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save ekam230/60ebc4dcd0b696ea9119c50fc276e5c3 to your computer and use it in GitHub Desktop.
Save ekam230/60ebc4dcd0b696ea9119c50fc276e5c3 to your computer and use it in GitHub Desktop.
Moonlight and Sunshine gamestream guide for Windows 11

This guide was last updated: 20th December 2022, and the most optimum settings may differ as Sunshine and Moonlight are updated.

Overview

This guide is intended to help those migrating from streaming their games with Nvidia GameStream, to Sunshine. It will help you setup the Moonlight client and Sunshine gamesteam host to stream your PC games to your other devices. The aim is to optimise the settings to get similar streaming performance as Nvidia GameStream.

Prerequisites

  1. Download and install Moonlight client on your chosen device
  2. Download and install the nightly build of Sunshine gamestream host on the PC which you want to stream games from.

Configuration

The following setup tweaks will help make Moonlight and Sunshine run optimally for the best experience.

  1. Disable the Sunshine service. This service runs as the SYSTEM user, and can cause issues when launching programs under this user.

    1. Browse to C:\Program Files\Sunshine\scripts
    2. Right click uninstall-service.bat and run as Admin
  2. Run Sunshine manually as Admin

    1. Browse to C:\Program Files\Sunshine
    2. Right click sunshine.exe and run as Admin

Graphics card configuration

  • Set Nvidia VSync to Fast or set "AMD Enhanced Sync" and see if it helps with stream smoothness or reducing latency. If using either of these methods, you should also cap the framerate to the client's framerate or else the stream will stutter. You can use RTSS for a global frame limit.

Sunshine configuration

Ensure to Sunshine is *Run as Admin" Use the Web GUI at https://localhost:47990 to access the Sunshine configuration web gui. Configure the following options:

  1. Under NVENC Encoder select:

    1. Nvenc preset: Low latency High Perofrmance (llhp)
    2. Nvenc rate control: CBR
    3. Nvenc encoder: auto
  2. Under Advanced select:

    1. HEVC Support: Sunshine will specify based on encoder
    2. Force encoder: autodetect
    3. FEC percentage: 5 (only lower from 20 if on LAN)

Moonlight configuration

Configure Moonlight as follows for 60FPS gameplay

  1. Video resolution: Your preference
  2. Video frame rate: 120
  3. Video bitrate: Your preference, or as network allows
  4. Video frame pacing: Prefer lowest latency

Experiments

The total latency of the following system:

  • LG C7 OLED
  • RTX 2070S host
  • Nvidia Shield client running moonlight
    1. Video resolution: 4k
    2. Video frame rate: 120
    3. Video bitrate: 120mbps
    4. Video frame pacing: Prefer lowest latency
  • 60 fps rendering rate on host and client

Input latency measurements:

  • GFE: 3x16ms (48ms) lag on LG OLED C7 in Game mode
  • GFE: 4x16ms (64ms) lag on LG OLED C7 in ISF mode
  • Sunshine: 6x16ms (100ms) lag on LG OLED C7 in ISF mode, llhp preset

Evaluation

  1. GFE is about 3 frames lower latency than Sunshine at 60 fps, ~48ms.
  2. Game mode on LG C7 OLED reduces latency by 1 frame, or 16ms when rendering at 60fps. LG TV HDMI Input icon has been set as PC
  3. NVENC low latency (ll) preset causes fps to vary more, and get stuck at 30/45fps more than llhp preset
  4. Nvenc rate control: CBR, significantly helps keeps frame rate higher in low movement scenes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment