# Configuration

Sunshine Name
The name displayed by Moonlight. If not specified, the PC's hostname is used
Log Level
The minimum log level printed to standard out
Maximum Connected Clients
Sunshine can allow a single streaming session to be shared with multiple clients simultaneously.
Note: Some hardware encoders may have limitations that reduce performance with multiple streams.
Command Preparations
Configure a list of commands to be executed before or after running any application. If any of the specified preparation commands fail, the application launch process will be aborted.

Do Command | Undo Command | Run as Admin |
--- | --- | --- | ---
|  | Elevated |

Enable Gamepad Input
Allows guests to control the host system with a gamepad / controller
Emulated Gamepad Type
Choose which type of gamepad to emulate on the host

##

Map Back/Select to Touchpad Click
When forcing DS4 emulation, map Back/Select to Touchpad Click

##

Emulate a DS4 gamepad if the client gamepad reports motion sensors are present
If disabled, motion sensors will not be taken into account during gamepad type selection.
Emulate a DS4 gamepad if the client gamepad reports a touchpad is present
If disabled, touchpad presence will not be taken into account during gamepad type selection.
Home/Guide Button Emulation Timeout
If the Back/Select button is held down for the specified number of milliseconds, a Home/Guide button press is emulated.
If set to a value < 0 (default), holding the Back/Select button will not emulate the Home/Guide button.

Enable Keyboard Input
Allows guests to control the host system with the keyboard
Key Repeat Delay
Control how fast keys will repeat themselves
The initial delay in milliseconds before repeating keys
Key Repeat Frequency
How often keys repeat every second
This configurable option supports decimals
Always Send Scancodes
Sending scancodes enhances compatibility with games and apps but may result in incorrect keyboard input from certain clients that aren't using a US English keyboard layout.
Enable if keyboard input is not working at all in certain applications.
Disable if keys on the client are generating the wrong input on the host.
Map Right Alt key to Windows key
It may be possible that you cannot send the Windows Key from Moonlight directly.
In those cases it may be useful to make Sunshine think the Right Alt key is the Windows key

Enable Mouse Input
Allows guests to control the host system with the mouse
High Resolution Scrolling Support
When enabled, Sunshine will pass through high resolution scroll events from Moonlight clients.
This can be useful to disable for older applications that scroll too fast with high resolution scroll events.
Native Pen/Touch Support
When enabled, Sunshine will pass through native pen/touch events from Moonlight clients.
This can be useful to disable for older applications without native pen/touch support.
Audio Sink
Manually specify a specific audio device to capture. If unset, the device is chosen automatically.
We strongly recommend leaving this field blank to use automatic device selection!
If you have multiple audio devices with identical names, you can get the Device ID using the following command:

    tools\audio-info.exe

Audio Sink
The name of the audio sink used for Audio Loopback
If you do not specify this variable, pulseaudio will select the default monitor device.
You can find the name of the audio sink using either command:

    pacmd list-sinks | grep "name:"

    pactl info | grep Source

Audio Sink
The name of the audio sink used for Audio Loopback
Sunshine can only access microphones on macOS due to system limitations.
To stream system audio using Soundflower or BlackHole.
Virtual Sink
Manually specify a virtual audio device to use. If unset, the device is chosen automatically.
We strongly recommend leaving this field blank to use automatic device selection!
Install Steam Audio Drivers
If Steam is installed, this will automatically install the Steam Streaming Speakers driver to support 5.1/7.1 surround sound and muting host audio.
Adapter Name
Manually specify a GPU to use for capture. If unset, the GPU is chosen automatically.
We strongly recommend leaving this field blank to use automatic GPU selection!
Note: This GPU must have a display connected and powered on.
The appropriate values can be found using the following command:

    tools\dxgi-info.exe

Adapter Name
Manually specify a GPU to use for capture.

    ls /dev/dri/renderD*  # to find all devices capable of VAAPI

                  vainfo --display drm --device /dev/dri/renderD129 | \
                    grep -E "((VAProfileH264High|VAProfileHEVCMain|VAProfileHEVCMain10).*VAEntrypointEncSlice)|Driver version"

Replace ``renderD129`` with the device from above to lists the name and capabilities of the device.
To be supported by Sunshine, it needs to have at the very minimum: VAProfileH264High : VAEntrypointEncSlice
Output Name
Manually specify a display to use for capture. If unset, the primary display is captured.
Note: If you specified a GPU above, this display must be connected to that GPU.
The appropriate values can be found using the following command:
tools\dxgi-info.exe
Monitor number
During Sunshine startup, you should see the list of detected monitors, e.g.:

                Info: Detecting connected monitors
                Info: Detected monitor 0: DVI-D-0, connected: false
                Info: Detected monitor 1: HDMI-0, connected: true
                Info: Detected monitor 2: DP-0, connected: true
                Info: Detected monitor 3: DP-1, connected: false
                Info: Detected monitor 4: DVI-D-1, connected: false

You need to use the value before the colon in the output, e.g. 1.
Advertised Resolutions
{{r}} ×
Advertised FPS
{{f}} ×
The display modes advertised by Sunshine.
Some versions of Moonlight, such as Moonlight-nx (Switch), rely on these lists to ensure that the requested resolutions and fps are supported.
This setting does not change how the screen stream is sent to Moonlight.
UPnP
Automatically configure port forwarding for streaming over the Internet
Address Family
Set the address family used by Sunshine
Port
Set the family of ports used by Sunshine
Sunshine cannot use ports below 1024!
Ports above 65535 are not available!

