Skip to content

Commit

Permalink
docs: add more troubleshooting notes (LizardByte#2684)
Browse files Browse the repository at this point in the history
Co-authored-by: ReenigneArcher <[email protected]>
  • Loading branch information
2 people authored and KuleRucket committed Oct 9, 2024
1 parent 0ac4e3c commit 8436010
Show file tree
Hide file tree
Showing 4 changed files with 58 additions and 16 deletions.
5 changes: 2 additions & 3 deletions docs/source/about/advanced_usage.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1122,9 +1122,7 @@ keybindings
Value Platform Description
========= ======== ===========
nvfbc Linux Use NVIDIA Frame Buffer Capture to capture direct to GPU memory. This is usually the fastest method for
NVIDIA cards. For GeForce cards it will only work with drivers patched with
`nvidia-patch <https://github.com/keylase/nvidia-patch/>`__
or `nvlax <https://github.com/illnyang/nvlax/>`__.
NVIDIA cards. NvFBC does not have native Wayland support and does not work with XWayland.
wlr Linux Capture for wlroots based Wayland compositors via DMA-BUF.
kms Linux DRM/KMS screen capture from the kernel. This requires that sunshine has cap_sys_admin capability.
See :ref:`Linux Setup <about/setup:install>`.
Expand Down Expand Up @@ -1158,6 +1156,7 @@ keybindings
nvenc For NVIDIA graphics cards
quicksync For Intel graphics cards
amdvce For AMD graphics cards
vaapi Use Linux VA-API (AMD, Intel)
software Encoding occurs on the CPU
========= ===========

Expand Down
2 changes: 1 addition & 1 deletion docs/source/about/setup.rst
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ Install
sudo dnf remove sunshine
The `deb`, `rpm`, `zst`, `Flatpak` and `AppImage` packages should handle these steps automatically.
The `deb`, `rpm`, `zst`, `Flatpak` and `AppImage` packages should handle the steps below automatically.
Third party packages may not.

Sunshine needs access to `uinput` to create mouse and gamepad virtual devices and (optionally) to `uhid`
Expand Down
32 changes: 20 additions & 12 deletions docs/source/troubleshooting/general.rst
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,6 @@ Web UI Access
Can't access the web UI?
#. Check firewall rules.

Nvidia issues
-------------
NvFBC, NvENC, or general issues with Nvidia graphics card.
- Consumer grade Nvidia cards are software limited to a specific number of encodes. See
`Video Encode and Decode GPU Support Matrix <https://developer.nvidia.com/video-encode-and-decode-gpu-support-matrix-new>`__
for more info.
- You can usually bypass the restriction with a driver patch. See Keylase's
`Linux <https://github.com/keylase/nvidia-patch>`__
or `Windows <https://github.com/keylase/nvidia-patch/blob/master/win>`__ patches for more guidance.

Controller works on Steam but not in games
------------------------------------------
One trick might be to change Steam settings and check or uncheck the configuration to support Xbox/Playstation
Expand All @@ -47,8 +37,26 @@ Also, if you have many controllers already directly connected to the host, it mi
Sunshine provided controller (connected to the guest) is the "first" one. In Linux this can be accomplished on USB
devices by finding the device in `/sys/bus/usb/devices/` and writing `0` to the `authorized` file.

Packet loss
-----------
Packet loss (Buffer overrun)
----------------------------
If the host PC (running Sunshine) has a much faster connection to the network
than the slowest segment of the network path to the client device (running
Moonlight), massive packet loss can occur: Sunshine emits its stream in bursts
every 16ms (for 60fps) but those bursts can't be passed on fast enough to the
client and must be buffered by one of the network devices inbetween. If the
bitrate is high enough, these buffers will overflow and data will be discarded.

This can easily happen if e.g. the host has a 2.5 Gbit/s connection and the
client only 1 Gbit/s or Wifi. Similarly a 1 Gbps host may be too fast for a
client having only a 100 Mbps interface.

As a workaround the transmission speed of the host NIC can be reduced: 1 Gbps
instead of 2.5 or 100 Mbps instead of 1 Gbps. (A technically more advanced
solution would be to configure traffic shaping rules at the OS-level, so that
only Sunshine's traffic is slowed down.)

Packet loss (MTU)
-----------------
Albeit unlikely, some guests might work better with a lower `MTU
<https://en.wikipedia.org/wiki/Maximum_transmission_unit>`__ from the host. For example, a LG TV was found to have 30-60%
packet loss when the host had MTU set to 1500 and 1472, but 0% packet loss with a MTU of 1428 set in the network card
Expand Down
35 changes: 35 additions & 0 deletions docs/source/troubleshooting/linux.rst
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,41 @@ If screencasting fails with KMS, you may need to run the following to force unpr
sudo setcap -r $(readlink -f $(which sunshine))
.. note:: The above command will not work with the AppImage or Flatpak packages.
Please refer to the :ref:`Setup guide <about/setup:Install>` for more
specific instructions.

KMS streaming fails on Nvidia GPUs
----------------------------------
If KMS screen capture results in a black screen being streamed, you may need to
set the parameter `modeset=1` for Nvidia's kernel module. This can be done by
adding the following directive to the kernel command line:
.. code-block::
nvidia_drm.modeset=1
Consult your distribution's documentation for details on how to do this. (Most
often grub is used to load the kernel and set its command line.)

AMD encoding latency issues
---------------------------
If you notice unexpectedly high encoding latencies (e.g. in Moolight's
performance overlay) or strong fluctuations thereof, this is due to
`missing support <https://gitlab.freedesktop.org/drm/amd/-/issues/3336>`_
in Mesa/libva for AMD's low latency encoder mode. This is particularly
problematic at higher resolutions (4K).

As of now this can only be fixed by recompiling Mesa with a test patch (see
url above) that unconditionally enables a low latency tuning mode for all
encoder workloads. This is for advanced users only and neither support nor
warranty are provided. Note also that this patch entails a higher power
consumption while encoding and may not be suitable for all use cases.

(A crude workaround is to *increase* the load on the de-/encoder by having it
de- or encode an additional arbitrary video stream in the background. This
ensures that the encoder's clock frequencies stay high and the latency
fluctuations disappear.)

Gamescope compatibility
-----------------------
Some users have reported stuttering issues when streaming games running within Gamescope.

0 comments on commit 8436010

Please sign in to comment.