Protocol | Port | Note
--- | --- | ---
TCP | {{+effectivePort - 5}} |
TCP | {{+effectivePort}} | Use this port to connect with Moonlight.
TCP | {{+effectivePort + 1}} | Web UI
TCP | {{+effectivePort + 21}} |
UDP | {{+effectivePort + 9}} - {{+effectivePort + 11}} |

Exposing the Web UI to the internet is a security risk! Proceed at your own risk!
Origin Web UI Allowed
The origin of the remote endpoint address that is not denied access to Web UI
External IP
If no external IP address is given, Sunshine will automatically detect external IP
LAN Encryption Mode
This determines when encryption will be used when streaming over your local network.
Encryption can reduce streaming performance, particularly on less powerful hosts and clients.
WAN Encryption Mode
This determines when encryption will be used when streaming over the Internet.
Encryption can reduce streaming performance, particularly on less powerful hosts and clients.
Ping Timeout
How long to wait in milliseconds for data from moonlight before shutting down the stream
Apps File
The file where current apps of Sunshine are stored
Credentials File
Store Username/Password separately from Sunshine's state file.
Logfile Path
The file where the current logs of Sunshine are stored.
Private Key
The private key used for the web UI and Moonlight client pairing. For best compatibility, this should be an RSA-2048 private key.
Certificate
The certificate used for the web UI and Moonlight client pairing. For best compatibility, this should have an RSA-2048 public key.
State File
The file where current state of Sunshine is stored
FEC Percentage
Percentage of error correcting packets per data packet in each video frame.
Higher values can correct for more network packet loss, but at the cost of increasing bandwidth usage.
The default value of 20 is what GeForce Experience uses.
Quantization Parameter
Quantization Parameter
Some devices may not support Constant Bit Rate.
For those devices, QP is used instead.
Higher value means more compression, but less quality
Minimum CPU Thread Count
Increasing the value slightly reduces encoding efficiency, but the tradeoff is usually
worth it to gain the use of more CPU cores for encoding. The ideal value is the lowest
value that can reliably encode at your desired streaming settings on your hardware.
HEVC Support
Allows the client to request HEVC Main or HEVC Main10 video streams.
HEVC is more CPU-intensive to encode, so enabling this may reduce performance when using software encoding.
AV1 Support
Allows the client to request AV1 Main 8-bit or 10-bit video streams.
AV1 is more CPU-intensive to encode, so enabling this may reduce performance when using software encoding.
Force a Specific Capture Method
Force a specific capture method, otherwise Sunshine will use the first one that works. NvFBC requires patched nvidia drivers.
Force a Specific Encoder
Force a specific encoder, otherwise Sunshine will select the best available option.
Note: If you specify a hardware encoder on Windows, it must match the GPU where the display is connected.
Performance preset
Higher numbers improve compression (quality at given bitrate) at the cost of increased encoding latency.
Recommended to change only when limited by network or decoder, otherwise similar effect can be accomplished by increasing bitrate.
Two-pass mode
Adds preliminary encoding pass.
This allows to detect more motion vectors, better distribute bitrate across the frame and more strictly adhere to bitrate limits.
Disabling it is not recommended since this can lead to occasional bitrate overshoot and subsequent packet loss.
Spatial AQ
Assign higher QP values to flat regions of the video.
Recommended to enable when streaming at lower bitrates.
Single-frame VBV/HRD percentage increase
By default sunshine uses single-frame VBV/HRD, which means any encoded video frame size is not expected to exceed requested bitrate divided by requested frame rate.
Relaxing this restriction can be beneficial and act as low-latency variable bitrate, but may also lead to packet loss if the network doesn't have buffer headroom to handle bitrate spikes.
Maximum accepted value is 400, which corresponds to 5x increased encoded video frame upper size limit.

##

Use realtime priority in hardware accelerated gpu scheduling
Currently NVIDIA drivers may freeze in encoder when HAGS is enabled, realtime priority is used and VRAM utilization is close to maximum.
Disabling this option lowers the priority to high, sidestepping the freeze at the cost of reduced capture performance when the GPU is heavily loaded.
Prefer lower encoding latency over power savings
Sunshine requests maximum GPU clock speed while streaming to reduce encoding latency.
Disabling it is not recommended since this can lead to significantly increased encoding latency.
Present OpenGL/Vulkan on top of DXGI
Sunshine can't capture fullscreen OpenGL and Vulkan programs at full frame rate unless they present on top of DXGI.
This is system-wide setting that is reverted on sunshine program exit.
Prefer CAVLC over CABAC in H.264
Simpler form of entropy coding.
CAVLC needs around 10% more bitrate for same quality.
Only relevant for really old decoding devices.
QuickSync Preset
QuickSync Coder (H264)
Allow Slow HEVC Encoding
This can enable HEVC encoding on older Intel GPUs, at the cost of higher GPU usage and worse performance.
AMF Quality
AMF Rate Control
AMF Usage
AMF Preanalysis
AMF Variance Based Adaptive Quantization (VBAQ)
AMF Coder (H264)
VideoToolbox Coder
VideoToolbox Software Encoding
VideoToolbox Realtime Encoding
SW Presets
Optimize the trade-off between encoding speed (encoded frames per second) and compression efficiency (quality per bit in the bitstream). Defaults to superfast.
SW Tune
Tuning options, which are applied after the preset. Defaults to zerolatency.
Success! Click 'Apply' to restart Sunshine and apply changes. This will terminate any running sessions.
Success! Sunshine is restarting to apply changes.