diff --git a/.codeql-prebuild-cpp-Linux.sh b/.codeql-prebuild-cpp-Linux.sh index 8f31178ffe6..f0d03bb2c81 100644 --- a/.codeql-prebuild-cpp-Linux.sh +++ b/.codeql-prebuild-cpp-Linux.sh @@ -1,76 +1,11 @@ # install dependencies for C++ analysis set -e -CUDA_VERSION=11.8.0 -CUDA_BUILD=520.61.05 - -# install wget and cuda first -sudo apt-get update -y -sudo apt-get install -y \ - wget - -# Install CUDA -url_base="https://developer.download.nvidia.com/compute/cuda/${CUDA_VERSION}/local_installers" -url="${url_base}/cuda_${CUDA_VERSION}_${CUDA_BUILD}_linux.run" -sudo wget -q -O /root/cuda.run ${url} -sudo chmod a+x /root/cuda.run -sudo /root/cuda.run --silent --toolkit --toolkitpath=/usr/local/cuda --no-opengl-libs --no-man-page --no-drm -sudo rm /root/cuda.run - -# Install dependencies -sudo apt-get install -y \ - build-essential \ - gcc-10 \ - g++-10 \ - libayatana-appindicator3-dev \ - libavdevice-dev \ - libcap-dev \ - libcurl4-openssl-dev \ - libdrm-dev \ - libevdev-dev \ - libminiupnpc-dev \ - libmfx-dev \ - libnotify-dev \ - libnuma-dev \ - libopus-dev \ - libpulse-dev \ - libssl-dev \ - libva-dev \ - libvdpau-dev \ - libwayland-dev \ - libx11-dev \ - libxcb-shm0-dev \ - libxcb-xfixes0-dev \ - libxcb1-dev \ - libxfixes-dev \ - libxrandr-dev \ - libxtst-dev - -# clean apt cache -sudo apt-get clean -sudo rm -rf /var/lib/apt/lists/* - -# Update gcc alias -# https://stackoverflow.com/a/70653945/11214013 -sudo update-alternatives --install \ - /usr/bin/gcc gcc /usr/bin/gcc-10 100 \ - --slave /usr/bin/g++ g++ /usr/bin/g++-10 \ - --slave /usr/bin/gcov gcov /usr/bin/gcov-10 \ - --slave /usr/bin/gcc-ar gcc-ar /usr/bin/gcc-ar-10 \ - --slave /usr/bin/gcc-ranlib gcc-ranlib /usr/bin/gcc-ranlib-10 - -# build -mkdir -p build -cd build || exit 1 -cmake \ - -DBUILD_DOCS=OFF \ - -DCMAKE_CUDA_COMPILER=/usr/local/cuda/bin/nvcc \ - -G "Unix Makefiles" \ - .. -make -j"$(nproc)" +chmod +x ./scripts/linux_build.sh +./scripts/linux_build.sh --skip-package --ubuntu-test-repo # Delete CUDA -sudo rm -rf /usr/local/cuda +rm -rf ./build/cuda # skip autobuild echo "skip_autobuild=true" >> "$GITHUB_OUTPUT" diff --git a/.dockerignore b/.dockerignore index a6ccb41e660..641742725e4 100644 --- a/.dockerignore +++ b/.dockerignore @@ -14,6 +14,9 @@ scripts/ tools/ crowdin.yml +# don't ignore linux build script +!scripts/linux_build.sh + # ignore dev directories build/ cmake-*/ diff --git a/.github/ISSUE_TEMPLATE/bug-report.yml b/.github/ISSUE_TEMPLATE/bug-report.yml index f03374555f9..422a0a6477b 100644 --- a/.github/ISSUE_TEMPLATE/bug-report.yml +++ b/.github/ISSUE_TEMPLATE/bug-report.yml @@ -122,6 +122,7 @@ body: description: The type of the installed graphics card. options: - AMD + - Apple Silicon - Intel - Nvidia - none (software encoding) diff --git a/.github/semantic.yml b/.github/semantic.yml new file mode 100644 index 00000000000..b5eb70d02e6 --- /dev/null +++ b/.github/semantic.yml @@ -0,0 +1,14 @@ +--- +# This file is centrally managed in https://github.com//.github/ +# Don't make changes to this file in this repo as they will be overwritten with changes made to the same file in +# the above-mentioned repo. + +# This is the configuration file for https://github.com/Ezard/semantic-prs + +enabled: true +titleOnly: true # We only use the PR title as we squash and merge +commitsOnly: false +titleAndCommits: false +anyCommit: false +allowMergeCommits: false +allowRevertCommits: false diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 085053876ad..1ed66a7b9b6 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -41,7 +41,7 @@ jobs: - name: Setup Release id: setup_release - uses: LizardByte/setup-release-action@v2024.725.234618 + uses: LizardByte/setup-release-action@v2024.801.192524 with: github_token: ${{ secrets.GITHUB_TOKEN }} @@ -150,14 +150,14 @@ jobs: mkdir -p build mkdir -p artifacts - cd build cmake -DGITHUB_CLONE_URL=${clone_url} \ + -B build \ + -S . \ -DBUILD_VERSION=${build_version} \ -DGITHUB_BRANCH=${branch} \ -DGITHUB_COMMIT=${commit} \ -DSUNSHINE_CONFIGURE_FLATPAK_MAN=ON \ - -DSUNSHINE_CONFIGURE_ONLY=ON \ - .. + -DSUNSHINE_CONFIGURE_ONLY=ON - name: Debug Manifest working-directory: build @@ -257,7 +257,7 @@ jobs: matrix: include: # package these differently - type: AppImage - EXTRA_ARGS: '-DSUNSHINE_BUILD_APPIMAGE=ON' + EXTRA_ARGS: '--appimage-build' dist: 22.04 steps: @@ -276,81 +276,23 @@ jobs: with: submodules: recursive - - name: Install wget - run: | - sudo apt-get update -y - sudo apt-get install -y \ - wget - - - name: Install CUDA - env: - CUDA_VERSION: 11.8.0 - CUDA_BUILD: 520.61.05 - timeout-minutes: 4 - run: | - url_base="https://developer.download.nvidia.com/compute/cuda/${CUDA_VERSION}/local_installers" - url="${url_base}/cuda_${CUDA_VERSION}_${CUDA_BUILD}_linux.run" - sudo wget -q -O /root/cuda.run ${url} - sudo chmod a+x /root/cuda.run - sudo /root/cuda.run --silent --toolkit --toolkitpath=/usr/local/cuda --no-opengl-libs --no-man-page --no-drm - sudo rm /root/cuda.run - - name: Setup Dependencies Linux timeout-minutes: 5 run: | - # allow newer gcc - sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y + # create the artifacts directory + mkdir -p artifacts - # allow libfuse2 for appimage on 22.04 + # allow libfuse2 for appimage on 22.04+ sudo add-apt-repository universe - # libx11-xcb-dev and libxcb-dri3-dev are required for building libva sudo apt-get install -y \ - build-essential \ - cmake \ - doxygen \ - graphviz \ - gcc-10 \ - g++-10 \ - libayatana-appindicator3-dev \ - libavdevice-dev \ - libcap-dev \ - libcurl4-openssl-dev \ libdrm-dev \ - libevdev-dev \ libfuse2 \ - libminiupnpc-dev \ - libnotify-dev \ - libnuma-dev \ - libopus-dev \ - libpulse-dev \ - libssl-dev \ - libvdpau-dev \ + libgl-dev \ libwayland-dev \ - libx11-dev \ libx11-xcb-dev \ libxcb-dri3-dev \ - libxcb-shm0-dev \ - libxcb-xfixes0-dev \ - libxcb1-dev \ - libxfixes-dev \ - libxrandr-dev \ - libxtst-dev \ - python3 \ - python3-venv - - # clean apt cache - sudo apt-get clean - sudo rm -rf /var/lib/apt/lists/* - - # Update gcc alias - # https://stackoverflow.com/a/70653945/11214013 - sudo update-alternatives --install \ - /usr/bin/gcc gcc /usr/bin/gcc-10 100 \ - --slave /usr/bin/g++ g++ /usr/bin/g++-10 \ - --slave /usr/bin/gcov gcov /usr/bin/gcov-10 \ - --slave /usr/bin/gcc-ar gcc-ar /usr/bin/gcc-ar-10 \ - --slave /usr/bin/gcc-ranlib gcc-ranlib /usr/bin/gcc-ranlib-10 + libxfixes-dev - name: Setup python id: python @@ -371,7 +313,7 @@ jobs: --enable-x11 \ --enable-glx \ --enable-wayland \ - --without-legacy # emgd, nvctrl, fglrx + --without-legacy # emgd, nvctrl, fglrx make -j $(nproc) sudo make install cd .. && rm -rf libva-* @@ -381,28 +323,9 @@ jobs: BRANCH: ${{ github.head_ref || github.ref_name }} BUILD_VERSION: ${{ needs.setup_release.outputs.release_tag }} COMMIT: ${{ needs.setup_release.outputs.release_commit }} - timeout-minutes: 10 run: | - echo "nproc: $(nproc)" - - mkdir -p build - mkdir -p artifacts - - cd build - cmake \ - -DBUILD_WERROR=ON \ - -DCMAKE_BUILD_TYPE=Release \ - -DCMAKE_CUDA_COMPILER:PATH=/usr/local/cuda/bin/nvcc \ - -DCMAKE_INSTALL_PREFIX=/usr \ - -DSUNSHINE_ASSETS_DIR=share/sunshine \ - -DSUNSHINE_EXECUTABLE_PATH=/usr/bin/sunshine \ - -DSUNSHINE_ENABLE_WAYLAND=ON \ - -DSUNSHINE_ENABLE_X11=ON \ - -DSUNSHINE_ENABLE_DRM=ON \ - -DSUNSHINE_ENABLE_CUDA=ON \ - ${{ matrix.EXTRA_ARGS }} \ - .. - make -j $(expr $(nproc) - 1) # use all but one core + chmod +x ./scripts/linux_build.sh + ./scripts/linux_build.sh --skip-cleanup --skip-package --ubuntu-test-repo ${{ matrix.EXTRA_ARGS }} - name: Set AppImage Version if: | @@ -416,7 +339,7 @@ jobs: working-directory: build run: | # install sunshine to the DESTDIR - make install DESTDIR=AppDir + DESTDIR=AppDir ninja install # custom AppRun file cp -f ../packaging/linux/AppImage/AppRun ./AppDir/ @@ -454,7 +377,7 @@ jobs: - name: Delete CUDA # free up space on the runner run: | - sudo rm -rf /usr/local/cuda + rm -rf ./build/cuda - name: Verify AppImage if: ${{ matrix.type == 'AppImage' }} @@ -597,9 +520,10 @@ jobs: echo "Clone URL: ${clone_url}" echo "Tag: ${tag}" - mkdir build - cd build + mkdir -p build cmake \ + -B build \ + -S . \ -DBUILD_VERSION="${build_version}" \ -DFORMULA_VERSION="${version}" \ -DGITHUB_BRANCH="${branch}" \ @@ -608,9 +532,7 @@ jobs: -DGITHUB_DEFAULT_BRANCH="${default_branch}" \ -DGITHUB_TAG="${tag}" \ -DSUNSHINE_CONFIGURE_HOMEBREW=ON \ - -DSUNSHINE_CONFIGURE_ONLY=ON \ - .. - cd .. + -DSUNSHINE_CONFIGURE_ONLY=ON # copy formula to artifacts mkdir -p homebrew @@ -643,7 +565,7 @@ jobs: - name: Validate Homebrew Formula if: | matrix.release != true - uses: LizardByte/homebrew-release-action@v2024.612.21058 + uses: LizardByte/homebrew-release-action@v2024.809.31635 with: formula_file: ${{ github.workspace }}/homebrew/sunshine.rb git_email: ${{ secrets.GH_BOT_EMAIL }} @@ -668,6 +590,39 @@ jobs: tag: ${{ needs.setup_release.outputs.release_tag }} token: ${{ secrets.GH_BOT_TOKEN }} + - name: Patch homebrew formula + # create beta version of the formula + # don't run this on macOS, as the sed command fails + if: >- + matrix.release + run: | + # variables + formula_file="homebrew/sunshine-beta.rb" + + # rename the file + mv homebrew/sunshine.rb $formula_file + + # update the formula + sed -i 's/class Sunshine < Formula/class SunshineBeta < Formula/' $formula_file + sed -i 's/# conflicts_with/conflicts_with/' $formula_file + + # print new file + echo "New formula:" + cat $formula_file + + - name: Upload Homebrew Beta Formula + if: >- + matrix.release && + needs.setup_release.outputs.publish_release == 'true' + uses: LizardByte/homebrew-release-action@v2024.809.31635 + with: + formula_file: ${{ github.workspace }}/homebrew/sunshine-beta.rb + git_email: ${{ secrets.GH_BOT_EMAIL }} + git_username: ${{ secrets.GH_BOT_NAME }} + publish: true + token: ${{ secrets.GH_BOT_TOKEN }} + validate: false + build_mac_port: needs: [setup_release] strategy: @@ -731,17 +686,16 @@ jobs: echo "Commit: ${commit}" echo "Clone URL: ${clone_url}" - mkdir build - cd build + mkdir -p build cmake \ + -B build \ + -S . \ -DBUILD_VERSION=${build_version} \ -DGITHUB_BRANCH=${branch} \ -DGITHUB_COMMIT=${commit} \ -DGITHUB_CLONE_URL=${clone_url} \ -DSUNSHINE_CONFIGURE_PORTFILE=ON \ - -DSUNSHINE_CONFIGURE_ONLY=ON \ - .. - cd .. + -DSUNSHINE_CONFIGURE_ONLY=ON # copy Portfile to artifacts mkdir -p artifacts @@ -1101,7 +1055,6 @@ jobs: Remove-Item -Path doxygen-setup.exe - name: Setup python - # use this instead of msys2 python due to known issues using wheels, https://www.msys2.org/docs/python/ id: setup-python uses: actions/setup-python@v5 with: @@ -1125,17 +1078,16 @@ jobs: BUILD_VERSION: ${{ needs.setup_release.outputs.release_tag }} COMMIT: ${{ needs.setup_release.outputs.release_commit }} run: | - mkdir build - cd build + mkdir -p build cmake \ + -B build \ + -G Ninja \ + -S . \ -DBUILD_WERROR=ON \ -DCMAKE_BUILD_TYPE=RelWithDebInfo \ - -DPython_EXECUTABLE='${{ steps.python-path.outputs.python-path }}' \ -DSUNSHINE_ASSETS_DIR=assets \ - -DTESTS_SOFTWARE_ENCODER_UNAVAILABLE='skip' \ - -G "MinGW Makefiles" \ - .. - mingw32-make -j$(nproc) + -DTESTS_SOFTWARE_ENCODER_UNAVAILABLE='skip' + ninja -C build - name: Package Windows shell: msys2 {0} diff --git a/.github/workflows/ci-docker.yml b/.github/workflows/ci-docker.yml index 8e14b6c207e..124febc4872 100644 --- a/.github/workflows/ci-docker.yml +++ b/.github/workflows/ci-docker.yml @@ -115,7 +115,7 @@ jobs: - name: Setup Release id: setup_release - uses: LizardByte/setup-release-action@v2024.725.234618 + uses: LizardByte/setup-release-action@v2024.801.192524 with: dotnet: ${{ needs.check_dockerfiles.outputs.dotnet }} github_token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/cpp-lint.yml b/.github/workflows/cpp-lint.yml index 5d0df5ad76c..96cb1d06194 100644 --- a/.github/workflows/cpp-lint.yml +++ b/.github/workflows/cpp-lint.yml @@ -55,7 +55,7 @@ jobs: - name: Clang format lint if: ${{ steps.find_files.outputs.found_files }} - uses: DoozyX/clang-format-lint-action@v0.17 + uses: DoozyX/clang-format-lint-action@v0.18 with: source: ${{ steps.find_files.outputs.found_files }} extensions: 'cpp,h,m,mm' diff --git a/.github/workflows/update-homebrew-release.yml b/.github/workflows/update-homebrew-release.yml index 1ab0e16a741..dc6ef218140 100644 --- a/.github/workflows/update-homebrew-release.yml +++ b/.github/workflows/update-homebrew-release.yml @@ -61,7 +61,7 @@ jobs: if: >- steps.check.outputs.hasTopic == 'true' && fromJson(steps.download.outputs.downloaded_files)[0] - uses: LizardByte/homebrew-release-action@v2024.612.21058 + uses: LizardByte/homebrew-release-action@v2024.809.31635 with: formula_file: ${{ fromJson(steps.download.outputs.downloaded_files)[0] }} git_email: ${{ secrets.GH_BOT_EMAIL }} diff --git a/.gitignore b/.gitignore index ccc8b0c7487..b3c5bd85850 100644 --- a/.gitignore +++ b/.gitignore @@ -40,6 +40,7 @@ # build directories build/ cmake-*/ +docs/doxyconfig* # npm node_modules/ diff --git a/.gitmodules b/.gitmodules index 4aa76d5206f..88198314dd0 100644 --- a/.gitmodules +++ b/.gitmodules @@ -6,10 +6,10 @@ path = third-party/build-deps url = https://github.com/LizardByte/build-deps.git branch = dist -[submodule "third-party/doxygen-awesome-css"] - path = third-party/doxygen-awesome-css - url = https://github.com/jothepro/doxygen-awesome-css.git - branch = main +[submodule "third-party/doxyconfig"] + path = third-party/doxyconfig + url = https://github.com/LizardByte/doxyconfig.git + branch = master [submodule "third-party/googletest"] path = third-party/googletest url = https://github.com/google/googletest/ diff --git a/.readthedocs.yaml b/.readthedocs.yaml index aa2f75f8063..ee2f3bb2e4f 100644 --- a/.readthedocs.yaml +++ b/.readthedocs.yaml @@ -3,41 +3,28 @@ # Read the Docs configuration file # See https://docs.readthedocs.io/en/stable/config-file/v2.html for details -# Required version: 2 -# Set the version of Python build: os: ubuntu-24.04 tools: python: "miniconda-latest" - apt_packages: - - libboost-locale-dev # required for rstcheck in cpp code block - jobs: - post_build: - - find ./third-party -iname "*.rst" -type f -delete # find and delete rst files in third-party - - rstcheck -r . # lint rst files - # - rstfmt --check --diff -w 120 . # check rst formatting + commands: + - | + if [ -f readthedocs_build.sh ]; then + doxyconfig_dir="." + else + doxyconfig_dir="./third-party/doxyconfig" + fi + chmod +x "${doxyconfig_dir}/readthedocs_build.sh" + export DOXYCONFIG_DIR="${doxyconfig_dir}" + "${doxyconfig_dir}/readthedocs_build.sh" # using conda, we can get newer doxygen and graphviz than ubuntu provide # https://github.com/readthedocs/readthedocs.org/issues/8151#issuecomment-890359661 conda: - environment: docs/environment.yml + environment: third-party/doxyconfig/environment.yml -# submodules required for include statements submodules: include: all recursive: true - -# Build documentation in the docs/ directory with Sphinx -sphinx: - builder: html - configuration: docs/source/conf.py - fail_on_warning: true - -# Using Sphinx, build docs in additional formats -formats: all - -python: - install: - - requirements: ./docs/requirements.txt diff --git a/DOCKER_README.md b/DOCKER_README.md index f15fac2cc9e..be27e2fa91f 100644 --- a/DOCKER_README.md +++ b/DOCKER_README.md @@ -25,15 +25,15 @@ ENTRYPOINT steam && sunshine Sunshine images are available with the following tag suffixes, based on their respective base images. - `archlinux` -- `debian-bullseye` -- `fedora-36` -- `fedora-37` -- `ubuntu-20.04` +- `debian-bookworm` +- `fedora-39` +- `fedora-40` - `ubuntu-22.04` +- `ubuntu-24.04` ### Tags You must combine the `SUNSHINE_VERSION` and `SUNSHINE_OS` to determine the tag to pull. The format should be -`-`. For example, `latest-ubuntu-22.04`. +`-`. For example, `latest-ubuntu-24.04`. See all our available tags on [docker hub](https://hub.docker.com/r/lizardbyte/sunshine/tags) or [ghcr](https://github.com/LizardByte/Sunshine/pkgs/container/sunshine/versions) for more info. @@ -152,8 +152,15 @@ The architectures supported by these images are shown in the table below. |-----------------|--------------|---------------| | archlinux | ✅ | ❌ | | debian-bookworm | ✅ | ✅ | -| debian-bullseye | ✅ | ✅ | -| fedora-38 | ✅ | ✅ | -| fedora-39 | ✅ | ✅ | -| ubuntu-20.04 | ✅ | ✅ | +| fedora-39 | ✅ | ❌ | +| fedora-40 | ✅ | ❌ | | ubuntu-22.04 | ✅ | ✅ | +| ubuntu-24.04 | ✅ | ✅ | + +
+ +| Previous | Next | +|:-------------------------------|-----------------------------------------------------:| +| [Changelog](docs/changelog.md) | [Third-Party Packages](docs/third_party_packages.md) | + +
diff --git a/README.md b/README.md new file mode 100644 index 00000000000..a0f1b931e71 --- /dev/null +++ b/README.md @@ -0,0 +1,153 @@ +# Overview + +[![GitHub stars](https://img.shields.io/github/stars/lizardbyte/sunshine.svg?logo=github&style=for-the-badge)](https://github.com/LizardByte/Sunshine) +[![GitHub Releases](https://img.shields.io/github/downloads/lizardbyte/sunshine/total.svg?style=for-the-badge&logo=github)](https://github.com/LizardByte/Sunshine/releases/latest) +[![Docker](https://img.shields.io/docker/pulls/lizardbyte/sunshine.svg?style=for-the-badge&logo=docker)](https://hub.docker.com/r/lizardbyte/sunshine) +[![GHCR](https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fraw.githubusercontent.com%2Fipitio%2Fbackage%2Fmaster%2Findex%2FLizardByte%2FSunshine%2Fsunshine.json&query=%24.downloads&label=ghcr%20pulls&style=for-the-badge&logo=github)](https://github.com/LizardByte/Sunshine/pkgs/container/sunshine) +[![Winget Version](https://img.shields.io/badge/dynamic/json.svg?color=orange&label=Winget&style=for-the-badge&prefix=v&query=$[-1:].name&url=https%3A%2F%2Fapi.github.com%2Frepos%2Fmicrosoft%2Fwinget-pkgs%2Fcontents%2Fmanifests%2Fl%2FLizardByte%2FSunshine&logo=microsoft)](https://github.com/microsoft/winget-pkgs/tree/master/manifests/l/LizardByte/Sunshine) +[![GitHub Workflow Status (CI)](https://img.shields.io/github/actions/workflow/status/lizardbyte/sunshine/CI.yml.svg?branch=master&label=CI%20build&logo=github&style=for-the-badge)](https://github.com/LizardByte/Sunshine/actions/workflows/CI.yml?query=branch%3Amaster) +[![GitHub Workflow Status (localize)](https://img.shields.io/github/actions/workflow/status/lizardbyte/sunshine/localize.yml.svg?branch=master&label=localize%20build&logo=github&style=for-the-badge)](https://github.com/LizardByte/Sunshine/actions/workflows/localize.yml?query=branch%3Amaster) +[![Read the Docs](https://img.shields.io/readthedocs/sunshinestream.svg?label=Docs&style=for-the-badge&logo=readthedocs)](http://sunshinestream.readthedocs.io) +[![Codecov](https://img.shields.io/codecov/c/gh/LizardByte/Sunshine?token=SMGXQ5NVMJ&style=for-the-badge&logo=codecov&label=codecov)](https://codecov.io/gh/LizardByte/Sunshine) + +LizardByte has the full documentation hosted on [Read the Docs](https://sunshinestream.readthedocs.io). + +## About + +Sunshine is a self-hosted game stream host for Moonlight. +Offering low latency, cloud gaming server capabilities with support for AMD, Intel, and Nvidia GPUs for hardware +encoding. Software encoding is also available. You can connect to Sunshine from any Moonlight client on a variety of +devices. A web UI is provided to allow configuration, and client pairing, from your favorite web browser. Pair from +the local server or any mobile device. + +## System Requirements + +@warning{These tables are a work in progress. Do not purchase hardware based on this information.} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Minimum Requirements
ComponentRequirement
GPUAMD: VCE 1.0 or higher, see: obs-amd hardware support
Intel: VAAPI-compatible, see: VAAPI hardware support
Nvidia: NVENC enabled cards, see: nvenc support matrix
CPUAMD: Ryzen 3 or higher
Intel: Core i3 or higher
RAM4GB or more
OSWindows: 10+ (Windows Server does not support virtual gamepads)
macOS: 12+
Linux/Debian: 12+ (bookworm)
Linux/Fedora: 39+
Linux/Ubuntu: 22.04+ (jammy)
NetworkHost: 5GHz, 802.11ac
Client: 5GHz, 802.11ac
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
4k Suggestions
ComponentRequirement
GPUAMD: Video Coding Engine 3.1 or higher
Intel: HD Graphics 510 or higher
Nvidia: GeForce GTX 1080 or higher
CPUAMD: Ryzen 5 or higher
Intel: Core i5 or higher
NetworkHost: CAT5e ethernet or better
Client: CAT5e ethernet or better
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
HDR Suggestions
ComponentRequirement
GPUAMD: Video Coding Engine 3.4 or higher
Intel: HD Graphics 730 or higher
Nvidia: Nvidia: Pascal-based GPU (GTX 10-series) or higher
CPUAMD: Ryzen 5 or higher
Intel: Core i5 or higher
NetworkHost: CAT5e ethernet or better
Client: CAT5e ethernet or better
+ +## Support + +Our support methods are listed in our [LizardByte Docs](https://lizardbyte.readthedocs.io/en/latest/about/support.html). + +
+ +| Previous | Next | +|:---------|------------------------------------:| +| | [Overview](docs/getting_started.md) | + +
diff --git a/README.rst b/README.rst deleted file mode 100644 index b2b7f4634e6..00000000000 --- a/README.rst +++ /dev/null @@ -1,111 +0,0 @@ -Overview -======== -LizardByte has the full documentation hosted on `Read the Docs `__. - -About ------ -Sunshine is a self-hosted game stream host for Moonlight. -Offering low latency, cloud gaming server capabilities with support for AMD, Intel, and Nvidia GPUs for hardware -encoding. Software encoding is also available. You can connect to Sunshine from any Moonlight client on a variety of -devices. A web UI is provided to allow configuration, and client pairing, from your favorite web browser. Pair from -the local server or any mobile device. - -System Requirements -------------------- - -.. warning:: This table is a work in progress. Do not purchase hardware based on this. - -**Minimum Requirements** - -.. csv-table:: - :widths: 15, 60 - - "GPU", "AMD: VCE 1.0 or higher, see: `obs-amd hardware support `_" - "", "Intel: VAAPI-compatible, see: `VAAPI hardware support `_" - "", "Nvidia: NVENC enabled cards, see: `nvenc support matrix `_" - "CPU", "AMD: Ryzen 3 or higher" - "", "Intel: Core i3 or higher" - "RAM", "4GB or more" - "OS", "Windows: 10+ (Windows Server does not support virtual gamepads)" - "", "macOS: 12+" - "", "Linux/Debian: 11 (bullseye)" - "", "Linux/Fedora: 39+" - "", "Linux/Ubuntu: 22.04+ (jammy)" - "Network", "Host: 5GHz, 802.11ac" - "", "Client: 5GHz, 802.11ac" - -**4k Suggestions** - -.. csv-table:: - :widths: 15, 60 - - "GPU", "AMD: Video Coding Engine 3.1 or higher" - "", "Intel: HD Graphics 510 or higher" - "", "Nvidia: GeForce GTX 1080 or higher" - "CPU", "AMD: Ryzen 5 or higher" - "", "Intel: Core i5 or higher" - "Network", "Host: CAT5e ethernet or better" - "", "Client: CAT5e ethernet or better" - -**HDR Suggestions** - -.. csv-table:: - :widths: 15, 60 - - "GPU", "AMD: Video Coding Engine 3.4 or higher" - "", "Intel: UHD Graphics 730 or higher" - "", "Nvidia: Pascal-based GPU (GTX 10-series) or higher" - "CPU", "AMD: todo" - "", "Intel: todo" - "Network", "Host: CAT5e ethernet or better" - "", "Client: CAT5e ethernet or better" - -Integrations ------------- - -.. image:: https://img.shields.io/github/actions/workflow/status/lizardbyte/sunshine/CI.yml.svg?branch=master&label=CI%20build&logo=github&style=for-the-badge - :alt: GitHub Workflow Status (CI) - :target: https://github.com/LizardByte/Sunshine/actions/workflows/CI.yml?query=branch%3Amaster - -.. image:: https://img.shields.io/github/actions/workflow/status/lizardbyte/sunshine/localize.yml.svg?branch=master&label=localize%20build&logo=github&style=for-the-badge - :alt: GitHub Workflow Status (localize) - :target: https://github.com/LizardByte/Sunshine/actions/workflows/localize.yml?query=branch%3Amaster - -.. image:: https://img.shields.io/readthedocs/sunshinestream.svg?label=Docs&style=for-the-badge&logo=readthedocs - :alt: Read the Docs - :target: http://sunshinestream.readthedocs.io/ - -.. image:: https://img.shields.io/codecov/c/gh/LizardByte/Sunshine?token=SMGXQ5NVMJ&style=for-the-badge&logo=codecov&label=codecov - :alt: Codecov - :target: https://codecov.io/gh/LizardByte/Sunshine - -Support -------- - -Our support methods are listed in our -`LizardByte Docs `__. - -Downloads ---------- - -.. image:: https://img.shields.io/github/downloads/lizardbyte/sunshine/total.svg?style=for-the-badge&logo=github - :alt: GitHub Releases - :target: https://github.com/LizardByte/Sunshine/releases/latest - -.. image:: https://img.shields.io/docker/pulls/lizardbyte/sunshine.svg?style=for-the-badge&logo=docker - :alt: Docker - :target: https://hub.docker.com/r/lizardbyte/sunshine - -.. image:: https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fraw.githubusercontent.com%2Fipitio%2Fghcr-pulls%2Fmaster%2Findex.json&query=%24%5B%3F(%40.owner%3D%3D%22LizardByte%22%20%26%26%20%40.repo%3D%3D%22Sunshine%22%20%26%26%20%40.image%3D%3D%22sunshine%22)%5D.pulls&label=ghcr%20pulls&style=for-the-badge&logo=github - :alt: GHCR - :target: https://github.com/LizardByte/Sunshine/pkgs/container/sunshine - -.. image:: https://img.shields.io/badge/dynamic/json.svg?color=orange&label=Winget&style=for-the-badge&prefix=v&query=$[-1:].name&url=https%3A%2F%2Fapi.github.com%2Frepos%2Fmicrosoft%2Fwinget-pkgs%2Fcontents%2Fmanifests%2Fl%2FLizardByte%2FSunshine&logo=microsoft - :alt: Winget Version - :target: https://github.com/microsoft/winget-pkgs/tree/master/manifests/l/LizardByte/Sunshine - -Stats ------- -.. image:: https://img.shields.io/github/stars/lizardbyte/sunshine.svg?logo=github&style=for-the-badge - :alt: GitHub stars - :target: https://github.com/LizardByte/Sunshine diff --git a/cmake/compile_definitions/common.cmake b/cmake/compile_definitions/common.cmake index f4a91a78ad0..a2260595c9a 100644 --- a/cmake/compile_definitions/common.cmake +++ b/cmake/compile_definitions/common.cmake @@ -6,12 +6,19 @@ list(APPEND SUNSHINE_COMPILE_OPTIONS -Wall -Wno-sign-compare) # Werror - treat warnings as errors # Wno-maybe-uninitialized/Wno-uninitialized - disable warnings for maybe uninitialized variables # Wno-sign-compare - disable warnings for signed/unsigned comparisons +# Wno-restrict - disable warnings for memory overlap if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU") # GCC specific compile options # GCC 12 and higher will complain about maybe-uninitialized if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 12) list(APPEND SUNSHINE_COMPILE_OPTIONS -Wno-maybe-uninitialized) + + # Disable the bogus warning that may prevent compilation (only for GCC 12). + # See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105651. + if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 13) + list(APPEND SUNSHINE_COMPILE_OPTIONS -Wno-restrict) + endif() endif() elseif(CMAKE_CXX_COMPILER_ID STREQUAL "Clang") # Clang specific compile options diff --git a/cmake/compile_definitions/linux.cmake b/cmake/compile_definitions/linux.cmake index e07c2a55d8f..d90f5dc655e 100644 --- a/cmake/compile_definitions/linux.cmake +++ b/cmake/compile_definitions/linux.cmake @@ -24,57 +24,42 @@ if(${SUNSHINE_ENABLE_CUDA}) # https://tech.amikelive.com/node-930/cuda-compatibility-of-nvidia-display-gpu-drivers/ if(CMAKE_CUDA_COMPILER_VERSION VERSION_LESS 6.5) list(APPEND CMAKE_CUDA_ARCHITECTURES 10) - # set(CUDA_NVCC_FLAGS "${CUDA_NVCC_FLAGS} -gencode arch=compute_10,code=sm_10") elseif(CMAKE_CUDA_COMPILER_VERSION VERSION_GREATER_EQUAL 6.5) list(APPEND CMAKE_CUDA_ARCHITECTURES 50 52) - # set(CUDA_NVCC_FLAGS "${CUDA_NVCC_FLAGS} -gencode arch=compute_50,code=sm_50") - # set(CUDA_NVCC_FLAGS "${CUDA_NVCC_FLAGS} -gencode arch=compute_52,code=sm_52") endif() if(CMAKE_CUDA_COMPILER_VERSION VERSION_LESS 7.0) list(APPEND CMAKE_CUDA_ARCHITECTURES 11) - # set(CUDA_NVCC_FLAGS "${CUDA_NVCC_FLAGS} -gencode arch=compute_11,code=sm_11") elseif(CMAKE_CUDA_COMPILER_VERSION VERSION_GREATER 7.6) list(APPEND CMAKE_CUDA_ARCHITECTURES 60 61 62) - # set(CUDA_NVCC_FLAGS "${CUDA_NVCC_FLAGS} -gencode arch=compute_60,code=sm_60") - # set(CUDA_NVCC_FLAGS "${CUDA_NVCC_FLAGS} -gencode arch=compute_61,code=sm_61") - # set(CUDA_NVCC_FLAGS "${CUDA_NVCC_FLAGS} -gencode arch=compute_62,code=sm_62") endif() + # https://docs.nvidia.com/cuda/archive/9.2/cuda-compiler-driver-nvcc/index.html if(CMAKE_CUDA_COMPILER_VERSION VERSION_LESS 9.0) list(APPEND CMAKE_CUDA_ARCHITECTURES 20) - # set(CUDA_NVCC_FLAGS "${CUDA_NVCC_FLAGS} -gencode arch=compute_20,code=sm_20") elseif(CMAKE_CUDA_COMPILER_VERSION VERSION_GREATER_EQUAL 9.0) list(APPEND CMAKE_CUDA_ARCHITECTURES 70) - # set(CUDA_NVCC_FLAGS "${CUDA_NVCC_FLAGS} -gencode arch=compute_70,code=sm_70") endif() + # https://docs.nvidia.com/cuda/archive/10.0/cuda-compiler-driver-nvcc/index.html if(CMAKE_CUDA_COMPILER_VERSION VERSION_GREATER_EQUAL 10.0) - list(APPEND CMAKE_CUDA_ARCHITECTURES 75) - # set(CUDA_NVCC_FLAGS "${CUDA_NVCC_FLAGS} -gencode arch=compute_75,code=sm_75") + list(APPEND CMAKE_CUDA_ARCHITECTURES 72 75) endif() + # https://docs.nvidia.com/cuda/archive/11.0/cuda-compiler-driver-nvcc/index.html if(CMAKE_CUDA_COMPILER_VERSION VERSION_LESS 11.0) list(APPEND CMAKE_CUDA_ARCHITECTURES 30) - # set(CUDA_NVCC_FLAGS "${CUDA_NVCC_FLAGS} -gencode arch=compute_30,code=sm_30") elseif(CMAKE_CUDA_COMPILER_VERSION VERSION_GREATER_EQUAL 11.0) list(APPEND CMAKE_CUDA_ARCHITECTURES 80) - # set(CUDA_NVCC_FLAGS "${CUDA_NVCC_FLAGS} -gencode arch=compute_80,code=sm_80") - endif() - - if(CMAKE_CUDA_COMPILER_VERSION VERSION_GREATER_EQUAL 11.1) - list(APPEND CMAKE_CUDA_ARCHITECTURES 86) - # set(CUDA_NVCC_FLAGS "${CUDA_NVCC_FLAGS} -gencode arch=compute_86,code=sm_86") endif() + # https://docs.nvidia.com/cuda/archive/11.8.0/cuda-compiler-driver-nvcc/index.html if(CMAKE_CUDA_COMPILER_VERSION VERSION_GREATER_EQUAL 11.8) - list(APPEND CMAKE_CUDA_ARCHITECTURES 90) - # set(CUDA_NVCC_FLAGS "${CUDA_NVCC_FLAGS} -gencode arch=compute_90,code=sm_90") + list(APPEND CMAKE_CUDA_ARCHITECTURES 86 87 89 90) endif() if(CMAKE_CUDA_COMPILER_VERSION VERSION_LESS 12.0) list(APPEND CMAKE_CUDA_ARCHITECTURES 35) - # set(CUDA_NVCC_FLAGS "${CUDA_NVCC_FLAGS} -gencode arch=compute_35,code=sm_35") endif() # sort the architectures diff --git a/cmake/packaging/linux.cmake b/cmake/packaging/linux.cmake index 5fa6d2dfb7c..25f3364c1c4 100644 --- a/cmake/packaging/linux.cmake +++ b/cmake/packaging/linux.cmake @@ -14,10 +14,14 @@ else() find_package(Systemd) find_package(Udev) - install(FILES "${SUNSHINE_SOURCE_ASSETS_DIR}/linux/misc/60-sunshine.rules" - DESTINATION "${UDEV_RULES_INSTALL_DIR}") - install(FILES "${CMAKE_CURRENT_BINARY_DIR}/sunshine.service" - DESTINATION "${SYSTEMD_USER_UNIT_INSTALL_DIR}") + if(UDEV_FOUND) + install(FILES "${SUNSHINE_SOURCE_ASSETS_DIR}/linux/misc/60-sunshine.rules" + DESTINATION "${UDEV_RULES_INSTALL_DIR}") + endif() + if(SYSTEMD_FOUND) + install(FILES "${CMAKE_CURRENT_BINARY_DIR}/sunshine.service" + DESTINATION "${SYSTEMD_USER_UNIT_INSTALL_DIR}") + endif() endif() # Post install diff --git a/cmake/targets/common.cmake b/cmake/targets/common.cmake index d8e5ce3c515..b086bdd73a4 100644 --- a/cmake/targets/common.cmake +++ b/cmake/targets/common.cmake @@ -63,7 +63,7 @@ add_custom_target(web-ui ALL # docs if(BUILD_DOCS) - add_subdirectory(docs) + add_subdirectory(third-party/doxyconfig docs) endif() # tests diff --git a/docker/clion-toolchain.dockerfile b/docker/clion-toolchain.dockerfile index 3ffd483fdbb..647a4bedd09 100644 --- a/docker/clion-toolchain.dockerfile +++ b/docker/clion-toolchain.dockerfile @@ -53,8 +53,6 @@ apt-get install -y --no-install-recommends \ libxfixes-dev \ libxrandr-dev \ libxtst-dev \ - python3.10 \ - python3.10-venv \ udev \ wget \ x11-xserver-utils \ diff --git a/docker/debian-bookworm.dockerfile b/docker/debian-bookworm.dockerfile index 481790577cf..8a6db148e21 100644 --- a/docker/debian-bookworm.dockerfile +++ b/docker/debian-bookworm.dockerfile @@ -11,9 +11,6 @@ ENV DEBIAN_FRONTEND=noninteractive FROM sunshine-base as sunshine-build -ARG TARGETPLATFORM -RUN echo "target_platform: ${TARGETPLATFORM}" - ARG BRANCH ARG BUILD_VERSION ARG COMMIT @@ -24,98 +21,20 @@ ENV BUILD_VERSION=${BUILD_VERSION} ENV COMMIT=${COMMIT} SHELL ["/bin/bash", "-o", "pipefail", "-c"] -# install dependencies -RUN <<_DEPS -#!/bin/bash -set -e -apt-get update -y -apt-get install -y --no-install-recommends \ - build-essential \ - cmake=3.25.* \ - doxygen \ - git \ - graphviz \ - libayatana-appindicator3-dev \ - libcap-dev \ - libcurl4-openssl-dev \ - libdrm-dev \ - libevdev-dev \ - libminiupnpc-dev \ - libnotify-dev \ - libnuma-dev \ - libopus-dev \ - libpulse-dev \ - libssl-dev \ - libva-dev \ - libvdpau-dev \ - libwayland-dev \ - libx11-dev \ - libxcb-shm0-dev \ - libxcb-xfixes0-dev \ - libxcb1-dev \ - libxfixes-dev \ - libxrandr-dev \ - libxtst-dev \ - nodejs \ - npm \ - python3.11 \ - python3.11-venv \ - udev \ - wget \ - x11-xserver-utils \ - xvfb -apt-get clean -rm -rf /var/lib/apt/lists/* -_DEPS - -# install cuda -WORKDIR /build/cuda -# versions: https://developer.nvidia.com/cuda-toolkit-archive -ENV CUDA_VERSION="12.0.0" -ENV CUDA_BUILD="525.60.13" -# hadolint ignore=SC3010 -RUN <<_INSTALL_CUDA -#!/bin/bash -set -e -cuda_prefix="https://developer.download.nvidia.com/compute/cuda/" -cuda_suffix="" -if [[ "${TARGETPLATFORM}" == 'linux/arm64' ]]; then - cuda_suffix="_sbsa" -fi -url="${cuda_prefix}${CUDA_VERSION}/local_installers/cuda_${CUDA_VERSION}_${CUDA_BUILD}_linux${cuda_suffix}.run" -echo "cuda url: ${url}" -wget "$url" --progress=bar:force:noscroll -q --show-progress -O ./cuda.run -chmod a+x ./cuda.run -./cuda.run --silent --toolkit --toolkitpath=/build/cuda --no-opengl-libs --no-man-page --no-drm -rm ./cuda.run -_INSTALL_CUDA # copy repository WORKDIR /build/sunshine/ COPY --link .. . -# setup build directory -WORKDIR /build/sunshine/build - # cmake and cpack -RUN <<_MAKE +RUN <<_BUILD #!/bin/bash set -e -cmake \ - -DBUILD_WERROR=ON \ - -DCMAKE_CUDA_COMPILER:PATH=/build/cuda/bin/nvcc \ - -DCMAKE_BUILD_TYPE=Release \ - -DCMAKE_INSTALL_PREFIX=/usr \ - -DSUNSHINE_ASSETS_DIR=share/sunshine \ - -DSUNSHINE_EXECUTABLE_PATH=/usr/bin/sunshine \ - -DSUNSHINE_ENABLE_WAYLAND=ON \ - -DSUNSHINE_ENABLE_X11=ON \ - -DSUNSHINE_ENABLE_DRM=ON \ - -DSUNSHINE_ENABLE_CUDA=ON \ - /build/sunshine -make -j "$(nproc)" -cpack -G DEB -_MAKE +chmod +x ./scripts/linux_build.sh +./scripts/linux_build.sh --sudo-off +apt-get clean +rm -rf /var/lib/apt/lists/* +_BUILD # run tests WORKDIR /build/sunshine/build/tests diff --git a/docker/fedora-39.dockerfile b/docker/fedora-39.dockerfile index 40d45ed152f..e50fffdbc38 100644 --- a/docker/fedora-39.dockerfile +++ b/docker/fedora-39.dockerfile @@ -9,9 +9,6 @@ FROM ${BASE}:${TAG} AS sunshine-base FROM sunshine-base as sunshine-build -ARG TARGETPLATFORM -RUN echo "target_platform: ${TARGETPLATFORM}" - ARG BRANCH ARG BUILD_VERSION ARG COMMIT @@ -22,105 +19,20 @@ ENV BUILD_VERSION=${BUILD_VERSION} ENV COMMIT=${COMMIT} SHELL ["/bin/bash", "-o", "pipefail", "-c"] -# install dependencies -# hadolint ignore=DL3041 -RUN <<_DEPS -#!/bin/bash -set -e -dnf -y update -dnf -y group install "Development Tools" -dnf -y install \ - cmake-3.27.* \ - gcc-13.2.* \ - gcc-c++-13.2.* \ - git \ - libappindicator-gtk3-devel \ - libcap-devel \ - libcurl-devel \ - libdrm-devel \ - libevdev-devel \ - libnotify-devel \ - libva-devel \ - libvdpau-devel \ - libX11-devel \ - libxcb-devel \ - libXcursor-devel \ - libXfixes-devel \ - libXi-devel \ - libXinerama-devel \ - libXrandr-devel \ - libXtst-devel \ - mesa-libGL-devel \ - miniupnpc-devel \ - nodejs \ - numactl-devel \ - openssl-devel \ - opus-devel \ - pulseaudio-libs-devel \ - rpm-build \ - wget \ - which \ - xorg-x11-server-Xvfb -dnf clean all -rm -rf /var/cache/yum -_DEPS - -# install cuda -WORKDIR /build/cuda -# versions: https://developer.nvidia.com/cuda-toolkit-archive -ENV CUDA_VERSION="12.4.0" -ENV CUDA_BUILD="550.54.14" -# hadolint ignore=SC3010 -RUN <<_INSTALL_CUDA -#!/bin/bash -set -e -cuda_prefix="https://developer.download.nvidia.com/compute/cuda/" -cuda_suffix="" -if [[ "${TARGETPLATFORM}" == 'linux/arm64' ]]; then - cuda_suffix="_sbsa" - - # patch headers https://bugs.launchpad.net/ubuntu/+source/mumax3/+bug/2032624 - sed -i 's/__Float32x4_t/int/g' /usr/include/bits/math-vector.h - sed -i 's/__Float64x2_t/int/g' /usr/include/bits/math-vector.h - sed -i 's/__SVFloat32_t/float/g' /usr/include/bits/math-vector.h - sed -i 's/__SVFloat64_t/float/g' /usr/include/bits/math-vector.h - sed -i 's/__SVBool_t/int/g' /usr/include/bits/math-vector.h -fi -url="${cuda_prefix}${CUDA_VERSION}/local_installers/cuda_${CUDA_VERSION}_${CUDA_BUILD}_linux${cuda_suffix}.run" -echo "cuda url: ${url}" -wget "$url" --progress=bar:force:noscroll -q --show-progress -O ./cuda.run -chmod a+x ./cuda.run -./cuda.run --silent --toolkit --toolkitpath=/build/cuda --no-opengl-libs --no-man-page --no-drm -rm ./cuda.run -_INSTALL_CUDA # copy repository WORKDIR /build/sunshine/ COPY --link .. . -# setup build directory -WORKDIR /build/sunshine/build - # cmake and cpack -RUN <<_MAKE +RUN <<_BUILD #!/bin/bash set -e -cmake \ - -DCMAKE_CUDA_COMPILER:PATH=/build/cuda/bin/nvcc \ - -DBUILD_DOCS=OFF \ - -DBUILD_WERROR=ON \ - -DCMAKE_BUILD_TYPE=Release \ - -DCMAKE_INSTALL_PREFIX=/usr \ - -DSUNSHINE_ASSETS_DIR=share/sunshine \ - -DSUNSHINE_EXECUTABLE_PATH=/usr/bin/sunshine \ - -DSUNSHINE_ENABLE_WAYLAND=ON \ - -DSUNSHINE_ENABLE_X11=ON \ - -DSUNSHINE_ENABLE_DRM=ON \ - -DSUNSHINE_ENABLE_CUDA=ON \ - /build/sunshine -make -j "$(nproc)" -cpack -G RPM -_MAKE +chmod +x ./scripts/linux_build.sh +./scripts/linux_build.sh --sudo-off +dnf clean all +rm -rf /var/cache/yum +_BUILD # run tests WORKDIR /build/sunshine/build/tests diff --git a/docker/fedora-40.dockerfile b/docker/fedora-40.dockerfile index c97f81d2f06..24735eef0e4 100644 --- a/docker/fedora-40.dockerfile +++ b/docker/fedora-40.dockerfile @@ -9,9 +9,6 @@ FROM ${BASE}:${TAG} AS sunshine-base FROM sunshine-base as sunshine-build -ARG TARGETPLATFORM -RUN echo "target_platform: ${TARGETPLATFORM}" - ARG BRANCH ARG BUILD_VERSION ARG COMMIT @@ -22,109 +19,20 @@ ENV BUILD_VERSION=${BUILD_VERSION} ENV COMMIT=${COMMIT} SHELL ["/bin/bash", "-o", "pipefail", "-c"] -# install dependencies -# hadolint ignore=DL3041 -RUN <<_DEPS -#!/bin/bash -set -e -dnf -y update -dnf -y group install "Development Tools" -dnf -y install \ - cmake-3.28.* \ - doxygen \ - gcc-14.1.* \ - gcc-c++-14.1.* \ - git \ - graphviz \ - libappindicator-gtk3-devel \ - libcap-devel \ - libcurl-devel \ - libdrm-devel \ - libevdev-devel \ - libnotify-devel \ - libva-devel \ - libvdpau-devel \ - libX11-devel \ - libxcb-devel \ - libXcursor-devel \ - libXfixes-devel \ - libXi-devel \ - libXinerama-devel \ - libXrandr-devel \ - libXtst-devel \ - mesa-libGL-devel \ - miniupnpc-devel \ - nodejs \ - numactl-devel \ - openssl-devel \ - opus-devel \ - pulseaudio-libs-devel \ - python3.11 \ - rpm-build \ - wget \ - which \ - xorg-x11-server-Xvfb -dnf clean all -rm -rf /var/cache/yum -_DEPS - -# TODO: re-enable cuda once cuda supports gcc-14 -## install cuda -#WORKDIR /build/cuda -## versions: https://developer.nvidia.com/cuda-toolkit-archive -#ENV CUDA_VERSION="12.4.0" -#ENV CUDA_BUILD="550.54.14" -## hadolint ignore=SC3010 -#RUN <<_INSTALL_CUDA -##!/bin/bash -#set -e -#cuda_prefix="https://developer.download.nvidia.com/compute/cuda/" -#cuda_suffix="" -#if [[ "${TARGETPLATFORM}" == 'linux/arm64' ]]; then -# cuda_suffix="_sbsa" -# -# # patch headers https://bugs.launchpad.net/ubuntu/+source/mumax3/+bug/2032624 -# sed -i 's/__Float32x4_t/int/g' /usr/include/bits/math-vector.h -# sed -i 's/__Float64x2_t/int/g' /usr/include/bits/math-vector.h -# sed -i 's/__SVFloat32_t/float/g' /usr/include/bits/math-vector.h -# sed -i 's/__SVFloat64_t/float/g' /usr/include/bits/math-vector.h -# sed -i 's/__SVBool_t/int/g' /usr/include/bits/math-vector.h -#fi -#url="${cuda_prefix}${CUDA_VERSION}/local_installers/cuda_${CUDA_VERSION}_${CUDA_BUILD}_linux${cuda_suffix}.run" -#echo "cuda url: ${url}" -#wget "$url" --progress=bar:force:noscroll -q --show-progress -O ./cuda.run -#chmod a+x ./cuda.run -#./cuda.run --silent --toolkit --toolkitpath=/build/cuda --no-opengl-libs --no-man-page --no-drm -#rm ./cuda.run -#_INSTALL_CUDA # copy repository WORKDIR /build/sunshine/ COPY --link .. . -# setup build directory -WORKDIR /build/sunshine/build - -# TODO: re-add as first cmake argument: -DCMAKE_CUDA_COMPILER:PATH=/build/cuda/bin/nvcc \ -# TODO: enable cuda flag # cmake and cpack -RUN <<_MAKE +RUN <<_BUILD #!/bin/bash set -e -cmake \ - -DBUILD_WERROR=ON \ - -DCMAKE_BUILD_TYPE=Release \ - -DCMAKE_INSTALL_PREFIX=/usr \ - -DSUNSHINE_ASSETS_DIR=share/sunshine \ - -DSUNSHINE_EXECUTABLE_PATH=/usr/bin/sunshine \ - -DSUNSHINE_ENABLE_WAYLAND=ON \ - -DSUNSHINE_ENABLE_X11=ON \ - -DSUNSHINE_ENABLE_DRM=ON \ - -DSUNSHINE_ENABLE_CUDA=OFF \ - /build/sunshine -make -j "$(nproc)" -cpack -G RPM -_MAKE +chmod +x ./scripts/linux_build.sh +./scripts/linux_build.sh --sudo-off +dnf clean all +rm -rf /var/cache/yum +_BUILD # run tests WORKDIR /build/sunshine/build/tests diff --git a/docker/ubuntu-22.04.dockerfile b/docker/ubuntu-22.04.dockerfile index 9ccf75687dd..bfb2c3d0677 100644 --- a/docker/ubuntu-22.04.dockerfile +++ b/docker/ubuntu-22.04.dockerfile @@ -11,9 +11,6 @@ ENV DEBIAN_FRONTEND=noninteractive FROM sunshine-base as sunshine-build -ARG TARGETPLATFORM -RUN echo "target_platform: ${TARGETPLATFORM}" - ARG BRANCH ARG BUILD_VERSION ARG COMMIT @@ -24,134 +21,20 @@ ENV BUILD_VERSION=${BUILD_VERSION} ENV COMMIT=${COMMIT} SHELL ["/bin/bash", "-o", "pipefail", "-c"] -# install dependencies -RUN <<_DEPS -#!/bin/bash -set -e -apt-get update -y -apt-get install -y --no-install-recommends \ - build-essential \ - cmake=3.22.* \ - ca-certificates \ - doxygen \ - git \ - graphviz \ - libayatana-appindicator3-dev \ - libcap-dev \ - libcurl4-openssl-dev \ - libdrm-dev \ - libevdev-dev \ - libminiupnpc-dev \ - libnotify-dev \ - libnuma-dev \ - libopus-dev \ - libpulse-dev \ - libssl-dev \ - libva-dev \ - libvdpau-dev \ - libwayland-dev \ - libx11-dev \ - libxcb-shm0-dev \ - libxcb-xfixes0-dev \ - libxcb1-dev \ - libxfixes-dev \ - libxrandr-dev \ - libxtst-dev \ - python3.10 \ - python3.10-venv \ - udev \ - wget \ - x11-xserver-utils \ - xvfb -apt-get clean -rm -rf /var/lib/apt/lists/* -_DEPS - -# install cmake -# sunshine requires cmake >= 3.25 -WORKDIR /build/cmake -# https://cmake.org/download/ -ENV CMAKE_VERSION="3.30.1" -# hadolint ignore=SC3010 -RUN <<_INSTALL_CMAKE -#!/bin/bash -cmake_prefix="https://github.com/Kitware/CMake/releases/download/v" -if [[ "${TARGETPLATFORM}" == 'linux/amd64' ]]; then - cmake_arch="x86_64" -elif [[ "${TARGETPLATFORM}" == 'linux/arm64' ]]; then - cmake_arch="aarch64" -fi -url="${cmake_prefix}${CMAKE_VERSION}/cmake-${CMAKE_VERSION}-linux-${cmake_arch}.sh" -echo "cmake url: ${url}" -wget "$url" --progress=bar:force:noscroll -q --show-progress -O ./cmake.sh -sh ./cmake.sh --prefix=/usr/local --skip-license -cmake --version -_INSTALL_CMAKE - -#Install Node -# hadolint ignore=SC1091 -RUN <<_INSTALL_NODE -#!/bin/bash -set -e -wget -qO- https://raw.githubusercontent.com/nvm-sh/nvm/master/install.sh | bash -source "$HOME/.nvm/nvm.sh" -nvm install 20.9.0 -nvm use 20.9.0 -_INSTALL_NODE - -# install cuda -WORKDIR /build/cuda -# versions: https://developer.nvidia.com/cuda-toolkit-archive -ENV CUDA_VERSION="11.8.0" -ENV CUDA_BUILD="520.61.05" -# hadolint ignore=SC3010 -RUN <<_INSTALL_CUDA -#!/bin/bash -set -e -cuda_prefix="https://developer.download.nvidia.com/compute/cuda/" -cuda_suffix="" -if [[ "${TARGETPLATFORM}" == 'linux/arm64' ]]; then - cuda_suffix="_sbsa" -fi -url="${cuda_prefix}${CUDA_VERSION}/local_installers/cuda_${CUDA_VERSION}_${CUDA_BUILD}_linux${cuda_suffix}.run" -echo "cuda url: ${url}" -wget "$url" --progress=bar:force:noscroll -q --show-progress -O ./cuda.run -chmod a+x ./cuda.run -./cuda.run --silent --toolkit --toolkitpath=/build/cuda --no-opengl-libs --no-man-page --no-drm -rm ./cuda.run -_INSTALL_CUDA # copy repository WORKDIR /build/sunshine/ COPY --link .. . -# setup build directory -WORKDIR /build/sunshine/build - # cmake and cpack -# hadolint ignore=SC1091 -RUN <<_MAKE +RUN <<_BUILD #!/bin/bash set -e -#Set Node version -source "$HOME/.nvm/nvm.sh" -nvm use 20.9.0 -#Actually build -cmake \ - -DBUILD_WERROR=ON \ - -DCMAKE_CUDA_COMPILER:PATH=/build/cuda/bin/nvcc \ - -DCMAKE_BUILD_TYPE=Release \ - -DCMAKE_INSTALL_PREFIX=/usr \ - -DSUNSHINE_ASSETS_DIR=share/sunshine \ - -DSUNSHINE_EXECUTABLE_PATH=/usr/bin/sunshine \ - -DSUNSHINE_ENABLE_WAYLAND=ON \ - -DSUNSHINE_ENABLE_X11=ON \ - -DSUNSHINE_ENABLE_DRM=ON \ - -DSUNSHINE_ENABLE_CUDA=ON \ - /build/sunshine -make -j "$(nproc)" -cpack -G DEB -_MAKE +chmod +x ./scripts/linux_build.sh +./scripts/linux_build.sh --sudo-off +apt-get clean +rm -rf /var/lib/apt/lists/* +_BUILD # run tests WORKDIR /build/sunshine/build/tests diff --git a/docker/ubuntu-24.04.dockerfile b/docker/ubuntu-24.04.dockerfile index 765a6b85f31..cbadaa62090 100644 --- a/docker/ubuntu-24.04.dockerfile +++ b/docker/ubuntu-24.04.dockerfile @@ -1,6 +1,6 @@ # syntax=docker/dockerfile:1.4 # artifacts: true -# platforms: linux/amd64 +# platforms: linux/amd64,linux/arm64/v8 # platforms_pr: linux/amd64 # no-cache-filters: sunshine-base,artifacts,sunshine ARG BASE=ubuntu @@ -11,9 +11,6 @@ ENV DEBIAN_FRONTEND=noninteractive FROM sunshine-base as sunshine-build -ARG TARGETPLATFORM -RUN echo "target_platform: ${TARGETPLATFORM}" - ARG BRANCH ARG BUILD_VERSION ARG COMMIT @@ -24,129 +21,20 @@ ENV BUILD_VERSION=${BUILD_VERSION} ENV COMMIT=${COMMIT} SHELL ["/bin/bash", "-o", "pipefail", "-c"] -# install dependencies -RUN <<_DEPS -#!/bin/bash -set -e -apt-get update -y -apt-get install -y --no-install-recommends \ - build-essential \ - cmake=3.28.* \ - ca-certificates \ - doxygen \ - gcc-11 \ - g++-11 \ - git \ - graphviz \ - libayatana-appindicator3-dev \ - libcap-dev \ - libcurl4-openssl-dev \ - libdrm-dev \ - libevdev-dev \ - libminiupnpc-dev \ - libnotify-dev \ - libnuma-dev \ - libopus-dev \ - libpulse-dev \ - libssl-dev \ - libva-dev \ - libvdpau-dev \ - libwayland-dev \ - libx11-dev \ - libxcb-shm0-dev \ - libxcb-xfixes0-dev \ - libxcb1-dev \ - libxfixes-dev \ - libxrandr-dev \ - libxtst-dev \ - python3.12 \ - python3.12-venv \ - udev \ - wget \ - x11-xserver-utils \ - xvfb -apt-get clean -rm -rf /var/lib/apt/lists/* -_DEPS - - -#Install Node -# hadolint ignore=SC1091 -RUN <<_INSTALL_NODE -#!/bin/bash -set -e -wget -qO- https://raw.githubusercontent.com/nvm-sh/nvm/master/install.sh | bash -source "$HOME/.nvm/nvm.sh" -nvm install 20.9.0 -nvm use 20.9.0 -_INSTALL_NODE - -# Update gcc alias -# https://stackoverflow.com/a/70653945/11214013 -RUN <<_GCC_ALIAS -#!/bin/bash -set -e -update-alternatives --install \ - /usr/bin/gcc gcc /usr/bin/gcc-11 100 \ - --slave /usr/bin/g++ g++ /usr/bin/g++-11 \ - --slave /usr/bin/gcov gcov /usr/bin/gcov-11 \ - --slave /usr/bin/gcc-ar gcc-ar /usr/bin/gcc-ar-11 \ - --slave /usr/bin/gcc-ranlib gcc-ranlib /usr/bin/gcc-ranlib-11 -_GCC_ALIAS - -# install cuda -WORKDIR /build/cuda -# versions: https://developer.nvidia.com/cuda-toolkit-archive -ENV CUDA_VERSION="11.8.0" -ENV CUDA_BUILD="520.61.05" -# hadolint ignore=SC3010 -RUN <<_INSTALL_CUDA -#!/bin/bash -set -e -cuda_prefix="https://developer.download.nvidia.com/compute/cuda/" -cuda_suffix="" -if [[ "${TARGETPLATFORM}" == 'linux/arm64' ]]; then - cuda_suffix="_sbsa" -fi -url="${cuda_prefix}${CUDA_VERSION}/local_installers/cuda_${CUDA_VERSION}_${CUDA_BUILD}_linux${cuda_suffix}.run" -echo "cuda url: ${url}" -wget "$url" --progress=bar:force:noscroll -q --show-progress -O ./cuda.run -chmod a+x ./cuda.run -./cuda.run --silent --toolkit --toolkitpath=/build/cuda --no-opengl-libs --no-man-page --no-drm -rm ./cuda.run -_INSTALL_CUDA # copy repository WORKDIR /build/sunshine/ COPY --link .. . -# setup build directory -WORKDIR /build/sunshine/build - # cmake and cpack -# hadolint ignore=SC1091 -RUN <<_MAKE +RUN <<_BUILD #!/bin/bash set -e -#Set Node version -source "$HOME/.nvm/nvm.sh" -nvm use 20.9.0 -#Actually build -cmake \ - -DBUILD_WERROR=ON \ - -DCMAKE_CUDA_COMPILER:PATH=/build/cuda/bin/nvcc \ - -DCMAKE_BUILD_TYPE=Release \ - -DCMAKE_INSTALL_PREFIX=/usr \ - -DSUNSHINE_ASSETS_DIR=share/sunshine \ - -DSUNSHINE_EXECUTABLE_PATH=/usr/bin/sunshine \ - -DSUNSHINE_ENABLE_WAYLAND=ON \ - -DSUNSHINE_ENABLE_X11=ON \ - -DSUNSHINE_ENABLE_DRM=ON \ - -DSUNSHINE_ENABLE_CUDA=ON \ - /build/sunshine -make -j "$(nproc)" -cpack -G DEB -_MAKE +chmod +x ./scripts/linux_build.sh +./scripts/linux_build.sh --sudo-off +apt-get clean +rm -rf /var/lib/apt/lists/* +_BUILD # run tests WORKDIR /build/sunshine/build/tests diff --git a/docs/CMakeLists.txt b/docs/CMakeLists.txt deleted file mode 100644 index 31d0f48cc96..00000000000 --- a/docs/CMakeLists.txt +++ /dev/null @@ -1,126 +0,0 @@ -cmake_minimum_required(VERSION 3.19) - -# find doxygen and graphviz -find_package(Doxygen - REQUIRED dot) - -if(POLICY CMP0094) # https://cmake.org/cmake/help/latest/policy/CMP0094.html - cmake_policy(SET CMP0094 NEW) # FindPython should return the first matching Python -endif() - -# needed on GitHub Actions CI: actions/setup-python does not touch registry/frameworks on Windows/macOS -# this mirrors PythonInterp behavior which did not consult registry/frameworks first -if(NOT DEFINED Python_FIND_REGISTRY) - set(Python_FIND_REGISTRY "LAST") # cmake-lint: disable=C0103 -endif() -if(NOT DEFINED Python_FIND_FRAMEWORK) - set(Python_FIND_FRAMEWORK "LAST") # cmake-lint: disable=C0103 -endif() - -# find python -if(NOT DEFINED Python_EXECUTABLE) - find_package(Python3 3.9 REQUIRED COMPONENTS Interpreter) -else() - set(Python3_EXECUTABLE "${Python_EXECUTABLE}") # cmake-lint: disable=C0103 - message(STATUS "Using Python3_EXECUTABLE: ${Python3_EXECUTABLE}") -endif() - -# create venv in build dir -set(VENV_DIR "${CMAKE_BINARY_DIR}/venv") - -# create venv -execute_process( - COMMAND ${Python3_EXECUTABLE} -m venv ${VENV_DIR} - COMMAND_ERROR_IS_FATAL LAST - RESULT_VARIABLE VENV_RESULT -) - -unset(Python3_EXECUTABLE) - -set(VENV_PATTERNS - ${VENV_DIR}/bin/python - ${VENV_DIR}/bin/python.exe - ${VENV_DIR}/Scripts/python.exe -) - -# set Python3_EXECUTABLE to the python interpreter in the venv -foreach(pattern ${VENV_PATTERNS}) - if(EXISTS ${pattern}) - set(Python3_EXECUTABLE "${pattern}") # cmake-lint: disable=C0103 - get_filename_component(Python3_ROOT_DIR ${pattern} DIRECTORY) - message(STATUS "Using Python3_EXECUTABLE (venv): ${Python3_EXECUTABLE}") - message(STATUS "Using Python3_ROOT_DIR (venv): ${Python3_ROOT_DIR}") - break() - endif() -endforeach() - -# fail if Python3_ROOT_DIR is not set -if(NOT DEFINED Python3_EXECUTABLE) - message(FATAL_ERROR "Unable to setup python venv") -endif() - -# call a simple python command -execute_process( - COMMAND ${Python3_EXECUTABLE} -c "print(' Testing Python3_EXECUTABLE')" - COMMAND_ERROR_IS_FATAL ANY - RESULT_VARIABLE PYTHON_RESULT -) - -# fail if the python command failed -if(NOT PYTHON_RESULT EQUAL 0) - message(FATAL_ERROR "Python3_EXECUTABLE failed") -endif() - -# install doc requirements -execute_process( - COMMAND ${Python3_EXECUTABLE} -m pip install -r ${CMAKE_CURRENT_SOURCE_DIR}/requirements.txt - COMMAND_ERROR_IS_FATAL ANY - RESULT_VARIABLE PIP_RESULT -) - -# rst check -set(RST_PATTERNS - ${CMAKE_CURRENT_SOURCE_DIR} - ${CMAKE_SOURCE_DIR}/README.rst -) - -# check rst files -foreach(pattern ${RST_PATTERNS}) - message(STATUS "Checking RST files: ${pattern}") - execute_process( - COMMAND "${Python3_ROOT_DIR}/rstcheck" -r "${pattern}" - COMMAND_ERROR_IS_FATAL ANY - RESULT_VARIABLE RST_RESULT - WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} - ) -endforeach() - -# commands -list(APPEND SPHINX_BUILD_HTML_COMMAND - "${Python3_ROOT_DIR}/sphinx-build" - "-M" - "html" - "${CMAKE_CURRENT_SOURCE_DIR}/source" - "${CMAKE_CURRENT_BINARY_DIR}/build/html" - "-W" - "--keep-going" -) - -list(APPEND SPHINX_BUILD_EPUB_COMMAND - "${Python3_ROOT_DIR}/sphinx-build" - "-M" - "epub" - "${CMAKE_CURRENT_SOURCE_DIR}/source" - "${CMAKE_CURRENT_BINARY_DIR}/build/epub" - "-W" - "--keep-going" -) - -# build docs -add_custom_target(docs ALL - WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}" - COMMENT "Building documentation" - COMMAND ${CMAKE_COMMAND} -E env DOXY_PATH=$ ${SPHINX_BUILD_HTML_COMMAND} - COMMAND ${CMAKE_COMMAND} -E env DOXY_PATH=$ ${SPHINX_BUILD_EPUB_COMMAND} - VERBATIM -) diff --git a/docs/Doxyfile b/docs/Doxyfile index 05903d7c317..1333aa511aa 100644 --- a/docs/Doxyfile +++ b/docs/Doxyfile @@ -21,82 +21,39 @@ # replacement variables: # doxygen -x_noenv [configFile] -# must be first -DOXYFILE_ENCODING = UTF-8 - -ALIASES = "" -ALIASES += "examples=^^**Examples**^^@code{.cpp}" -ALIASES += "examples_end=@endcode^^" -ALIASES += "rst=^^\verbatim embed:rst:leading-asterisk^^" -ALIASES += "rst_end=\endverbatim" - -CASE_SENSE_NAMES = YES -DISABLE_INDEX = NO -DOCBOOK_OUTPUT = doxydocbook +# project metadata DOCSET_BUNDLE_ID = dev.lizardbyte.Sunshine DOCSET_PUBLISHER_ID = dev.lizardbyte.Sunshine.documentation -DOCSET_PUBLISHER_NAME = LizardByte -DOT_GRAPH_MAX_NODES = 60 -DOT_IMAGE_FORMAT = svg - -# TODO: On Windows, Doxygen hangs when creating dot graphs if this is set to 0 -DOT_NUM_THREADS = 1 - -EXTRACT_ALL = NO -FULL_SIDEBAR = NO -GENERATE_HTML = YES -GENERATE_LATEX = NO -GENERATE_TREEVIEW = YES - -# TODO: Sphinx/Breathe does not support Objective-C right now, so disable XML -# https://github.com/breathe-doc/breathe/issues/129 -GENERATE_XML = NO - -HAVE_DOT = YES -HTML_COLORSTYLE = LIGHT # required with Doxygen >= 1.9.5 -HTML_COPY_CLIPBOARD = NO # required for Doxygen >= 1.10.0 -HTML_EXTRA_FILES = ../third-party/doxygen-awesome-css/doxygen-awesome-darkmode-toggle.js -HTML_EXTRA_FILES += ../third-party/doxygen-awesome-css/doxygen-awesome-fragment-copy-button.js -HTML_EXTRA_FILES += ../third-party/doxygen-awesome-css/doxygen-awesome-paragraph-link.js -HTML_EXTRA_FILES += ../third-party/doxygen-awesome-css/doxygen-awesome-interactive-toc.js -HTML_EXTRA_STYLESHEET = ../third-party/doxygen-awesome-css/doxygen-awesome.css -HTML_HEADER = doxygen/header.html -HTML_OUTPUT = doxyhtml -INCLUDE_PATH = ../third-party/build-deps/ffmpeg/Linux-x86_64/include/ -INPUT = ../src -INTERACTIVE_SVG = YES -LATEX_OUTPUT = doxylatex -MACRO_EXPANSION = YES -MAN_OUTPUT = doxyman -NUM_PROC_THREADS = 1 -PREDEFINED = DOXYGEN -PREDEFINED += __APPLE__ -PREDEFINED += linux -PREDEFINED += __linux -PREDEFINED += __linux__ -PREDEFINED += __MACH__ -PREDEFINED += _WIN32 -PREDEFINED += SUNSHINE_BUILD_WAYLAND -PREDEFINED += SUNSHINE_TRAY=1 PROJECT_BRIEF = "Self-hosted game stream host for Moonlight." PROJECT_ICON = ../sunshine.ico PROJECT_LOGO = ../sunshine.png PROJECT_NAME = Sunshine -OUTPUT_DIRECTORY = build/doxygen -RECURSIVE = YES -RTF_OUTPUT = doxyrtf -SORT_BRIEF_DOCS = YES -STRIP_FROM_INC_PATH = ../ -STRIP_FROM_PATH = ../ -WARN_AS_ERROR = FAIL_ON_WARNINGS + +# project specific settings +DOT_GRAPH_MAX_NODES = 60 +IMAGE_PATH = ../docs/images +INCLUDE_PATH = ../third-party/build-deps/ffmpeg/Linux-x86_64/include/ +PREDEFINED += SUNSHINE_BUILD_WAYLAND +PREDEFINED += SUNSHINE_TRAY=1 # TODO: Enable this when we have complete documentation WARN_IF_UNDOCUMENTED = NO -WARN_IF_DOC_ERROR = YES -WARN_IF_INCOMPLETE_DOC = YES -WARN_IF_UNDOC_ENUM_VAL = YES -WARN_NO_PARAMDOC = YES -WARNINGS = YES - -XML_OUTPUT = doxyxml +# files and directories to process +USE_MDFILE_AS_MAINPAGE = ../README.md +INPUT = ../README.md \ + getting_started.md \ + changelog.md \ + ../DOCKER_README.md \ + third_party_packages.md \ + gamestream_migration.md \ + legal.md \ + configuration.md \ + app_examples.md \ + guides.md \ + performance_tuning.md \ + troubleshooting.md \ + building.md \ + contributing.md \ + ../third-party/doxyconfig/docs/source_code.md \ + ../src diff --git a/docs/Makefile b/docs/Makefile deleted file mode 100644 index 8b6275ab8cc..00000000000 --- a/docs/Makefile +++ /dev/null @@ -1,20 +0,0 @@ -# Minimal makefile for Sphinx documentation -# - -# You can set these variables from the command line, and also -# from the environment for the first two. -SPHINXOPTS ?= -W --keep-going -SPHINXBUILD ?= sphinx-build -SOURCEDIR = source -BUILDDIR = build - -# Put it first so that "make" without argument is like "make help". -help: - @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) - -.PHONY: help Makefile - -# Catch-all target: route all unknown targets to Sphinx using the new -# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). -%: Makefile - @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) diff --git a/docs/app_examples.md b/docs/app_examples.md new file mode 100644 index 00000000000..990064de036 --- /dev/null +++ b/docs/app_examples.md @@ -0,0 +1,325 @@ +# App Examples +Since not all applications behave the same, we decided to create some examples to help you get started adding games +and applications to Sunshine. + +@attention{Throughout these examples, any fields not shown are left blank. You can enhance your experience by +adding an image or a log file (via the `Output` field).} + +@note{When a working directory is not specified, it defaults to the folder where the target application resides.} + + +## Common Examples + +### Desktop + +| Field | Value | +|------------------|----------------------------| +| Application Name | @code{}Desktop@endcode | +| Image | @code{}desktop.png@endcode | + +### Steam Big Picture +@note{Steam is launched as a detached command because Steam starts with a process that self updates itself and the original +process is killed.} + +@tabs{ + @tab{Linux | + \| Field \| Value \| + \|-------------------\|-----------------------------------------------------\| + \| Application Name \| @code{}Steam Big Picture@endcode \| + \| Detached Commands \| @code{}setsid steam steam://open/bigpicture@endcode \| + \| Image \| @code{}steam.png@endcode \| + } + @tab{macOS | + \| Field \| Value \| + \|-------------------\|---------------------------------------------------\| + \| Application Name \| @code{}Steam Big Picture@endcode \| + \| Detached Commands \| @code{}open steam steam://open/bigpicture@endcode \| + \| Image \| @code{}steam.png@endcode \| + } + @tab{Windows | + \| Field \| Value \| + \|-------------------\|----------------------------------------\| + \| Application Name \| @code{}Steam Big Picture@endcode \| + \| Detached Commands \| @code{}steam://open/bigpicture@endcode \| + \| Image \| @code{}steam.png@endcode \| + } +} + +### Epic Game Store game +@note{Using URI method will be the most consistent between various games.} + +#### URI + +@tabs{ + @tab{Windows | + \| Field \| Value \| + \|------------------\|-------------------------------------------------------------------------------------------------------------------------------------------------------\| + \| Application Name \| @code{}Surviving Mars@endcode \| + \| Commands \| @code{}com.epicgames.launcher://apps/d759128018124dcabb1fbee9bb28e178%3A20729b9176c241f0b617c5723e70ec2d%3AOvenbird?action=launch&silent=true@endcode \| + } +} + +#### Binary (w/ working directory +@tabs{ + @tab{Windows | + \| Field \| Value \| + \|-------------------\|------------------------------------------------------------\| + \| Application Name \| @code{}Surviving Mars@endcode \| + \| Command \| @code{}MarsEpic.exe@endcode \| + \| Working Directory \| @code{}"C:\Program Files\Epic Games\SurvivingMars"@endcode \| + } +} + +#### Binary (w/o working directory) +@tabs{ + @tab{Windows | + \| Field \| Value \| + \|-------------------\|-------------------------------------------------------------------------\| + \| Application Name \| @code{}Surviving Mars@endcode \| + \| Command \| @code{}"C:\Program Files\Epic Games\SurvivingMars\MarsEpic.exe"@endcode \| + } +} + +### Steam game +@note{Using URI method will be the most consistent between various games.} + +#### URI + +@tabs{ + @tab{Linux | + \| Field \| Value \| + \|-------------------\|------------------------------------------------------\| + \| Application Name \| @code{}Surviving Mars@endcode \| + \| Detached Commands \| @code{}setsid steam steam://rungameid/464920@endcode \| + } + @tab{macOS | + \| Field \| Value \| + \|-------------------\|----------------------------------------------\| + \| Application Name \| @code{}Surviving Mars@endcode \| + \| Detached Commands \| @code{}open steam://rungameid/464920@endcode \| + } + @tab{Windows | + \| Field \| Value \| + \|-------------------\|-----------------------------------------\| + \| Application Name \| @code{}Surviving Mars@endcode \| + \| Detached Commands \| @code{}steam://rungameid/464920@endcode \| + } +} + +#### Binary (w/ working directory +@tabs{ + @tab{Linux | + \| Field \| Value \| + \|-------------------\|--------------------------------------------------------------\| + \| Application Name \| @code{}Surviving Mars@endcode \| + \| Command \| @code{}MarsSteam@endcode \| + \| Working Directory \| @code{}~/.steam/steam/SteamApps/common/Survivng Mars@endcode \| + } + @tab{macOS | + \| Field \| Value \| + \|-------------------\|--------------------------------------------------------------\| + \| Application Name \| @code{}Surviving Mars@endcode \| + \| Command \| @code{}MarsSteam@endcode \| + \| Working Directory \| @code{}~/.steam/steam/SteamApps/common/Survivng Mars@endcode \| + } + @tab{Windows | + \| Field \| Value \| + \|-------------------\|-------------------------------------------------------------------------------\| + \| Application Name \| @code{}Surviving Mars@endcode \| + \| Command \| @code{}MarsSteam.exe@endcode \| + \| Working Directory \| @code{}"C:\Program Files (x86)\Steam\steamapps\common\Surviving Mars"@endcode \| + } +} + +#### Binary (w/o working directory) +@tabs{ + @tab{Linux | + \| Field \| Value \| + \|-------------------\|------------------------------------------------------------------------\| + \| Application Name \| @code{}Surviving Mars@endcode \| + \| Command \| @code{}~/.steam/steam/SteamApps/common/Survivng Mars/MarsSteam@endcode \| + } + @tab{macOS | + \| Field \| Value \| + \|-------------------\|------------------------------------------------------------------------\| + \| Application Name \| @code{}Surviving Mars@endcode \| + \| Command \| @code{}~/.steam/steam/SteamApps/common/Survivng Mars/MarsSteam@endcode \| + } + @tab{Windows | + \| Field \| Value \| + \|-------------------\|---------------------------------------------------------------------------------------------\| + \| Application Name \| @code{}Surviving Mars@endcode \| + \| Command \| @code{}"C:\Program Files (x86)\Steam\steamapps\common\Surviving Mars\MarsSteam.exe"@endcode \| + } +} + +### Prep Commands + +#### Changing Resolution and Refresh Rate + +##### Linux + +###### X11 + +| Prep Step | Command | +|-----------|---------------------------------------------------------------------------------------------------------------------------------------| +| Do | @code{}sh -c "xrandr --output HDMI-1 --mode ${SUNSHINE_CLIENT_WIDTH}x${SUNSHINE_CLIENT_HEIGHT} --rate ${SUNSHINE_CLIENT_FPS}"@endcode | +| Undo | @code{}xrandr --output HDMI-1 --mode 3840x2160 --rate 120@endcode | + +@hint{The above only works if the xrandr mode already exists. You will need to create new modes to stream to macOS +and iOS devices, since they use non standard resolutions. + +You can update the ``Do`` command to this: +```bash +bash -c "${HOME}/scripts/set-custom-res.sh \"${SUNSHINE_CLIENT_WIDTH}\" \"${SUNSHINE_CLIENT_HEIGHT}\" \"${SUNSHINE_CLIENT_FPS}\"" +``` + +The `set-custom-res.sh` will have this content: +```bash +#!/bin/bash +set -e + +# Get params and set any defaults +width=${1:-1920} +height=${2:-1080} +refresh_rate=${3:-60} + +# You may need to adjust the scaling differently so the UI/text isn't too small / big +scale=${4:-0.55} + +# Get the name of the active display +display_output=$(xrandr | grep " connected" | awk '{ print $1 }') + +# Get the modeline info from the 2nd row in the cvt output +modeline=$(cvt ${width} ${height} ${refresh_rate} | awk 'FNR == 2') +xrandr_mode_str=${modeline//Modeline \"*\" /} +mode_alias="${width}x${height}" + +echo "xrandr setting new mode ${mode_alias} ${xrandr_mode_str}" +xrandr --newmode ${mode_alias} ${xrandr_mode_str} +xrandr --addmode ${display_output} ${mode_alias} + +# Reset scaling +xrandr --output ${display_output} --scale 1 + +# Apply new xrandr mode +xrandr --output ${display_output} --primary --mode ${mode_alias} --pos 0x0 --rotate normal --scale ${scale} + +# Optional reset your wallpaper to fit to new resolution +# xwallpaper --zoom /path/to/wallpaper.png +``` +} + +###### Wayland + +| Prep Step | Command | +|-----------|------------------------------------------------------------------------------------------------------------------------------------------| +| Do | @code{}sh -c "wlr-xrandr --output HDMI-1 --mode \"${SUNSHINE_CLIENT_WIDTH}x${SUNSHINE_CLIENT_HEIGHT}@${SUNSHINE_CLIENT_FPS}Hz\""@endcode | +| Undo | @code{}wlr-xrandr --output HDMI-1 --mode 3840x2160@120Hz@endcode | + +@hint{`wlr-xrandr` only works with wlroots-based compositors.} + +###### Gnome (Wayland, X11) + +| Prep Step | Command | +|-----------|---------------------------------------------------------------------------------------------------------------------------------------| +| Do | @code{}sh -c "xrandr --output HDMI-1 --mode ${SUNSHINE_CLIENT_WIDTH}x${SUNSHINE_CLIENT_HEIGHT} --rate ${SUNSHINE_CLIENT_FPS}"@endcode | +| Undo | @code{}xrandr --output HDMI-1 --mode 3840x2160 --rate 120@endcode | + +The commands above are valid for an X11 session but won't work for +Wayland. In that case `xrandr` must be replaced by [gnome-randr.py](https://gitlab.com/Oschowa/gnome-randr). +This script is intended as a drop-in replacement with the same syntax. (It can be saved in +`/usr/local/bin` and needs to be made executable.) + +###### KDE Plasma (Wayland, X11) + +| Prep Step | Command | +|-----------|--------------------------------------------------------------------------------------------------------------------------------------| +| Do | @code{}sh -c "kscreen-doctor output.HDMI-A-1.mode.${SUNSHINE_CLIENT_WIDTH}x${SUNSHINE_CLIENT_HEIGHT}@${SUNSHINE_CLIENT_FPS}"@endcode | +| Undo | @code{}kscreen-doctor output.HDMI-A-1.mode.3840x2160@120@endcode | + +###### NVIDIA + +| Prep Step | Command | +|-----------|-------------------------------------------------------------------------------------------------------------| +| Do | @code{}sh -c "${HOME}/scripts/set-custom-res.sh ${SUNSHINE_CLIENT_WIDTH} ${SUNSHINE_CLIENT_HEIGHT}"@endcode | +| Undo | @code{}sh -c "${HOME}/scripts/set-custom-res.sh 3840 2160"@endcode | + +The ``set-custom-res.sh`` will have this content: +```bash +#!/bin/bash +set -e + +# Get params and set any defaults +width=${1:-1920} +height=${2:-1080} +output=${3:-HDMI-1} +nvidia-settings -a CurrentMetaMode="${output}: nvidia-auto-select { ViewPortIn=${width}x${height}, ViewPortOut=${width}x${height}+0+0 }" +``` + +##### macOS + +###### displayplacer +@note{This example uses the `displayplacer` tool to change the resolution. +This tool can be installed following instructions in their +[GitHub repository](https://github.com/jakehilborn/displayplacer)}. + +| Prep Step | Command | +|-----------|----------------------------------------------------------------------------------------------------| +| Do | @code{}displayplacer "id: res:1920x1080 hz:60 scaling:on origin:(0,0) degree:0"@endcode | +| Undo | @code{}displayplacer "id: res:3840x2160 hz:120 scaling:on origin:(0,0) degree:0"@endcode | + +##### Windows + +###### QRes +@note{This example uses the *QRes* tool to change the resolution and refresh rate. +This tool can be downloaded from their [SourceForge repository](https://sourceforge.net/projects/qres).}. + +| Prep Step | Command | +|-----------|-------------------------------------------------------------------------------------------------------------------------| +| Do | @code{}cmd /C FullPath\qres.exe /x:%SUNSHINE_CLIENT_WIDTH% /y:%SUNSHINE_CLIENT_HEIGHT% /r:%SUNSHINE_CLIENT_FPS%@endcode | +| Undo | @code{}cmd /C FullPath\qres.exe /x:3840 /y:2160 /r:120@endcode | + +### Additional Considerations + +#### Linux (Flatpak) +@attention{Because Flatpak packages run in a sandboxed environment and do not normally have access to the +host, the Flatpak of Sunshine requires commands to be prefixed with `flatpak-spawn --host`.} + +#### Windows +**Elevating Commands (Windows)** + +If you've installed Sunshine as a service (default), you can specify if a command should be elevated with +administrative privileges. Simply enable the elevated option in the WEB UI, or add it to the JSON configuration. +This is an option for both prep-cmd and regular commands and will launch the process with the current user without a +UAC prompt. + +@note{It is important to write the values "true" and "false" as string values, not as the typical true/false +values in most JSON.} + +**Example** +```json +{ + "name": "Game With AntiCheat that Requires Admin", + "output": "", + "cmd": "ping 127.0.0.1", + "exclude-global-prep-cmd": "false", + "elevated": "true", + "prep-cmd": [ + { + "do": "powershell.exe -command \"Start-Streaming\"", + "undo": "powershell.exe -command \"Stop-Streaming\"", + "elevated": "false" + } + ], + "image-path": "" +} +``` + +
+ +| Previous | Next | +|:----------------------------------|--------------------:| +| [Configuration](configuration.md) | [Guides](guides.md) | + +
diff --git a/docs/building.md b/docs/building.md new file mode 100644 index 00000000000..502b0a1cbbb --- /dev/null +++ b/docs/building.md @@ -0,0 +1,162 @@ +# Building +Sunshine binaries are built using [CMake](https://cmake.org) and requires `cmake` > 3.25. + +## Building Locally + +### Dependencies + +#### Linux +Dependencies vary depending on the distribution. You can reference our +[linux_build.sh](https://github.com/LizardByte/Sunshine/blob/master/scripts/linux_build.sh) script for a list of +dependencies we use in Debian-based and Fedora-based distributions. Please submit a PR if you would like to extend the +script to support other distributions. + +##### CUDA Toolkit +Sunshine requires CUDA Toolkit for NVFBC capture. There are two caveats to CUDA: + +1. The version installed depends on the version of GCC. +2. The version of CUDA you use will determine compatibility with various GPU generations. + At the time of writing, the recommended version to use is CUDA ~11.8. + See [CUDA compatibility](https://docs.nvidia.com/deploy/cuda-compatibility/index.html) for more info. + +@tip{To install older versions, select the appropriate run file based on your desired CUDA version and architecture +according to [CUDA Toolkit Archive](https://developer.nvidia.com/cuda-toolkit-archive)} + +#### macOS +You can either use [Homebrew](https://brew.sh) or [MacPorts](https://www.macports.org) to install dependencies. + +##### Homebrew +```bash +dependencies=( + "boost" # Optional + "cmake" + "doxygen" # Optional, for docs + "graphviz" # Optional, for docs + "icu4c" # Optional, if boost is not installed + "miniupnpc" + "node" + "openssl@3" + "opus" + "pkg-config" +) +brew install ${dependencies[@]} +``` + +If there are issues with an SSL header that is not found: + +@tabs{ + @tab{ Intel | ```bash + ln -s /usr/local/opt/openssl/include/openssl /usr/local/include/openssl + ```} + @tab{ Apple Silicon | ```bash + ln -s /opt/homebrew/opt/openssl/include/openssl /opt/homebrew/include/openssl + ``` + } +} + +##### MacPorts +```bash +dependencies=( + "cmake" + "curl" + "doxygen" # Optional, for docs + "graphviz" # Optional, for docs + "libopus" + "miniupnpc" + "npm9" + "pkgconfig" +) +sudo port install ${dependencies[@]} +``` + +#### Windows +First you need to install [MSYS2](https://www.msys2.org), then startup "MSYS2 UCRT64" and execute the following +commands. + +##### Update all packages +```bash +pacman -Syu +``` + +##### Install dependencies +```bash +dependencies=( + "doxygen" # Optional, for docs + "git" + "mingw-w64-ucrt-x86_64-boost" # Optional + "mingw-w64-ucrt-x86_64-cmake" + "mingw-w64-ucrt-x86_64-cppwinrt" + "mingw-w64-ucrt-x86_64-curl" + "mingw-w64-ucrt-x86_64-graphviz" # Optional, for docs + "mingw-w64-ucrt-x86_64-miniupnpc" + "mingw-w64-ucrt-x86_64-nlohmann-json" + "mingw-w64-ucrt-x86_64-nodejs" + "mingw-w64-ucrt-x86_64-nsis" + "mingw-w64-ucrt-x86_64-onevpl" + "mingw-w64-ucrt-x86_64-openssl" + "mingw-w64-ucrt-x86_64-opus" + "mingw-w64-ucrt-x86_64-toolchain" +) +pacman -S ${dependencies[@]} +``` + +### Clone +Ensure [git](https://git-scm.com) is installed on your system, then clone the repository using the following command: + +```bash +git clone https://github.com/lizardbyte/sunshine.git --recurse-submodules +cd sunshine +mkdir build +``` + +### Build + +```bash +cmake -B build -G Ninja -S . +ninja -C build +``` + +@tip{Available build options can be found in +[options.cmake](https://github.com/LizardByte/Sunshine/blob/master/cmake/prep/options.cmake).} + +### Package + +@tabs{ + @tab{Linux | @tabs{ + @tab{deb | ```bash + cpack -G DEB --config ./build/CPackConfig.cmake + ```} + @tab{rpm | ```bash + cpack -G RPM --config ./build/CPackConfig.cmake + ```} + }} + @tab{macOS | @tabs{ + @tab{DragNDrop | ```bash + cpack -G DragNDrop --config ./build/CPackConfig.cmake + ```} + }} + @tab{Windows | @tabs{ + @tab{Installer | ```bash + cpack -G NSIS --config ./build/CPackConfig.cmake + ```} + @tab{Portable | ```bash + cpack -G ZIP --config ./build/CPackConfig.cmake + ```} + }} +} + +### Remote Build +It may be beneficial to build remotely in some cases. This will enable easier building on different operating systems. + +1. Fork the project +2. Activate workflows +3. Trigger the *CI* workflow manually +4. Download the artifacts/binaries from the workflow run summary + +
+ +| Previous | Next | +|:--------------------------------------|--------------------------------:| +| [Troubleshooting](troubleshooting.md) | [Contributing](contributing.md) | + +
diff --git a/docs/changelog.md b/docs/changelog.md new file mode 100644 index 00000000000..f975767a237 --- /dev/null +++ b/docs/changelog.md @@ -0,0 +1,17 @@ +# Changelog + +@htmlonly + + + +@endhtmlonly + +
+ +| Previous | Next | +|:--------------------------------------|------------------------------:| +| [Getting Started](getting_started.md) | [Docker](../DOCKER_README.md) | + +
diff --git a/docs/configuration.md b/docs/configuration.md new file mode 100644 index 00000000000..98bab79a060 --- /dev/null +++ b/docs/configuration.md @@ -0,0 +1,2456 @@ +# Configuration +Sunshine will work with the default settings for most users. In some cases you may want to configure Sunshine further. + +The default location for the configuration file is listed below. You can use another location if you +choose, by passing in the full configuration file path as the first argument when you start Sunshine. + +**Example** +```bash +sunshine ~/sunshine_config.conf +``` + +The default location of the `apps.json` is the same as the configuration file. You can use a custom +location by modifying the configuration file. + +**Default Config Directory** + +| OS | Location | +|---------|-------------------------------------------------| +| Docker | @code{}/config@endcode | +| Linux | @code{}~/.config/sunshine@endcode | +| macOS | @code{}~/.config/sunshine@endcode | +| Windows | @code{}%ProgramFiles%\\Sunshine\\config@endcode | + +Although it is recommended to use the configuration UI, it is possible manually configure Sunshine by +editing the `conf` file in a text editor. Use the examples as reference. + +## [General](https://localhost:47990/config/#general) + +### [locale](https://localhost:47990/config/#locale) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Description + The locale used for Sunshine's user interface. +
Default@code{} + en + @endcode
Example@code{} + locale = en + @endcode
ChoicesdeGerman
enEnglish
en_GBEnglish (UK)
en_USEnglish (United States)
esSpanish
frFrench
itItalian
jaJapanese
ptPortuguese
ruRussian
svSwedish
trTurkish
zhChinese (Simplified)
+ +### [sunshine_name](https://localhost:47990/config/#sunshine_name) + + + + + + + + + + + + + + +
Description + The name displayed by Moonlight. +
DefaultPC hostname
Example@code{} + sunshine_name = Sunshine + @endcode
+ +### [min_log_level](https://localhost:47990/config/#min_log_level) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Description + The minimum log level printed to standard out. +
Default@code{} + info + @endcode
Example@code{} + min_log_level = info + @endcode
ChoicesverboseAll logging message. + @attention{This may negatively affect streaming performance.}
debugDebug log messages and higher. + @attention{This may negatively affect streaming performance.}
infoInformational log messages and higher.
warningWarning log messages and higher.
errorError log messages and higher.
fatalOnly fatal log messages.
noneNo log messages.
+ +### [channels](https://localhost:47990/config/#channels) + + + + + + + + + + + + + + +
Description + Sunshine can support multiple clients streaming simultaneously, + at the cost of higher CPU and GPU usage. + @note{All connected clients share control of the same streaming session.} + @warning{Some hardware encoders may have limitations that reduce performance with multiple streams.} +
Default@code{} + 1 + @endcode
Example@code{} + channels = 1 + @endcode
+ +### [global_prep_cmd](https://localhost:47990/config/#global_prep_cmd) + + + + + + + + + + + + + + +
Description + A list of commands to be run before/after all applications. + If any of the prep-commands fail, starting the application is aborted. +
Default@code{} + [] + @endcode
Example@code{} + global_prep_cmd = [{"do":"nircmd.exe setdisplay 1280 720 32 144","undo":"nircmd.exe setdisplay 2560 1440 32 144"}] + @endcode
+ +### [notify_pre_releases](https://localhost:47990/config/#notify_pre_releases) + + + + + + + + + + + + + + +
Description + Whether to be notified of new pre-release versions of Sunshine. +
Default@code{} + disabled + @endcode
Example@code{} + notify_pre_releases = disabled + @endcode
+ +## [Input](https://localhost:47990/config/#input) + +### [controller](https://localhost:47990/config/#controller) + + + + + + + + + + + + + + +
Description + Whether to allow controller input from the client. +
Default@code{} + enabled + @endcode
Example@code{} + controller = enabled + @endcode
+ +### [gamepad](https://localhost:47990/config/#gamepad) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Description + The type of gamepad to emulate on the host. +
Default@code{} + auto + @endcode
Example@code{} + gamepad = auto + @endcode
Choicesds4DualShock 4 controller (PS4) + @note{This option applies to Windows only.}
ds5DualShock 5 controller (PS5) + @note{This option applies to Linux only.}
switchSwitch Pro controller + @note{This option applies to Linux only.}
x360Xbox 360 controller + @note{This option applies to Windows only.}
xoneXbox One controller + @note{This option applies to Linux only.}
+ +### [ds4_back_as_touchpad_click](https://localhost:47990/config/#ds4_back_as_touchpad_click) + + + + + + + + + + + + + + +
Description + Allow Select/Back inputs to also trigger DS4 touchpad click. Useful for clients looking to + emulate touchpad click on Xinput devices. + @hint{Only applies when gamepad is set to ds4 manually. Unused in other gamepad modes.} +
Default@code{} + enabled + @endcode
Example@code{} + ds4_back_as_touchpad_click = enabled + @endcode
+ +### [motion_as_ds4](https://localhost:47990/config/#motion_as_ds4) + + + + + + + + + + + + + + +
Description + If a client reports that a connected gamepad has motion sensor support, emulate it on the + host as a DS4 controller. +
+
+ When disabled, motion sensors will not be taken into account during gamepad type selection. + @hint{Only applies when gamepad is set to auto.} +
Default@code{} + enabled + @endcode
Example@code{} + motion_as_ds4 = enabled + @endcode
+ +### [touchpad_as_ds4](https://localhost:47990/config/#touchpad_as_ds4) + + + + + + + + + + + + + + +
Description + If a client reports that a connected gamepad has a touchpad, emulate it on the host + as a DS4 controller. +
+
+ When disabled, touchpad presence will not be taken into account during gamepad type selection. + @hint{Only applies when gamepad is set to auto.} +
Default@code{} + enabled + @endcode
Example@code{} + touchpad_as_ds4 = enabled + @endcode
+ +### [back_button_timeout](https://localhost:47990/config/#back_button_timeout) + + + + + + + + + + + + + + +
Description + If the Back/Select button is held down for the specified number of milliseconds, + a Home/Guide button press is emulated. + @tip{If back_button_timeout < 0, then the Home/Guide button will not be emulated.} +
Default@code{} + -1 + @endcode
Example@code{} + back_button_timeout = 2000 + @endcode
+ +### [keyboard](https://localhost:47990/config/#keyboard) + + + + + + + + + + + + + + +
Description + Whether to allow keyboard input from the client. +
Default@code{} + enabled + @endcode
Example@code{} + keyboard = enabled + @endcode
+ +### [key_repeat_delay](https://localhost:47990/config/#key_repeat_delay) + + + + + + + + + + + + + + +
Description + The initial delay, in milliseconds, before repeating keys. Controls how fast keys will + repeat themselves. +
Default@code{} + 500 + @endcode
Example@code{} + key_repeat_delay = 500 + @endcode
+ +### [key_repeat_frequency](https://localhost:47990/config/#key_repeat_frequency) + + + + + + + + + + + + + + +
Description + How often keys repeat every second. + @tip{This configurable option supports decimals.} +
Default@code{} + 24.9 + @endcode
Example@code{} + key_repeat_frequency = 24.9 + @endcode
+ +### [always_send_scancodes](https://localhost:47990/config/#always_send_scancodes) + + + + + + + + + + + + + + +
Description + 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. + @caution{Applies to Windows only.} +
Default@code{} + enabled + @endcode
Example@code{} + always_send_scancodes = enabled + @endcode
+ +### [key_rightalt_to_key_win](https://localhost:47990/config/#key_rightalt_to_key_win) + + + + + + + + + + + + + + +
DescriptionIt 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. +
Default@code{} + disabled + @endcode
Example@code{} + key_rightalt_to_key_win = enabled + @endcode
+ +### [mouse](https://localhost:47990/config/#mouse) + + + + + + + + + + + + + + +
Description + Whether to allow mouse input from the client. +
Default@code{} + enabled + @endcode
Example@code{} + mouse = enabled + @endcode
+ +### [high_resolution_scrolling](https://localhost:47990/config/#high_resolution_scrolling) + + + + + + + + + + + + + + +
Description + 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. +
Default@code{} + enabled + @endcode
Example@code{} + high_resolution_scrolling = enabled + @endcode
+ +### [native_pen_touch](https://localhost:47990/config/#native_pen_touch) + + + + + + + + + + + + + + +
Description + 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. +
Default@code{} + enabled + @endcode
Example@code{} + native_pen_touch = enabled + @endcode
+ +### [native_pen_touch](https://localhost:47990/config/#native_pen_touch) + + + + + + + + + + + + + + +
Description + Sometimes it may be useful to map keybindings. Wayland won't allow clients to capture the Win Key + for example. + @tip{See [virtual key codes](https://docs.microsoft.com/en-us/windows/win32/inputdev/virtual-key-codes)} + @hint{keybindings needs to have a multiple of two elements.} + @note{This option is not available in the UI. A PR would be welcome.} +
Default@code{} + [ + 0x10, 0xA0, + 0x11, 0xA2, + 0x12, 0xA4 + ] + @endcode
Example@code{} + keybindings = [ + 0x10, 0xA0, + 0x11, 0xA2, + 0x12, 0xA4, + 0x4A, 0x4B + ] + @endcode
+ +## [Audio/Video](https://localhost:47990/config/#audio-video) + +### [audio_sink](https://localhost:47990/config/#audio_sink) + + + + + + + + + + + + + + + + + + + + + + +
Description + The name of the audio sink used for audio loopback. + @tip{To find the name of the audio sink follow these instructions. +
+
+ **Linux + pulseaudio:** +
+ @code{} + pacmd list-sinks | grep "name:" + @endcode +
+
+ **Linux + pipewire:** +
+ @code{} + pactl info | grep Source + # in some causes you'd need to use the `Sink` device, if `Source` doesn't work, so try: + pactl info | grep Sink + @endcode +
+
+ **macOS:** +
+ Sunshine can only access microphones on macOS due to system limitations. + To stream system audio use + [Soundflower](https://github.com/mattingalls/Soundflower) or + [BlackHole](https://github.com/ExistentialAudio/BlackHole). +
+
+ **Windows:** +
+ Enter the following command in command prompt or PowerShell. + @code{} + %ProgramFiles%\Sunshine\tools\audio-info.exe + @endcode + If you have multiple audio devices with identical names, use the Device ID instead. + } + @attention{If you want to mute the host speakers, use + [virtual_sink](#virtual_sinkhttpslocalhost47990configvirtual_sink) instead.} +
DefaultSunshine will select the default audio device.
Example (Linux)@code{} + audio_sink = alsa_output.pci-0000_09_00.3.analog-stereo + @endcode
Example (macOS)@code{} + audio_sink = BlackHole 2ch + @endcode
Example (Windows)@code{} + audio_sink = Speakers (High Definition Audio Device) + @endcode
+ +### [virtual_sink](https://localhost:47990/config/#virtual_sink) + + + + + + + + + + + + + + +
Description + The audio device that's virtual, like Steam Streaming Speakers. This allows Sunshine to stream audio, + while muting the speakers. + @tip{See [audio_sink](#audio_sinkhttpslocalhost47990configaudio_sink)!} + @tip{These are some options for virtual sound devices. + * Stream Streaming Speakers (Linux, macOS, Windows) + * Steam must be installed. + * Enable [install_steam_audio_drivers](#install_steam_audio_drivershttpslocalhost47990configinstall_steam_audio_drivers) + or use Steam Remote Play at least once to install the drivers. + * [Virtual Audio Cable](https://vb-audio.com/Cable) (macOS, Windows) + } +
Defaultn/a
Example@code{} + virtual_sink = Steam Streaming Speakers + @endcode
+ +### [install_steam_audio_drivers](https://localhost:47990/config/#install_steam_audio_drivers) + + + + + + + + + + + + + + +
Description + Installs the Steam Streaming Speakers driver (if Steam is installed) to support surround sound and muting + host audio. + @note{This option is only supported on Windows.} +
Default@code{} + enabled + @endcode
Example@code{} + install_steam_audio_drivers = enabled + @endcode
+ +### [adapter_name](https://localhost:47990/config/#adapter_name) + + + + + + + + + + + + + + + + + + +
Description + Select the video card you want to stream. + @tip{To find the appropriate values follow these instructions. +
+
+ **Linux + VA-API:** +
+ Unlike with *amdvce* and *nvenc*, it doesn't matter if video encoding is done on a different GPU. + @code{} + ls /dev/dri/renderD* # to find all devices capable of VAAPI + # replace ``renderD129`` with the device from above to list the name and capabilities of the device + vainfo --display drm --device /dev/dri/renderD129 | \ + grep -E "((VAProfileH264High|VAProfileHEVCMain|VAProfileHEVCMain10).*VAEntrypointEncSlice)|Driver version" + @endcode + To be supported by Sunshine, it needs to have at the very minimum: + `VAProfileH264High : VAEntrypointEncSlice` +
+
+ **Windows:** +
+ Enter the following command in command prompt or PowerShell. + @code{} + %ProgramFiles%\Sunshine\tools\dxgi-info.exe + @endcode + For hybrid graphics systems, DXGI reports the outputs are connected to whichever graphics + adapter that the application is configured to use, so it's not a reliable indicator of how the + display is physically connected. + } +
DefaultSunshine will select the default video card.
Example (Linux)@code{} + adapter_name = /dev/dri/renderD128 + @endcode
Example (Windows)@code{} + adapter_name = Radeon RX 580 Series + @endcode
+ +### [output_name](https://localhost:47990/config/#output_name) + + + + + + + + + + + + + + + + + + + + + + +
Description + Select the display number you want to stream. + @tip{To find the appropriate values follow these instructions. +
+
+ **Linux:** +
+ During Sunshine startup, you should see the list of detected displays: + @code{} + Info: Detecting displays + Info: Detected display: DVI-D-0 (id: 0) connected: false + Info: Detected display: HDMI-0 (id: 1) connected: true + Info: Detected display: DP-0 (id: 2) connected: true + Info: Detected display: DP-1 (id: 3) connected: false + Info: Detected display: DVI-D-1 (id: 4) connected: false + @endcode + You need to use the id value inside the parenthesis, e.g. `1`. +
+
+ **macOS:** +
+ During Sunshine startup, you should see the list of detected displays: + @code{} + Info: Detecting displays + Info: Detected display: Monitor-0 (id: 3) connected: true + Info: Detected display: Monitor-1 (id: 2) connected: true + @endcode + You need to use the id value inside the parenthesis, e.g. `3`. +
+
+ **Windows:** +
+ Enter the following command in command prompt or PowerShell. + @code{} + %ProgramFiles%\Sunshine\tools\dxgi-info.exe + @endcode + } +
DefaultSunshine will select the default display.
Example (Linux)@code{} + output_name = 0 + @endcode
Example (macOS)@code{} + output_name = 3 + @endcode
Example (Windows)@code{} + output_name = \\.\DISPLAY1 + @endcode
+ +### [min_fps_factor](https://localhost:47990/config/#min_fps_factor) + + + + + + + + + + + + + + + + + + +
Description + Sunshine will use this factor to calculate the minimum time between frames. Increasing this value may help + when streaming mostly static content. + @warning{Higher values will consume more bandwidth.} +
Default@code{} + 1 + @endcode
Range1-3
Example@code{} + min_fps_factor = 1 + @endcode
+ +## [Network](https://localhost:47990/config/#network) + +### [upnp](https://localhost:47990/config/#upnp) + + + + + + + + + + + + + + +
Description + Sunshine will attempt to open ports for streaming over the internet. +
Default@code{} + disabled + @endcode
Example@code{} + upnp = enabled + @endcode
+ +### [address_family](https://localhost:47990/config/#address_family) + + + + + + + + + + + + + + + + + + + + + + + +
Description + Set the address family that Sunshine will use. +
Default@code{} + ipv4 + @endcode
Example@code{} + address_family = both + @endcode
Choicesipv4IPv4 only
bothIPv4+IPv6
+ +### [port](https://localhost:47990/config/#port) + + + + + + + + + + + + + + + + + + +
Description + Set the family of ports used by Sunshine. + Changing this value will offset other ports as shown in config UI. +
Default@code{} + 47989 + @endcode
Range1029-65514
Example@code{} + port = 47989 + @endcode
+ +### [origin_web_ui_allowed](https://localhost:47990/config/#origin_web_ui_allowed) + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Description + The origin of the remote endpoint address that is not denied for HTTPS Web UI. +
Default@code{} + lan + @endcode
Example@code{} + origin_web_ui_allowed = lan + @endcode
ChoicespcOnly localhost may access the web ui
lanOnly LAN devices may access the web ui
wanAnyone may access the web ui
+ +### [external_ip](https://localhost:47990/config/#external_ip) + + + + + + + + + + + + + + +
Description + If no external IP address is given, Sunshine will attempt to automatically detect external ip-address. +
DefaultAutomatic
Example@code{} + external_ip = 123.456.789.12 + @endcode
+ +### [lan_encryption_mode](https://localhost:47990/config/#lan_encryption_mode) + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Description + This determines when encryption will be used when streaming over your local network. + @warning{Encryption can reduce streaming performance, particularly on less powerful hosts and clients.} +
Default@code{} + 0 + @endcode
Example@code{} + lan_encryption_mode = 0 + @endcode
Choices0encryption will not be used
1encryption will be used if the client supports it
2encryption is mandatory and unencrypted connections are rejected
+ +### [wan_encryption_mode](https://localhost:47990/config/#wan_encryption_mode) + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Description + This determines when encryption will be used when streaming over the Internet. + @warning{Encryption can reduce streaming performance, particularly on less powerful hosts and clients.} +
Default@code{} + 1 + @endcode
Example@code{} + wan_encryption_mode = 1 + @endcode
Choices0encryption will not be used
1encryption will be used if the client supports it
2encryption is mandatory and unencrypted connections are rejected
+ +### [ping_timeout](https://localhost:47990/config/#ping_timeout) + + + + + + + + + + + + + + +
Description + How long to wait, in milliseconds, for data from Moonlight before shutting down the stream. +
Default@code{} + 10000 + @endcode
Example@code{} + ping_timeout = 10000 + @endcode
+ +## [Config Files](https://localhost:47990/config/#files) + +### [file_apps](https://localhost:47990/config/#file_apps) + + + + + + + + + + + + + + +
Description + The application configuration file path. The file contains a JSON formatted list of applications that + can be started by Moonlight. +
Default@code{} + apps.json + @endcode
Example@code{} + file_apps = apps.json + @endcode
+ +### [credentials_file](https://localhost:47990/config/#credentials_file) + + + + + + + + + + + + + + +
Description + The file where user credentials for the UI are stored. +
Default@code{} + sunshine_state.json + @endcode
Example@code{} + credentials_file = sunshine_state.json + @endcode
+ +### [log_path](https://localhost:47990/config/#log_path) + + + + + + + + + + + + + + +
Description + The path where the Sunshine log is stored. +
Default@code{} + sunshine.log + @endcode
Example@code{} + log_path = sunshine.log + @endcode
+ +### [pkey](https://localhost:47990/config/#pkey) + + + + + + + + + + + + + + +
Description + The private key used for the web UI and Moonlight client pairing. For best compatibility, + this should be an RSA-2048 private key. + @warning{Not all Moonlight clients support ECDSA keys or RSA key lengths other than 2048 bits.} +
Default@code{} + credentials/cakey.pem + @endcode
Example@code{} + pkey = /dir/pkey.pem + @endcode
+ +### [cert](https://localhost:47990/config/#cert) + + + + + + + + + + + + + + +
Description + The certificate used for the web UI and Moonlight client pairing. For best compatibility, + this should have an RSA-2048 public key. + @warning{Not all Moonlight clients support ECDSA keys or RSA key lengths other than 2048 bits.} +
Default@code{} + credentials/cacert.pem + @endcode
Example@code{} + cert = /dir/cert.pem + @endcode
+ +### [file_state](https://localhost:47990/config/#file_state) + + + + + + + + + + + + + + +
Description + The file where current state of Sunshine is stored. +
Default@code{} + sunshine_state.json + @endcode
Example@code{} + file_state = sunshine_state.json + @endcode
+ +## [Advanced](https://localhost:47990/config/#advanced) + +### [fec_percentage](https://localhost:47990/config/#fec_percentage) + + + + + + + + + + + + + + + + + + +
Description + Percentage of error correcting packets per data packet in each video frame. + @warning{Higher values can correct for more network packet loss, + but at the cost of increasing bandwidth usage.} +
Default@code{} + 20 + @endcode
Range1-255
Example@code{} + fec_percentage = 20 + @endcode
+ +### [qp](https://localhost:47990/config/#qp) + + + + + + + + + + + + + + +
Description + Quantization Parameter. Some devices don't support Constant Bit Rate. For those devices, QP is used instead. + @warning{Higher value means more compression, but less quality.} +
Default@code{} + 28 + @endcode
Example@code{} + qp = 28 + @endcode
+ +### [min_threads](https://localhost:47990/config/#min_threads) + + + + + + + + + + + + + + +
Description + Minimum number of CPU threads used for encoding. + @note{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.} +
Default@code{} + 2 + @endcode
Example@code{} + min_threads = 2 + @endcode
+ +### [hevc_mode](https://localhost:47990/config/#hevc_mode) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Description + Allows the client to request HEVC Main or HEVC Main10 video streams. + @warning{HEVC is more CPU-intensive to encode, so enabling this may reduce performance when using software + encoding.} +
Default@code{} + 0 + @endcode
Example@code{} + hevc_mode = 2 + @endcode
Choices0advertise support for HEVC based on encoder capabilities (recommended)
1do not advertise support for HEVC
2advertise support for HEVC Main profile
3advertise support for HEVC Main and Main10 (HDR) profiles
+ +### [av1_mode](https://localhost:47990/config/#av1_mode) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Description + Allows the client to request AV1 Main 8-bit or 10-bit video streams. + @warning{AV1 is more CPU-intensive to encode, so enabling this may reduce performance when using software + encoding.} +
Default@code{} + 0 + @endcode
Example@code{} + av1_mode = 2 + @endcode
Choices0advertise support for AV1 based on encoder capabilities (recommended)
1do not advertise support for AV1
2advertise support for AV1 Main 8-bit profile
3advertise support for AV1 Main 8-bit and 10-bit (HDR) profiles
+ +### [capture](https://localhost:47990/config/#capture) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Description + Force specific screen capture method. +
DefaultAutomatic. + Sunshine will use the first capture method available in the order of the table above.
Example@code{} + capture = kms + @endcode
ChoicesnvfbcUse NVIDIA Frame Buffer Capture to capture direct to GPU memory. This is usually the fastest method for + NVIDIA cards. NvFBC does not have native Wayland support and does not work with XWayland. + @note{Applies to Linux only.}
wlrCapture for wlroots based Wayland compositors via DMA-BUF. + @note{Applies to Linux only.}
kmsDRM/KMS screen capture from the kernel. This requires that Sunshine has `cap_sys_admin` capability. + @note{Applies to Linux only.}
x11Uses XCB. This is the slowest and most CPU intensive so should be avoided if possible. + @note{Applies to Linux only.}
ddxUse DirectX Desktop Duplication API to capture the display. This is well-supported on Windows machines. + @note{Applies to Windows only.}
wgc(beta feature) Use Windows.Graphics.Capture to capture the display. + @note{Applies to Windows only.} + @attention{This capture method is not compatible with the Sunshine service.}
+ +### [encoder](https://localhost:47990/config/#encoder) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Description + Force a specific encoder. +
DefaultSunshine will use the first encoder that is available.
Example@code{} + encoder = nvenc + @endcode
ChoicesnvencFor NVIDIA graphics cards
quicksyncFor Intel graphics cards
amdvceFor AMD graphics cards
vaapiUse Linux VA-API (AMD, Intel)
softwareEncoding occurs on the CPU
+ +## [NVIDIA NVENC Encoder](https://localhost:47990/config/#nvidia-nvenc-encoder) + +### [nvenc_preset](https://localhost:47990/config/#nvenc_preset) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Description + NVENC encoder 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. + @note{This option only applies when using NVENC [encoder](#encoderhttpslocalhost47990configencoder).} +
Default@code{} + 1 + @endcode
Example@code{} + nvenc_preset = 1 + @endcode
Choices1P1 (fastest)
2P2
3P3
4P4
5P5
6P6
7P7 (slowest)
+ +### [nvenc_twopass](https://localhost:47990/config/#nvenc_twopass) + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Description + Enable two-pass mode in NVENC encoder. + 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. + @note{This option only applies when using NVENC [encoder](#encoderhttpslocalhost47990configencoder).} +
Default@code{} + quarter_res + @endcode
Example@code{} + nvenc_twopass = quarter_res + @endcode
ChoicesdisabledOne pass (fastest)
quarter_resTwo passes, first pass at quarter resolution (faster)
full_resTwo passes, first pass at full resolution (slower)
+ +### [nvenc_spatial_aq](https://localhost:47990/config/#nvenc_spatial_aq) + + + + + + + + + + + + + + +
Description + Assign higher QP values to flat regions of the video. + Recommended to enable when streaming at lower bitrates. + @note{This option only applies when using NVENC [encoder](#encoderhttpslocalhost47990configencoder).} + @warning{Enabling this option may reduce performance.} +
Default@code{} + disabled + @endcode
Example@code{} + nvenc_spatial_aq = disabled + @endcode
+ +### [nvenc_vbv_increase](https://localhost:47990/config/#nvenc_vbv_increase) + + + + + + + + + + + + + + + + + + +
Description + 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. + @note{This option only applies when using NVENC [encoder](#encoderhttpslocalhost47990configencoder).} + @warning{Can lead to network packet loss.} +
Default@code{} + 0 + @endcode
Range0-400
Example@code{} + nvenc_vbv_increase = 0 + @endcode
+ +### [nvenc_realtime_hags](https://localhost:47990/config/#nvenc_realtime_hags) + + + + + + + + + + + + + + +
Description + Use realtime gpu scheduling priority in NVENC when hardware accelerated gpu scheduling (HAGS) is enabled + in Windows. 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. + @note{This option only applies when using NVENC [encoder](#encoderhttpslocalhost47990configencoder).} + @note{Applies to Windows only.} +
Default@code{} + enabled + @endcode
Example@code{} + nvenc_realtime_hags = enabled + @endcode
+ +### [nvenc_latency_over_power](https://localhost:47990/config/#nvenc_latency_over_power) + + + + + + + + + + + + + + +
Description + Adaptive P-State algorithm which NVIDIA drivers employ doesn't work well with low latency streaming, + so Sunshine requests high power mode explicitly. + @note{This option only applies when using NVENC [encoder](#encoderhttpslocalhost47990configencoder).} + @warning{Disabling this is not recommended since this can lead to significantly increased encoding latency.} + @note{Applies to Windows only.} +
Default@code{} + enabled + @endcode
Example@code{} + nvenc_latency_over_power = enabled + @endcode
+ +### [nvenc_opengl_vulkan_on_dxgi](https://localhost:47990/config/#nvenc_opengl_vulkan_on_dxgi) + + + + + + + + + + + + + + +
Description + Sunshine can't capture fullscreen OpenGL and Vulkan programs at full frame rate unless they present on + top of DXGI. With this option enabled Sunshine changes global Vulkan/OpenGL present method to + "Prefer layered on DXGI Swapchain". This is system-wide setting that is reverted on Sunshine program exit. + @note{This option only applies when using NVENC [encoder](#encoderhttpslocalhost47990configencoder).} + @note{Applies to Windows only.} +
Default@code{} + enabled + @endcode
Example@code{} + nvenc_opengl_vulkan_on_dxgi = enabled + @endcode
+ +### [nvenc_h264_cavlc](https://localhost:47990/config/#nvenc_h264_cavlc) + + + + + + + + + + + + + + +
Description + Prefer CAVLC entropy coding over CABAC in H.264 when using NVENC. + CAVLC is outdated and needs around 10% more bitrate for same quality, but provides slightly faster + decoding when using software decoder. + @note{This option only applies when using H.264 format with the + NVENC [encoder](#encoderhttpslocalhost47990configencoder).} +
Default@code{} + disabled + @endcode
Example@code{} + nvenc_h264_cavlc = disabled + @endcode
+ +## [Intel QuickSync Encoder](https://localhost:47990/config/#intel-quicksync-encoder) + +### [qsv_preset](https://localhost:47990/config/#qsv_preset) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Description + The encoder preset to use. + @note{This option only applies when using quicksync [encoder](#encoderhttpslocalhost47990configencoder).} +
Default@code{} + medium + @endcode
Example@code{} + qsv_preset = medium + @endcode
Choicesveryfastfastest (lowest quality)
fasterfaster (lower quality)
fastfast (low quality)
mediummedium (default)
slowslow (good quality)
slowerslower (better quality)
veryslowslowest (best quality)
+ +### [qsv_coder](https://localhost:47990/config/#qsv_coder) + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Description + The entropy encoding to use. + @note{This option only applies when using H.264 with the quicksync + [encoder](#encoderhttpslocalhost47990configencoder).} +
Default@code{} + auto + @endcode
Example@code{} + qsv_coder = auto + @endcode
Choicesautolet ffmpeg decide
cabaccontext adaptive binary arithmetic coding - higher quality
cavlccontext adaptive variable-length coding - faster decode
+ +### [qsv_slow_hevc](https://localhost:47990/config/#qsv_slow_hevc) + + + + + + + + + + + + + + +
Description + This options enables use of HEVC on older Intel GPUs that only support low power encoding for H.264. + @note{This option only applies when using quicksync [encoder](#encoderhttpslocalhost47990configencoder).} + @caution{Streaming performance may be significantly reduced when this option is enabled.} +
Default@code{} + disabled + @endcode
Example@code{} + qsv_slow_hevc = disabled + @endcode
+ +## [AMD AMF Encoder](https://localhost:47990/config/#amd-amf-encoder) + +### [amd_usage](https://localhost:47990/config/#amd_usage) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Description + The encoder usage profile is used to set the base set of encoding parameters. + @note{This option only applies when using amdvce [encoder](#encoderhttpslocalhost47990configencoder).} + @note{The other AMF options that follow will override a subset of the settings applied by your usage + profile, but there are hidden parameters set in usage profiles that cannot be overridden elsewhere.} +
Default@code{} + ultralowlatency + @endcode
Example@code{} + amd_usage = ultralowlatency + @endcode
Choicestranscodingtranscoding (slowest)
webcamwebcam (slow)
lowlatency_high_qualitylow latency, high quality (fast)
lowlatencylow latency (faster)
ultralowlatencyultra low latency (fastest)
+ +### [amd_rc](https://localhost:47990/config/#amd_rc) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Description + The encoder rate control. + @note{This option only applies when using amdvce [encoder](#encoderhttpslocalhost47990configencoder).} + @warning{The `vbr_latency` option generally works best, but some bitrate overshoots may still occur. + Enabling HRD allows all bitrate based rate controls to better constrain peak bitrate, but may result in + encoding artifacts depending on your card.} +
Default@code{} + vbr_latency + @endcode
Example@code{} + amd_rc = vbr_latency + @endcode
Choicescqpconstant qp mode
cbrconstant bitrate
vbr_latencyvariable bitrate, latency constrained
vbr_peakvariable bitrate, peak constrained
+ +### [amd_enforce_hrd](https://localhost:47990/config/#amd_enforce_hrd) + + + + + + + + + + + + + + +
Description + Enable Hypothetical Reference Decoder (HRD) enforcement to help constrain the target bitrate. + @note{This option only applies when using amdvce [encoder](#encoderhttpslocalhost47990configencoder).} + @warning{HRD is known to cause encoding artifacts or negatively affect encoding quality on certain cards.} +
Default@code{} + disabled + @endcode
Example@code{} + amd_enforce_hrd = disabled + @endcode
+ +### [amd_quality](https://localhost:47990/config/#amd_quality) + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Description + The quality profile controls the tradeoff between speed and quality of encoding. + @note{This option only applies when using amdvce [encoder](#encoderhttpslocalhost47990configencoder).} +
Default@code{} + balanced + @endcode
Example@code{} + amd_quality = balanced + @endcode
Choicesspeedprefer speed
balancedbalanced
qualityprefer quality
+ +### [amd_preanalysis](https://localhost:47990/config/#amd_preanalysis) + + + + + + + + + + + + + + +
Description + Preanalysis can increase encoding quality at the cost of latency. + @note{This option only applies when using amdvce [encoder](#encoderhttpslocalhost47990configencoder).} +
Default@code{} + disabled + @endcode
Example@code{} + amd_preanalysis = disabled + @endcode
+ +### [amd_vbaq](https://localhost:47990/config/#amd_vbaq) + + + + + + + + + + + + + + +
Description + Variance Based Adaptive Quantization (VBAQ) can increase subjective visual quality by prioritizing + allocation of more bits to smooth areas compared to more textured areas. + @note{This option only applies when using amdvce [encoder](#encoderhttpslocalhost47990configencoder).} +
Default@code{} + enabled + @endcode
Example@code{} + amd_vbaq = enabled + @endcode
+ +### [amd_coder](https://localhost:47990/config/#amd_coder) + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Description + The entropy encoding to use. + @note{This option only applies when using H.264 with the amdvce + [encoder](#encoderhttpslocalhost47990configencoder).} +
Default@code{} + auto + @endcode
Example@code{} + amd_coder = auto + @endcode
Choicesautolet ffmpeg decide
cabaccontext adaptive binary arithmetic coding - faster decode
cavlccontext adaptive variable-length coding - higher quality
+ +## [VideoToolbox Encoder](https://localhost:47990/config/#videotoolbox-encoder) + +### [vt_coder](https://localhost:47990/config/#vt_coder) + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Description + The entropy encoding to use. + @note{This option only applies when using macOS.} +
Default@code{} + auto + @endcode
Example@code{} + vt_coder = auto + @endcode
Choicesautolet ffmpeg decide
cabaccontext adaptive binary arithmetic coding - faster decode
cavlccontext adaptive variable-length coding - higher quality
+ +### [vt_software](https://localhost:47990/config/#vt_software) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Description + Force Video Toolbox to use software encoding. + @note{This option only applies when using macOS.} +
Default@code{} + auto + @endcode
Example@code{} + vt_software = auto + @endcode
Choicesautolet ffmpeg decide
disableddisable software encoding
allowedallow software encoding
forcedforce software encoding
+ +### [vt_realtime](https://localhost:47990/config/#vt_realtime) + + + + + + + + + + + + + + +
Description + Realtime encoding. + @note{This option only applies when using macOS.} + @warning{Disabling realtime encoding might result in a delayed frame encoding or frame drop.} +
Default@code{} + enabled + @endcode
Example@code{} + vt_realtime = enabled + @endcode
+ +## [Software Encoder](https://localhost:47990/config/#software-encoder) + +### [sw_preset](https://localhost:47990/config/#sw_preset) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Description + The encoder preset to use. + @note{This option only applies when using software [encoder](#encoderhttpslocalhost47990configencoder).} + @note{From [FFmpeg](https://trac.ffmpeg.org/wiki/Encode/H.264#preset). +
+
+ A preset is a collection of options that will provide a certain encoding speed to compression ratio. A slower + preset will provide better compression (compression is quality per filesize). This means that, for example, if + you target a certain file size or constant bit rate, you will achieve better quality with a slower preset. + Similarly, for constant quality encoding, you will simply save bitrate by choosing a slower preset. +
+
+ Use the slowest preset that you have patience for.} +
Default@code{} + superfast + @endcode
Example@code{} + sw_preset = superfast + @endcode
Choicesultrafastfastest
superfast
veryfast
faster
fast
medium
slow
slower
veryslowslowest
+ +### [sw_tune](https://localhost:47990/config/#sw_tune) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Description + The tuning preset to use. + @note{This option only applies when using software [encoder](#encoderhttpslocalhost47990configencoder).} + @note{From [FFmpeg](https://trac.ffmpeg.org/wiki/Encode/H.264#preset). +
+
+ You can optionally use -tune to change settings based upon the specifics of your input. + } +
Default@code{} + zerolatency + @endcode
Example@code{} + sw_tune = zerolatency + @endcode
Choicesfilmuse for high quality movie content; lowers deblocking
animationgood for cartoons; uses higher deblocking and more reference frames
grainpreserves the grain structure in old, grainy film material
stillimagegood for slideshow-like content
fastdecodeallows faster decoding by disabling certain filters
zerolatencygood for fast encoding and low-latency streaming
+ +
+ +| Previous | Next | +|:------------------|--------------------------------:| +| [Legal](legal.md) | [App Examples](app_examples.md) | + +
diff --git a/docs/contributing.md b/docs/contributing.md new file mode 100644 index 00000000000..33b78062562 --- /dev/null +++ b/docs/contributing.md @@ -0,0 +1,195 @@ +# Contributing +Read our contribution guide in our organization level +[docs](https://lizardbyte.readthedocs.io/en/latest/developers/contributing.html). + +## Project Patterns + +### Web UI +* The Web UI uses [Vite](https://vitejs.dev) as its build system. +* The HTML pages used by the Web UI are found in `./src_assets/common/assets/web`. +* [EJS](https://www.npmjs.com/package/vite-plugin-ejs) is used as a templating system for the pages + (check `template_header.html` and `template_header_main.html`). +* The Style System is provided by [Bootstrap](https://getbootstrap.com). +* The JS framework used by the more interactive pages is [Vus.js](https://vuejs.org). + +#### Building + +@tabs{ + @tab{CMake | ```bash + cmake -B build -G Ninja -S . --target web-ui + ninja -C build web-ui + ```} + @tab{Manual | ```bash + npm run dev + ```} +} + +### Localization +Sunshine and related LizardByte projects are being localized into various languages. +The default language is `en` (English). + +![](https://app.lizardbyte.dev/uno/crowdin/LizardByte_graph.svg) + +@admonition{Community | We are looking for language coordinators to help approve translations. +The goal is to have the bars above filled with green! +If you are interesting, please reach out to us on our Discord server.} + +#### CrowdIn +The translations occur on [CrowdIn][crowdin-url]. +Anyone is free to contribute to the localization there. + +##### Translation Basics +* The brand names *LizardByte* and *Sunshine* should never be translated. +* Other brand names should never be translated. Examples include *AMD*, *Intel*, and *NVIDIA*. + +##### CrowdIn Integration +How does it work? + +When a change is made to Sunshine source code, a workflow generates new translation templates +that get pushed to CrowdIn automatically. + +When translations are updated on CrowdIn, a push gets made to the *l10n_master* branch and a PR is made against the +*master* branch. Once the PR is merged, all updated translations are part of the project and will be included in the +next release. + +#### Extraction + +##### Web UI +Sunshine uses [Vue I18n](https://vue-i18n.intlify.dev) for localizing the UI. +The following is a simple example of how to use it. + +* Add the string to the `./src_assets/common/assets/web/public/assets/locale/en.json` file, in English. + ```json + { + "index": { + "welcome": "Hello, Sunshine!" + } + } + ``` + + @note{The json keys should be sorted alphabetically. You can use [jsonabc](https://novicelab.org/jsonabc) + to sort the keys.} + + @attention{Due to the integration with Crowdin, it is important to only add strings to the *en.json* file, + and to not modify any other language files. After the PR is merged, the translations can take place + on [CrowdIn][crowdin-url]. Once the translations are complete, a PR will be made + to merge the translations into Sunshine.} + +* Use the string in the Vue component. + ```html + + ``` + + @tip{More formatting examples can be found in the + [Vue I18n guide](https://kazupon.github.io/vue-i18n/guide/formatting.html).} + +##### C++ + +There should be minimal cases where strings need to be extracted from C++ source code; however it may be necessary in +some situations. For example the system tray icon could be localized as it is user interfacing. + +* Wrap the string to be extracted in a function as shown. + ```cpp + #include + #include + + std::string msg = boost::locale::translate("Hello world!"); + ``` + +@tip{More examples can be found in the documentation for +[boost locale](https://www.boost.org/doc/libs/1_70_0/libs/locale/doc/html/messages_formatting.html).} + +@warning{The below is for information only. Contributors should never include manually updated template files, or +manually compiled language files in Pull Requests.} + +Strings are automatically extracted from the code to the `locale/sunshine.po` template file. The generated file is +used by CrowdIn to generate language specific template files. The file is generated using the +`.github/workflows/localize.yml` workflow and is run on any push event into the `master` branch. Jobs are only run if +any of the following paths are modified. + +```yaml +- 'src/**' +``` + +When testing locally it may be desirable to manually extract, initialize, update, and compile strings. Python is +required for this, along with the python dependencies in the `./scripts/requirements.txt` file. Additionally, +[xgettext](https://www.gnu.org/software/gettext) must be installed. + +* Extract, initialize, and update + ```bash + python ./scripts/_locale.py --extract --init --update + ``` + +* Compile + ```bash + python ./scripts/_locale.py --compile + ``` + +@attention{Due to the integration with CrowdIn, it is important to not include any extracted or compiled files in +Pull Requests. The files are automatically generated and updated by the workflow. Once the PR is merged, the +translations can take place on [CrowdIn][crowdin-url]. Once the translations are +complete, a PR will be made to merge the translations into Sunshine.} + +### Testing + +#### Clang Format +Source code is tested against the `.clang-format` file for linting errors. The workflow file responsible for clang +format testing is `.github/workflows/cpp-clang-format-lint.yml`. + +Option 1: +```bash +find ./ -iname *.cpp -o -iname *.h -iname *.m -iname *.mm | xargs clang-format -i +``` + +Option 2 (will modify files): +```bash +python ./scripts/update_clang_format.py +``` + +#### Unit Testing +Sunshine uses [Google Test](https://github.com/google/googletest) for unit testing. Google Test is included in the +repo as a submodule. The test sources are located in the `./tests` directory. + +The tests need to be compiled into an executable, and then run. The tests are built using the normal build process, but +can be disabled by setting the `BUILD_TESTS` CMake option to `OFF`. + +To run the tests, execute the following command. + +```bash +./build/tests/test_sunshine +``` + +To see all available options, run the tests with the `--help` flag. + +```bash +./build/tests/test_sunshine --help +``` + +@tip{See the googletest [FAQ](https://google.github.io/googletest/faq.html) for more information on how to use +Google Test.} + +We use [gcovr](https://www.gcovr.com) to generate code coverage reports, +and [Codecov](https://about.codecov.io) to analyze the reports for all PRs and commits. + +Codecov will fail a PR if the total coverage is reduced too much, or if not enough of the diff is covered by tests. +In some cases, the code cannot be covered when running the tests inside of GitHub runners. For example, any test that +needs access to the GPU will not be able to run. In these cases, the coverage can be omitted by adding comments to the +code. See the [gcovr documentation](https://gcovr.com/en/stable/guide/exclusion-markers.html#exclusion-markers) for +more information. + +Even if your changes cannot be covered in the CI, we still encourage you to write the tests for them. This will allow +maintainers to run the tests locally. + +[crowdin-url]: https://translate.lizardbyte.dev + +
+ +| Previous | Next | +|:------------------------|-------------------------------------------------------------:| +| [Building](building.md) | [Source Code](../third-party/doxyconfig/docs/source_code.md) | + +
diff --git a/docs/doxygen/header.html b/docs/doxygen/header.html deleted file mode 100644 index 1f8d0d0594a..00000000000 --- a/docs/doxygen/header.html +++ /dev/null @@ -1,95 +0,0 @@ - - - - - - - - -$projectname: $title -$title - - - - - - - - - - -$treeview -$search -$mathjax -$darkmode - -$extrastylesheet - - - - - - - - - - - - - - - -
- - - -
- - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
$projectname $projectnumber -
-
$projectbrief
-
-
$projectbrief
-
$searchbox
$searchbox
-
- - diff --git a/docs/environment.yml b/docs/environment.yml deleted file mode 100644 index 5919549dde6..00000000000 --- a/docs/environment.yml +++ /dev/null @@ -1,12 +0,0 @@ ---- -name: RTD -channels: - - conda-forge - - defaults -dependencies: - - doxygen=1.10.0 - - graphviz=11.0.0 - - pip - - python=3.11 - - pip: - - -r ./requirements.txt diff --git a/docs/gamestream_migration.md b/docs/gamestream_migration.md new file mode 100644 index 00000000000..274ad0e05d8 --- /dev/null +++ b/docs/gamestream_migration.md @@ -0,0 +1,31 @@ +# GameStream Migration +Nvidia announced that their GameStream service for Nvidia Games clients will be discontinued in February 2023. +Luckily, Sunshine performance is now equal to or better than Nvidia GameStream. + +## Migration +We have developed a simple migration tool to help you migrate your GameStream games and apps to Sunshine automatically. +Please check out our [GSMS](https://github.com/LizardByte/GSMS) project if you're interested in an automated +migration option. GSMS offers the ability to migrate your custom and auto-detected games and apps. The +working directory, command, and image are all set in Sunshine's `apps.json` file. The box-art image is also copied +to a specified directory. + +## Internet Streaming +If you are using the Moonlight Internet Hosting Tool, you can remove it from your system when you migrate to Sunshine. +To stream over the Internet with Sunshine and a UPnP-capable router, enable the UPnP option in the Sunshine Web UI. + +@note{Running Sunshine together with versions of the Moonlight Internet Hosting Tool prior to v5.6 will cause UPnP +port forwarding to become unreliable. Either uninstall the tool entirely or update it to v5.6 or later.} + +## Limitations +Sunshine does have some limitations, as compared to Nvidia GameStream. + +* Automatic game/application list. +* Changing game settings automatically, to optimize streaming. + +
+ +| Previous | Next | +|:------------------------------------------------|------------------:| +| [Third-party Packages](third_party_packages.md) | [Legal](legal.md) | + +
diff --git a/docs/getting_started.md b/docs/getting_started.md new file mode 100644 index 00000000000..a9bd5561314 --- /dev/null +++ b/docs/getting_started.md @@ -0,0 +1,573 @@ +# Getting Started + +The recommended method for running Sunshine is to use the [binaries](#binaries) included in the +[latest release][latest-release], unless otherwise specified. + +[Pre-releases](https://github.com/LizardByte/Sunshine/releases) are also available. These should be considered beta, +and release artifacts may be missing when merging changes on a faster cadence. + +## Binaries + +Binaries of Sunshine are created for each release. They are available for Linux, macOS, and Windows. +Binaries can be found in the [latest release][latest-release]. + +@tip{Some third party packages also exist. +See [Third Party Packages](third_party_packages.md) for more information. +No support will be provided for third party packages!} + +## Install + +### Docker +@warning{The Docker images are not recommended for most users.} + +Docker images are available on [Dockerhub.io](https://hub.docker.com/repository/docker/lizardbyte/sunshin) +and [ghcr.io](https://github.com/orgs/LizardByte/packages?repo_name=sunshine). + +See [Docker](../DOCKER_README.md) for more information. + +### Linux +**CUDA Compatibility** + +CUDA is used for NVFBC capture. + +@tip{See [CUDA GPUS](https://developer.nvidia.com/cuda-gpus) to cross-reference Compute Capability to your GPU.} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
CUDA Compatibility
CUDA VersionMin DriverCUDA Compute CapabilitiesPackage
11.8.0450.80.0235;50;52;60;61;62;70;72;75;80;86;87;89;90sunshine.AppImage
sunshine-ubuntu-22.04-{arch}.deb
sunshine-ubuntu-24.04-{arch}.deb
12.0.0525.60.1350;52;60;61;62;70;72;75;80;86;87;89;90sunshine_{arch}.flatpak
sunshine-debian-bookworm-{arch}.deb
12.4.0sunshine-fedora-39-{arch}.rpm
12.5.1sunshine.pkg.tar.zst
n/an/an/asunshine-fedora-40-{arch}.rpm
+ +#### AppImage +@caution{Use distro-specific packages instead of the AppImage if they are available.} + +According to AppImageLint the supported distro matrix of the AppImage is below. + +- ✖ Debian bullseye +- ✔ Debian bookworm +- ✔ Debian trixie +- ✔ Debian sid +- ✔ Ubuntu noble +- ✔ Ubuntu jammy +- ✖ Ubuntu focal +- ✖ Ubuntu bionic +- ✖ Ubuntu xenial +- ✖ Ubuntu trusty +- ✖ CentOS 7 + +##### Install +1. Download [sunshine.AppImage](https://github.com/LizardByte/Sunshine/releases/latest/download/sunshine.AppImage) + into your home directory. + ```bash + cd ~ + wget https://github.com/LizardByte/Sunshine/releases/latest/download/sunshine.AppImage + ``` +2. Open terminal and run the following command. + ```bash + ./sunshine.AppImage --install + ``` + +##### Run +```bash +./sunshine.AppImage --install && ./sunshine.AppImage +``` + +##### Uninstall +```bash +./sunshine.AppImage --remove +``` + +#### ArchLinux +@warning{We do not provide support for any AUR packages.} + +##### Install Prebuilt Packages +Follow the instructions at LizardByte's [pacman-repo](https://github.com/LizardByte/pacman-repo) to add +the repository. Then run the following command. +```bash +pacman -S sunshine +``` + +##### Install PKGBUILD Archive +Open terminal and run the following command. +```bash +wget https://github.com/LizardByte/Sunshine/releases/latest/download/sunshine.pkg.tar.gz +tar -xvf sunshine.pkg.tar.gz +cd sunshine + +# install optional dependencies +pacman -S cuda # Nvidia GPU encoding support +pacman -S libva-mesa-driver # AMD GPU encoding support + +makepkg -si +``` + +##### Uninstall +```bash +pacman -R sunshine +``` + +#### Debian/Ubuntu +##### Install +Download `sunshine-{distro}-{distro-version}-{arch}.deb` and run the following command. +```bash +sudo dpkg -i ./sunshine-{distro}-{distro-version}-{arch}.deb +``` + +@note{The `{distro-version}` is the version of the distro we built the package on. The `{arch}` is the +architecture of your operating system.} + +@tip{You can double-click the deb file to see details about the package and begin installation.} + +##### Uninstall +```bash +sudo apt remove sunshine +``` + +#### Fedora +##### Install +1. Add `rpmfusion` repositories. + ```bash + sudo dnf install \ + https://mirrors.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm \ + https://mirrors.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-$(rpm -E %fedora).noarch.rpm + ``` +2. Download `sunshine-{distro}-{distro-version}-{arch}.rpm` and run the following command. + ```bash + sudo dnf install ./sunshine-{distro}-{distro-version}-{arch}.rpm + ``` + +@note{The `{distro-version}` is the version of the distro we built the package on. The `{arch}` is the +architecture of your operating system.} + +@tip{You can double-click the rpm file to see details about the package and begin installation.} + +##### Uninstall +```bash +sudo dnf remove sunshine +``` + +#### Flatpak +@caution{Use distro-specific packages instead of the Flatpak if they are available.} + +@important{The instructions provided here are for the version supplied in the [latest release][latest-release], +which does not necessarily match the version in the Flathub repository!} + +Using this package requires that you have [Flatpak](https://flatpak.org/setup) installed. + +##### Download +1. Download `sunshine_{arch}.flatpak` and run the following command. + @note{Replace `{arch}` with your system architecture.} + +##### Install (system level) +```bash +flatpak install --system ./sunshine_{arch}.flatpak +``` + +##### Install (user level) +```bash +flatpak install --user ./sunshine_{arch}.flatpak +``` + +##### Additional installation (required) +```bash +flatpak run --command=additional-install.sh dev.lizardbyte.app.Sunshine +``` + +##### Run with NVFBC capture (X11 Only) +```bash +flatpak run dev.lizardbyte.app.Sunshine +``` + +##### Run with KMS capture (Wayland & X11) +```bash +sudo -i PULSE_SERVER=unix:$(pactl info | awk '/Server String/{print$3}') flatpak run dev.lizardbyte.app.Sunshine +``` + +##### Uninstall +```bash +flatpak run --command=remove-additional-install.sh dev.lizardbyte.app.Sunshine +flatpak uninstall --delete-data dev.lizardbyte.app.Sunshine +``` + +#### Homebrew +@important{The Homebrew package is experimental on Linux.} + +This package requires that you have [Homebrew](https://docs.brew.sh/Installation) installed. + +##### Install +```bash +brew tap LizardByte/homebrew +brew install sunshine +``` + +##### Uninstall +```bash +brew uninstall sunshine +``` + +### macOS + +@important{Sunshine on macOS is experimental. Gamepads do not work.} + +#### Homebrew +This package requires that you have [Homebrew](https://docs.brew.sh/Installation) installed. + +##### Install +```bash +brew tap LizardByte/homebrew +brew install sunshine +``` + +##### Uninstall +```bash +brew uninstall sunshine +``` + +@tip{For beta you can replace `sunshine` with `sunshine-beta` in the above commands.} + +#### Portfile +This package requires that you have [MacPorts](https://www.macports.org/install.php) installed. + +##### Install +1. Update the Macports sources. + ```bash + sudo nano /opt/local/etc/macports/sources.conf + ``` + + Add this line, replacing your username, below the line that starts with `rsync`. + ```bash + file:///Users//ports + ``` + + `Ctrl+x`, then `Y` to exit and save changes. + +2. Download and install by running the following commands. + ```bash + mkdir -p ~/ports/multimedia/sunshine + cd ~/ports/multimedia/sunshine + curl -OL https://github.com/LizardByte/Sunshine/releases/latest/download/Portfile + cd ~/ports + portindex + sudo port install sunshine + ``` + +##### Install service (optional) +```bash +sudo port load sunshine +``` + +##### Uninstall +```bash +sudo port uninstall sunshine +``` + +### Windows + +#### Installer (recommended) + +1. Download and install + [sunshine-windows-installer.exe](https://github.com/LizardByte/Sunshine/releases/latest/download/sunshine-windows-installer.exe) + +@attention{You should carefully select or unselect the options you want to install. Do not blindly install or +enable features.} + +To uninstall, find Sunshine in the list here and select "Uninstall" from the +overflow menu. Different versions of Windows may provide slightly different steps for uninstall. + +#### Standalone (lite version) + +@warning{By using this package instead of the installer, performance will be reduced. This package is not +recommended for most users. No support will be provided!} + +1. Download and extract + [sunshine-windows-portable.zip](https://github.com/LizardByte/Sunshine/releases/latest/download/sunshine-windows-portable.zip) +2. Open command prompt as administrator +3. Firewall rules + + Install: + ```bash + cd /d {path to extracted directory} + scripts/add-firewall-rule.bat + ``` + + Uninstall: + ```bash + cd /d {path to extracted directory} + scripts/delete-firewall-rule.bat + ``` + +4. Virtual Gamepad Support + + Install: + ```bash + cd /d {path to extracted directory} + scripts/install-gamepad.bat + ``` + + Uninstall: + ```bash + cd /d {path to extracted directory} + scripts/uninstall-gamepad.bat + ``` + +5. Windows service + + Install: + ```bash + cd /d {path to extracted directory} + scripts/install-service.bat + scripts/autostart-service.bat + ``` + + Uninstall: + ```bash + cd /d {path to extracted directory} + scripts/uninstall-service.bat + ``` + +To uninstall, delete the extracted directory which contains the `sunshine.exe` file. + +## Initial Setup +After installation, some initial setup is required. + +### Linux + +#### KMS Capture +@warning{Capture of most Wayland-based desktop environments will fail unless this step is performed.} +@note{`cap_sys_admin` may as well be root, except you don't need to be root to run the program. This is necessary to +allow Sunshine to use KMS capture.} + +##### Enable +```bash +sudo setcap cap_sys_admin+p $(readlink -f $(which sunshine)) +``` + +#### X11 Capture +For X11 capture to work, you may need to disable the capabilities that were set for KMS capture. + +```bash +sudo setcap -r $(readlink -f $(which sunshine)) +``` + +#### Service + +**Start once** +```bash +systemctl --user start sunshine +``` + +**Start on boot** +```bash +systemctl --user enable sunshine +``` + +### macOS +The first time you start Sunshine, you will be asked to grant access to screen recording and your microphone. + +Sunshine can only access microphones on macOS due to system limitations. To stream system audio use +[Soundflower](https://github.com/mattingalls/Soundflower) or +[BlackHole](https://github.com/ExistentialAudio/BlackHole). + +@note{Command Keys are not forwarded by Moonlight. Right Option-Key is mapped to CMD-Key.} +@caution{Gamepads are not currently supported.} + +## Usage + +### Basic usage +If Sunshine is not installed/running as a service, then start Sunshine with the following command, unless a start +command is listed in the specified package [install](#install) instructions above. + +@note{A service is a process that runs in the background. This is the default when installing Sunshine from the +Windows installer. Running multiple instances of Sunshine is not advised.} + +```bash +sunshine +``` + +### Specify config file +```bash +sunshine /sunshine.conf +``` + +@note{You do not need to specify a config file. If no config file is entered the default location will be used.} + +@attention{The configuration file specified will be created if it doesn't exist.} + +### Start Sunshine over SSH (Linux/X11) +Assuming you are already logged into the host, you can use this command + +```bash +ssh @ 'export DISPLAY=:0; sunshine' +``` + +If you are logged into the host with only a tty (teletypewriter), you can use `startx` to start the X server prior to +executing Sunshine. You nay need to add `sleep` between `startx` and `sunshine` to allow more time for the display to +be ready. + +```bash +ssh @ 'startx &; export DISPLAY=:0; sunshine' +``` + +@tip{You could also utilize the `~/.bash_profile` or `~/.bashrc` files to set up the `DISPLAY` variable.} + +@seealso{ See [Remote SSH Headless Setup](md_docs_2guides.html#remote-ssh-headless-setup) +on how to set up a headless streaming server without autologin and dummy plugs (X11 + NVidia GPUs)} + +### Configuration + +Sunshine is configured via the web ui, which is available on [https://localhost:47990](https://localhost:47990) +by default. You may replace *localhost* with your internal ip address. + +@attention{Ignore any warning given by your browser about "insecure website". This is due to the SSL certificate +being self-signed.} + +@caution{If running for the first time, make sure to note the username and password that you created.} + +1. Add games and applications. +2. Adjust any configuration settings as needed. +3. In Moonlight, you may need to add the PC manually. +4. When Moonlight requests for you insert the pin: + + - Login to the web ui + - Go to "PIN" in the Navbar + - Type in your PIN and press Enter, you should get a Success Message + - In Moonlight, select one of the Applications listed + +### Arguments +To get a list of available arguments, run the following command. + +@tabs{ + @tab{ General | @code{.bash} + sunshine --help + @endcode } + @tab{ AppImage | @code{.bash} + ./sunshine.AppImage --help + @endcode } + @tab{ Flatpak | @code{.bash} + flatpak run --command=sunshine dev.lizardbyte.app.Sunshine --help + @endcode } +} + +### Shortcuts +All shortcuts start with `Ctrl+Alt+Shift`, just like Moonlight. + +* `Ctrl+Alt+Shift+N`: Hide/Unhide the cursor (This may be useful for Remote Desktop Mode for Moonlight) +* `Ctrl+Alt+Shift+F1/F12`: Switch to different monitor for Streaming + +### Application List +* Applications should be configured via the web UI +* A basic understanding of working directories and commands is required +* You can use Environment variables in place of values +* `$(HOME)` will be replaced by the value of `$HOME` +* `$$` will be replaced by `$`, e.g. `$$(HOME)` will be become `$(HOME)` +* `env` - Adds or overwrites Environment variables for the commands/applications run by Sunshine. + This can only be changed by modifying the `apps.json` file directly. + +### Considerations +* On Windows, Sunshine uses the Desktop Duplication API which only supports capturing from the GPU used for display. + If you want to capture and encode on the eGPU, connect a display or HDMI dummy display dongle to it and run the games + on that display. +* When an application is started, if there is an application already running, it will be terminated. +* If any of the prep-commands fail, starting the application is aborted. +* When the application has been shutdown, the stream shuts down as well. + + * For example, if you attempt to run `steam` as a `cmd` instead of `detached` the stream will immediately fail. + This is due to the method in which the steam process is executed. Other applications may behave similarly. + * This does not apply to `detached` applications. + +* The "Desktop" app works the same as any other application except it has no commands. It does not start an application, + instead it simply starts a stream. If you removed it and would like to get it back, just add a new application with + the name "Desktop" and "desktop.png" as the image path. +* For the Linux flatpak you must prepend commands with `flatpak-spawn --host`. + +### HDR Support +Streaming HDR content is officially supported on Windows hosts and experimentally supported for Linux hosts. + +* General HDR support information and requirements: + + * HDR must be activated in the host OS, which may require an HDR-capable display or EDID emulator dongle + connected to your host PC. + * You must also enable the HDR option in your Moonlight client settings, otherwise the stream will be SDR + (and probably overexposed if your host is HDR). + * A good HDR experience relies on proper HDR display calibration both in the OS and in game. HDR calibration can + differ significantly between client and host displays. + * You may also need to tune the brightness slider or HDR calibration options in game to the different HDR brightness + capabilities of your client's display. + * Some GPUs video encoders can produce lower image quality or encoding performance when streaming in HDR compared + to SDR. + +* Additional information: + + @tabs{ + @tab{ Windows | + - HDR streaming is supported for Intel, AMD, and NVIDIA GPUs that support encoding HEVC Main 10 or AV1 10-bit profiles. + - We recommend calibrating the display by streaming the Windows HDR Calibration app to your client device and saving an HDR calibration profile to use while streaming. + - Older games that use NVIDIA-specific NVAPI HDR rather than native Windows HDR support may not display properly in HDR. + } + + @tab{ Linux | + - HDR streaming is supported for Intel and AMD GPUs that support encoding HEVC Main 10 or AV1 10-bit profiles using VAAPI. + - The KMS capture backend is required for HDR capture. Other capture methods, like NvFBC or X11, do not support HDR. + - You will need a desktop environment with a compositor that supports HDR rendering, such as Gamescope or KDE Plasma 6. + + @seealso{[Arch wiki on HDR Support for Linux](https://wiki.archlinux.org/title/HDR_monitor_support) and + [Reddit Guide for HDR Support for AMD GPUs](https://www.reddit.com/r/linux_gaming/comments/10m2gyx/guide_alpha_test_hdr_on_linux)} + } + } + +### Tutorials and Guides +Tutorial videos are available [here](https://www.youtube.com/playlist?list=PLMYr5_xSeuXAbhxYHz86hA1eCDugoxXY0). + +Guides are available [here](guides.md). + +@admonition{Community! | +Tutorials and Guides are community generated. Want to contribute? Reach out to us on our discord server.} + +
+ +| Previous | Next | +|:-------------------------|--------------------------:| +| [Overview](../README.md) | [Changelog](changelog.md) | + +
+ +[latest-release]: https://github.com/LizardByte/Sunshine/releases/latest diff --git a/docs/guides.md b/docs/guides.md new file mode 100644 index 00000000000..c0f592d7ac9 --- /dev/null +++ b/docs/guides.md @@ -0,0 +1,534 @@ +# Guides + +@admonition{Community | This collection of guides is written by the community! +Feel free to contribute your own tips and trips by making a PR.} + + +## Linux + +### Discord call cancellation + +| Author | [RickAndTired](https://github.com/RickAndTired) | +|------------|-------------------------------------------------| +| Difficulty | Easy | + +* Set your normal *Sound Output* volume to 100% + + ![](images/discord_calls_01.png) + +* Start Sunshine + +* Set *Sound Output* to *sink-sunshine-stereo* (if it isn't automatic) + + ![](images/discord_calls_02.png) + +* In Discord, right click *Deafen* and select your normal *Output Device*. + This is also where you will need to adjust output volume for Discord calls + + ![](images/discord_calls_03.png) + +* Open *qpwgraph* + + ![](images/discord_calls_04.png) + +* Connect `sunshine [sunshine-record]` to your normal *Output Device* + * Drag `monitor_FL` to `playback_FL` + * Drag `monitor_FR` to `playback_FR` + + ![](images/discord_calls_05.png) + +### Remote SSH Headless Setup + +| Author | [Eric Dong](https://github.com/e-dong) | +|------------|----------------------------------------| +| Difficulty | Intermediate | + +This is a guide to setup remote SSH into host to startup X server and Sunshine without physical login and dummy plug. +The virtual display is accelerated by the NVidia GPU using the TwinView configuration. + +@attention{This guide is specific for Xorg and NVidia GPUs. I start the X server using the `startx` command. +I also only tested this on an Artix runit init system on LAN. +I didn't have to do anything special with pulseaudio (pipewire untested). + +Keep your monitors plugged in until the [Checkpoint](#checkpoint) step.} + +@tip{Prior to editing any system configurations, you should make a copy of the original file. +This will allow you to use it for reference or revert your changes easily.} + +#### The Big Picture +Once you are done, you will need to perform these 3 steps: + +1. Turn on the host machine +2. Start Sunshine on remote host with a script that: + + * Edits permissions of `/dev/uinput` (added sudo config to execute script with no password prompt) + * Starts X server with `startx` on virtual display + * Starts Sunshine + +3. Startup Moonlight on the client of interest and connect to host + +@hint{As an alternative to SSH... + +**Step 2** can be replaced with autologin and starting Sunshine as a service or putting +`sunshine &` in your `.xinitrc` file if you start your X server with `startx`. +In this case, the workaround for `/dev/uinput` permissions is not needed because the udev rule would be triggered +for "physical" login. See [Linux Setup](md_docs_2getting__started.html#linux). I personally think autologin compromises +the security of the PC, so I went with the remote SSH route. I use the PC more than for gaming, so I don't need a +virtual display everytime I turn on the PC (E.g running updates, config changes, file/media server).} + +First we will [setup the host](#host-setup) and then the [SSH Client](#ssh-client-setup) +(Which may not be the same as the machine running the moonlight client). + +#### Host Setup +We will be setting up: + +1. [Static IP Setup](#static-ip-setup) +2. [SSH Server Setup](#ssh-server-setup) +3. [Virtual Display Setup](#virtual-display-setup) +4. [Uinput Permissions Workaround](#uinput-permissions-workaround) +5. [Stream Launcher Script](#stream-launcher-script) + +#### Static IP Setup +Setup static IP Address for host. For LAN connections you can use DHCP reservation within your assigned range. +e.g. 192.168.x.x. This will allow you to ssh to the host consistently, so the assigned IP address does +not change. It is preferred to set this through your router config. + +#### SSH Server Setup +@note{Most distros have OpenSSH already installed. If it is not present, install OpenSSH using your package manager.} + +@tabs{ + @tab{Debian based | ```bash + sudo apt update + sudo apt install openssh-server + ```} + @tab{Arch based | ```bash + sudo pacman -S openssh + # Install openssh- if you are not using SystemD + # e.g. sudo pacman -S openssh-runit + ```} + @tab{Alpine based | ```bash + sudo apk update + sudo apk add openssh + ```} + @tab{Fedora based (dnf) | ```bash + sudo dnf install openssh-server + ```} + @tab{Fedora based (yum) | ```bash + sudo yum install openssh-server + ```} +} + +Next make sure the OpenSSH daemon is enabled to run when the system starts. + +@tabs{ + @tab{SystemD | ```bash + sudo systemctl enable sshd.service + sudo systemctl start sshd.service # Starts the service now + sudo systemctl status sshd.service # See if the service is running + ```} + @tab{Runit | ```bash + sudo ln -s /etc/runit/sv/sshd /run/runit/service # Enables the OpenSSH daemon to run when system starts + sudo sv start sshd # Starts the service now + sudo sv status sshd # See if the service is running + ```} + @tab{OpenRC | ```bash + rc-update add sshd # Enables service + rc-status # List services to verify sshd is enabled + rc-service sshd start # Starts the service now + ```} +} + +**Disabling PAM in sshd** + +I noticed when the ssh session is disconnected for any reason, `pulseaudio` would disconnect. +This is due to PAM handling sessions. When running `dmesg`, I noticed `elogind` would say removed user session. +In this [Gentoo Forums post](https://forums.gentoo.org/viewtopic-t-1090186-start-0.html), +someone had a similar issue. Starting the X server in the background and exiting out of the console would cause your +session to be removed. + +@caution{According to this [article](https://devicetests.com/ssh-usepam-security-session-status) +disabling PAM increases security, but reduces certain functionality in terms of session handling. +*Do so at your own risk!*} + +Edit the ``sshd_config`` file with the following to disable PAM. + +```txt +usePAM no +``` + +After making changes to the `sshd_config`, restart the sshd service for changes to take effect. + +@tip{Run the command to check the ssh configuration prior to restarting the sshd service. +```bash +sudo sshd -t -f /etc/ssh/sshd_config +``` + +An incorrect configuration will prevent the sshd service from starting, which might mean +losing SSH access to the server.} + +@tabs{ + @tab{SystemD | ```bash + sudo systemctl restart sshd.service + ```} + @tab{Runit | ```bash + sudo sv restart sshd + ```} + @tab{OpenRC | ```bash + sudo rc-service sshd restart + ```} +} + +#### Virtual Display Setup +As an alternative to a dummy dongle, you can use this config to create a virtual display. + +@important{This is only available for NVidia GPUs using Xorg.} + +@hint{Use ``xrandr`` to see name of your active display output. Usually it starts with ``DP`` or ``HDMI``. For me, it is ``DP-0``. +Put this name for the ``ConnectedMonitor`` option under the ``Device`` section. + +```bash +xrandr | grep " connected" | awk '{ print $1 }' +``` +} + +```xorg +Section "ServerLayout" + Identifier "TwinLayout" + Screen 0 "metaScreen" 0 0 +EndSection + +Section "Monitor" + Identifier "Monitor0" + Option "Enable" "true" +EndSection + +Section "Device" + Identifier "Card0" + Driver "nvidia" + VendorName "NVIDIA Corporation" + Option "MetaModes" "1920x1080" + Option "ConnectedMonitor" "DP-0" + Option "ModeValidation" "NoDFPNativeResolutionCheck,NoVirtualSizeCheck,NoMaxPClkCheck,NoHorizSyncCheck,NoVertRefreshCheck,NoWidthAlignmentCheck" +EndSection + +Section "Screen" + Identifier "metaScreen" + Device "Card0" + Monitor "Monitor0" + DefaultDepth 24 + Option "TwinView" "True" + SubSection "Display" + Modes "1920x1080" + EndSubSection +EndSection +``` + +@note{The `ConnectedMonitor` tricks the GPU into thinking a monitor is connected, +even if there is none actually connected! This allows a virtual display to be created that is accelerated with +your GPU! The `ModeValidation` option disables valid resolution checks, so you can choose any +resolution on the host! + +**References** + +* [issue comment on virtual-display-linux](https://github.com/dianariyanto/virtual-display-linux/issues/9#issuecomment-786389065) +* [Nvidia Documentation on Configuring TwinView](https://download.nvidia.com/XFree86/Linux-x86/270.29/README/configtwinview.html) +* [Arch Wiki Nvidia#TwinView](https://wiki.archlinux.org/title/NVIDIA#TwinView) +* [Unix Stack Exchange - How to add virtual display monitor with Nvidia proprietary driver](https://unix.stackexchange.com/questions/559918/how-to-add-virtual-monitor-with-nvidia-proprietary-driver) +} + +#### Uinput Permissions Workaround + +##### Steps +We can use `chown` to change the permissions from a script. Since this requires `sudo`, +we will need to update the sudo configuration to execute this without being prompted for a password. + +1. Create a `sunshine-setup.sh` script to update permissions on `/dev/uinput`. Since we aren't logged into the host, + the udev rule doesn't apply. +2. Update user sudo configuration `/etc/sudoers.d/` to allow the `sunshine-setup.sh` + script to be executed with `sudo`. + +@note{After I setup the :ref:`udev rule ` to get access to `/dev/uinput`, I noticed when I sshed +into the host without physical login, the ACL permissions on `/dev/uinput` were not changed. So I asked +[reddit](https://www.reddit.com/r/linux_gaming/comments/14htuzv/does_sshing_into_host_trigger_udev_rule_on_the). +I discovered that SSH sessions are not the same as a physical login. +I suppose it's not possible for SSH to trigger a udev rule or create a physical login session.} + +##### Setup Script +This script will take care of any preconditions prior to starting up Sunshine. + +Run the following to create a script named something like `sunshine-setup.sh`: + +```bash +echo "chown $(id -un):$(id -gn) /dev/uinput" > sunshine-setup.sh && \ + chmod +x sunshine-setup.sh +``` + +(**Optional**) To Ensure ethernet is being used for streaming, you can block Wi-Fi with `rfkill`. + +Run this command to append the rfkill block command to the script: + +```bash +echo "rfkill block $(rfkill list | grep "Wireless LAN" \ + | sed 's/^\([[:digit:]]\).*/\1/')" >> sunshine-setup.sh +``` + +##### Sudo Configuration +We will manually change the permissions of `/dev/uinput` using `chown`. +You need to use `sudo` to make this change, so add/update the entry in `/etc/sudoers.d/${USER}`. + +@danger{Do so at your own risk! It is more secure to give sudo and no password prompt to a single script, +than a generic executable like chown.} + +@warning{Be very careful of messing this config up. If you make a typo, *YOU LOSE THE ABILITY TO USE SUDO*. +Fortunately, your system is not borked, you will need to login as root to fix the config. +You may want to setup a backup user / SSH into the host as root to fix the config if this happens. +Otherwise, you will need to plug your machine back into a monitor and login as root to fix this. +To enable root login over SSH edit your SSHD config, and add `PermitRootLogin yes`, and restart the SSH server.} + +1. First make a backup of your `/etc/sudoers.d/${USER}` file. + + ```bash + sudo cp /etc/sudoers.d/${USER} /etc/sudoers.d/${USER}.backup + ``` + +2. `cd` to the parent dir of the `sunshine-setup.sh` script. +3. Execute the following to update your sudoer config file. + + ```bash + echo "${USER} ALL=(ALL:ALL) ALL, NOPASSWD: $(pwd)/sunshine-setup.sh" \ + | sudo tee /etc/sudoers.d/${USER} + ``` + +These changes allow the script to use sudo without being prompted with a password. + +e.g. `sudo $(pwd)/sunshine-setup.sh` + +#### Stream Launcher Script +This is the main entrypoint script that will run the `sunshine-setup.sh` script, start up X server, and Sunshine. +The client will call this script that runs on the host via ssh. + + +##### Sunshine Startup Script +This guide will refer to this script as `~/scripts/sunshine.sh`. +The setup script will be referred as `~/scripts/sunshine-setup.sh`. + +```bash +#!/bin/bash +set -e + +export DISPLAY=:0 + +# Check existing X server +ps -e | grep X >/dev/null +[[ ${?} -ne 0 ]] && { + echo "Starting X server" + startx &>/dev/null & + [[ ${?} -eq 0 ]] && { + echo "X server started successfully" + } || echo "X server failed to start" +} || echo "X server already running" + +# Check if sunshine is already running +ps -e | grep -e .*sunshine$ >/dev/null +[[ ${?} -ne 0 ]] && { + sudo ~/scripts/sunshine-setup.sh + echo "Starting Sunshine!" + sunshine > /dev/null & + [[ ${?} -eq 0 ]] && { + echo "Sunshine started successfully" + } || echo "Sunshine failed to start" +} || echo "Sunshine is already running" + +# Add any other Programs that you want to startup automatically +# e.g. +# steam &> /dev/null & +# firefox &> /dev/null & +# kdeconnect-app &> /dev/null & +``` + +#### SSH Client Setup +We will be setting up: + +1. [SSH Key Authentication Setup](#ssh-key-authentication-setup) +2. [SSH Client Script (Optional)](#ssh-client-script-optional) + +##### SSH Key Authentication Setup +1. Setup your SSH keys with `ssh-keygen` and use `ssh-copy-id` to authorize remote login to your host. + Run `ssh @` to login to your host. + SSH keys automate login so you don't need to input your password! +2. Optionally setup a `~/.ssh/config` file to simplify the `ssh` command + + ```txt + Host + Hostname + User + IdentityFile ~/.ssh/ + ``` + + Now you can use `ssh `. + `ssh ` will execute the command or script on the remote host. + +##### Checkpoint +As a sanity check, let's make sure your setup is working so far! + +###### Test Steps +With your monitor still plugged into your Sunshine host PC: + +1. `ssh ` +2. `~/scripts/sunshine.sh` +3. `nvidia-smi` + + You should see the Sunshine and Xorg processing running: + + ```bash + nvidia-smi + ``` + + *Output:* + ```txt + +---------------------------------------------------------------------------------------+ + | NVIDIA-SMI 535.104.05 Driver Version: 535.104.05 CUDA Version: 12.2 | + |-----------------------------------------+----------------------+----------------------+ + | GPU Name Persistence-M | Bus-Id Disp.A | Volatile Uncorr. ECC | + | Fan Temp Perf Pwr:Usage/Cap | Memory-Usage | GPU-Util Compute M. | + | | | MIG M. | + |=========================================+======================+======================| + | 0 NVIDIA GeForce RTX 3070 Off | 00000000:01:00.0 On | N/A | + | 30% 46C P2 45W / 220W | 549MiB / 8192MiB | 2% Default | + | | | N/A | + +-----------------------------------------+----------------------+----------------------+ + + +---------------------------------------------------------------------------------------+ + | Processes: | + | GPU GI CI PID Type Process name GPU Memory | + | ID ID Usage | + |=======================================================================================| + | 0 N/A N/A 1393 G /usr/lib/Xorg 86MiB | + | 0 N/A N/A 1440 C+G sunshine 293MiB | + +---------------------------------------------------------------------------------------+ + ``` + +4. Check `/dev/uinput` permissions + + ```bash + ls -l /dev/uinput + ``` + + *Output:* + + ```console + crw------- 1 10, 223 Aug 29 17:31 /dev/uinput + ``` + +5. Connect to Sunshine host from a moonlight client + +Now kill X and Sunshine by running `pkill X` on the host, unplug your monitors from your GPU, and repeat steps 1 - 5. +You should get the same result. +With this setup you don't need to modify the Xorg config regardless if monitors are plugged in or not. + +```bash +pkill X +``` + +##### SSH Client Script (Optional) +At this point you have a working setup! For convenience, I created this bash script to automate the +startup of the X server and Sunshine on the host. +This can be run on Unix systems, or on Windows using the `git-bash` or any bash shell. + +For Android/iOS you can install Linux emulators, e.g. `Userland` for Android and `ISH` for iOS. +The neat part is that you can execute one script to launch Sunshine from your phone or tablet! + +```bash +#!/bin/bash +set -e + +ssh_args="@192.168.X.X" # Or use alias set in ~/.ssh/config + +check_ssh(){ + result=1 + # Note this checks infinitely, you could update this to have a max # of retries + while [[ $result -ne 0 ]] + do + echo "checking host..." + ssh $ssh_args "exit 0" 2>/dev/null + result=$? + [[ $result -ne 0 ]] && { + echo "Failed to ssh to $ssh_args, with exit code $result" + } + sleep 3 + done + echo "Host is ready for streaming!" +} + +start_stream(){ + echo "Starting sunshine server on host..." + echo "Start moonlight on your client of choice" + # -f runs ssh in the background + ssh -f $ssh_args "~/scripts/sunshine.sh &" +} + +check_ssh +start_stream +exit_code=${?} + +sleep 3 +exit ${exit_code} +``` + +#### Next Steps +Congratulations, you can now stream your desktop headless! When trying this the first time, +keep your monitors close by incase something isn't working right. + +@seealso{Now that you have a virtual display, you may want to automate changing the resolution +and refresh rate prior to connecting to an app. See +[Changing Resolution and Refresh Rate](md_docs_2app__examples#changing-resolution-and-refresh-rate) +for more information.} + + +## macOS +@todo{It's looking lonely here.} + + +## Windows + +| Author | [BeeLeDev](https://github.com/BeeLeDev) | +|------------|-----------------------------------------| +| Difficulty | Intermediate | + +### Discord call cancellation +Cancel Discord call audio with Voicemeeter (Standard) + +#### Voicemeeter Configuration +1. Click "Hardware Out" +2. Set the physical device you receive audio to as your Hardware Out with MME +3. Turn on BUS A for the Virtual Input + +#### Windows Configuration +1. Open the sound settings +2. Set your default Playback as Voicemeeter Input + +@tip{Run audio in the background to find the device that your Virtual Input is using +(Voicemeeter In #), you will see the bar to the right of the device have green bars +going up and down. This device will be referred to as Voicemeeter Input.} + +#### Discord Configuration +1. Open the settings +2. Go to Voice & Video +3. Set your Output Device as the physical device you receive audio to + +@tip{It is usually the same device you set for Hardware Out in Voicemeeter.} + +#### Sunshine Configuration +1. Go to Configuration +2. Go to the Audio/Video tab +3. Set Virtual Sink as Voicemeeter Input + +@note{This should be the device you set as default previously in Playback.} + +
+ +| Previous | Next | +|:--------------------------------|--------------------------------------------:| +| [App Examples](app_examples.md) | [Performance Tuning](performance_tuning.md) | + +
diff --git a/docs/source/images/discord_calls_01.png b/docs/images/discord_calls_01.png similarity index 100% rename from docs/source/images/discord_calls_01.png rename to docs/images/discord_calls_01.png diff --git a/docs/source/images/discord_calls_02.png b/docs/images/discord_calls_02.png similarity index 100% rename from docs/source/images/discord_calls_02.png rename to docs/images/discord_calls_02.png diff --git a/docs/source/images/discord_calls_03.png b/docs/images/discord_calls_03.png similarity index 100% rename from docs/source/images/discord_calls_03.png rename to docs/images/discord_calls_03.png diff --git a/docs/source/images/discord_calls_04.png b/docs/images/discord_calls_04.png similarity index 100% rename from docs/source/images/discord_calls_04.png rename to docs/images/discord_calls_04.png diff --git a/docs/source/images/discord_calls_05.png b/docs/images/discord_calls_05.png similarity index 100% rename from docs/source/images/discord_calls_05.png rename to docs/images/discord_calls_05.png diff --git a/docs/source/legal/legal.rst b/docs/legal.md similarity index 62% rename from docs/source/legal/legal.rst rename to docs/legal.md index 3fd3b8f2c28..aee2effea8e 100644 --- a/docs/source/legal/legal.rst +++ b/docs/legal.md @@ -1,13 +1,11 @@ -Legal -===== -.. attention:: This documentation is for informational purposes only and is not intended as legal advice. If you have - any legal questions or concerns about using Sunshine, we recommend consulting with a lawyer. +# Legal +@attention{This documentation is for informational purposes only and is not intended as legal advice. If you have +any legal questions or concerns about using Sunshine, we recommend consulting with a lawyer.} Sunshine is licensed under the GPL-3.0 license, which allows for free use and modification of the software. -The full text of the license can be reviewed `here `__. +The full text of the license can be reviewed [here](https://github.com/LizardByte/Sunshine/blob/master/LICENSE). -Commercial Use --------------- +## Commercial Use Sunshine can be used in commercial applications without any limitations. This means that businesses and organizations can use Sunshine to create and sell products or services without needing to seek permission or pay a fee. @@ -19,3 +17,11 @@ Motion Picture Experts Group (MPEG-LA) and/or any other necessary licensing requ In summary, while Sunshine is free to use, it is the user's responsibility to ensure compliance with all applicable licensing requirements when redistributing the software as part of a commercial offering. If you have any questions or concerns about using Sunshine in a commercial setting, we recommend consulting with a lawyer. + +
+ +| Previous | Next | +|:------------------------------------------------|----------------------------------:| +| [Gamestream Migration](gamestream_migration.md) | [Configuration](configuration.md) | + +
diff --git a/docs/make.bat b/docs/make.bat deleted file mode 100644 index 08ca2232081..00000000000 --- a/docs/make.bat +++ /dev/null @@ -1,36 +0,0 @@ -@ECHO OFF - -pushd %~dp0 - -REM Command file for Sphinx documentation - -if "%SPHINXBUILD%" == "" ( - set SPHINXBUILD=sphinx-build -) -set SOURCEDIR=source -set BUILDDIR=build -set "SPHINXOPTS=-W --keep-going" - -%SPHINXBUILD% >NUL 2>NUL -if errorlevel 9009 ( - echo. - echo.The 'sphinx-build' command was not found. Make sure you have Sphinx - echo.installed, then set the SPHINXBUILD environment variable to point - echo.to the full path of the 'sphinx-build' executable. Alternatively you - echo.may add the Sphinx directory to PATH. - echo. - echo.If you don't have Sphinx installed, grab it from - echo.https://www.sphinx-doc.org/ - exit /b 1 -) - -if "%1" == "" goto help - -%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% || exit /b %ERRORLEVEL% -goto end - -:help -%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% || exit /b %ERRORLEVEL% - -:end -popd diff --git a/docs/performance_tuning.md b/docs/performance_tuning.md new file mode 100644 index 00000000000..e055d5aa7c4 --- /dev/null +++ b/docs/performance_tuning.md @@ -0,0 +1,20 @@ +# Performance Tuning +In addition to the options available in the [Configuration](configuration.md) section, there are a few additional +system options that can be used to help improve the performance of Sunshine. + +## AMD + +In Windows, enabling *Enhanced Sync* in AMD's settings may help reduce the latency by an additional frame. This +applies to `amfenc` and `libx264`. + +## NVIDIA + +Enabling *Fast Sync* in Nvidia settings may help reduce latency. + +
+ +| Previous | Next | +|:--------------------|--------------------------------------:| +| [Guides](guides.md) | [Troubleshooting](troubleshooting.md) | + +
diff --git a/docs/requirements.txt b/docs/requirements.txt deleted file mode 100644 index 90f05fd8f64..00000000000 --- a/docs/requirements.txt +++ /dev/null @@ -1,8 +0,0 @@ -furo==2024.7.18 -m2r2==0.3.3.post2 -rstcheck[sphinx]==6.2.4 -rstfmt==0.0.14 -setuptools # required by m2r2, Ubuntu 24.04 doesn't include this -Sphinx==7.2.6 -sphinx-copybutton==0.5.2 -sphinx_inline_tabs==2023.4.21 diff --git a/docs/source/about/advanced_usage.rst b/docs/source/about/advanced_usage.rst deleted file mode 100644 index 95025b91358..00000000000 --- a/docs/source/about/advanced_usage.rst +++ /dev/null @@ -1,1880 +0,0 @@ -Advanced Usage -============== -Sunshine will work with the default settings for most users. In some cases you may want to configure Sunshine further. - -Performance Tips ----------------- - -.. tab:: AMD - - In Windows, enabling `Enhanced Sync` in AMD's settings may help reduce the latency by an additional frame. This - applies to `amfenc` and `libx264`. - -.. tab:: NVIDIA - - Enabling `Fast Sync` in Nvidia settings may help reduce latency. - -Configuration -------------- -The default location for the configuration file is listed below. You can use another location if you -choose, by passing in the full configuration file path as the first argument when you start Sunshine. - -The default location of the ``apps.json`` is the same as the configuration file. You can use a custom -location by modifying the configuration file. - -**Default File Location** - -.. table:: - :widths: auto - - ========= =========== - Value Description - ========= =========== - Docker /config/ - Linux ~/.config/sunshine/ - macOS ~/.config/sunshine/ - Windows %ProgramFiles%\\Sunshine\\config - ========= =========== - -**Example** - .. code-block:: bash - - sunshine ~/sunshine_config.conf - -Although it is recommended to use the configuration UI, it is possible manually configure sunshine by -editing the `conf` file in a text editor. Use the examples as reference. - -`General `__ ------------------------------------------------------ - -`locale `__ -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -**Description** - The locale used for Sunshine's user interface. - -**Choices** - -.. table:: - :widths: auto - - ======= =========== - Value Description - ======= =========== - de German - en English - en_GB English (UK) - en_US English (United States) - es Spanish - fr French - it Italian - ja Japanese - pt Portuguese - ru Russian - sv Swedish - tr Turkish - zh Chinese (Simplified) - ======= =========== - -**Default** - ``en`` - -**Example** - .. code-block:: text - - locale = en - -`sunshine_name `__ -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -**Description** - The name displayed by Moonlight - -**Default** - PC hostname - -**Example** - .. code-block:: text - - sunshine_name = Sunshine - -`min_log_level `__ -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -**Description** - The minimum log level printed to standard out. - -**Choices** - -.. table:: - :widths: auto - - ======= =========== - Value Description - ======= =========== - verbose verbose logging - debug debug logging - info info logging - warning warning logging - error error logging - fatal fatal logging - none no logging - ======= =========== - -**Default** - ``info`` - -**Example** - .. code-block:: text - - min_log_level = info - -`channels `__ -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -**Description** - Sunshine can support multiple clients streaming simultaneously, at the cost of higher CPU and GPU usage. - - .. note:: All connected clients share control of the same streaming session. - - .. warning:: Some hardware encoders may have limitations that reduce performance with multiple streams. - -**Default** - ``1`` - -**Example** - .. code-block:: text - - channels = 1 - -`global_prep_cmd `__ -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -**Description** - A list of commands to be run before/after all applications. If any of the prep-commands fail, starting the application is aborted. - -**Default** - ``[]`` - -**Example** - .. code-block:: text - - global_prep_cmd = [{"do":"nircmd.exe setdisplay 1280 720 32 144","undo":"nircmd.exe setdisplay 2560 1440 32 144"}] - -`notify_pre_releases `__ -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -**Description** - Whether to be notified of new pre-release versions of Sunshine. - -**Default** - ``disabled`` - -**Example** - .. code-block:: text - - notify_pre_releases = disabled - -`Input `__ -------------------------------------------------- - -`controller `__ -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -**Description** - Whether to allow controller input from the client. - -**Example** - .. code-block:: text - - controller = enabled - -`gamepad `__ -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -**Description** - The type of gamepad to emulate on the host. - - .. caution:: Applies to Windows only. - -**Choices** - -.. table:: - :widths: auto - - ===== =========== - Value Description - ===== =========== - auto Selected based on information from client - x360 Xbox 360 controller - ds4 DualShock 4 controller (PS4) - ===== =========== - -**Default** - ``auto`` - -**Example** - .. code-block:: text - - gamepad = auto - -`ds4_back_as_touchpad_click `__ -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -**Description** - .. hint:: Only applies when gamepad is set to ds4 manually. Unused in other gamepad modes. - - Allow Select/Back inputs to also trigger DS4 touchpad click. Useful for clients looking to emulate touchpad click - on Xinput devices. - -**Default** - ``enabled`` - -**Example** - .. code-block:: text - - ds4_back_as_touchpad_click = enabled - -`motion_as_ds4 `__ -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -**Description** - .. hint:: Only applies when gamepad is set to auto. - - If a client reports that a connected gamepad has motion sensor support, emulate it on the host as a DS4 controller. - - When disabled, motion sensors will not be taken into account during gamepad type selection. - -**Default** - ``enabled`` - -**Example** - .. code-block:: text - - motion_as_ds4 = enabled - -`touchpad_as_ds4 `__ -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -**Description** - .. hint:: Only applies when gamepad is set to auto. - - If a client reports that a connected gamepad has a touchpad, emulate it on the host as a DS4 controller. - - When disabled, touchpad presence will not be taken into account during gamepad type selection. - -**Default** - ``enabled`` - -**Example** - .. code-block:: text - - touchpad_as_ds4 = enabled - -`back_button_timeout `__ -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -**Description** - If the Back/Select button is held down for the specified number of milliseconds, a Home/Guide button press is emulated. - - .. tip:: If back_button_timeout < 0, then the Home/Guide button will not be emulated. - -**Default** - ``-1`` - -**Example** - .. code-block:: text - - back_button_timeout = 2000 - -`keyboard `__ -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -**Description** - Whether to allow keyboard input from the client. - -**Example** - .. code-block:: text - - keyboard = enabled - -`key_repeat_delay `__ -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -**Description** - The initial delay, in milliseconds, before repeating keys. Controls how fast keys will repeat themselves. - -**Default** - ``500`` - -**Example** - .. code-block:: text - - key_repeat_delay = 500 - -`key_repeat_frequency `__ -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -**Description** - How often keys repeat every second. - - .. tip:: This configurable option supports decimals. - -**Default** - ``24.9`` - -**Example** - .. code-block:: text - - key_repeat_frequency = 24.9 - -`always_send_scancodes `__ -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -**Description** - 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. - - .. caution:: Applies to Windows only. - -**Default** - ``enabled`` - -**Example** - .. code-block:: text - - always_send_scancodes = enabled - -`key_rightalt_to_key_win `__ -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -**Description** - 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. - -**Default** - ``disabled`` - -**Example** - .. code-block:: text - - key_rightalt_to_key_win = enabled - -`mouse `__ -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -**Description** - Whether to allow mouse input from the client. - -**Example** - .. code-block:: text - - mouse = enabled - -`high_resolution_scrolling `__ -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -**Description** - 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. - -**Default** - ``enabled`` - -**Example** - .. code-block:: text - - high_resolution_scrolling = enabled - -`native_pen_touch `__ -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -**Description** - 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. - -**Default** - ``enabled`` - -**Example** - .. code-block:: text - - native_pen_touch = enabled - -keybindings -^^^^^^^^^^^ - -**Description** - Sometimes it may be useful to map keybindings. Wayland won't allow clients to capture the Win Key for example. - - .. tip:: See `virtual key codes `__ - - .. hint:: keybindings needs to have a multiple of two elements. - -**Default** - .. code-block:: text - - [ - 0x10, 0xA0, - 0x11, 0xA2, - 0x12, 0xA4 - ] - -**Example** - .. code-block:: text - - keybindings = [ - 0x10, 0xA0, - 0x11, 0xA2, - 0x12, 0xA4, - 0x4A, 0x4B - ] - -.. note:: This option is not available in the UI. A PR would be welcome. - -`Audio/Video `__ -------------------------------------------------------------- - -`audio_sink `__ -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -**Description** - The name of the audio sink used for audio loopback. - - .. tip:: To find the name of the audio sink follow these instructions. - - **Linux + pulseaudio** - .. code-block:: bash - - pacmd list-sinks | grep "name:" - - **Linux + pipewire** - .. code-block:: bash - - pactl info | grep Source - # in some causes you'd need to use the `Sink` device, if `Source` doesn't work, so try: - pactl info | grep Sink - - **macOS** - Sunshine can only access microphones on macOS due to system limitations. To stream system audio use - `Soundflower `__ or - `BlackHole `__. - - **Windows** - .. code-block:: batch - - tools\audio-info.exe - - .. tip:: If you have multiple audio devices with identical names, use the Device ID instead. - - .. tip:: If you want to mute the host speakers, use `virtual_sink`_ instead. - -**Default** - Sunshine will select the default audio device. - -**Examples** - **Linux** - .. code-block:: text - - audio_sink = alsa_output.pci-0000_09_00.3.analog-stereo - - **macOS** - .. code-block:: text - - audio_sink = BlackHole 2ch - - **Windows** - .. code-block:: text - - audio_sink = Speakers (High Definition Audio Device) - -`virtual_sink `__ -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -**Description** - The audio device that's virtual, like Steam Streaming Speakers. This allows Sunshine to stream audio, while muting - the speakers. - - .. tip:: See `audio_sink`_! - - .. tip:: These are some options for virtual sound devices. - - - Stream Streaming Speakers (Linux, macOS, Windows) - - - Steam must be installed. - - Enable `install_steam_audio_drivers`_ or use Steam Remote Play at least once to install the drivers. - - - `Virtual Audio Cable `__ (macOS, Windows) - -**Example** - .. code-block:: text - - virtual_sink = Steam Streaming Speakers - -`install_steam_audio_drivers `__ -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -**Description** - Installs the Steam Streaming Speakers driver (if Steam is installed) to support surround sound and muting host audio. - - .. tip:: This option is only supported on Windows. - -**Default** - ``enabled`` - -**Example** - .. code-block:: text - - install_steam_audio_drivers = enabled - -`adapter_name `__ -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -**Description** - Select the video card you want to stream. - - .. tip:: To find the name of the appropriate values follow these instructions. - - **Linux + VA-API** - Unlike with `amdvce` and `nvenc`, it doesn't matter if video encoding is done on a different GPU. - - .. code-block:: bash - - ls /dev/dri/renderD* # to find all devices capable of VAAPI - - # replace ``renderD129`` with the device from above to lists the name and capabilities of the device - vainfo --display drm --device /dev/dri/renderD129 | \ - grep -E "((VAProfileH264High|VAProfileHEVCMain|VAProfileHEVCMain10).*VAEntrypointEncSlice)|Driver version" - - To be supported by Sunshine, it needs to have at the very minimum: - ``VAProfileH264High : VAEntrypointEncSlice`` - - .. todo:: macOS - - **Windows** - .. code-block:: batch - - tools\dxgi-info.exe - - .. note:: For hybrid graphics systems, DXGI reports the outputs are connected to whichever graphics adapter - that the application is configured to use, so it's not a reliable indicator of how the display is - physically connected. - -**Default** - Sunshine will select the default video card. - -**Examples** - **Linux** - .. code-block:: text - - adapter_name = /dev/dri/renderD128 - - .. todo:: macOS - - **Windows** - .. code-block:: text - - adapter_name = Radeon RX 580 Series - -`output_name `__ -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -**Description** - Select the display number you want to stream. - - .. tip:: To find the name of the appropriate values follow these instructions. - - **Linux** - During Sunshine startup, you should see the list of detected displays: - - .. code-block:: text - - Info: Detecting displays - Info: Detected display: DVI-D-0 (id: 0) connected: false - Info: Detected display: HDMI-0 (id: 1) connected: true - Info: Detected display: DP-0 (id: 2) connected: true - Info: Detected display: DP-1 (id: 3) connected: false - Info: Detected display: DVI-D-1 (id: 4) connected: false - - You need to use the id value inside the parenthesis, e.g. ``1``. - - **macOS** - During Sunshine startup, you should see the list of detected displays: - - .. code-block:: text - - Info: Detecting displays - Info: Detected display: Monitor-0 (id: 3) connected: true - Info: Detected display: Monitor-1 (id: 2) connected: true - - You need to use the id value inside the parenthesis, e.g. ``3``. - - **Windows** - .. code-block:: batch - - tools\dxgi-info.exe - -**Default** - Sunshine will select the default display. - -**Examples** - **Linux** - .. code-block:: text - - output_name = 0 - - **macOS** - .. code-block:: text - - output_name = 3 - - **Windows** - .. code-block:: text - - output_name = \\.\DISPLAY1 - -`resolutions `__ -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -**Description** - The resolutions advertised by Sunshine. - - .. note:: Some versions of Moonlight, such as Moonlight-nx (Switch), rely on this list to ensure that the requested - resolution is supported. - -**Default** - .. code-block:: text - - [ - 352x240, - 480x360, - 858x480, - 1280x720, - 1920x1080, - 2560x1080, - 3440x1440, - 1920x1200, - 3840x2160, - 3840x1600, - ] - -**Example** - .. code-block:: text - - resolutions = [ - 352x240, - 480x360, - 858x480, - 1280x720, - 1920x1080, - 2560x1080, - 3440x1440, - 1920x1200, - 3840x2160, - 3840x1600, - ] - -`fps `__ -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -**Description** - The fps modes advertised by Sunshine. - - .. note:: Some versions of Moonlight, such as Moonlight-nx (Switch), rely on this list to ensure that the requested - fps is supported. - -**Default** - ``[10, 30, 60, 90, 120]`` - -**Example** - .. code-block:: text - - fps = [10, 30, 60, 90, 120] - -min_fps_factor `__ -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -**Description** - Sunshine will use this factor to calculate the minimum time between frames. Increasing this value may help when - streaming mostly static content. - - .. Warning:: Higher values will consume more bandwidth. - -**Default** - ``1`` - -**Range** - ``1-3`` - -**Example** - .. code-block:: text - - min_fps_factor = 1 - -`Network `__ ------------------------------------------------------ - -`upnp `__ -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -**Description** - Sunshine will attempt to open ports for streaming over the internet. - -**Choices** - -.. table:: - :widths: auto - - ===== =========== - Value Description - ===== =========== - on enable UPnP - off disable UPnP - ===== =========== - -**Default** - ``disabled`` - -**Example** - .. code-block:: text - - upnp = on - -`address_family `__ -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -**Description** - Set the address family that Sunshine will use. - -.. table:: - :widths: auto - - ===== =========== - Value Description - ===== =========== - ipv4 IPv4 only - both IPv4+IPv6 - ===== =========== - -**Default** - ``ipv4`` - -**Example** - .. code-block:: text - - address_family = both - -`port `__ -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -**Description** - Set the family of ports used by Sunshine. Changing this value will offset other ports per the table below. - -.. table:: - :widths: auto - - ================ ============ =========================== - Port Description Default Port Difference from config port - ================ ============ =========================== - HTTPS 47984 TCP -5 - HTTP 47989 TCP 0 - Web 47990 TCP +1 - RTSP 48010 TCP +21 - Video 47998 UDP +9 - Control 47999 UDP +10 - Audio 48000 UDP +11 - Mic (unused) 48002 UDP +13 - ================ ============ =========================== - -.. attention:: Custom ports may not be supported by all Moonlight clients. - -**Default** - ``47989`` - -**Range** - ``1029-65514`` - -**Example** - .. code-block:: text - - port = 47989 - -`origin_web_ui_allowed `__ -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -**Description** - The origin of the remote endpoint address that is not denied for HTTPS Web UI. - -**Choices** - -.. table:: - :widths: auto - - ===== =========== - Value Description - ===== =========== - pc Only localhost may access the web ui - lan Only LAN devices may access the web ui - wan Anyone may access the web ui - ===== =========== - -**Default** - ``lan`` - -**Example** - .. code-block:: text - - origin_web_ui_allowed = lan - -`external_ip `__ -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -**Description** - If no external IP address is given, Sunshine will attempt to automatically detect external ip-address. - -**Default** - Automatic - -**Example** - .. code-block:: text - - external_ip = 123.456.789.12 - -`lan_encryption_mode `__ -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -**Description** - This determines when encryption will be used when streaming over your local network. - - .. warning:: Encryption can reduce streaming performance, particularly on less powerful hosts and clients. - -**Choices** - -.. table:: - :widths: auto - - ===== =========== - Value Description - ===== =========== - 0 encryption will not be used - 1 encryption will be used if the client supports it - 2 encryption is mandatory and unencrypted connections are rejected - ===== =========== - -**Default** - ``0`` - -**Example** - .. code-block:: text - - lan_encryption_mode = 0 - -`wan_encryption_mode `__ -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -**Description** - This determines when encryption will be used when streaming over the Internet. - - .. warning:: Encryption can reduce streaming performance, particularly on less powerful hosts and clients. - -**Choices** - -.. table:: - :widths: auto - - ===== =========== - Value Description - ===== =========== - 0 encryption will not be used - 1 encryption will be used if the client supports it - 2 encryption is mandatory and unencrypted connections are rejected - ===== =========== - -**Default** - ``1`` - -**Example** - .. code-block:: text - - wan_encryption_mode = 1 - -`ping_timeout `__ -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -**Description** - How long to wait, in milliseconds, for data from Moonlight before shutting down the stream. - -**Default** - ``10000`` - -**Example** - .. code-block:: text - - ping_timeout = 10000 - -`Config Files `__ --------------------------------------------------------- - -`file_apps `__ -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -**Description** - The application configuration file path. The file contains a json formatted list of applications that can be started - by Moonlight. - -**Default** - OS and package dependent - -**Example** - .. code-block:: text - - file_apps = apps.json - -`credentials_file `__ -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -**Description** - The file where user credentials for the UI are stored. - -**Default** - ``sunshine_state.json`` - -**Example** - .. code-block:: text - - credentials_file = sunshine_state.json - -`log_path `__ -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -**Description** - The path where the sunshine log is stored. - -**Default** - ``sunshine.log`` - -**Example** - .. code-block:: text - - log_path = sunshine.log - -`pkey `__ -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -**Description** - The private key used for the web UI and Moonlight client pairing. For best compatibility, this should be an RSA-2048 private key. - - .. warning:: Not all Moonlight clients support ECDSA keys or RSA key lengths other than 2048 bits. - -**Default** - ``credentials/cakey.pem`` - -**Example** - .. code-block:: text - - pkey = /dir/pkey.pem - -`cert `__ -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -**Description** - The certificate used for the web UI and Moonlight client pairing. For best compatibility, this should have an RSA-2048 public key. - - .. warning:: Not all Moonlight clients support ECDSA keys or RSA key lengths other than 2048 bits. - -**Default** - ``credentials/cacert.pem`` - -**Example** - .. code-block:: text - - cert = /dir/cert.pem - -`file_state `__ -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -**Description** - The file where current state of Sunshine is stored. - -**Default** - ``sunshine_state.json`` - -**Example** - .. code-block:: text - - file_state = sunshine_state.json - -`Advanced `__ -------------------------------------------------------- - -`fec_percentage `__ -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -**Description** - Percentage of error correcting packets per data packet in each video frame. - - .. warning:: Higher values can correct for more network packet loss, but at the cost of increasing bandwidth usage. - -**Default** - ``20`` - -**Range** - ``1-255`` - -**Example** - .. code-block:: text - - fec_percentage = 20 - -`qp `__ -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -**Description** - Quantization Parameter. Some devices don't support Constant Bit Rate. For those devices, QP is used instead. - - .. warning:: Higher value means more compression, but less quality. - -**Default** - ``28`` - -**Example** - .. code-block:: text - - qp = 28 - -`min_threads `__ -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -**Description** - Minimum number of CPU threads used for encoding. - - .. note:: 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. - -**Default** - ``2`` - -**Example** - .. code-block:: text - - min_threads = 2 - -`hevc_mode `__ -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -**Description** - Allows the client to request HEVC Main or HEVC Main10 video streams. - - .. warning:: HEVC is more CPU-intensive to encode, so enabling this may reduce performance when using software - encoding. - -**Choices** - -.. table:: - :widths: auto - - ===== =========== - Value Description - ===== =========== - 0 advertise support for HEVC based on encoder capabilities (recommended) - 1 do not advertise support for HEVC - 2 advertise support for HEVC Main profile - 3 advertise support for HEVC Main and Main10 (HDR) profiles - ===== =========== - -**Default** - ``0`` - -**Example** - .. code-block:: text - - hevc_mode = 2 - -`av1_mode `__ -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -**Description** - Allows the client to request AV1 Main 8-bit or 10-bit video streams. - - .. warning:: AV1 is more CPU-intensive to encode, so enabling this may reduce performance when using software - encoding. - -**Choices** - -.. table:: - :widths: auto - - ===== =========== - Value Description - ===== =========== - 0 advertise support for AV1 based on encoder capabilities (recommended) - 1 do not advertise support for AV1 - 2 advertise support for AV1 Main 8-bit profile - 3 advertise support for AV1 Main 8-bit and 10-bit (HDR) profiles - ===== =========== - -**Default** - ``0`` - -**Example** - .. code-block:: text - - av1_mode = 2 - -`capture `__ -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -**Description** - Force specific screen capture method. - -**Choices** - -.. table:: - :widths: auto - - ========= ======== =========== - 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. 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 `. - x11 Linux Uses XCB. This is the slowest and most CPU intensive so should be avoided if possible. - ddx Windows Use DirectX Desktop Duplication API to capture the display. This is well-supported on Windows machines. - wgc Windows (beta feature) Use Windows.Graphics.Capture to capture the display. - ========= ======== =========== - -**Default** - Automatic. Sunshine will use the first capture method available in the order of the table above. - -**Example** - .. code-block:: text - - capture = kms - -`encoder `__ -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -**Description** - Force a specific encoder. - -**Choices** - -.. table:: - :widths: auto - - ========= =========== - Value Description - ========= =========== - 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 - ========= =========== - -**Default** - Sunshine will use the first encoder that is available. - -**Example** - .. code-block:: text - - encoder = nvenc - -`NVIDIA NVENC Encoder `__ -------------------------------------------------------------------------------- - -`nvenc_preset `__ -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -**Description** - NVENC encoder 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. - - .. note:: This option only applies when using NVENC `encoder`_. - -**Choices** - -.. table:: - :widths: auto - - ========== =========== - Value Description - ========== =========== - 1 P1 (fastest) - 2 P2 - 3 P3 - 4 P4 - 5 P5 - 6 P6 - 7 P7 (slowest) - ========== =========== - -**Default** - ``1`` - -**Example** - .. code-block:: text - - nvenc_preset = 1 - -`nvenc_twopass `__ -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -**Description** - Enable two-pass mode in NVENC encoder. - 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. - - .. note:: This option only applies when using NVENC `encoder`_. - -**Choices** - -.. table:: - :widths: auto - - =========== =========== - Value Description - =========== =========== - disabled One pass (fastest) - quarter_res Two passes, first pass at quarter resolution (faster) - full_res Two passes, first pass at full resolution (slower) - =========== =========== - -**Default** - ``quarter_res`` - -**Example** - .. code-block:: text - - nvenc_twopass = quarter_res - -`nvenc_spatial_aq `__ -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -**Description** - Assign higher QP values to flat regions of the video. - Recommended to enable when streaming at lower bitrates. - - .. Note:: This option only applies when using NVENC `encoder`_. - -**Choices** - -.. table:: - :widths: auto - - ========== =========== - Value Description - ========== =========== - disabled Don't enable Spatial AQ (faster) - enabled Enable Spatial AQ (slower) - ========== =========== - -**Default** - ``disabled`` - -**Example** - .. code-block:: text - - nvenc_spatial_aq = disabled - -`nvenc_vbv_increase `__ -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -**Description** - 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. - - .. Note:: This option only applies when using NVENC `encoder`_. - - .. Warning:: Can lead to network packet loss. - -**Default** - ``0`` - -**Range** - ``0-400`` - -**Example** - .. code-block:: text - - nvenc_vbv_increase = 0 - -`nvenc_realtime_hags `__ -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -**Description** - Use realtime gpu scheduling priority in NVENC when hardware accelerated gpu scheduling (HAGS) is enabled in Windows. - 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. - - .. note:: This option only applies when using NVENC `encoder`_. - - .. caution:: Applies to Windows only. - -**Choices** - -.. table:: - :widths: auto - - ========== =========== - Value Description - ========== =========== - disabled Use high priority - enabled Use realtime priority - ========== =========== - -**Default** - ``enabled`` - -**Example** - .. code-block:: text - - nvenc_realtime_hags = enabled - -`nvenc_latency_over_power `__ -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -**Description** - Adaptive P-State algorithm which NVIDIA drivers employ doesn't work well with low latency streaming, so sunshine requests high power mode explicitly. - - .. Note:: This option only applies when using NVENC `encoder`_. - - .. Warning:: Disabling it is not recommended since this can lead to significantly increased encoding latency. - - .. Caution:: Applies to Windows only. - -**Choices** - -.. table:: - :widths: auto - - ========== =========== - Value Description - ========== =========== - disabled Sunshine doesn't change GPU power preferences (not recommended) - enabled Sunshine requests high power mode explicitly - ========== =========== - -**Default** - ``enabled`` - -**Example** - .. code-block:: text - - nvenc_latency_over_power = enabled - -`nvenc_opengl_vulkan_on_dxgi `__ -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -**Description** - 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. - - .. Note:: This option only applies when using NVENC `encoder`_. - - .. Caution:: Applies to Windows only. - -**Choices** - -.. table:: - :widths: auto - - ========== =========== - Value Description - ========== =========== - disabled Sunshine leaves global Vulkan/OpenGL present method unchanged - enabled Sunshine changes global Vulkan/OpenGL present method to "Prefer layered on DXGI Swapchain" - ========== =========== - -**Default** - ``enabled`` - -**Example** - .. code-block:: text - - nvenc_opengl_vulkan_on_dxgi = enabled - -`nvenc_h264_cavlc `__ -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -**Description** - Prefer CAVLC entropy coding over CABAC in H.264 when using NVENC. - CAVLC is outdated and needs around 10% more bitrate for same quality, but provides slightly faster decoding when using software decoder. - - .. note:: This option only applies when using H.264 format with NVENC `encoder`_. - -**Choices** - -.. table:: - :widths: auto - - ========== =========== - Value Description - ========== =========== - disabled Prefer CABAC - enabled Prefer CAVLC - ========== =========== - -**Default** - ``disabled`` - -**Example** - .. code-block:: text - - nvenc_h264_cavlc = disabled - -`Intel QuickSync Encoder `__ -------------------------------------------------------------------------------------- - -`qsv_preset `__ -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -**Description** - The encoder preset to use. - - .. note:: This option only applies when using quicksync `encoder`_. - -**Choices** - -.. table:: - :widths: auto - - ========== =========== - Value Description - ========== =========== - veryfast fastest (lowest quality) - faster faster (lower quality) - fast fast (low quality) - medium medium (default) - slow slow (good quality) - slower slower (better quality) - veryslow slowest (best quality) - ========== =========== - -**Default** - ``medium`` - -**Example** - .. code-block:: text - - qsv_preset = medium - -`qsv_coder `__ -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -**Description** - The entropy encoding to use. - - .. note:: This option only applies when using H264 with quicksync `encoder`_. - -**Choices** - -.. table:: - :widths: auto - - ========== =========== - Value Description - ========== =========== - auto let ffmpeg decide - cabac context adaptive binary arithmetic coding - higher quality - cavlc context adaptive variable-length coding - faster decode - ========== =========== - -**Default** - ``auto`` - -**Example** - .. code-block:: text - - qsv_coder = auto - -`qsv_slow_hevc `__ -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -**Description** - This options enables use of HEVC on older Intel GPUs that only support low power encoding for H.264. - - .. Caution:: Streaming performance may be significantly reduced when this option is enabled. - -**Default** - ``disabled`` - -**Example** - .. code-block:: text - - qsv_slow_hevc = disabled - -`AMD AMF Encoder `__ ---------------------------------------------------------------------- - -`amd_usage `__ -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -**Description** - The encoder usage profile is used to set the base set of encoding - parameters. - - .. note:: This option only applies when using amdvce `encoder`_. - - .. note:: The other AMF options that follow will override a subset - of the settings applied by your usage profile, but there are - hidden parameters set in usage profiles that cannot be - overridden elsewhere. - -**Choices** - -.. table:: - :widths: auto - - ======================= =========== - Value Description - ======================= =========== - transcoding transcoding (slowest) - webcam webcam (slow) - lowlatency_high_quality low latency, high quality (fast) - lowlatency low latency (faster) - ultralowlatency ultra low latency (fastest) - ======================= =========== - -**Default** - ``ultralowlatency`` - -**Example** - .. code-block:: text - - amd_usage = ultralowlatency - -`amd_rc `__ -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -**Description** - The encoder rate control. - - .. note:: This option only applies when using amdvce `encoder`_. - - .. warning:: The 'vbr_latency' option generally works best, but - some bitrate overshoots may still occur. Enabling HRD allows - all bitrate based rate controls to better constrain peak bitrate, - but may result in encoding artifacts depending on your card. - -**Choices** - -.. table:: - :widths: auto - - =========== =========== - Value Description - =========== =========== - cqp constant qp mode - cbr constant bitrate - vbr_latency variable bitrate, latency constrained - vbr_peak variable bitrate, peak constrained - =========== =========== - -**Default** - ``vbr_latency`` - -**Example** - .. code-block:: text - - amd_rc = vbr_latency - -`amd_enforce_hrd `__ -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -**Description** - Enable Hypothetical Reference Decoder (HRD) enforcement to help constrain the target bitrate. - - .. note:: This option only applies when using amdvce `encoder`_. - - .. warning:: HRD is known to cause encoding artifacts or negatively affect - encoding quality on certain cards. - -**Choices** - -.. table:: - :widths: auto - - ======== =========== - Value Description - ======== =========== - enabled enable HRD - disabled disable HRD - ======== =========== - -**Default** - ``disabled`` - -**Example** - .. code-block:: text - - amd_enforce_hrd = disabled - -`amd_quality `__ -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -**Description** - The quality profile controls the tradeoff between - speed and quality of encoding. - - .. note:: This option only applies when using amdvce `encoder`_. - -**Choices** - -.. table:: - :widths: auto - - ========== =========== - Value Description - ========== =========== - speed prefer speed - balanced balanced - quality prefer quality - ========== =========== - -**Default** - ``balanced`` - -**Example** - .. code-block:: text - - amd_quality = balanced - - -`amd_preanalysis `__ -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -**Description** - Preanalysis can increase encoding quality at the cost of latency. - - .. note:: This option only applies when using amdvce `encoder`_. - -**Default** - ``disabled`` - -**Example** - .. code-block:: text - - amd_preanalysis = disabled - -`amd_vbaq `__ -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -**Description** - Variance Based Adaptive Quantization (VBAQ) can increase subjective - visual quality by prioritizing allocation of more bits to smooth - areas compared to more textured areas. - - .. note:: This option only applies when using amdvce `encoder`_. - -**Default** - ``enabled`` - -**Example** - .. code-block:: text - - amd_vbaq = enabled - -`amd_coder `__ -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -**Description** - The entropy encoding to use. - - .. note:: This option only applies when using H264 with amdvce `encoder`_. - -**Choices** - -.. table:: - :widths: auto - - ========== =========== - Value Description - ========== =========== - auto let ffmpeg decide - cabac context adaptive variable-length coding - higher quality - cavlc context adaptive binary arithmetic coding - faster decode - ========== =========== - -**Default** - ``auto`` - -**Example** - .. code-block:: text - - amd_coder = auto - -`VideoToolbox Encoder `__ -------------------------------------------------------------------------------- - -`vt_coder `__ -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -**Description** - The entropy encoding to use. - - .. note:: This option only applies when using macOS. - -**Choices** - -.. table:: - :widths: auto - - ========== =========== - Value Description - ========== =========== - auto let ffmpeg decide - cabac - cavlc - ========== =========== - -**Default** - ``auto`` - -**Example** - .. code-block:: text - - vt_coder = auto - -`vt_software `__ -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -**Description** - Force Video Toolbox to use software encoding. - - .. note:: This option only applies when using macOS. - -**Choices** - -.. table:: - :widths: auto - - ========== =========== - Value Description - ========== =========== - auto let ffmpeg decide - disabled disable software encoding - allowed allow software encoding - forced force software encoding - ========== =========== - -**Default** - ``auto`` - -**Example** - .. code-block:: text - - vt_software = auto - -`vt_realtime `__ -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -**Description** - Realtime encoding. - - .. note:: This option only applies when using macOS. - - .. warning:: Disabling realtime encoding might result in a delayed frame encoding or frame drop. - -**Default** - ``enabled`` - -**Example** - .. code-block:: text - - vt_realtime = enabled - -`Software Encoder `__ ------------------------------------------------------------------------ - -`sw_preset `__ -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -**Description** - The encoder preset to use. - - .. note:: This option only applies when using software `encoder`_. - - .. note:: From `FFmpeg `__. - - A preset is a collection of options that will provide a certain encoding speed to compression ratio. A slower - preset will provide better compression (compression is quality per filesize). This means that, for example, if - you target a certain file size or constant bit rate, you will achieve better quality with a slower preset. - Similarly, for constant quality encoding, you will simply save bitrate by choosing a slower preset. - - Use the slowest preset that you have patience for. - -**Choices** - -.. table:: - :widths: auto - - ========= =========== - Value Description - ========= =========== - ultrafast fastest - superfast - veryfast - faster - fast - medium - slow - slower - veryslow slowest - ========= =========== - -**Default** - ``superfast`` - -**Example** - .. code-block:: text - - sw_preset = superfast - -`sw_tune `__ -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -**Description** - The tuning preset to use. - - .. note:: This option only applies when using software `encoder`_. - - .. note:: From `FFmpeg `__. - - You can optionally use -tune to change settings based upon the specifics of your input. - -**Choices** - -.. table:: - :widths: auto - - =========== =========== - Value Description - =========== =========== - film use for high quality movie content; lowers deblocking - animation good for cartoons; uses higher deblocking and more reference frames - grain preserves the grain structure in old, grainy film material - stillimage good for slideshow-like content - fastdecode allows faster decoding by disabling certain filters - zerolatency good for fast encoding and low-latency streaming - =========== =========== - -**Default** - ``zerolatency`` - -**Example** - .. code-block:: text - - sw_tune = zerolatency diff --git a/docs/source/about/docker.rst b/docs/source/about/docker.rst deleted file mode 100644 index 7508c79554e..00000000000 --- a/docs/source/about/docker.rst +++ /dev/null @@ -1 +0,0 @@ -.. mdinclude:: ../../../DOCKER_README.md diff --git a/docs/source/about/guides/app_examples.rst b/docs/source/about/guides/app_examples.rst deleted file mode 100644 index 932c129a727..00000000000 --- a/docs/source/about/guides/app_examples.rst +++ /dev/null @@ -1,370 +0,0 @@ -App Examples -============ -Since not all applications behave the same, we decided to create some examples to help you get started adding games -and applications to Sunshine. - -.. attention:: Throughout these examples, any fields not shown are left blank. You can enhance your experience by - adding an image or a log file (via the ``Output`` field). - -.. note:: When a working directory is not specified, it defaults to the folder where the target application resides. - -Common Examples ---------------- - -Desktop -^^^^^^^ - -+----------------------+-----------------+ -| **Field** | **Value** | -+----------------------+-----------------+ -| Application Name | ``Desktop`` | -+----------------------+-----------------+ -| Image | ``desktop.png`` | -+----------------------+-----------------+ - -Steam Big Picture -^^^^^^^^^^^^^^^^^ - -.. note:: Steam is launched as a detached command because Steam starts with a process that self updates itself and the original - process is killed. - -.. tab:: Linux - - +----------------------+------------------------------------------+ - | Application Name | ``Steam Big Picture`` | - +----------------------+------------------------------------------+ - | Detached Commands | ``setsid steam steam://open/bigpicture`` | - +----------------------+------------------------------------------+ - | Image | ``steam.png`` | - +----------------------+------------------------------------------+ - -.. tab:: macOS - - +----------------------+----------------------------------+ - | Application Name | ``Steam Big Picture`` | - +----------------------+----------------------------------+ - | Detached Commands | ``open steam://open/bigpicture`` | - +----------------------+----------------------------------+ - | Image | ``steam.png`` | - +----------------------+----------------------------------+ - -.. tab:: Windows - - +----------------------+-----------------------------+ - | Application Name | ``Steam Big Picture`` | - +----------------------+-----------------------------+ - | Command | ``steam://open/bigpicture`` | - +----------------------+-----------------------------+ - | Image | ``steam.png`` | - +----------------------+-----------------------------+ - -Epic Game Store game -^^^^^^^^^^^^^^^^^^^^ - -.. note:: Using URI method will be the most consistent between various games. - -URI (Epic) -"""""""""" - -.. tab:: Windows - - +----------------------+--------------------------------------------------------------------------------------------------------------------------------------------+ - | Application Name | ``Surviving Mars`` | - +----------------------+--------------------------------------------------------------------------------------------------------------------------------------------+ - | Command | ``com.epicgames.launcher://apps/d759128018124dcabb1fbee9bb28e178%3A20729b9176c241f0b617c5723e70ec2d%3AOvenbird?action=launch&silent=true`` | - +----------------------+--------------------------------------------------------------------------------------------------------------------------------------------+ - -Binary (Epic w/ working directory) -"""""""""""""""""""""""""""""""""" - -.. tab:: Windows - - +----------------------+-----------------------------------------------+ - | Application Name | ``Surviving Mars`` | - +----------------------+-----------------------------------------------+ - | Command | ``MarsEpic.exe`` | - +----------------------+-----------------------------------------------+ - | Working Directory | ``C:\Program Files\Epic Games\SurvivingMars`` | - +----------------------+-----------------------------------------------+ - -Binary (Epic w/o working directory) -""""""""""""""""""""""""""""""""""" - -.. tab:: Windows - - +----------------------+--------------------------------------------------------------+ - | Application Name | ``Surviving Mars`` | - +----------------------+--------------------------------------------------------------+ - | Command | ``"C:\Program Files\Epic Games\SurvivingMars\MarsEpic.exe"`` | - +----------------------+--------------------------------------------------------------+ - -Steam game -^^^^^^^^^^ - -.. note:: Using URI method will be the most consistent between various games. - -URI (Steam) -""""""""""" - -.. tab:: Linux - - +----------------------+-------------------------------------------+ - | Application Name | ``Surviving Mars`` | - +----------------------+-------------------------------------------+ - | Detached Commands | ``setsid steam steam://rungameid/464920`` | - +----------------------+-------------------------------------------+ - -.. tab:: macOS - - +----------------------+-----------------------------------+ - | Application Name | ``Surviving Mars`` | - +----------------------+-----------------------------------+ - | Detached Commands | ``open steam://rungameid/464920`` | - +----------------------+-----------------------------------+ - -.. tab:: Windows - - +----------------------+------------------------------+ - | Application Name | ``Surviving Mars`` | - +----------------------+------------------------------+ - | Command | ``steam://rungameid/464920`` | - +----------------------+------------------------------+ - -Binary (Steam w/ working directory) -""""""""""""""""""""""""""""""""""" - -.. tab:: Linux - - +----------------------+---------------------------------------------------+ - | Application Name | ``Surviving Mars`` | - +----------------------+---------------------------------------------------+ - | Command | ``MarsSteam`` | - +----------------------+---------------------------------------------------+ - | Working Directory | ``~/.steam/steam/SteamApps/common/Survivng Mars`` | - +----------------------+---------------------------------------------------+ - -.. tab:: macOS - - +----------------------+---------------------------------------------------+ - | Application Name | ``Surviving Mars`` | - +----------------------+---------------------------------------------------+ - | Command | ``MarsSteam`` | - +----------------------+---------------------------------------------------+ - | Working Directory | ``~/.steam/steam/SteamApps/common/Survivng Mars`` | - +----------------------+---------------------------------------------------+ - -.. tab:: Windows - - +----------------------+------------------------------------------------------------------+ - | Application Name | ``Surviving Mars`` | - +----------------------+------------------------------------------------------------------+ - | Command | ``MarsSteam.exe`` | - +----------------------+------------------------------------------------------------------+ - | Working Directory | ``C:\Program Files (x86)\Steam\steamapps\common\Surviving Mars`` | - +----------------------+------------------------------------------------------------------+ - -Binary (Steam w/o working directory) -"""""""""""""""""""""""""""""""""""" - -.. tab:: Linux - - +----------------------+-------------------------------------------------------------+ - | Application Name | ``Surviving Mars`` | - +----------------------+-------------------------------------------------------------+ - | Command | ``~/.steam/steam/SteamApps/common/Survivng Mars/MarsSteam`` | - +----------------------+-------------------------------------------------------------+ - -.. tab:: macOS - - +----------------------+-------------------------------------------------------------+ - | Application Name | ``Surviving Mars`` | - +----------------------+-------------------------------------------------------------+ - | Command | ``~/.steam/steam/SteamApps/common/Survivng Mars/MarsSteam`` | - +----------------------+-------------------------------------------------------------+ - -.. tab:: Windows - - +----------------------+----------------------------------------------------------------------------------+ - | Application Name | ``Surviving Mars`` | - +----------------------+----------------------------------------------------------------------------------+ - | Command | ``"C:\Program Files (x86)\Steam\steamapps\common\Surviving Mars\MarsSteam.exe"`` | - +----------------------+----------------------------------------------------------------------------------+ - -Prep Commands -------------- - -Changing Resolution and Refresh Rate -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -.. tab:: Linux - - .. tab:: X11 - - +----------------------+--------------------------------------------------------------------------------------------------------------------------------+ - | Command Preparations | Do: ``sh -c "xrandr --output HDMI-1 --mode ${SUNSHINE_CLIENT_WIDTH}x${SUNSHINE_CLIENT_HEIGHT} --rate ${SUNSHINE_CLIENT_FPS}"`` | - | +--------------------------------------------------------------------------------------------------------------------------------+ - | | Undo: ``xrandr --output HDMI-1 --mode 3840x2160 --rate 120`` | - +----------------------+--------------------------------------------------------------------------------------------------------------------------------+ - - .. hint:: - The above only works if the xrandr mode already exists. You will need to create new modes to stream to macOS and iOS devices, since they use non standard resolutions. - - You can update the ``Do`` command to this: - .. code-block:: bash - - bash -c "${HOME}/scripts/set-custom-res.sh \"${SUNSHINE_CLIENT_WIDTH}\" \"${SUNSHINE_CLIENT_HEIGHT}\" \"${SUNSHINE_CLIENT_FPS}\"" - - The ``set-custom-res.sh`` will have this content: - .. code-block:: bash - - #!/bin/bash - - # Get params and set any defaults - width=${1:-1920} - height=${2:-1080} - refresh_rate=${3:-60} - - # You may need to adjust the scaling differently so the UI/text isn't too small / big - scale=${4:-0.55} - - # Get the name of the active display - display_output=$(xrandr | grep " connected" | awk '{ print $1 }') - - # Get the modeline info from the 2nd row in the cvt output - modeline=$(cvt ${width} ${height} ${refresh_rate} | awk 'FNR == 2') - xrandr_mode_str=${modeline//Modeline \"*\" /} - mode_alias="${width}x${height}" - - echo "xrandr setting new mode ${mode_alias} ${xrandr_mode_str}" - xrandr --newmode ${mode_alias} ${xrandr_mode_str} - xrandr --addmode ${display_output} ${mode_alias} - - # Reset scaling - xrandr --output ${display_output} --scale 1 - - # Apply new xrandr mode - xrandr --output ${display_output} --primary --mode ${mode_alias} --pos 0x0 --rotate normal --scale ${scale} - - # Optional reset your wallpaper to fit to new resolution - # xwallpaper --zoom /path/to/wallpaper.png - - .. tab:: Wayland - - +----------------------+-----------------------------------------------------------------------------------------------------------------------------------+ - | Command Preparations | Do: ``sh -c "wlr-xrandr --output HDMI-1 --mode \"${SUNSHINE_CLIENT_WIDTH}x${SUNSHINE_CLIENT_HEIGHT}@${SUNSHINE_CLIENT_FPS}Hz\""`` | - | +-----------------------------------------------------------------------------------------------------------------------------------+ - | | Undo: ``wlr-xrandr --output HDMI-1 --mode 3840x2160@120Hz`` | - +----------------------+-----------------------------------------------------------------------------------------------------------------------------------+ - - .. hint:: - - ``wlr-xrandr`` only works with wlroots-based compositors. - - .. tab:: Gnome (Wayland, X11) - - +----------------------+--------------------------------------------------------------------------------------------------------------------------------+ - | Command Preparations | Do: ``sh -c "xrandr --output HDMI-1 --mode ${SUNSHINE_CLIENT_WIDTH}x${SUNSHINE_CLIENT_HEIGHT} --rate ${SUNSHINE_CLIENT_FPS}"`` | - | +--------------------------------------------------------------------------------------------------------------------------------+ - | | Undo: ``xrandr --output HDMI-1 --mode 3840x2160 --rate 120`` | - +----------------------+--------------------------------------------------------------------------------------------------------------------------------+ - - The commands above are valid for an X11 session but won't work for - Wayland. In that case ``xrandr`` must be replaced by `gnome-randr.py - `_. This script is intended as a - drop-in replacement with the same syntax. (It can be saved in - ``/usr/local/bin`` and needs to be made executable.) - - .. tab:: KDE Plasma (Wayland, X11) - - +----------------------+-------------------------------------------------------------------------------------------------------------------------------+ - | Command Preparations | Do: ``sh -c "kscreen-doctor output.HDMI-A-1.mode.${SUNSHINE_CLIENT_WIDTH}x${SUNSHINE_CLIENT_HEIGHT}@${SUNSHINE_CLIENT_FPS}"`` | - | +-------------------------------------------------------------------------------------------------------------------------------+ - | | Undo: ``kscreen-doctor output.HDMI-A-1.mode.3840x2160@120`` | - +----------------------+-------------------------------------------------------------------------------------------------------------------------------+ - - .. tab:: NVIDIA - - +----------------------+------------------------------------------------------------------------------------------------------+ - | Command Preparations | Do: ``sh -c "${HOME}/scripts/set-custom-res.sh ${SUNSHINE_CLIENT_WIDTH} ${SUNSHINE_CLIENT_HEIGHT}"`` | - | +------------------------------------------------------------------------------------------------------+ - | | Undo: ``sh -c "${HOME}/scripts/set-custom-res.sh 3840 2160"`` | - +----------------------+------------------------------------------------------------------------------------------------------+ - - The ``set-custom-res.sh`` will have this content: - .. code-block:: bash - - #!/bin/bash - - # Get params and set any defaults - width=${1:-1920} - height=${2:-1080} - output=${3:-HDMI-1} - nvidia-settings -a CurrentMetaMode="${output}: nvidia-auto-select { ViewPortIn=${width}x${height}, ViewPortOut=${width}x${height}+0+0 }" - -.. tab:: macOS - - .. tab:: displayplacer - - .. note:: This example uses the `displayplacer` tool to change the resolution. - This tool can be installed following instructions in their - `GitHub repository `__. - - +----------------------+-----------------------------------------------------------------------------------------------+ - | Command Preparations | Do: ``displayplacer "id: res:1920x1080 hz:60 scaling:on origin:(0,0) degree:0"`` | - | +-----------------------------------------------------------------------------------------------+ - | | Undo: ``displayplacer "id: res:3840x2160 hz:120 scaling:on origin:(0,0) degree:0"`` | - +----------------------+-----------------------------------------------------------------------------------------------+ - -.. tab:: Windows - - .. tab:: QRes - - .. note:: This example uses the `QRes` tool to change the resolution and refresh rate. - This tool can be downloaded from their `SourceForge repository `__. - - +----------------------+------------------------------------------------------------------------------------------------------------------+ - | Command Preparations | Do: ``cmd /C FullPath\qres.exe /x:%SUNSHINE_CLIENT_WIDTH% /y:%SUNSHINE_CLIENT_HEIGHT% /r:%SUNSHINE_CLIENT_FPS%`` | - | +------------------------------------------------------------------------------------------------------------------+ - | | Undo: ``cmd /C FullPath\qres.exe /x:3840 /y:2160 /r:120`` | - +----------------------+------------------------------------------------------------------------------------------------------------------+ - -Additional Considerations -------------------------- - -.. tab:: Linux - - .. tab:: Flatpak - - .. attention:: Because Flatpak packages run in a sandboxed environment and do not normally have access to the - host, the Flatpak of Sunshine requires commands to be prefixed with ``flatpak-spawn --host``. - -.. tab:: Windows - - **Elevating Commands (Windows)** - - If you've installed Sunshine as a service (default), you can specify if a command should be elevated with - administrative privileges. Simply enable the elevated option in the WEB UI, or add it to the JSON configuration. - This is an option for both prep-cmd and regular commands and will launch the process with the current user without a - UAC prompt. - - .. note:: It is important to write the values "true" and "false" as string values, not as the typical true/false - values in most JSON. - - **Example** - .. code-block:: json - - { - "name": "Game With AntiCheat that Requires Admin", - "output": "", - "cmd": "ping 127.0.0.1", - "exclude-global-prep-cmd": "false", - "elevated": "true", - "prep-cmd": [ - { - "do": "powershell.exe -command \"Start-Streaming\"", - "undo": "powershell.exe -command \"Stop-Streaming\"", - "elevated": "false" - } - ], - "image-path": "" - } diff --git a/docs/source/about/guides/guides.rst b/docs/source/about/guides/guides.rst deleted file mode 100644 index e11418367b3..00000000000 --- a/docs/source/about/guides/guides.rst +++ /dev/null @@ -1,11 +0,0 @@ -Guides -====== - -Collection of guides written by the community! - -.. toctree:: - :maxdepth: 2 - - app_examples - linux - windows diff --git a/docs/source/about/guides/linux.rst b/docs/source/about/guides/linux.rst deleted file mode 100644 index a7c456d201e..00000000000 --- a/docs/source/about/guides/linux.rst +++ /dev/null @@ -1,10 +0,0 @@ -Linux -====== - -Collection of Sunshine Linux host guides. - -.. toctree:: - :maxdepth: 1 - :glob: - - linux/* diff --git a/docs/source/about/guides/linux/discord_calls.rst b/docs/source/about/guides/linux/discord_calls.rst deleted file mode 100644 index 34b5920a3cb..00000000000 --- a/docs/source/about/guides/linux/discord_calls.rst +++ /dev/null @@ -1,30 +0,0 @@ -How to not stream Discord call audio -==================================== - -#. Set your normal `Sound Output` volume to 100% - - .. image:: ../../../images/discord_calls_01.png - -#. Start Sunshine - -#. Set `Sound Output` to `sink-sunshine-stereo` (if it isn't automatic) - - .. image:: ../../../images/discord_calls_02.png - -#. In Discord - `Right Click` - `Deafen` - Select your normal `Output Device` - - This is also where you will need to adjust output volume for Discord calls - - .. image:: ../../../images/discord_calls_03.png - -#. Open `qpwgraph` - - .. image:: ../../../images/discord_calls_04.png - -#. Connect `sunshine [sunshine-record]` to your normal `Output Device` - - * Drag `monitor_FL` to `playback_FL` - - * Drag `monitor_FR` to `playback_FR` - - .. image:: ../../../images/discord_calls_05.png diff --git a/docs/source/about/guides/linux/headless_ssh.rst b/docs/source/about/guides/linux/headless_ssh.rst deleted file mode 100644 index b86bc8a7caa..00000000000 --- a/docs/source/about/guides/linux/headless_ssh.rst +++ /dev/null @@ -1,526 +0,0 @@ -Remote SSH Headless Setup -========================= - -.. csv-table:: Remote SSH Headless Setup - :header-rows: 0 - :stub-columns: 1 - - Author, `Eric Dong `__ - Difficulty, Intermediate - -This is a guide to setup remote SSH into host to startup X server and sunshine without physical login and dummy plug. -The virtual display is accelerated by the NVidia GPU using the TwinView configuration. - -.. attention:: - This guide is specific for Xorg and NVidia GPUs. I start the X server using the ``startx`` command. - I also only tested this on an Artix runit init system on LAN. - I didn't have to do anything special with pulseaudio (pipewire untested). - - Keep your monitors plugged in until the `Checkpoint`_ step - -.. tip:: - Prior to editing any system configurations, you should make a copy of the original file. - This will allow you to use it for reference or revert your changes easily. - -The Big Picture ---------------- -Once you are done, you will need to perform these 3 steps: - -#. Turn on the host machine -#. Start sunshine on remote host with a script that: - - - Edits permissions of ``/dev/uinput`` (added sudo config to execute script with no password prompt) - - Starts X server with ``startx`` on virtual display - - Starts ``Sunshine`` - -#. Startup Moonlight on the client of interest and connect to host - -.. hint:: - - As an alternative to SSH... - - **Step 2** can be replaced with autologin and starting sunshine as a service or putting - ``sunshine &`` in your ``.xinitrc`` file if you start your X server with ``startx``. - In this case, the workaround for ``/dev/uinput`` permissions is not needed because the udev rule would be triggered - for "physical" login. See :ref:`Linux Setup `. I personally think autologin compromises the - security of the PC, so I went with the remote SSH route. I use the PC more than for gaming, so I don't need a - virtual display everytime I turn on the PC (E.g running updates, config changes, file/media server). - -First we will setup the host and then the SSH Client (Which may not be the same as the machine running the -moonlight client) - -Host Setup ----------- - -We will be setting up: - -#. `Static IP Setup`_ -#. `SSH Server Setup`_ -#. `Virtual Display Setup`_ -#. `Uinput Permissions Workaround`_ -#. `Stream Launcher Script`_ - - -Static IP Setup -^^^^^^^^^^^^^^^ -Setup static IP Address for host. For LAN connections you can use DHCP reservation within your assigned range. -e.g. 192.168.x.x. This will allow you to ssh to the host consistently, so the assigned IP address does -not change. It is preferred to set this through your router config. - - -SSH Server Setup -^^^^^^^^^^^^^^^^ - -.. note:: - Most distros have OpenSSH already installed. If it is not present, install OpenSSH using your package manager. - -.. tab:: Debian/Ubuntu - - .. code-block:: bash - - sudo apt update - sudo apt install openssh-server - -.. tab:: Arch/Artix - - .. code-block:: bash - - sudo pacman -S openssh - # Install openssh- if you are not using SystemD - # e.g. sudo pacman -S openssh-runit - -.. tab:: Alpine - - .. code-block:: bash - - sudo apk update - sudo apk add openssh - -.. tab:: CentOS/RHEL/Fedora - - **CentOS/RHEL 7** - .. code-block:: bash - - sudo yum install openssh-server - - **CentOS/Fedora/RHEL 8** - .. code-block:: bash - - sudo dnf install openssh-server - -Next make sure the OpenSSH daemon is enabled to run when the system starts. - -.. tab:: SystemD - - .. code-block:: bash - - sudo systemctl enable sshd.service - sudo systemctl start sshd.service # Starts the service now - sudo systemctl status sshd.service # See if the service is running - -.. tab:: Runit - - .. code-block:: bash - - sudo ln -s /etc/runit/sv/sshd /run/runit/service # Enables the OpenSSH daemon to run when system starts - sudo sv start sshd # Starts the service now - sudo sv status sshd # See if the service is running - -.. tab:: OpenRC - - .. code-block:: bash - - rc-update add sshd # Enables service - rc-status # List services to verify sshd is enabled - rc-service sshd start # Starts the service now - -**Disabling PAM in sshd** - -I noticed when the ssh session is disconnected for any reason, ``pulseaudio`` would disconnect. -This is due to PAM handling sessions. When running ``dmesg``, I noticed ``elogind`` would say removed user session. -In this `Gentoo Forums post `__, -someone had a similar issue. Starting the X server in the background and exiting out of the console would cause your -session to be removed. - -.. caution:: - According to this `article `__ - disabling PAM increases security, but reduces certain functionality in terms of session handling. - *Do so at your own risk!* - -Edit the ``sshd_config`` file with the following to disable PAM. - -.. code-block:: text - - usePAM no - -After making changes to the ``sshd_config``, restart the sshd service for changes to take effect. - -.. tip:: - Run the command to check the ssh configuration prior to restarting the sshd service. - - .. code-block:: bash - - sudo sshd -t -f /etc/ssh/sshd_config - - An incorrect configuration will prevent the sshd service from starting, which might mean - losing SSH access to the server. - -.. tab:: SystemD - - .. code-block:: bash - - sudo systemctl restart sshd.service - -.. tab:: Runit - - .. code-block:: bash - - sudo sv restart sshd - -.. tab:: OpenRC - - .. code-block:: bash - - sudo rc-service sshd restart - - -Virtual Display Setup -^^^^^^^^^^^^^^^^^^^^^ - -As an alternative to a dummy dongle, you can use this config to create a virtual display. - -.. important:: - This is only available for NVidia GPUs using Xorg. - -.. hint:: - Use ``xrandr`` to see name of your active display output. Usually it starts with ``DP`` or ``HDMI``. For me, it is ``DP-0``. - Put this name for the ``ConnectedMonitor`` option under the ``Device`` section. - - .. code-block:: bash - - xrandr | grep " connected" | awk '{ print $1 }' - - -.. code-block:: xorg.conf - - Section "ServerLayout" - Identifier "TwinLayout" - Screen 0 "metaScreen" 0 0 - EndSection - - Section "Monitor" - Identifier "Monitor0" - Option "Enable" "true" - EndSection - - Section "Device" - Identifier "Card0" - Driver "nvidia" - VendorName "NVIDIA Corporation" - Option "MetaModes" "1920x1080" - Option "ConnectedMonitor" "DP-0" - Option "ModeValidation" "NoDFPNativeResolutionCheck,NoVirtualSizeCheck,NoMaxPClkCheck,NoHorizSyncCheck,NoVertRefreshCheck,NoWidthAlignmentCheck" - EndSection - - Section "Screen" - Identifier "metaScreen" - Device "Card0" - Monitor "Monitor0" - DefaultDepth 24 - Option "TwinView" "True" - SubSection "Display" - Modes "1920x1080" - EndSubSection - EndSection - -.. note:: - The ``ConnectedMonitor`` tricks the GPU into thinking a monitor is connected, - even if there is none actually connected! This allows a virtual display to be created that is accelerated with - your GPU! The ``ModeValidation`` option disables valid resolution checks, so you can choose any - resolution on the host! - - **References** - - - `issue comment on virtual-display-linux - `__ - - `Nvidia Documentation on Configuring TwinView - `__ - - `Arch Wiki Nvidia#TwinView `__ - - `Unix Stack Exchange - How to add virtual display monitor with Nvidia proprietary driver - `__ - - -Uinput Permissions Workaround -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -**Steps** - -We can use ``chown`` to change the permissions from a script. Since this requires ``sudo``, -we will need to update the sudo configuration to execute this without being prompted for a password. - -#. Create a ``sunshine-setup.sh`` script to update permissions on ``/dev/uinput``. Since we aren't logged into the host, - the udev rule doesn't apply. -#. Update user sudo configuration ``/etc/sudoers.d/`` to allow the ``sunshine-setup.sh`` - script to be executed with ``sudo``. - -.. note:: - After I setup the :ref:`udev rule ` to get access to ``/dev/uinput``, - I noticed when I sshed into the host without physical login, the ACL permissions on ``/dev/uinput`` were not changed. - So I asked `reddit - `__. - I discovered that SSH sessions are not the same as a physical login. - I suppose it's not possible for SSH to trigger a udev rule or create a physical login session. - -**Setup Script** - -This script will take care of any preconditions prior to starting up sunshine. - -Run the following to create a script named something like ``sunshine-setup.sh``: - .. code-block:: bash - - echo "chown $(id -un):$(id -gn) /dev/uinput" > sunshine-setup.sh &&\ - chmod +x sunshine-setup.sh - -(**Optional**) To Ensure ethernet is being used for streaming, -you can block WiFi with ``rfkill``. - -Run this command to append the rfkill block command to the script: - .. code-block:: bash - - echo "rfkill block $(rfkill list | grep "Wireless LAN" \ - | sed 's/^\([[:digit:]]\).*/\1/')" >> sunshine-setup.sh - -**Sudo Configuration** - -We will manually change the permissions of ``/dev/uinput`` using ``chown``. -You need to use ``sudo`` to make this change, so add/update the entry in ``/etc/sudoers.d/${USER}`` - -.. danger:: - Do so at your own risk! It is more secure to give sudo and no password prompt to a single script, - than a generic executable like chown. - -.. warning:: - Be very careful of messing this config up. If you make a typo, *YOU LOSE THE ABILITY TO USE SUDO*. - Fortunately, your system is not borked, you will need to login as root to fix the config. - You may want to setup a backup user / SSH into the host as root to fix the config if this happens. - Otherwise you will need to plug your machine back into a monitor and login as root to fix this. - To enable root login over SSH edit your SSHD config, and add ``PermitRootLogin yes``, and restart the SSH server. - -#. First make a backup of your ``/etc/sudoers.d/${USER}`` file. - - .. code-block:: bash - - sudo cp /etc/sudoers.d/${USER} /etc/sudoers.d/${USER}.backup - -#. ``cd`` to the parent dir of the ``sunshine-setup.sh`` script. -#. Execute the following to update your sudoer config file. - - .. code-block:: bash - - echo "${USER} ALL=(ALL:ALL) ALL, NOPASSWD: $(pwd)/sunshine-setup.sh" \ - | sudo tee /etc/sudoers.d/${USER} - -These changes allow the script to use sudo without being prompted with a password. - -e.g. ``sudo $(pwd)/sunshine-setup.sh`` - - -Stream Launcher Script -^^^^^^^^^^^^^^^^^^^^^^ - -This is the main entrypoint script that will run the ``sunshine-setup.sh`` script, start up X server, and Sunshine. -The client will call this script that runs on the host via ssh. - - -**Sunshine Startup Script** - -This guide will refer to this script as ``~/scripts/sunshine.sh``. -The setup script will be referred as ``~/scripts/sunshine-setup.sh`` - -.. code-block:: bash - - #!/bin/bash - - export DISPLAY=:0 - - # Check existing X server - ps -e | grep X >/dev/null - [[ ${?} -ne 0 ]] && { - echo "Starting X server" - startx &>/dev/null & - [[ ${?} -eq 0 ]] && { - echo "X server started successfully" - } || echo "X server failed to start" - } || echo "X server already running" - - # Check if sunshine is already running - ps -e | grep -e .*sunshine$ >/dev/null - [[ ${?} -ne 0 ]] && { - sudo ~/scripts/sunshine-setup.sh - echo "Starting Sunshine!" - sunshine > /dev/null & - [[ ${?} -eq 0 ]] && { - echo "Sunshine started successfully" - } || echo "Sunshine failed to start" - } || echo "Sunshine is already running" - - # Add any other Programs that you want to startup automatically - # e.g. - # steam &> /dev/null & - # firefox &> /dev/null & - # kdeconnect-app &> /dev/null & - ----- - -SSH Client Setup ----------------- - -We will be setting up: - -#. `SSH Key Authentication Setup`_ -#. `SSH Client Script (Optional)`_ - -SSH Key Authentication Setup -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -#. Setup your SSH keys with ``ssh-keygen`` and use ``ssh-copy-id`` to authorize remote login to your host. - Run ``ssh @`` to login to your host. - SSH keys automate login so you don't need to input your password! -#. Optionally setup a ``~/.ssh/config`` file to simplify the ``ssh`` command - - .. code-block:: text - - Host - Hostname - User - IdentityFile ~/.ssh/ - - Now you can use ``ssh ``. - ``ssh `` will execute the command or script on the remote host. - -Checkpoint -^^^^^^^^^^ - -As a sanity check, let's make sure your setup is working so far! - -**Test Steps** - -With your monitor still plugged into your Sunshine host PC: - -#. ``ssh `` -#. ``~/scripts/sunshine.sh`` -#. ``nvidia-smi`` - - You should see the sunshine and Xorg processing running: - - .. code-block:: bash - - nvidia-smi - - *Output:* - - .. code-block:: console - - +---------------------------------------------------------------------------------------+ - | NVIDIA-SMI 535.104.05 Driver Version: 535.104.05 CUDA Version: 12.2 | - |-----------------------------------------+----------------------+----------------------+ - | GPU Name Persistence-M | Bus-Id Disp.A | Volatile Uncorr. ECC | - | Fan Temp Perf Pwr:Usage/Cap | Memory-Usage | GPU-Util Compute M. | - | | | MIG M. | - |=========================================+======================+======================| - | 0 NVIDIA GeForce RTX 3070 Off | 00000000:01:00.0 On | N/A | - | 30% 46C P2 45W / 220W | 549MiB / 8192MiB | 2% Default | - | | | N/A | - +-----------------------------------------+----------------------+----------------------+ - - +---------------------------------------------------------------------------------------+ - | Processes: | - | GPU GI CI PID Type Process name GPU Memory | - | ID ID Usage | - |=======================================================================================| - | 0 N/A N/A 1393 G /usr/lib/Xorg 86MiB | - | 0 N/A N/A 1440 C+G sunshine 293MiB | - +---------------------------------------------------------------------------------------+ - -#. Check ``/dev/uinput`` permissions - - .. code-block:: bash - - ls -l /dev/uinput - - *Output:* - - .. code-block:: console - - crw------- 1 10, 223 Aug 29 17:31 /dev/uinput - -#. Connect to Sunshine host from a moonlight client - -Now kill X and sunshine by running ``pkill X`` on the host, -unplug your monitors from your GPU, and repeat steps 1 - 5. -You should get the same result. -With this setup you don't need to modify the Xorg config regardless if monitors are plugged in or not. - -.. code-block:: bash - - pkill X - - -SSH Client Script (Optional) -^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -At this point you have a working setup! For convenience I created this bash script to automate the -startup of the X server and Sunshine on the host. -This can be run on Unix systems, or on Windows using the ``git-bash`` or any bash shell. - -For Android/iOS you can install Linux emulators, e.g. ``Userland`` for Android and ``ISH`` for iOS. -The neat part is that you can execute one script to launch Sunshine from your phone or tablet! - -.. code-block:: bash - - #!/bin/bash - - ssh_args="@192.168.X.X" # Or use alias set in ~/.ssh/config - - check_ssh(){ - result=1 - # Note this checks infinitely, you could update this to have a max # of retries - while [[ $result -ne 0 ]] - do - echo "checking host..." - ssh $ssh_args "exit 0" 2>/dev/null - result=$? - [[ $result -ne 0 ]] && { - echo "Failed to ssh to $ssh_args, with exit code $result" - } - sleep 3 - done - echo "Host is ready for streaming!" - } - - start_stream(){ - echo "Starting sunshine server on host..." - echo "Start moonlight on your client of choice" - # -f runs ssh in the background - ssh -f $ssh_args "~/scripts/sunshine.sh &" - } - - check_ssh - start_stream - exit_code=${?} - - sleep 3 - exit ${exit_code} - -Next Steps ----------- - -Congrats you can now stream your desktop headless! When trying this the first time, -keep your monitors close by incase something isn't working right. - -If you have any feedback and any suggestions, feel free to make a post on Discord! - -.. seealso:: - Now that you have a virtual display, you may want to automate changing the resolution - and refresh rate prior to connecting to an app. See :ref:`Changing Resolution and Refresh Rate - ` for more information. diff --git a/docs/source/about/guides/windows.rst b/docs/source/about/guides/windows.rst deleted file mode 100644 index 71d8b940473..00000000000 --- a/docs/source/about/guides/windows.rst +++ /dev/null @@ -1,10 +0,0 @@ -Windows -======= - -Collection of Sunshine Windows host guides. - -.. toctree:: - :maxdepth: 1 - :glob: - - windows/* diff --git a/docs/source/about/guides/windows/discord_voicemeeter.rst b/docs/source/about/guides/windows/discord_voicemeeter.rst deleted file mode 100644 index 41db4a7030b..00000000000 --- a/docs/source/about/guides/windows/discord_voicemeeter.rst +++ /dev/null @@ -1,37 +0,0 @@ -Discord call audio cancellation with Voicemeeter (Standard) -=========================================================== - -Voicemeeter -^^^^^^^^^^^ - -#. Click Hardware Out -#. Set the physical device you recieve audio to as your Hardware Out with MME -#. Turn on BUS A for the Virtual Input - -Windows -^^^^^^^ - -#. Open the sound settings -#. Set your default Playback as Voicemeeter Input - -.. note:: Run audio in the background to find the device that your Virtual Input is using - (Voicemeeter In #), you will see the bar to the right of the device have green bars - going up and down. This device will be referred to as Voicemeeter Input. - -Discord -^^^^^^^ - -#. Open the settings -#. Go to Voice & Video -#. Set your Output Device as the physical you receive audio to - -.. note:: It is usually the same device you set for Hardware Out in Voicemeeter. - -Sunshine -^^^^^^^^ - -#. Go to Configuration -#. Go to the Audio/Video tab -#. Set Virtual Sink as Voicemeeter Input - -.. note:: This should be the device you set as default previously in Playback. diff --git a/docs/source/about/overview.rst b/docs/source/about/overview.rst deleted file mode 100644 index e4a3ad51c71..00000000000 --- a/docs/source/about/overview.rst +++ /dev/null @@ -1 +0,0 @@ -.. include:: ../../../README.rst diff --git a/docs/source/about/setup.rst b/docs/source/about/setup.rst deleted file mode 100644 index 0a2676cf08c..00000000000 --- a/docs/source/about/setup.rst +++ /dev/null @@ -1,653 +0,0 @@ -Setup -===== -.. _latest release: https://github.com/LizardByte/Sunshine/releases/latest - -The recommended method for running Sunshine is to use the `binaries`_ bundled with the `latest release`_. - -Binaries --------- -Binaries of Sunshine are created for each release. They are available for Linux, macOS, and Windows. -Binaries can be found in the `latest release`_. - -.. tip:: Some third party packages also exist. See - :ref:`Third Party Packages `. - No support will be provided for third party packages! - -Install -------- -.. tab:: Docker - - .. warning:: The Docker images are not recommended for most users. No support will be provided! - - Docker images are available on `Dockerhub.io `__ - and `ghcr.io `__. - - See :ref:`Docker ` for additional information. - -.. tab:: Linux - - **CUDA Compatibility** - - CUDA is used for NVFBC capture. - - .. tip:: See `CUDA GPUS `__ to cross reference Compute Capability to your GPU. - - .. table:: - :widths: auto - - =========================================== ============== ============== ================================ - Package CUDA Version Min Driver CUDA Compute Capabilities - =========================================== ============== ============== ================================ - sunshine.AppImage 11.8.0 450.80.02 35;50;52;60;61;62;70;75;80;86;90 - sunshine.pkg.tar.zst 11.8.0 450.80.02 35;50;52;60;61;62;70;75;80;86;90 - sunshine_{arch}.flatpak 12.0.0 525.60.13 50;52;60;61;62;70;75;80;86;90 - sunshine-debian-bookworm-{arch}.deb 12.0.0 525.60.13 50;52;60;61;62;70;75;80;86;90 - sunshine-fedora-39-{arch}.rpm 12.4.0 525.60.13 50;52;60;61;62;70;75;80;86;90 - sunshine-fedora-40-{arch}.rpm n/a n/a n/a - sunshine-ubuntu-22.04-{arch}.deb 11.8.0 450.80.02 35;50;52;60;61;62;70;75;80;86;90 - sunshine-ubuntu-24.04-{arch}.deb 11.8.0 450.80.02 35;50;52;60;61;62;70;75;80;86;90 - =========================================== ============== ============== ================================ - - .. tab:: AppImage - - .. caution:: Use distro-specific packages instead of the AppImage if they are available. - - According to AppImageLint the supported distro matrix of the AppImage is below. - - - ✖ Debian bullseye - - ✔ Debian bookworm - - ✔ Debian trixie - - ✔ Debian sid - - ✔ Ubuntu noble - - ✔ Ubuntu jammy - - ✖ Ubuntu focal - - ✖ Ubuntu bionic - - ✖ Ubuntu xenial - - ✖ Ubuntu trusty - - ✖ CentOS 7 - - #. Download ``sunshine.AppImage`` to your home directory. - - .. code-block:: bash - - cd ~ - wget https://github.com/LizardByte/Sunshine/releases/latest/download/sunshine.AppImage - - #. Open terminal and run the following code. - - .. code-block:: bash - - ./sunshine.AppImage --install - - Start: - .. code-block:: bash - - ./sunshine.AppImage --install && ./sunshine.AppImage - - Uninstall: - .. code-block:: bash - - ./sunshine.AppImage --remove - - .. tab:: Arch Linux Package - - .. warning:: We do not provide support for any AUR packages. - - .. tab:: Prebuilt Package - - #. Follow the instructions at LizardByte's `pacman-repo `__ to add - the repository. Then run the following code. - - .. code-block:: bash - - pacman -S sunshine - - Uninstall: - .. code-block:: bash - - pacman -R sunshine - - .. tab:: PKGBUILD Archive - - #. Open terminal and run the following code. - - .. code-block:: bash - - wget https://github.com/LizardByte/Sunshine/releases/latest/download/sunshine.pkg.tar.gz - tar -xvf sunshine.pkg.tar.gz - cd sunshine - - # install optional dependencies - pacman -S cuda # Nvidia GPU encoding support - pacman -S libva-mesa-driver # AMD GPU encoding support - - makepkg -si - - Uninstall: - .. code-block:: bash - - pacman -R sunshine - - .. tab:: Debian/Ubuntu Package - - #. Download ``sunshine-{distro}-{distro-version}-{arch}.deb`` and run the following code. - - .. code-block:: bash - - sudo dpkg -i ./sunshine-{distro}-{distro-version}-{arch}.deb - - .. note:: The ``{distro-version}`` is the version of the distro we built the package on. The ``{arch}`` is the - architecture of your operating system. - - .. tip:: You can double click the deb file to see details about the package and begin installation. - - Uninstall: - .. code-block:: bash - - sudo apt remove sunshine - - .. tab:: Flatpak Package - - .. caution:: Use distro-specific packages instead of the Flatpak if they are available. - - .. important:: The instructions provided here are for the version supplied in the `latest release`_, which does - not necessarily match the version in the Flathub repository! - - #. Install `Flatpak `__ as required. - #. Download ``sunshine_{arch}.flatpak`` and run the following code. - - .. note:: Be sure to replace ``{arch}`` with the architecture for your operating system. - - System level (recommended) - .. code-block:: bash - - flatpak install --system ./sunshine_{arch}.flatpak - - User level - .. code-block:: bash - - flatpak install --user ./sunshine_{arch}.flatpak - - Additional installation (required) - .. code-block:: bash - - flatpak run --command=additional-install.sh dev.lizardbyte.app.Sunshine - - Start: - X11 and NVFBC capture (X11 Only) - .. code-block:: bash - - flatpak run dev.lizardbyte.app.Sunshine - - KMS capture (Wayland & X11) - .. code-block:: bash - - sudo -i PULSE_SERVER=unix:$(pactl info | awk '/Server String/{print$3}') \ - flatpak run dev.lizardbyte.app.Sunshine - - Uninstall: - .. code-block:: bash - - flatpak run --command=remove-additional-install.sh dev.lizardbyte.app.Sunshine - flatpak uninstall --delete-data dev.lizardbyte.app.Sunshine - - .. tab:: Homebrew - - .. important:: The Homebrew package is experimental. - - #. Install `Homebrew `__ - #. Update the Homebrew sources and install Sunshine. - - .. code-block:: bash - - brew tap LizardByte/homebrew - brew install sunshine - - .. tab:: RPM Package - - #. Add `rpmfusion` repositories by running the following code. - - .. code-block:: bash - - sudo dnf install \ - https://mirrors.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm \ - https://mirrors.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-$(rpm -E %fedora).noarch.rpm - - #. Download ``sunshine-{distro}-{distro-version}-{arch}.rpm`` and run the following code. - - .. code-block:: bash - - sudo dnf install ./sunshine-{distro}-{distro-version}-{arch}.rpm - - .. note:: The ``{distro-version}`` is the version of the distro we built the package on. The ``{arch}`` is the - architecture of your operating system. - - .. tip:: You can double click the rpm file to see details about the package and begin installation. - - Uninstall: - .. code-block:: bash - - sudo dnf remove sunshine - - 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` - in order to emulate a PS5 DualSense joypad with Gyro, Acceleration and Touchpad support. - - #. Create and reload `udev` rules for `uinput` and `uhid`. - .. code-block:: bash - - echo 'KERNEL=="uinput", SUBSYSTEM=="misc", OPTIONS+="static_node=uinput", TAG+="uaccess"\nKERNEL=="uhid", TAG+="uaccess"' | \ - sudo tee /etc/udev/rules.d/60-sunshine.rules - sudo udevadm control --reload-rules - sudo udevadm trigger - sudo modprobe uinput - - #. Enable permissions for KMS capture. - .. warning:: Capture of most Wayland-based desktop environments will fail unless this step is performed. - - .. note:: ``cap_sys_admin`` may as well be root, except you don't need to be root to run it. It is necessary to - allow Sunshine to use KMS capture. - - **Enable** - .. code-block:: bash - - sudo setcap cap_sys_admin+p $(readlink -f $(which sunshine)) - - **Disable (for Xorg/X11 only)** - .. code-block:: bash - - sudo setcap -r $(readlink -f $(which sunshine)) - - #. Optionally, configure autostart service - - - filename: ``~/.config/systemd/user/sunshine.service`` - - contents: - .. code-block:: cfg - - [Unit] - Description=Sunshine self-hosted game stream host for Moonlight. - StartLimitIntervalSec=500 - StartLimitBurst=5 - - [Service] - ExecStart= - Restart=on-failure - RestartSec=5s - #Flatpak Only - #ExecStop=flatpak kill dev.lizardbyte.app.Sunshine - - [Install] - WantedBy=graphical-session.target - - .. table:: - :widths: auto - - ========= ============================================== =============== - package ExecStart Auto Configured - ========= ============================================== =============== - ArchLinux /usr/bin/sunshine ✔ - deb /usr/bin/sunshine ✔ - rpm /usr/bin/sunshine ✔ - AppImage ~/sunshine.AppImage ✔ - Flatpak flatpak run dev.lizardbyte.app.Sunshine ✔ - ========= ============================================== =============== - - **Start once** - .. code-block:: bash - - systemctl --user start sunshine - - **Start on boot** - .. code-block:: bash - - systemctl --user enable sunshine - - #. Reboot - .. code-block:: bash - - sudo reboot now - -.. tab:: macOS - - .. important:: Sunshine on macOS is experimental. Gamepads do not work. - - .. tab:: Homebrew - - #. Install `Homebrew `__ - #. Update the Homebrew sources and install Sunshine. - - .. code-block:: bash - - brew tap LizardByte/homebrew - brew install sunshine - - .. tab:: Portfile - - #. Install `MacPorts `__ - #. Update the Macports sources. - - .. code-block:: bash - - sudo nano /opt/local/etc/macports/sources.conf - - Add this line, replacing your username, below the line that starts with ``rsync``. - ``file:///Users//ports`` - - ``Ctrl+x``, then ``Y`` to exit and save changes. - - #. Download and install by running the following code. - - .. code-block:: bash - - mkdir -p ~/ports/multimedia/sunshine - cd ~/ports/multimedia/sunshine - curl -OL https://github.com/LizardByte/Sunshine/releases/latest/download/Portfile - cd ~/ports - portindex - sudo port install sunshine - - #. The first time you start Sunshine, you will be asked to grant access to screen recording and your microphone. - - #. Optionally, install service - - .. code-block:: bash - - sudo port load Sunshine - - Uninstall: - .. code-block:: bash - - sudo port uninstall sunshine - - Sunshine can only access microphones on macOS due to system limitations. To stream system audio use - `Soundflower `__ or - `BlackHole `__. - - .. note:: Command Keys are not forwarded by Moonlight. Right Option-Key is mapped to CMD-Key. - - .. caution:: Gamepads are not currently supported. - -.. tab:: Windows - - .. tab:: Installer - - #. Download and install ``sunshine-windows-installer.exe`` - - .. attention:: You should carefully select or unselect the options you want to install. Do not blindly install or - enable features. - - To uninstall, find Sunshine in the list `here `__ and select "Uninstall" from the - overflow menu. Different versions of Windows may provide slightly different steps for uninstall. - - .. tab:: Standalone - - .. warning:: By using this package instead of the installer, performance will be reduced. This package is not - recommended for most users. No support will be provided! - - #. Download and extract ``sunshine-windows-portable.zip`` - #. Open command prompt as administrator - #. Firewall rules - - Install: - .. code-block:: bash - - cd /d {path to extracted directory} - scripts/add-firewall-rule.bat - - Uninstall: - .. code-block:: bash - - cd /d {path to extracted directory} - scripts/delete-firewall-rule.bat - - #. Virtual Gamepad Support - - Install: - .. code-block:: bash - - cd /d {path to extracted directory} - scripts/install-gamepad.bat - - Uninstall: - .. code-block:: bash - - cd /d {path to extracted directory} - scripts/uninstall-gamepad.bat - - #. Windows service - - Install: - .. code-block:: bash - - cd /d {path to extracted directory} - scripts/install-service.bat - scripts/autostart-service.bat - - Uninstall: - .. code-block:: bash - - cd /d {path to extracted directory} - scripts/uninstall-service.bat - - To uninstall, delete the extracted directory which contains the ``sunshine.exe`` file. - -Usage ------ -#. If Sunshine is not installed/running as a service, then start sunshine with the following command, unless a start - command is listed in the specified package `install`_ instructions above. - - .. note:: A service is a process that runs in the background. This is the default when installing Sunshine from the - Windows installer. Running multiple instances of Sunshine is not advised. - - **Basic usage** - .. code-block:: bash - - sunshine - - **Specify config file** - .. code-block:: bash - - sunshine /sunshine.conf - - .. note:: You do not need to specify a config file. - If no config file is entered the default location will be used. - - .. attention:: The configuration file specified will be created if it doesn't exist. - - **Start Sunshine over SSH (Linux/X11)** - Assuming you are already logged into the host, you can use this command - - .. code-block:: bash - - ssh @ 'export DISPLAY=:0; sunshine' - - If you are logged into the host with only a tty (teletypewriter), you can use ``startx`` to start the - X server prior to executing sunshine. - You nay need to add ``sleep`` between ``startx`` and ``sunshine`` to allow more time for the display to be ready. - - .. code-block:: bash - - ssh @ 'startx &; export DISPLAY=:0; sunshine' - - .. tip:: You could also utilize the ``~/.bash_profile`` or ``~/.bashrc`` files to setup the ``DISPLAY`` - variable. - - .. seealso:: - - See :ref:`Remote SSH Headless Setup - ` on - how to setup a headless streaming server without autologin and dummy plugs (X11 + NVidia GPUs) - -#. Configure Sunshine in the web ui - - The web ui is available on `https://localhost:47990 `__ by default. You may replace - `localhost` with your internal ip address. - - .. attention:: Ignore any warning given by your browser about "insecure website". This is due to the SSL certificate - being self signed. - - .. caution:: If running for the first time, make sure to note the username and password that you created. - - #. Add games and applications. - #. Adjust any configuration settings as needed. - -#. In Moonlight, you may need to add the PC manually. -#. When Moonlight requests for you insert the pin: - - - Login to the web ui - - Go to "PIN" in the Navbar - - Type in your PIN and press Enter, you should get a Success Message - - In Moonlight, select one of the Applications listed - -Network -------- -The Sunshine user interface will be available on port 47990 by default. - -.. warning:: Exposing ports to the internet can be dangerous. Do this at your own risk. - -Arguments ---------- -To get a list of available arguments run the following: - -.. tab:: General - - .. code-block:: bash - - sunshine --help - -.. tab:: AppImage - - .. code-block:: bash - - ./sunshine.AppImage --help - -.. tab:: Flatpak - - .. code-block:: bash - - flatpak run --command=sunshine dev.lizardbyte.app.Sunshine --help - -Shortcuts ---------- -All shortcuts start with ``CTRL + ALT + SHIFT``, just like Moonlight - -- ``CTRL + ALT + SHIFT + N`` - Hide/Unhide the cursor (This may be useful for Remote Desktop Mode for Moonlight) -- ``CTRL + ALT + SHIFT + F1/F12`` - Switch to different monitor for Streaming - -Application List ----------------- -- Applications should be configured via the web UI. -- A basic understanding of working directories and commands is required. -- You can use Environment variables in place of values -- ``$(HOME)`` will be replaced by the value of ``$HOME`` -- ``$$`` will be replaced by ``$``, e.g. ``$$(HOME)`` will be become ``$(HOME)`` -- ``env`` - Adds or overwrites Environment variables for the commands/applications run by Sunshine -- ``"Variable name":"Variable value"`` -- ``apps`` - The list of applications -- Advanced users may want to edit the application list manually. The format is ``json``. -- Example ``json`` application: - .. code-block:: json - - { - "cmd": "command to open app", - "detached": [ - "some-command", - "another-command" - ], - "image-path": "/full-path/to/png-image", - "name": "An App", - "output": "/full-path/to/command-log-file", - "prep-cmd": [ - { - "do": "some-command", - "undo": "undo-that-command" - } - ], - "working-dir": "/full-path/to/working-directory" - } - - - ``cmd`` - The main application - - ``detached`` - A list of commands to be run and forgotten about - - - If not specified, a process is started that sleeps indefinitely - - - ``image-path`` - The full path to the cover art image to use. - - ``name`` - The name of the application/game - - ``output`` - The file where the output of the command is stored - - ``auto-detach`` - Specifies whether the app should be treated as detached if it exits quickly - - ``wait-all`` - Specifies whether to wait for all processes to terminate rather than just the initial process - - ``exit-timeout`` - Specifies how long to wait in seconds for the process to gracefully exit (default: 5 seconds) - - ``prep-cmd`` - A list of commands to be run before/after the application - - - If any of the prep-commands fail, starting the application is aborted - - ``do`` - Run before the application - - - If it fails, all ``undo`` commands of the previously succeeded ``do`` commands are run - - - ``undo`` - Run after the application has terminated - - - Failures of ``undo`` commands are ignored - - - ``working-dir`` - The working directory to use. If not specified, Sunshine will use the application directory. - -- For more examples see :ref:`app examples `. - -Considerations --------------- -- On Windows, Sunshine uses the Desktop Duplication API which only supports capturing from the GPU used for display. - If you want to capture and encode on the eGPU, connect a display or HDMI dummy display dongle to it and run the games - on that display. -- When an application is started, if there is an application already running, it will be terminated. -- When the application has been shutdown, the stream shuts down as well. - - - For example, if you attempt to run ``steam`` as a ``cmd`` instead of ``detached`` the stream will immediately fail. - This is due to the method in which the steam process is executed. Other applications may behave similarly. - - This does not apply to ``detached`` applications. - -- The "Desktop" app works the same as any other application except it has no commands. It does not start an application, - instead it simply starts a stream. If you removed it and would like to get it back, just add a new application with - the name "Desktop" and "desktop.png" as the image path. -- For the Linux flatpak you must prepend commands with ``flatpak-spawn --host``. - -HDR Support ------------ -Streaming HDR content is officially supported on Windows hosts and experimentally supported for Linux hosts. - -- General HDR support information and requirements: - - - HDR must be activated in the host OS, which may require an HDR-capable display or EDID emulator dongle connected to your host PC. - - You must also enable the HDR option in your Moonlight client settings, otherwise the stream will be SDR (and probably overexposed if your host is HDR). - - A good HDR experience relies on proper HDR display calibration both in the OS and in game. HDR calibration can differ significantly between client and host displays. - - You may also need to tune the brightness slider or HDR calibration options in game to the different HDR brightness capabilities of your client's display. - - Some GPUs video encoders can produce lower image quality or encoding performance when streaming in HDR compared to SDR. - -- Additional information: - -.. tab:: Windows - - - HDR streaming is supported for Intel, AMD, and NVIDIA GPUs that support encoding HEVC Main 10 or AV1 10-bit profiles. - - We recommend calibrating the display by streaming the Windows HDR Calibration app to your client device and saving an HDR calibration profile to use while streaming. - - Older games that use NVIDIA-specific NVAPI HDR rather than native Windows HDR support may not display properly in HDR. - -.. tab:: Linux - - - HDR streaming is supported for Intel and AMD GPUs that support encoding HEVC Main 10 or AV1 10-bit profiles using VAAPI. - - The KMS capture backend is required for HDR capture. Other capture methods, like NvFBC or X11, do not support HDR. - - You will need a desktop environment with a compositor that supports HDR rendering, such as Gamescope or KDE Plasma 6. - -.. seealso:: - `Arch wiki on HDR Support for Linux `__ and - `Reddit Guide for HDR Support for AMD GPUs - `__ - -Tutorials and Guides --------------------- -Tutorial videos are available `here `_. - -Guides are available :doc:`here <./guides/guides>`. - -.. admonition:: Community! - - Tutorials and Guides are community generated. Want to contribute? Reach out to us on our discord server. diff --git a/docs/source/about/third_party_packages.rst b/docs/source/about/third_party_packages.rst deleted file mode 100644 index 3eac2426e1d..00000000000 --- a/docs/source/about/third_party_packages.rst +++ /dev/null @@ -1,37 +0,0 @@ -Third Party Packages -==================== - -.. danger:: These packages are not maintained by LizardByte. Use at your own risk. - -Chocolatey ----------- - -.. image:: https://img.shields.io/badge/dynamic/xml.svg?color=orange&label=chocolatey&style=for-the-badge&prefix=v&query=%2F%2Ftr%5B%40id%3D%27chocolatey%27%5D%2Ftd%5B3%5D%2Fspan%2Fa&url=https%3A%2F%2Frepology.org%2Fproject%2Fsunshine%2Fversions&logo=chocolatey - :alt: Chocolatey - :target: https://community.chocolatey.org/packages/sunshine - -Flathub -------- - -.. image:: https://img.shields.io/flathub/v/dev.lizardbyte.app.Sunshine?style=for-the-badge&logo=Flathub - :alt: Flathub - :target: https://flathub.org/apps/dev.lizardbyte.app.Sunshine - -nixpkgs -------- -.. image:: https://img.shields.io/badge/dynamic/xml.svg?color=orange&label=nixpkgs&style=for-the-badge&prefix=v&query=%2F%2Ftr%5B%40id%3D%27nix_unstable%27%5D%2Ftd%5B3%5D%2Fspan%2Fa&url=https%3A%2F%2Frepology.org%2Fproject%2Fsunshine%2Fversions&logo=nixos - :alt: nixpgs - :target: https://github.com/NixOS/nixpkgs/blob/nixos-unstable/pkgs/servers/sunshine/default.nix - -Scoop ------ - -.. image:: https://img.shields.io/scoop/v/sunshine.svg?bucket=extras&style=for-the-badge&logo=data:image/vnd.microsoft.icon;base64,AAABAAEAEBAAAAEAGAAhAwAAFgAAAIlQTkcNChoKAAAADUlIRFIAAAAQAAAAEAgGAAAAH/P/YQAAAuhJREFUOE9tk1tIFFEYx7+ZXdfbrhdMElJLFCykCxL20MUW9UkkqeiOFGSWYW75EvjgVlJmlpkaJV5SMtQlMYjEROqpQoiMMEpRW2/p6q67bTuXM2dmOjPu2moNDHPm4/v/Zs7//D9KlmUNAMjkBoqiJOVJapTyqqzXXn49tCohzbRSVERPSi7tokFOSkne2rmzoED4H6C0pHwjT2G2qspsU7U+wBuzWTs8M9mlpen0YEOoMS/73DjrnMuhXFyiLEmjwZH6vmufR5DDNtHBI7b9cWNNpw9AgcVCtw6+P8R43KdkjHMM+vDqI/tywyiN5oy46KQpLEogiG0149+7rG5HGRK5o01N9VYVoPxm/ZXCOMrD95NloihiOj4qhs1K3R8IbqQFogVJAuRifrXNT3wactkGmpvrbni9UregQu7nn87X0XB3w+ZYfcruHRAVJgNtE0EclmCGM8CYC2DE5UK8TJXtzT1ZZTRSeJUHiqOvW29Vb89KKw4kYgEvgIQFGHurg3l7AlitS8CzAohYZgQB5ZU9Ovx8FcBkMkdcKEx5GL1ee1yWGcKjgWMQfHgVDVOjNPD88qHwHAYOe57GbHOcLSoqQiunYC4tT4tL0NYmbwkOx1hO1ukABITg40AkOO0BJCgiYFEAl9sBjGj/pl+nyairq5xdAdy50xbKuH+eFyUMkijdJtHQCAIGxiOQYC0nguMYmJqeVJJW29vfU7wqSErDzeuV6aQ5lUPoIjn7RI5FRIRUMQkbLC05YN42txgaEpTd89IyuNZEaGlpCZqdXsjHAj5Avp7h+c2CIIiqGGMMMzNTgDD/oLev57I3vX+T6IttRUVNvNvpusey3EGeE5QtAkI82B12YFjmXagh5ER39zOrfw7UWfDPvcl0ddP0j+lGjucylDoiZhIbvkboDccsL9q/+Hr/2YI/JDMzZ4/IIyMhRyh1XYBmKCEptqOhoWFlyHwAZZxX/YHXNK/3/tiVUfcV6T8hxMYSf1PeGAAAAABJRU5ErkJggg== - :alt: Scoop (extras bucket) - :target: https://scoop.sh/#/apps?s=0&d=1&o=true&q=sunshine - -Solus ------ -.. image:: https://img.shields.io/badge/dynamic/xml.svg?color=orange&label=Solus&style=for-the-badge&prefix=v&query=%2F%2Ftr%5B%40id%3D%27solus%27%5D%2Ftd%5B3%5D%2Fspan%2Fa&url=https%3A%2F%2Frepology.org%2Fproject%2Fsunshine%2Fversions&logo=solus - :alt: Solus - :target: https://dev.getsol.us/source/sunshine diff --git a/docs/source/building/build.rst b/docs/source/building/build.rst deleted file mode 100644 index 97693205ae4..00000000000 --- a/docs/source/building/build.rst +++ /dev/null @@ -1,32 +0,0 @@ -Build -===== -Sunshine binaries are built using `CMake `__. Cross compilation is not -supported. That means the binaries must be built on the target operating system and architecture. - -Building Locally ----------------- - -Clone -^^^^^ -Ensure `git `__ is installed and run the following: - .. code-block:: bash - - git clone https://github.com/lizardbyte/sunshine.git --recurse-submodules - cd sunshine && mkdir build && cd build - -Compile -^^^^^^^ -See the section specific to your OS. - -- :ref:`Linux ` -- :ref:`macOS ` -- :ref:`Windows ` - -Remote Build ------------- -It may be beneficial to build remotely in some cases. This will enable easier building on different operating systems. - -#. Fork the project -#. Activate workflows -#. Trigger the `CI` workflow manually -#. Download the artifacts/binaries from the workflow run summary diff --git a/docs/source/building/linux.rst b/docs/source/building/linux.rst deleted file mode 100644 index 93597c2877d..00000000000 --- a/docs/source/building/linux.rst +++ /dev/null @@ -1,189 +0,0 @@ -Linux -===== - -Requirements ------------- - -Debian Bookworm -^^^^^^^^^^^^^^^ -Install Requirements - .. code-block:: bash - - sudo apt update && sudo apt install \ - build-essential \ - cmake \ - libayatana-appindicator3-dev \ - libcap-dev \ # KMS - libcurl4-openssl-dev \ - libdrm-dev \ # KMS - libevdev-dev \ - libminiupnpc-dev \ - libnotify-dev \ - libnuma-dev \ - libopus-dev \ - libpulse-dev \ - libssl-dev \ - libva-dev \ # VA-API - libvdpau-dev \ - libwayland-dev \ # Wayland - libx11-dev \ # X11 - libxcb-shm0-dev \ # X11 - libxcb-xfixes0-dev \ # X11 - libxcb1-dev \ # X11 - libxfixes-dev \ # X11 - libxrandr-dev \ # X11 - libxtst-dev \ # X11 - nodejs \ - npm \ - nvidia-cuda-dev \ # Cuda, NvFBC - nvidia-cuda-toolkit # Cuda, NvFBC - -Fedora 39, 40 -^^^^^^^^^^^^^ - -Install Requirements - .. code-block:: bash - - sudo dnf update && \ - sudo dnf group install "Development Tools" && \ - sudo dnf install \ - cmake \ - gcc \ - gcc-c++ \ - libappindicator-gtk3-devel \ - libcap-devel \ - libcurl-devel \ - libdrm-devel \ - libevdev-devel \ - libnotify-devel \ - libva-devel \ # VA-API - libvdpau-devel \ - libX11-devel \ # X11 - libxcb-devel \ # X11 - libXcursor-devel \ # X11 - libXfixes-devel \ # X11 - libXi-devel \ # X11 - libXinerama-devel \ # X11 - libXrandr-devel \ # X11 - libXtst-devel \ # X11 - mesa-libGL-devel \ - miniupnpc-devel \ - npm \ - numactl-devel \ - openssl-devel \ - opus-devel \ - pulseaudio-libs-devel \ - rpm-build \ # if you want to build an RPM binary package - wget \ # necessary for cuda install with `run` file - which # necessary for cuda install with `run` file - -Ubuntu 22.04 -^^^^^^^^^^^^ - -Install Requirements - .. code-block:: bash - - sudo apt update && sudo apt install \ - build-essential \ - cmake \ - libappindicator3-dev \ - libcap-dev \ # KMS - libcurl4-openssl-dev \ - libdrm-dev \ # KMS - libevdev-dev \ - libminiupnpc-dev \ - libnotify-dev \ - libnuma-dev \ - libopus-dev \ - libpulse-dev \ - libssl-dev \ - libva-dev \ # VA-API - libwayland-dev \ # Wayland - libx11-dev \ # X11 - libxcb-shm0-dev \ # X11 - libxcb-xfixes0-dev \ # X11 - libxcb1-dev \ # X11 - libxfixes-dev \ # X11 - libxrandr-dev \ # X11 - libxtst-dev \ # X11 - nodejs \ - npm \ - nvidia-cuda-dev \ # CUDA, NvFBC - nvidia-cuda-toolkit # CUDA, NvFBC - -Ubuntu 24.04 -^^^^^^^^^^^^ - -Install Requirements - .. code-block:: bash - - sudo apt update && sudo apt install \ - build-essential \ - cmake \ - gcc-11 \ - g++-11 \ - libappindicator3-dev \ - libcap-dev \ # KMS - libcurl4-openssl-dev \ - libdrm-dev \ # KMS - libevdev-dev \ - libminiupnpc-dev \ - libnotify-dev \ - libnuma-dev \ - libopus-dev \ - libpulse-dev \ - libssl-dev \ - libva-dev \ # VA-API - libwayland-dev \ # Wayland - libx11-dev \ # X11 - libxcb-shm0-dev \ # X11 - libxcb-xfixes0-dev \ # X11 - libxcb1-dev \ # X11 - libxfixes-dev \ # X11 - libxrandr-dev \ # X11 - libxtst-dev \ # X11 - nodejs \ - npm \ - nvidia-cuda-dev \ # CUDA, NvFBC - nvidia-cuda-toolkit # CUDA, NvFBC - -Update gcc alias - .. code-block:: bash - - update-alternatives --install \ - /usr/bin/gcc gcc /usr/bin/gcc-11 100 \ - --slave /usr/bin/g++ g++ /usr/bin/g++-11 \ - --slave /usr/bin/gcov gcov /usr/bin/gcov-11 \ - --slave /usr/bin/gcc-ar gcc-ar /usr/bin/gcc-ar-11 \ - --slave /usr/bin/gcc-ranlib gcc-ranlib /usr/bin/gcc-ranlib-11 - -CUDA ----- -If the version of CUDA available from your distro is not adequate, manually install CUDA. - -.. tip:: The version of CUDA you use will determine compatibility with various GPU generations. - At the time of writing, the recommended version to use is CUDA ~11.8. - See `CUDA compatibility `__ for more info. - - Select the appropriate run file based on your desired CUDA version and architecture according to - `CUDA Toolkit Archive `__. - -.. code-block:: bash - - wget https://developer.download.nvidia.com/compute/cuda/11.8.0/local_installers/cuda_11.8.0_520.61.05_linux.run \ - --progress=bar:force:noscroll -q --show-progress -O ./cuda.run - chmod a+x ./cuda.run - ./cuda.run --silent --toolkit --toolkitpath=/usr --no-opengl-libs --no-man-page --no-drm - rm ./cuda.run - -Build ------ -.. attention:: Ensure you are in the build directory created during the clone step earlier before continuing. - -.. code-block:: bash - - cmake .. - make -j ${nproc} - - cpack -G DEB # optionally, create a deb package - cpack -G RPM # optionally, create a rpm package diff --git a/docs/source/building/macos.rst b/docs/source/building/macos.rst deleted file mode 100644 index 6d90a651b25..00000000000 --- a/docs/source/building/macos.rst +++ /dev/null @@ -1,53 +0,0 @@ -macOS -===== - -Requirements ------------- -macOS Big Sur and Xcode 12.5+ - -Use either `MacPorts `__ or `Homebrew `__ - -MacPorts -"""""""" -Install Requirements - .. code-block:: bash - - sudo port install cmake curl doxygen graphviz libopus miniupnpc npm9 pkgconfig python311 py311-pip - -Homebrew -"""""""" -Install Requirements - .. code-block:: bash - - brew install cmake doxygen graphviz icu4c miniupnpc node openssl@3 opus pkg-config python@3.11 - -If there are issues with an SSL header that is not found: - .. tab:: Intel - - .. code-block:: bash - - pushd /usr/local/include - ln -s ../opt/openssl/include/openssl . - popd - - .. tab:: Apple Silicon - - .. code-block:: bash - - pushd /opt/homebrew/include - ln -s ../opt/openssl/include/openssl . - popd - -Build ------ -.. attention:: Ensure you are in the build directory created during the clone step earlier before continuing. - -.. code-block:: bash - - cmake .. - make -j $(sysctl -n hw.ncpu) - - cpack -G DragNDrop # optionally, create a macOS dmg package - -If cmake fails complaining to find Boost, try to set the path explicitly. - ``cmake -DBOOST_ROOT=[boost path] ..``, e.g., ``cmake -DBOOST_ROOT=/opt/local/libexec/boost/1.80 ..`` diff --git a/docs/source/building/windows.rst b/docs/source/building/windows.rst deleted file mode 100644 index 76cf6ac3ffb..00000000000 --- a/docs/source/building/windows.rst +++ /dev/null @@ -1,46 +0,0 @@ -Windows -======= - -Requirements ------------- -First you need to install `MSYS2 `__, then startup "MSYS2 UCRT64" and execute the following -codes. - -Update all packages: - .. code-block:: bash - - pacman -Suy - -Install dependencies: - .. code-block:: bash - - pacman -S \ - doxygen \ - git \ - mingw-w64-ucrt-x86_64-cmake \ - mingw-w64-ucrt-x86_64-cppwinrt \ - mingw-w64-ucrt-x86_64-curl \ - mingw-w64-ucrt-x86_64-graphviz \ - mingw-w64-ucrt-x86_64-miniupnpc \ - mingw-w64-ucrt-x86_64-nlohmann-json \ - mingw-w64-ucrt-x86_64-nodejs \ - mingw-w64-ucrt-x86_64-nsis \ - mingw-w64-ucrt-x86_64-onevpl \ - mingw-w64-ucrt-x86_64-openssl \ - mingw-w64-ucrt-x86_64-opus \ - mingw-w64-ucrt-x86_64-rust \ - mingw-w64-ucrt-x86_64-toolchain \ - python \ - python-pip - -Build ------ -.. attention:: Ensure you are in the build directory created during the clone step earlier before continuing. - -.. code-block:: bash - - cmake -G "MinGW Makefiles" .. - mingw32-make -j$(nproc) - - cpack -G NSIS # optionally, create a windows installer - cpack -G ZIP # optionally, create a windows standalone package diff --git a/docs/source/conf.py b/docs/source/conf.py deleted file mode 100644 index 8307055c0a0..00000000000 --- a/docs/source/conf.py +++ /dev/null @@ -1,167 +0,0 @@ -# Configuration file for the Sphinx documentation builder. -# -# This file only contains a selection of the most common options. For a full -# list see the documentation: -# https://www.sphinx-doc.org/en/master/usage/configuration.html - -# standard imports -from datetime import datetime -import os -import shutil -import subprocess -from typing import Mapping, Optional - - -# re-usable functions -def _run_subprocess( - args_list: list, - cwd: Optional[str] = None, - env: Optional[Mapping] = None, -) -> bool: - og_dir = os.getcwd() - if cwd: - os.chdir(cwd) - process = subprocess.Popen( - args=args_list, - stdout=subprocess.PIPE, - stderr=subprocess.STDOUT, - cwd=cwd, - encoding='utf-8', - env=env, - errors='replace', - ) - - if cwd: - os.chdir(og_dir) - - # Print stdout and stderr in real-time - # https://stackoverflow.com/a/57970619/11214013 - while True: - realtime_output = process.stdout.readline() - - if realtime_output == '' and process.poll() is not None: - break - - if realtime_output: - print(realtime_output.strip(), flush=True) - - process.stdout.close() - - exit_code = process.wait() - - if exit_code != 0: - print(f'::error:: Process [{args_list}] failed with exit code', exit_code) - raise RuntimeError(f'Process [{args_list}] failed with exit code {exit_code}') - else: - return True - - -# -- Path setup -------------------------------------------------------------- - -# If extensions (or modules to document with autodoc) are in another directory, -# add these directories to sys.path here. If the directory is relative to the -# documentation root, use os.path.abspath to make it absolute, like shown here. - -script_dir = os.path.dirname(os.path.abspath(__file__)) # the directory of this file -source_dir = os.path.dirname(script_dir) # the source folder directory -root_dir = os.path.dirname(source_dir) # the root folder directory - -# -- Project information ----------------------------------------------------- -project = 'Sunshine' -project_copyright = f'{datetime.now ().year}, {project}' -author = 'ReenigneArcher' - -# The full version, including alpha/beta/rc tags -# https://docs.readthedocs.io/en/stable/reference/environment-variables.html#envvar-READTHEDOCS_VERSION -version = os.getenv('READTHEDOCS_VERSION', 'dirty') - -# -- General configuration --------------------------------------------------- - -# Add any Sphinx extension module names here, as strings. They can be -# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom -# ones. -extensions = [ - 'm2r2', # enable markdown files - 'sphinx.ext.autosectionlabel', - 'sphinx.ext.todo', # enable to-do sections - 'sphinx.ext.viewcode', # add links to view source code - 'sphinx_copybutton', # add a copy button to code blocks - 'sphinx_inline_tabs', # add tabs -] - -# Add any paths that contain templates here, relative to this directory. -# templates_path = ['_templates'] - -# List of patterns, relative to source directory, that match files and -# directories to ignore when looking for source files. -# This pattern also affects html_static_path and html_extra_path. -exclude_patterns = ['toc.rst'] - -# Extensions to include. -source_suffix = ['.rst', '.md'] - - -# -- Options for HTML output ------------------------------------------------- - -# images -html_favicon = os.path.join(root_dir, 'src_assets', 'common', 'assets', 'web', 'public', 'images', 'sunshine.ico') -html_logo = os.path.join(root_dir, 'sunshine.png') - -# Add any paths that contain custom static files (such as style sheets) here, -# relative to this directory. They are copied after the builtin static files, -# so a file named "default.css" will overwrite the builtin "default.css". -# html_static_path = ['_static'] - -# The theme to use for HTML and HTML Help pages. See the documentation for -# a list of builtin themes. -html_theme = 'furo' - -html_theme_options = { - "top_of_page_button": "edit", - "source_edit_link": "https://github.com/lizardbyte/sunshine/tree/master/docs/source/{filename}", -} - -# extension config options -autosectionlabel_prefix_document = True # Make sure the target is unique -todo_include_todos = True - -# disable epub mimetype warnings -# https://github.com/readthedocs/readthedocs.org/blob/eadf6ac6dc6abc760a91e1cb147cc3c5f37d1ea8/docs/conf.py#L235-L236 -suppress_warnings = ["epub.unknown_project_files"] - -doxygen_cmd = os.getenv('DOXY_PATH', 'doxygen') -print(f'doxygen command: {doxygen_cmd}') - -# get doxygen version -doxy_version = _run_subprocess( - args_list=[doxygen_cmd, '--version'], - cwd=source_dir, -) - -# create build directories, as doxygen fails to create it in macports and docker -directories = [ - os.path.join(source_dir, 'build'), - os.path.join(source_dir, 'build', 'doxygen', 'doxyhtml'), -] -for d in directories: - os.makedirs( - name=d, - exist_ok=True, - ) - -# remove existing html files -# doxygen builds will not re-generated if the html directory already exists -html_dir = os.path.join(source_dir, 'build', 'html') -if os.path.exists(html_dir): - shutil.rmtree(html_dir) - -# run doxygen -doxy_proc = _run_subprocess( - args_list=[doxygen_cmd, 'Doxyfile'], - cwd=source_dir -) - -# copy doxygen html files -html_extra_path = [ - os.path.join(source_dir, 'build', 'doxygen'), # the final directory is omitted in order to have a proper path -] diff --git a/docs/source/contributing/contributing.rst b/docs/source/contributing/contributing.rst deleted file mode 100644 index ab85e13deee..00000000000 --- a/docs/source/contributing/contributing.rst +++ /dev/null @@ -1,25 +0,0 @@ -Contributing -============ - -Read our contribution guide in our organization level -`docs `__. - -Web UI ------- -The Web UI uses `Vite `__ as its build system, to handle the integration of the NPM libraries. - -The HTML pages used by the Web UI are found in ``src_assets/common/assets/web``. - -`EJS `__ is used as a templating system for the pages (check ``template_header.html`` and ``template_header_main.html``). - -The Style System is provided by `Bootstrap `__. - -The JS framework used by the more interactive pages is `Vue `__. - -Building -^^^^^^^^ -Sunshine already builds the UI as part of its build process, but you can make faster changes by starting vite manually. - -.. code-block:: bash - - npm run dev \ No newline at end of file diff --git a/docs/source/contributing/localization.rst b/docs/source/contributing/localization.rst deleted file mode 100644 index 617cba48399..00000000000 --- a/docs/source/contributing/localization.rst +++ /dev/null @@ -1,113 +0,0 @@ -Localization -============ -Sunshine and related LizardByte projects are being localized into various languages. The default language is -`en` (English). - - .. image:: https://app.lizardbyte.dev/uno/crowdin/LizardByte_graph.svg - -CrowdIn -------- -The translations occur on `CrowdIn `__. Anyone is free to contribute to -localization there. - -**Translations Basics** - - The brand names `LizardByte` and `Sunshine` should never be translated. - - Other brand names should never be translated. - Examples: - - - AMD - - Nvidia - -**CrowdIn Integration** - How does it work? - - When a change is made to sunshine source code, a workflow generates new translation templates - that get pushed to CrowdIn automatically. - - When translations are updated on CrowdIn, a push gets made to the `l10n_master` branch and a PR is made against the - `master` branch. Once PR is merged, all updated translations are part of the project and will be included in the - next release. - -Extraction ----------- - -.. tab:: UI - - Sunshine uses `Vue I18n `__ for localizing the UI. - The following is a simple example of how to use it. - - - Add the string to `src_assets/common/assets/web/public/assets/locale/en.json`, in English. - .. code-block:: json - - { - "index": { - "welcome": "Hello, Sunshine!" - } - } - - .. note:: The json keys should be sorted alphabetically. You can use `jsonabc `__ - to sort the keys. - - .. attention:: Due to the integration with Crowdin, it is important to only add strings to the `en.json` file, - and to not modify any other language files. After the PR is merged, the translations can take place - on `CrowdIn `__. Once the translations are complete, a PR will be made - to merge the translations into Sunshine. - - - Use the string in a Vue component. - .. code-block:: html - - - - .. tip:: More formatting examples can be found in the - `Vue I18n guide `__. - -.. tab:: C++ - - There should be minimal cases where strings need to be extracted from C++ source code; however it may be necessary in - some situations. For example the system tray icon could be localized as it is user interfacing. - - - Wrap the string to be extracted in a function as shown. - .. code-block:: cpp - - #include - #include - - std::string msg = boost::locale::translate("Hello world!"); - - .. tip:: More examples can be found in the documentation for - `boost locale `__. - - .. warning:: This is for information only. Contributors should never include manually updated template files, or - manually compiled language files in Pull Requests. - - Strings are automatically extracted from the code to the `locale/sunshine.po` template file. The generated file is - used by CrowdIn to generate language specific template files. The file is generated using the - `.github/workflows/localize.yml` workflow and is run on any push event into the `master` branch. Jobs are only run if - any of the following paths are modified. - - .. code-block:: yaml - - - 'src/**' - - When testing locally it may be desirable to manually extract, initialize, update, and compile strings. Python is - required for this, along with the python dependencies in the `./scripts/requirements.txt` file. Additionally, - `xgettext `__ must be installed. - - **Extract, initialize, and update** - .. code-block:: bash - - python ./scripts/_locale.py --extract --init --update - - **Compile** - .. code-block:: bash - - python ./scripts/_locale.py --compile - - .. attention:: Due to the integration with Crowdin, it is important to not include any extracted or compiled files in - Pull Requests. The files are automatically generated and updated by the workflow. Once the PR is merged, the - translations can take place on `CrowdIn `__. Once the translations are - complete, a PR will be made to merge the translations into Sunshine. diff --git a/docs/source/contributing/testing.rst b/docs/source/contributing/testing.rst deleted file mode 100644 index c1360a09e90..00000000000 --- a/docs/source/contributing/testing.rst +++ /dev/null @@ -1,143 +0,0 @@ -Testing -======= - -Clang Format ------------- -Source code is tested against the `.clang-format` file for linting errors. The workflow file responsible for clang -format testing is `.github/workflows/cpp-clang-format-lint.yml`. - -Test clang-format locally. - .. code-block:: bash - - find ./ -iname *.cpp -o -iname *.h -iname *.m -iname *.mm | xargs clang-format -i - -Sphinx ------- -.. note:: Documentation is now a cmake target and this is all handled by the cmake build system. When compiling docs - as a target, simply install Python, Doxygen, and Graphviz. The installation of python dependencies will be handled - automatically inside a virtual environment. The following instructions are for manual building of the docs. - -Sunshine uses `Sphinx `__ for documentation building. Sphinx, along with other -required python dependencies are included in the `./docs/requirements.txt` file. Python is required to build -sphinx docs. Installation and setup of python will not be covered here. - -Doxygen is used to generate the XML files required by Sphinx. Doxygen can be obtained from -`Doxygen downloads `__. Ensure that the `doxygen` executable is in your path. - -.. seealso:: - Sphinx is configured to use the graphviz extension. To obtain the dot executable from the Graphviz library, - see the `library’s downloads section `__. - - -The config file for Sphinx is `docs/source/conf.py`. This is already included in the repo and should not be modified. - -The config file for Doxygen is `docs/Doxyfile`. This is already included in the repo and should not be modified. - -Test with Sphinx - .. code-block:: bash - - cd docs - make html - - Alternatively - - .. code-block:: bash - - cd docs - sphinx-build -b html source build - -Lint with rstcheck - .. code-block:: bash - - rstcheck -r . - -Check formatting with rstfmt - .. code-block:: bash - - rstfmt --check --diff -w 120 . - -Format inplace with rstfmt - .. code-block:: bash - - rstfmt -w 120 . - -Unit Testing ------------- -Sunshine uses `Google Test `__ for unit testing. Google Test is included in the -repo as a submodule. The test sources are located in the `./tests` directory. - -The tests need to be compiled into an executable, and then run. The tests are built using the normal build process, but -can be disabled by setting the `BUILD_TESTS` CMake option to `OFF`. - -To run the tests, execute the following command from the build directory: - -.. tab:: Linux - - .. code-block:: bash - - pushd tests - ./test_sunshine - popd - -.. tab:: macOS - - .. code-block:: bash - - pushd tests - ./test_sunshine - popd - -.. tab:: Windows - - .. code-block:: bash - - pushd tests - test_sunshine.exe - popd - -To see all available options, run the tests with the `--help` option. - -.. tab:: Linux - - .. code-block:: bash - - pushd tests - ./test_sunshine --help - popd - -.. tab:: macOS - - .. code-block:: bash - - pushd tests - ./test_sunshine --help - popd - -.. tab:: Windows - - .. code-block:: bash - - pushd tests - test_sunshine.exe --help - popd - -Some tests rely on Python to run. CMake will search for Python and enable the docs tests if it is found, otherwise -cmake will fail. You can manually disable the tests by setting the `TESTS_ENABLE_PYTHON_TESTS` CMake option to -`OFF`. - -.. tip:: - - See the googletest `FAQ `__ for more information on how to use - Google Test. - -We use `gcovr `__ to generate code coverage reports, -and `Codecov `__ to analyze the reports for all PRs and commits. - -Codecov will fail a PR if the total coverage is reduced too much, or if not enough of the diff is covered by tests. -In some cases, the code cannot be covered when running the tests inside of GitHub runners. For example, any test that -needs access to the GPU will not be able to run. In these cases, the coverage can be omitted by adding comments to the -code. See the `gcovr documentation `__ for -more information. - -Even if your changes cannot be covered in the CI, we still encourage you to write the tests for them. This will allow -maintainers to run the tests locally. diff --git a/docs/source/gamestream/gamestream.rst b/docs/source/gamestream/gamestream.rst deleted file mode 100644 index 74e468f4bb3..00000000000 --- a/docs/source/gamestream/gamestream.rst +++ /dev/null @@ -1,28 +0,0 @@ -GameStream -========== -Nvidia announced that their GameStream service for Nvidia Games clients will be discontinued in February 2023. -Luckily, Sunshine performance is now on par with Nvidia GameStream. Many users have even reported that Sunshine -outperforms GameStream, so rest assured that Sunshine will be equally performant moving forward. - -Migration ---------- -We have developed a simple migration tool to help you migrate your GameStream games and apps to Sunshine automatically. -Please check out our `GSMS `__ project if you're interested in an automated -migration option. GSMS offers the ability to migrate your custom and auto-detected games and apps. The -working directory, command, and image are all set in Sunshine's ``apps.json`` file. The box-art image is also copied -to a specified directory. - -Internet Streaming ------------------- -If you are using the Moonlight Internet Hosting Tool, you can remove it from your system when you migrate to Sunshine. -To stream over the Internet with Sunshine and a UPnP-capable router, enable the UPnP option in the Sunshine Web UI. - -.. note:: Running Sunshine together with versions of the Moonlight Internet Hosting Tool prior to v5.6 will cause UPnP - port forwarding to become unreliable. Either uninstall the tool entirely or update it to v5.6 or later. - -Limitations ------------ -Sunshine does have some limitations, as compared to Nvidia GameStream. - -- Automatic game/application list. -- Changing game settings automatically, to optimize streaming. diff --git a/docs/source/history/changelog.rst b/docs/source/history/changelog.rst deleted file mode 100644 index 3689dd705f5..00000000000 --- a/docs/source/history/changelog.rst +++ /dev/null @@ -1,17 +0,0 @@ -Changelog -========= - -.. only:: epub - - You can view the changelog in the - `online version `__. - -.. only:: html - - .. raw:: html - - - - diff --git a/docs/source/index.rst b/docs/source/index.rst deleted file mode 100644 index 176e544544b..00000000000 --- a/docs/source/index.rst +++ /dev/null @@ -1,3 +0,0 @@ -Table of Contents -================= -.. include:: toc.rst diff --git a/docs/source/source_code/source_code.rst b/docs/source/source_code/source_code.rst deleted file mode 100644 index 6d43239bb55..00000000000 --- a/docs/source/source_code/source_code.rst +++ /dev/null @@ -1,114 +0,0 @@ -Source Code -=========== -We are in process of improving the source code documentation. Code should be documented using Doxygen syntax. -Many examples exist throughout the codebase. - -Source ------- -For generated docs, refer to the `Doxygen Documentation <../doxyhtml/index.html>`_. - -Guidelines ----------- - -Doxygen Comments -^^^^^^^^^^^^^^^^ - -- Use Doxygen comments to document all files, functions, classes, and variables. -- `Inline documentation block `_ should use the following format: - - .. code-block:: cpp - - ///< A brief description of the member. - -- Multi-line comments, such as for a `documentation block `_, should use the following format: - - .. code-block:: cpp - - /** - * @brief A brief description of the member. - * More detailed description of the member. - */ - - -Documentation Blocks -^^^^^^^^^^^^^^^^^^^^ -Documentation blocks should be placed above the declaration of the function, class, or variable. Below is an example -of a documentation block for the main function. - -.. code-block:: cpp - - /** - * @brief Main application entry point. - * @param argc The number of arguments. - * @param argv The arguments. - * @return The exit code. - * @examples - * main(1, const char* args[] = {"hello", "markdown", nullptr}); - * @examples_end - */ - int main(int argc, char *argv[]); - -.. attention:: The `@examples` and `@examples_end` tags are not standard Doxygen tags. They are custom aliases - we have specified to simplify documenting examples. Do not confuse this with the standard `@example` tag. - -In some cases, it could be valuable to have slightly different documentation for the definitions, especially when -the definition may change depending on the platform or other factors. In such cases, you should put the documentation -that is common in the declaration and the definition-specific documentation in the definition. Below is an example of -how to document the declaration and definition of a function. - -.. code-block:: cpp - - // myFile.h - /** - * @brief A brief description of the function. - * @param arg1 Describe the first argument. - * @param arg2 Describe the second argument. - * @return Describe the result. - */ - int myFunction(int arg1, int arg2); - - // myFile.cpp - /** - * This describes anything which is specific to the implementation of the function. - */ - int myFunction(int arg1, int arg2) - { - // Implementation - } - -File Documentation -^^^^^^^^^^^^^^^^^^ -The file documentation block must be placed at the top of the file. If it is not present, Doxygen will ignore the file. -Understandably, it is difficult to make a creative description for every file although it is still required. -Below is an example of a file documentation block. - -.. code-block:: cpp - - /** - * @file src/main.cpp - * @brief Main application entry point. - */ - -Inline Documentation Blocks -^^^^^^^^^^^^^^^^^^^^^^^^^^^ -Inline comments can be used to describe enum values, variables, and other code constructs. -To document the members of a file, struct, union, class, or enum, it is sometimes desired to place the documentation -block after the member instead of before. For this purpose you have to put an additional `<` marker in the comment -block. Below is an example of an inline comment for an enum value. - -.. code-block:: cpp - - enum class MyEnum - { - FIRST_VALUE, ///< A brief description of the FIRST_VALUE - SECOND_VALUE ///< A brief description of the SECOND_VALUE - }; - -Custom Aliases -^^^^^^^^^^^^^^ -We have defined some custom aliases to simplify documenting examples. - -- ``@examples`` - Start of an example block. This will format the following text as ``cpp``. -- ``@examples_end`` - End of an example block. -- ``@rst`` - Start of a reStructuredText block. This will format the following text as reStructuredText. -- ``@rst_end`` - End of a reStructuredText block. diff --git a/docs/source/toc.rst b/docs/source/toc.rst deleted file mode 100644 index 53ffe687c92..00000000000 --- a/docs/source/toc.rst +++ /dev/null @@ -1,60 +0,0 @@ -.. toctree:: - :maxdepth: 2 - :caption: About - - about/overview - about/setup - about/docker - about/third_party_packages - about/guides/guides - about/advanced_usage - -.. toctree:: - :maxdepth: 2 - :caption: GameStream - - gamestream/gamestream - -.. toctree:: - :maxdepth: 2 - :caption: Troubleshooting - - troubleshooting/general - troubleshooting/linux - troubleshooting/macos - troubleshooting/windows - -.. toctree:: - :maxdepth: 2 - :caption: Build - - building/build - building/linux - building/macos - building/windows - -.. toctree:: - :maxdepth: 2 - :caption: Contributing - - contributing/contributing - contributing/localization - contributing/testing - -.. toctree:: - :maxdepth: 2 - :caption: Legal - - legal/legal - -.. toctree:: - :maxdepth: 2 - :caption: source - - source_code/source_code - -.. toctree:: - :maxdepth: 2 - :caption: History - - history/changelog diff --git a/docs/source/troubleshooting/general.rst b/docs/source/troubleshooting/general.rst deleted file mode 100644 index 7d174787076..00000000000 --- a/docs/source/troubleshooting/general.rst +++ /dev/null @@ -1,97 +0,0 @@ -General -======= - -Forgotten Credentials ---------------------- -If you forgot your credentials to the web UI, try this. - .. tab:: General - - .. code-block:: bash - - sunshine --creds {new-username} {new-password} - - .. tab:: AppImage - - .. code-block:: bash - - ./sunshine.AppImage --creds {new-username} {new-password} - - .. tab:: Flatpak - - .. code-block:: bash - - flatpak run --command=sunshine dev.lizardbyte.app.Sunshine --creds {new-username} {new-password} - - -Web UI Access -------------- -Can't access the web UI? - #. Check firewall rules. - -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 -controllers and leave only support for Generic controllers. - -Also, if you have many controllers already directly connected to the host, it might help to disable them so that the -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. - -Network performance test ------------------------- -For real-time game streaming the most important characteristic of the network -path between server and client is not pure bandwidth but rather stability and -consistency (low latency with low variance, minimal or no packet loss). - -The network can be tested using the multi-platform tool `iPerf3 `__. - -On the Sunshine host ``iperf3`` is started in server mode: - -.. code-block:: bash - - iperf3 -s - -On the client device iperf3 is asked to perform a 60-second UDP test in reverse -direction (from server to client) at a given bitrate (e.g. 50 Mbps): - -.. code-block:: bash - - iperf3 -c {HostIpAddress} -t 60 -u -R -b 50M - -Watch the output on the client for packet loss and jitter values. Both should be -(very) low. Ideally packet loss remains less than 5% and jitter below 1ms. - -For Android clients use `PingMaster `__. - -For iOS clients use `HE.NET Network Tools `__. - -If you are testing a remote connection (over the internet) you will need to -forward the port 5201 (TCP and UDP) from your host. - -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.) - -Sunshine versions > 0.23.1 include improved networking code that should -alleviate or even solve this issue (without reducing the NIC speed). - -Packet loss (MTU) ------------------ -Albeit unlikely, some guests might work better with a lower `MTU -`__ 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 -serving the stream (a Linux PC). It's unclear how that helped precisely so it's a last resort suggestion. diff --git a/docs/source/troubleshooting/linux.rst b/docs/source/troubleshooting/linux.rst deleted file mode 100644 index aab32db0f1b..00000000000 --- a/docs/source/troubleshooting/linux.rst +++ /dev/null @@ -1,76 +0,0 @@ -Linux -===== - -Hardware Encoding fails ------------------------ -Due to legal concerns, Mesa has disabled hardware decoding and encoding by default. - -.. code-block:: text - - Error: Could not open codec [h264_vaapi]: Function not implemented - -If you see the above error in the Sunshine logs, compiling `Mesa` -manually, may be required. See the official Mesa3D `Compiling and Installing `__ -documentation for instructions. - -.. important:: You must re-enable the disabled encoders. You can do so, by passing the following argument to the build - system. You may also want to enable decoders, however that is not required for Sunshine and is not covered here. - - .. code-block:: bash - - -Dvideo-codecs=h264enc,h265enc - -.. note:: Other build options are listed in the - `meson options `__ file. - -KMS Streaming fails -------------------- -If screencasting fails with KMS, you may need to run the following to force unprivileged screencasting. - -.. code-block:: bash - - 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 ` 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 Moonlight's -performance overlay) or strong fluctuations thereof, this is due to -`missing support `_ -in Mesa/libva for AMD's low latency encoder mode. This is particularly -problematic at higher resolutions (4K). - -Only the most recent development versions of mesa include support for this -low-latency mode. It will be included in Mesa-24.2. - -In order to enable it, Sunshine has to be started with a special environment -variable: - -.. code-block:: bash - - AMD_DEBUG=lowlatencyenc sunshine - -To check whether low-latency mode is being used, one can watch the ``VCLK`` and -``DCLK`` frequencies in ``amdgpu_top``. Without this encoder tuning both clock -frequencies will fluctuate strongly, whereas with active low-latency encoding -they will stay high as long as the encoder is used. - -Gamescope compatibility ------------------------ -Some users have reported stuttering issues when streaming games running within Gamescope. diff --git a/docs/source/troubleshooting/macos.rst b/docs/source/troubleshooting/macos.rst deleted file mode 100644 index 551f6945f4a..00000000000 --- a/docs/source/troubleshooting/macos.rst +++ /dev/null @@ -1,13 +0,0 @@ -macOS -===== - -Dynamic session lookup failed ------------------------------ -If you get this error: - `Dynamic session lookup supported but failed: launchd did not provide a socket path, verify that - org.freedesktop.dbus-session.plist is loaded!` - - Try this. - .. code-block:: bash - - launchctl load -w /Library/LaunchAgents/org.freedesktop.dbus-session.plist diff --git a/docs/source/troubleshooting/windows.rst b/docs/source/troubleshooting/windows.rst deleted file mode 100644 index 313bef9a3ee..00000000000 --- a/docs/source/troubleshooting/windows.rst +++ /dev/null @@ -1,14 +0,0 @@ -Windows -======= - -No gamepad detected -------------------- -#. Verify that you've installed `Nefarius Virtual Gamepad `__. - -Permission denied ------------------ -Since Sunshine runs as a service on Windows, it may not have the same level of access that your regular user account -has. You may get permission denied errors when attempting to launch a game or application from a non system drive. - -You will need to modify the security permissions on your disk. Ensure that user/principal SYSTEM has full -permissions on the disk. diff --git a/docs/third_party_packages.md b/docs/third_party_packages.md new file mode 100644 index 00000000000..e89dd19b650 --- /dev/null +++ b/docs/third_party_packages.md @@ -0,0 +1,26 @@ +# Third-Party Packages + +@danger{These packages are not maintained by LizardByte. Use at your own risk.} + +## Chocolatey +[![Chocolatey](https://img.shields.io/badge/dynamic/xml.svg?color=orange&label=chocolatey&style=for-the-badge&prefix=v&query=%2F%2Ftr%5B%40id%3D%27chocolatey%27%5D%2Ftd%5B3%5D%2Fspan%2Fa&url=https%3A%2F%2Frepology.org%2Fproject%2Fsunshine%2Fversions&logo=chocolatey)](https://community.chocolatey.org/packages/sunshine) + +## Flathub +[![Flathub](https://img.shields.io/flathub/v/dev.lizardbyte.app.Sunshine?style=for-the-badge&logo=Flathub)](https://flathub.org/apps/dev.lizardbyte.app.Sunshine) + +## nixpkgs +[![nixpkgs](https://img.shields.io/badge/dynamic/xml.svg?color=orange&label=nixpkgs&style=for-the-badge&prefix=v&query=%2F%2Ftr%5B%40id%3D%27nix_unstable%27%5D%2Ftd%5B3%5D%2Fspan%2Fa&url=https%3A%2F%2Frepology.org%2Fproject%2Fsunshine%2Fversions&logo=nixos)](https://github.com/NixOS/nixpkgs/blob/nixos-unstable/pkgs/servers/sunshine/default.nix) + +## Scoop +[![Scoop (extras bucket)](https://img.shields.io/scoop/v/sunshine.svg?bucket=extras&style=for-the-badge&logo=data:image/vnd.microsoft.icon;base64,AAABAAEAEBAAAAEAGAAhAwAAFgAAAIlQTkcNChoKAAAADUlIRFIAAAAQAAAAEAgGAAAAH/P/YQAAAuhJREFUOE9tk1tIFFEYx7+ZXdfbrhdMElJLFCykCxL20MUW9UkkqeiOFGSWYW75EvjgVlJmlpkaJV5SMtQlMYjEROqpQoiMMEpRW2/p6q67bTuXM2dmOjPu2moNDHPm4/v/Zs7//D9KlmUNAMjkBoqiJOVJapTyqqzXXn49tCohzbRSVERPSi7tokFOSkne2rmzoED4H6C0pHwjT2G2qspsU7U+wBuzWTs8M9mlpen0YEOoMS/73DjrnMuhXFyiLEmjwZH6vmufR5DDNtHBI7b9cWNNpw9AgcVCtw6+P8R43KdkjHMM+vDqI/tywyiN5oy46KQpLEogiG0149+7rG5HGRK5o01N9VYVoPxm/ZXCOMrD95NloihiOj4qhs1K3R8IbqQFogVJAuRifrXNT3wactkGmpvrbni9UregQu7nn87X0XB3w+ZYfcruHRAVJgNtE0EclmCGM8CYC2DE5UK8TJXtzT1ZZTRSeJUHiqOvW29Vb89KKw4kYgEvgIQFGHurg3l7AlitS8CzAohYZgQB5ZU9Ovx8FcBkMkdcKEx5GL1ee1yWGcKjgWMQfHgVDVOjNPD88qHwHAYOe57GbHOcLSoqQiunYC4tT4tL0NYmbwkOx1hO1ukABITg40AkOO0BJCgiYFEAl9sBjGj/pl+nyairq5xdAdy50xbKuH+eFyUMkijdJtHQCAIGxiOQYC0nguMYmJqeVJJW29vfU7wqSErDzeuV6aQ5lUPoIjn7RI5FRIRUMQkbLC05YN42txgaEpTd89IyuNZEaGlpCZqdXsjHAj5Avp7h+c2CIIiqGGMMMzNTgDD/oLev57I3vX+T6IttRUVNvNvpusey3EGeE5QtAkI82B12YFjmXagh5ER39zOrfw7UWfDPvcl0ddP0j+lGjucylDoiZhIbvkboDccsL9q/+Hr/2YI/JDMzZ4/IIyMhRyh1XYBmKCEptqOhoWFlyHwAZZxX/YHXNK/3/tiVUfcV6T8hxMYSf1PeGAAAAABJRU5ErkJggg==)](https://scoop.sh/#/apps?s=0&d=1&o=true&q=sunshine) + +## Solus +[![Solus](https://img.shields.io/badge/dynamic/xml.svg?color=orange&label=Solus&style=for-the-badge&prefix=v&query=%2F%2Ftr%5B%40id%3D%27solus%27%5D%2Ftd%5B3%5D%2Fspan%2Fa&url=https%3A%2F%2Frepology.org%2Fproject%2Fsunshine%2Fversions&logo=solus)](https://dev.getsol.us/source/sunshine) + +
+ +| Previous | Next | +|:------------------------------|------------------------------------------------:| +| [Docker](../DOCKER_README.md) | [Gamestream Migration](gamestream_migration.md) | + +
diff --git a/docs/troubleshooting.md b/docs/troubleshooting.md new file mode 100644 index 00000000000..baf106f1993 --- /dev/null +++ b/docs/troubleshooting.md @@ -0,0 +1,200 @@ +# Troubleshooting + +## General + +### Forgotten Credentials +If you forgot your credentials to the web UI, try this. + +@tabs{ + @tab{General | ```bash + sunshine --creds {new-username} {new-password} + ``` + } + @tab{AppImage | ```bash + ./sunshine.AppImage --creds {new-username} {new-password} + ``` + } + @tab{Flatpak | ```bash + flatpak run --command=sunshine dev.lizardbyte.app.Sunshine --creds {new-username} {new-password} + ``` + } +} + +@tip{Don't forget to replace `{new-username}` and `{new-password}` with your new credentials. +Do not include the curly braces.} + +### Web UI Access +Can't access the web UI? + +1. Check firewall rules. + +### 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 +controllers and leave only support for Generic controllers. + +Also, if you have many controllers already directly connected to the host, it might help to disable them so that the +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. + +### Network performance test + +For real-time game streaming the most important characteristic of the network +path between server and client is not pure bandwidth but rather stability and +consistency (low latency with low variance, minimal or no packet loss). + +The network can be tested using the multi-platform tool [iPerf3](https://iperf.fr). + +On the Sunshine host `iperf3` is started in server mode: + +```bash +iperf3 -s +``` + +On the client device iperf3 is asked to perform a 60-second UDP test in reverse +direction (from server to client) at a given bitrate (e.g. 50 Mbps): + +```bash +iperf3 -c {HostIpAddress} -t 60 -u -R -b 50M +``` + +Watch the output on the client for packet loss and jitter values. Both should be +(very) low. Ideally packet loss remains less than 5% and jitter below 1ms. + +For Android clients use +[PingMaster](https://play.google.com/store/apps/details?id=com.appplanex.pingmasternetworktools). + +For iOS clients use [HE.NET Network Tools](https://apps.apple.com/us/app/he-net-network-tools/id858241710). + +If you are testing a remote connection (over the internet) you will need to +forward the port 5201 (TCP and UDP) from your host. + +### 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 Wi-Fi. 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.) + +Sunshine versions > 0.23.1 include improved networking code that should +alleviate or even solve this issue (without reducing the NIC speed). + +### Packet loss (MTU) +Although 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 +serving the stream (a Linux PC). It's unclear how that helped precisely, so it's a last +resort suggestion. + +## Linux + +### Hardware Encoding fails +Due to legal concerns, Mesa has disabled hardware decoding and encoding by default. + +```txt +Error: Could not open codec [h264_vaapi]: Function not implemented +``` + +If you see the above error in the Sunshine logs, compiling *Mesa* manually, may be required. See the official Mesa3D +[Compiling and Installing](https://docs.mesa3d.org/install.html) documentation for instructions. + +@important{You must re-enable the disabled encoders. You can do so, by passing the following argument to the build +system. You may also want to enable decoders, however that is not required for Sunshine and is not covered here. +```bash +-Dvideo-codecs=h264enc,h265enc +``` +} + +@note{Other build options are listed in the +[meson options](https://gitlab.freedesktop.org/mesa/mesa/-/blob/main/meson_options.txt) file.} + +### KMS Streaming fails +If screencasting fails with KMS, you may need to run the following to force unprivileged screencasting. + +```bash +sudo setcap -r $(readlink -f $(which sunshine)) +``` + +@note{The above command will not work with the AppImage or Flatpak packages. Please refer to the +[AppImage setup](md_docs_2getting__started.html#appimage) or +[Flatpak setup](md_docs_2getting__started.html#flatpak) 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: + +```bash +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 Moonlight'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). + +Only the most recent development versions of mesa include support for this +low-latency mode. It will be included in Mesa-24.2. + +In order to enable it, Sunshine has to be started with a special environment +variable: + +```bash +AMD_DEBUG=lowlatencyenc sunshine +``` + +To check whether low-latency mode is being used, one can watch the `VCLK` and +`DCLK` frequencies in `amdgpu_top`. Without this encoder tuning both clock +frequencies will fluctuate strongly, whereas with active low-latency encoding +they will stay high as long as the encoder is used. + +### Gamescope compatibility +Some users have reported stuttering issues when streaming games running within Gamescope. + +## macOS + +### Dynamic session lookup failed +If you get this error: + +> Dynamic session lookup supported but failed: launchd did not provide a socket path, verify that +> org.freedesktop.dbus-session.plist is loaded! + +Try this. +```bash +launchctl load -w /Library/LaunchAgents/org.freedesktop.dbus-session.plist +``` + +## Windows + +### No gamepad detected +Verify that you've installed [Nefarius Virtual Gamepad](https://github.com/nefarius/ViGEmBus/releases/latest). + +### Permission denied +Since Sunshine runs as a service on Windows, it may not have the same level of access that your regular user account +has. You may get permission denied errors when attempting to launch a game or application from a non system drive. + +You will need to modify the security permissions on your disk. Ensure that user/principal SYSTEM has full +permissions on the disk. + +
+ +| Previous | Next | +|:--------------------------------------------|------------------------:| +| [Performance Tuning](performance_tuning.md) | [Building](building.md) | + +
diff --git a/packaging/linux/Arch/PKGBUILD b/packaging/linux/Arch/PKGBUILD index 7904d6ede22..496ab69959d 100644 --- a/packaging/linux/Arch/PKGBUILD +++ b/packaging/linux/Arch/PKGBUILD @@ -46,7 +46,6 @@ makedepends=( 'make' 'nodejs' 'npm' - 'python' ) optdepends=( diff --git a/packaging/linux/flatpak/flatpak-lint-baseline_repo.json b/packaging/linux/flatpak/flatpak-lint-baseline_repo.json index 54282488475..92d24feb051 100644 --- a/packaging/linux/flatpak/flatpak-lint-baseline_repo.json +++ b/packaging/linux/flatpak/flatpak-lint-baseline_repo.json @@ -1,10 +1,10 @@ { "errors": [ - "appstream-external-screenshot-url", + "appstream-missing-screenshots", "finish-args-flatpak-spawn-access" ], "info": [ - "appstream-external-screenshot-url: Screenshots are not mirrored to https://dl.flathub.org/media", + "appstream-missing-screenshots: Catalogue file has no screenshots. Please check if screenshot URLs are reachable", "finish-args-flatpak-spawn-access: finish-args has a talk-name access for org.freedesktop.Flatpak" ], "message": "Please consult the documentation at https://docs.flathub.org/docs/for-app-authors/linter" diff --git a/packaging/macos/Portfile b/packaging/macos/Portfile index 3fdb7b93718..1b9e1bdaa39 100644 --- a/packaging/macos/Portfile +++ b/packaging/macos/Portfile @@ -34,9 +34,7 @@ post-fetch { depends_build-append port:doxygen \ port:graphviz \ port:npm9 \ - port:pkgconfig \ - port:python311 \ - port:py311-pip + port:pkgconfig depends_lib port:curl \ port:libopus \ diff --git a/packaging/sunshine.rb b/packaging/sunshine.rb index cb97f7f097a..cf6886b48bd 100644 --- a/packaging/sunshine.rb +++ b/packaging/sunshine.rb @@ -1,6 +1,7 @@ require "language/node" class @PROJECT_NAME@ < Formula + # conflicts_with "sunshine", because: "sunshine and sunshine-beta cannot be installed at the same time" desc "@PROJECT_DESCRIPTION@" homepage "@PROJECT_HOMEPAGE_URL@" url "@GITHUB_CLONE_URL@", @@ -145,10 +146,9 @@ def caveats test do # test that the binary runs at all - system "#{bin}/sunshine", "--version" + system bin/"sunshine", "--version" # run the test suite - # cannot build tests with python tests because homebrew destroys the source directory - system "#{bin}/test_sunshine", "--gtest_color=yes" + system bin/"test_sunshine", "--gtest_color=yes" end end diff --git a/scripts/linux_build.sh b/scripts/linux_build.sh new file mode 100644 index 00000000000..0ad3aaf6404 --- /dev/null +++ b/scripts/linux_build.sh @@ -0,0 +1,475 @@ +#!/bin/bash +set -e + +# Default value for arguments +appimage_build=0 +skip_cleanup=0 +skip_cuda=0 +skip_libva=0 +skip_package=0 +sudo_cmd="sudo" +ubuntu_test_repo=0 + +function _usage() { + local exit_code=$1 + + cat <&2 + _usage 1 + ;; + esac + ;; + \? ) + echo "Invalid option: -${OPTARG}" 1>&2 + _usage 1 + ;; + esac +done +shift $((OPTIND -1)) + +# dependencies array to build out +dependencies=() + +function add_debain_based_deps() { + dependencies+=( + "bison" # required if we need to compile doxygen + "build-essential" + "cmake" + "doxygen" + "flex" # required if we need to compile doxygen + "gcc-${gcc_version}" + "g++-${gcc_version}" + "git" + "graphviz" + "libcap-dev" # KMS + "libcurl4-openssl-dev" + "libdrm-dev" # KMS + "libevdev-dev" + "libminiupnpc-dev" + "libnotify-dev" + "libnuma-dev" + "libopus-dev" + "libpulse-dev" + "libssl-dev" + "libvdpau-dev" + "libwayland-dev" # Wayland + "libx11-dev" # X11 + "libxcb-shm0-dev" # X11 + "libxcb-xfixes0-dev" # X11 + "libxcb1-dev" # X11 + "libxfixes-dev" # X11 + "libxrandr-dev" # X11 + "libxtst-dev" # X11 + "ninja-build" + "npm" # web-ui + "udev" + "wget" # necessary for cuda install with `run` file + "xvfb" # necessary for headless unit testing + ) + + if [ "$skip_libva" == 0 ]; then + dependencies+=( + "libva-dev" # VA-API + ) + fi +} + +function add_debain_deps() { + add_debain_based_deps + dependencies+=( + "libayatana-appindicator3-dev" + ) +} + +function add_ubuntu_deps() { + if [ "$ubuntu_test_repo" == 1 ]; then + # allow newer gcc + ${sudo_cmd} add-apt-repository ppa:ubuntu-toolchain-r/test -y + fi + + add_debain_based_deps + dependencies+=( + "libappindicator3-dev" + ) +} + +function add_fedora_deps() { + dependencies+=( + "cmake" + "doxygen" + "gcc" + "g++" + "git" + "graphviz" + "libappindicator-gtk3-devel" + "libcap-devel" + "libcurl-devel" + "libdrm-devel" + "libevdev-devel" + "libnotify-devel" + "libvdpau-devel" + "libX11-devel" # X11 + "libxcb-devel" # X11 + "libXcursor-devel" # X11 + "libXfixes-devel" # X11 + "libXi-devel" # X11 + "libXinerama-devel" # X11 + "libXrandr-devel" # X11 + "libXtst-devel" # X11 + "mesa-libGL-devel" + "miniupnpc-devel" + "ninja-build" + "npm" + "numactl-devel" + "openssl-devel" + "opus-devel" + "pulseaudio-libs-devel" + "rpm-build" # if you want to build an RPM binary package + "wget" # necessary for cuda install with `run` file + "which" # necessary for cuda install with `run` file + "xorg-x11-server-Xvfb" # necessary for headless unit testing + ) + + if [ "$skip_libva" == 0 ]; then + dependencies+=( + "libva-devel" # VA-API + ) + fi +} + +function install_cuda() { + # check if we need to install cuda + if [ -f "${build_dir}/cuda/bin/nvcc" ]; then + echo "cuda already installed" + return + fi + + local cuda_prefix="https://developer.download.nvidia.com/compute/cuda/" + local cuda_suffix="" + if [ "$architecture" == "aarch64" ]; then + local cuda_suffix="_sbsa" + fi + + if [ "$architecture" == "aarch64" ]; then + # we need to patch the math-vector.h file for aarch64 fedora + # back up /usr/include/bits/math-vector.h + math_vector_file="" + if [ "$distro" == "ubuntu" ] || [ "$version" == "24.04" ]; then + math_vector_file="/usr/include/aarch64-linux-gnu/bits/math-vector.h" + elif [ "$distro" == "fedora" ]; then + math_vector_file="/usr/include/bits/math-vector.h" + fi + + if [ -n "$math_vector_file" ]; then + # patch headers https://bugs.launchpad.net/ubuntu/+source/mumax3/+bug/2032624 + ${sudo_cmd} cp "$math_vector_file" "$math_vector_file.bak" + ${sudo_cmd} sed -i 's/__Float32x4_t/int/g' "$math_vector_file" + ${sudo_cmd} sed -i 's/__Float64x2_t/int/g' "$math_vector_file" + ${sudo_cmd} sed -i 's/__SVFloat32_t/float/g' "$math_vector_file" + ${sudo_cmd} sed -i 's/__SVFloat64_t/float/g' "$math_vector_file" + ${sudo_cmd} sed -i 's/__SVBool_t/int/g' "$math_vector_file" + fi + fi + + local url="${cuda_prefix}${cuda_version}/local_installers/cuda_${cuda_version}_${cuda_build}_linux${cuda_suffix}.run" + echo "cuda url: ${url}" + wget "$url" --progress=bar:force:noscroll -q --show-progress -O "${build_dir}/cuda.run" + chmod a+x "${build_dir}/cuda.run" + "${build_dir}/cuda.run" --silent --toolkit --toolkitpath="${build_dir}/cuda" --no-opengl-libs --no-man-page --no-drm + rm "${build_dir}/cuda.run" +} + +function check_version() { + local package_name=$1 + local min_version=$2 + local installed_version + + echo "Checking if $package_name is installed and at least version $min_version" + + if [ "$distro" == "debian" ] || [ "$distro" == "ubuntu" ]; then + installed_version=$(dpkg -s "$package_name" 2>/dev/null | grep '^Version:' | awk '{print $2}') + elif [ "$distro" == "fedora" ]; then + installed_version=$(rpm -q --queryformat '%{VERSION}' "$package_name" 2>/dev/null) + else + echo "Unsupported Distro" + return 1 + fi + + if [ -z "$installed_version" ]; then + echo "Package not installed" + return 1 + fi + + if [ "$(printf '%s\n' "$installed_version" "$min_version" | sort -V | head -n1)" = "$min_version" ]; then + echo "$package_name version $installed_version is at least $min_version" + return 0 + else + echo "$package_name version $installed_version is less than $min_version" + return 1 + fi +} + +function run_install() { + # prepare CMAKE args + cmake_args=( + "-B=build" + "-G=Ninja" + "-S=." + "-DBUILD_WERROR=ON" + "-DCMAKE_BUILD_TYPE=Release" + "-DCMAKE_INSTALL_PREFIX=/usr" + "-DSUNSHINE_ASSETS_DIR=share/sunshine" + "-DSUNSHINE_EXECUTABLE_PATH=/usr/bin/sunshine" + "-DSUNSHINE_ENABLE_WAYLAND=ON" + "-DSUNSHINE_ENABLE_X11=ON" + "-DSUNSHINE_ENABLE_DRM=ON" + ) + + if [ "$appimage_build" == 1 ]; then + cmake_args+=("-DSUNSHINE_BUILD_APPIMAGE=ON") + fi + + # Update the package list + $package_update_command + + if [ "$distro" == "debian" ]; then + add_debain_deps + elif [ "$distro" == "ubuntu" ]; then + add_ubuntu_deps + elif [ "$distro" == "fedora" ]; then + add_fedora_deps + dnf group install "Development Tools" -y + fi + + # Install the dependencies + $package_install_command "${dependencies[@]}" + + # reload the environment + # shellcheck source=/dev/null + source ~/.bashrc + + gcc_alternative_files=( + "gcc" + "g++" + "gcov" + "gcc-ar" + "gcc-ranlib" + ) + + # update alternatives for gcc and g++ if a debian based distro + if [ "$distro" == "debian" ] || [ "$distro" == "ubuntu" ]; then + for file in "${gcc_alternative_files[@]}"; do + file_path="/etc/alternatives/$file" + if [ -e "$file_path" ]; then + mv "$file_path" "$file_path.bak" + fi + done + + ${sudo_cmd} update-alternatives --install \ + /usr/bin/gcc gcc /usr/bin/gcc-${gcc_version} 100 \ + --slave /usr/bin/g++ g++ /usr/bin/g++-${gcc_version} \ + --slave /usr/bin/gcov gcov /usr/bin/gcov-${gcc_version} \ + --slave /usr/bin/gcc-ar gcc-ar /usr/bin/gcc-ar-${gcc_version} \ + --slave /usr/bin/gcc-ranlib gcc-ranlib /usr/bin/gcc-ranlib-${gcc_version} + fi + + # compile cmake if the version is too low + cmake_min="3.25.0" + target_cmake_version="3.30.1" + if ! check_version "cmake" "$cmake_min"; then + cmake_prefix="https://github.com/Kitware/CMake/releases/download/v" + if [ "$architecture" == "x86_64" ]; then + cmake_arch="x86_64" + elif [ "$architecture" == "aarch64" ]; then + cmake_arch="aarch64" + fi + url="${cmake_prefix}${target_cmake_version}/cmake-${target_cmake_version}-linux-${cmake_arch}.sh" + echo "cmake url: ${url}" + wget "$url" --progress=bar:force:noscroll -q --show-progress -O "${build_dir}/cmake.sh" + ${sudo_cmd} sh "${build_dir}/cmake.sh" --skip-license --prefix=/usr/local + echo "cmake installed, version:" + cmake --version + fi + + # compile doxygen if version is too low + doxygen_min="1.10.0" + _doxygen_min="1_10_0" + if ! check_version "doxygen" "$doxygen_min"; then + if [ "${SUNSHINE_COMPILE_DOXYGEN}" == "true" ]; then + echo "Compiling doxygen" + doxygen_url="https://github.com/doxygen/doxygen/releases/download/Release_${_doxygen_min}/doxygen-${doxygen_min}.src.tar.gz" + echo "doxygen url: ${doxygen_url}" + wget "$doxygen_url" --progress=bar:force:noscroll -q --show-progress -O "${build_dir}/doxygen.tar.gz" + tar -xzf "${build_dir}/doxygen.tar.gz" + cd "doxygen-${doxygen_min}" + cmake -DCMAKE_BUILD_TYPE=Release -G="Ninja" -B="build" -S="." + ninja -C "build" + ninja -C "build" install + else + echo "Doxygen version too low, skipping docs" + cmake_args+=("-DBUILD_DOCS=OFF") + fi + fi + + # install node from nvm + if [ "$nvm_node" == 1 ]; then + nvm_url="https://raw.githubusercontent.com/nvm-sh/nvm/master/install.sh" + echo "nvm url: ${nvm_url}" + wget -qO- ${nvm_url} | bash + source "$HOME/.nvm/nvm.sh" + nvm install node + nvm use node + fi + + # run the cuda install + if [ -n "$cuda_version" ] && [ "$skip_cuda" == 0 ]; then + install_cuda + cmake_args+=("-DSUNSHINE_ENABLE_CUDA=ON") + cmake_args+=("-DCMAKE_CUDA_COMPILER:PATH=${build_dir}/cuda/bin/nvcc") + fi + + # Cmake stuff here + mkdir -p "build" + echo "cmake args:" + echo "${cmake_args[@]}" + cmake "${cmake_args[@]}" + ninja -C "build" + + # Create the package + if [ "$skip_package" == 0 ]; then + if [ "$distro" == "debian" ] || [ "$distro" == "ubuntu" ]; then + cpack -G DEB --config ./build/CPackConfig.cmake + elif [ "$distro" == "fedora" ]; then + cpack -G RPM --config ./build/CPackConfig.cmake + fi + fi + + if [ "$skip_cleanup" == 0 ]; then + # Restore the original gcc alternatives + if [ "$distro" == "debian" ] || [ "$distro" == "ubuntu" ]; then + for file in "${gcc_alternative_files[@]}"; do + if [ -e "/etc/alternatives/$file.bak" ]; then + ${sudo_cmd} mv "/etc/alternatives/$file.bak" "/etc/alternatives/$file" + else + ${sudo_cmd} rm "/etc/alternatives/$file" + fi + done + fi + + # restore the math-vector.h file + if [ "$architecture" == "aarch64" ] && [ -n "$math_vector_file" ]; then + ${sudo_cmd} mv -f "$math_vector_file.bak" "$math_vector_file" + fi + fi +} + +# Determine the OS and call the appropriate function +cat /etc/os-release +if grep -q "Debian GNU/Linux 12 (bookworm)" /etc/os-release; then + distro="debian" + version="12" + package_update_command="${sudo_cmd} apt-get update" + package_install_command="${sudo_cmd} apt-get install -y" + cuda_version="12.0.0" + cuda_build="525.60.13" + gcc_version="12" + nvm_node=0 +elif grep -q "PLATFORM_ID=\"platform:f39\"" /etc/os-release; then + distro="fedora" + version="39" + package_update_command="${sudo_cmd} dnf update -y" + package_install_command="${sudo_cmd} dnf install -y" + cuda_version="12.4.0" + cuda_build="550.54.14" + gcc_version="13" + nvm_node=0 +elif grep -q "PLATFORM_ID=\"platform:f40\"" /etc/os-release; then + distro="fedora" + version="40" + package_update_command="${sudo_cmd} dnf update -y" + package_install_command="${sudo_cmd} dnf install -y" + cuda_version= + cuda_build= + gcc_version="13" + nvm_node=0 +elif grep -q "Ubuntu 22.04" /etc/os-release; then + distro="ubuntu" + version="22.04" + package_update_command="${sudo_cmd} apt-get update" + package_install_command="${sudo_cmd} apt-get install -y" + cuda_version="11.8.0" + cuda_build="520.61.05" + gcc_version="11" + nvm_node=1 +elif grep -q "Ubuntu 24.04" /etc/os-release; then + distro="ubuntu" + version="24.04" + package_update_command="${sudo_cmd} apt-get update" + package_install_command="${sudo_cmd} apt-get install -y" + cuda_version="11.8.0" + cuda_build="520.61.05" + gcc_version="11" + nvm_node=0 +else + echo "Unsupported Distro or Version" + exit 1 +fi + +architecture=$(uname -m) + +echo "Detected Distro: $distro" +echo "Detected Version: $version" +echo "Detected Architecture: $architecture" + +if [ "$architecture" != "x86_64" ] && [ "$architecture" != "aarch64" ]; then + echo "Unsupported Architecture" + exit 1 +fi + +# get directory of this script +script_dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" +build_dir="$script_dir/../build" +echo "Script Directory: $script_dir" +echo "Build Directory: $build_dir" +mkdir -p "$build_dir" + +run_install diff --git a/src/config.cpp b/src/config.cpp index 7f5888633ae..e8accb15a57 100644 --- a/src/config.cpp +++ b/src/config.cpp @@ -407,21 +407,6 @@ namespace config { boost::asio::ip::host_name(), // sunshine_name, "sunshine_state.json"s, // file_state {}, // external_ip - { - "352x240"s, - "480x360"s, - "858x480"s, - "1280x720"s, - "1920x1080"s, - "2560x1080"s, - "2560x1440"s, - "3440x1440"s, - "1920x1200"s, - "3840x2160"s, - "3840x1600"s, - }, // supported resolutions - - { 10, 30, 60, 90, 120 }, // supported fps }; input_t input { @@ -1044,8 +1029,6 @@ namespace config { path_f(vars, "credentials_file", config::sunshine.credentials_file); string_f(vars, "external_ip", nvhttp.external_ip); - list_string_f(vars, "resolutions"s, nvhttp.resolutions); - list_int_f(vars, "fps"s, nvhttp.fps); list_prep_cmd_f(vars, "global_prep_cmd", config::sunshine.prep_cmds); string_f(vars, "audio_sink", audio.sink); diff --git a/src/config.h b/src/config.h index d2c4783ce93..c987fc543bf 100644 --- a/src/config.h +++ b/src/config.h @@ -115,8 +115,6 @@ namespace config { std::string file_state; std::string external_ip; - std::vector resolutions; - std::vector fps; }; struct input_t { diff --git a/src/logging.cpp b/src/logging.cpp index 5cc226ea647..a78b5b5de89 100644 --- a/src/logging.cpp +++ b/src/logging.cpp @@ -4,10 +4,12 @@ */ // standard includes #include +#include #include // lib includes #include +#include #include #include #include @@ -67,7 +69,6 @@ namespace logging { sink->set_formatter([](const bl::record_view &view, bl::formatting_ostream &os) { constexpr const char *message = "Message"; constexpr const char *severity = "Severity"; - constexpr int DATE_BUFFER_SIZE = 21 + 2 + 1; // Full string plus ": \0" auto log_level = view.attribute_values()[severity].extract().get(); @@ -93,11 +94,15 @@ namespace logging { break; }; - char _date[DATE_BUFFER_SIZE]; - std::time_t t = std::time(nullptr); - strftime(_date, DATE_BUFFER_SIZE, "[%Y:%m:%d:%H:%M:%S]: ", std::localtime(&t)); + auto now = std::chrono::system_clock::now(); + auto ms = std::chrono::duration_cast( + now - std::chrono::time_point_cast(now)); - os << _date << log_type << view.attribute_values()[message].extract(); + auto t = std::chrono::system_clock::to_time_t(now); + auto lt = *std::localtime(&t); + + os << "["sv << std::put_time(<, "%Y-%m-%d %H:%M:%S.") << boost::format("%03u") % ms.count() << "]: "sv + << log_type << view.attribute_values()[message].extract(); }); // Flush after each log record to ensure log file contents on disk isn't stale. diff --git a/src/main.cpp b/src/main.cpp index ed584459e9b..1a1d5ef24ef 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -71,6 +71,15 @@ SessionMonitorWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) { return DefWindowProc(hwnd, uMsg, wParam, lParam); } } + +WINAPI BOOL +ConsoleCtrlHandler(DWORD type) { + if (type == CTRL_CLOSE_EVENT) { + BOOST_LOG(info) << "Console closed handler called"; + lifetime::exit_sunshine(0, false); + } + return FALSE; +} #endif int @@ -244,6 +253,11 @@ main(int argc, char *argv[]) { shutdown_event->raise(true); }); +#ifdef _WIN32 + // Terminate gracefully on Windows when console window is closed + SetConsoleCtrlHandler(ConsoleCtrlHandler, TRUE); +#endif + proc::refresh(config::stream.file_apps); // If any of the following fail, we log an error and continue event though sunshine will not function correctly. diff --git a/src/nvhttp.cpp b/src/nvhttp.cpp index df25bccea8b..8ac567970eb 100644 --- a/src/nvhttp.cpp +++ b/src/nvhttp.cpp @@ -749,31 +749,6 @@ namespace nvhttp { } tree.put("root.ServerCodecModeSupport", codec_mode_flags); - pt::ptree display_nodes; - for (auto &resolution : config::nvhttp.resolutions) { - auto pred = [](auto ch) { return ch == ' ' || ch == '\t' || ch == 'x'; }; - - auto middle = std::find_if(std::begin(resolution), std::end(resolution), pred); - if (middle == std::end(resolution)) { - BOOST_LOG(warning) << resolution << " is not in the proper format for a resolution: WIDTHxHEIGHT"sv; - continue; - } - - auto width = util::from_chars(&*std::begin(resolution), &*middle); - auto height = util::from_chars(&*(middle + 1), &*std::end(resolution)); - for (auto fps : config::nvhttp.fps) { - pt::ptree display_node; - display_node.put("Width", width); - display_node.put("Height", height); - display_node.put("RefreshRate", fps); - - display_nodes.add_child("DisplayMode", display_node); - } - } - - if (!config::nvhttp.resolutions.empty()) { - tree.add_child("root.SupportedDisplayMode", display_nodes); - } auto current_appid = proc::proc.running(); tree.put("root.PairStatus", pair_status); tree.put("root.currentgame", current_appid); diff --git a/src/platform/linux/audio.cpp b/src/platform/linux/audio.cpp index 32aa36a61b5..ff231707e61 100644 --- a/src/platform/linux/audio.cpp +++ b/src/platform/linux/audio.cpp @@ -81,9 +81,13 @@ namespace platf { channel = position_mapping[*mapping++]; }); - pa_buffer_attr pa_attr = {}; - pa_attr.fragsize = frame_size * channels * sizeof(float); - pa_attr.maxlength = pa_attr.fragsize * 2; + pa_buffer_attr pa_attr = { + .maxlength = uint32_t(-1), + .tlength = uint32_t(-1), + .prebuf = uint32_t(-1), + .minreq = uint32_t(-1), + .fragsize = uint32_t(frame_size * channels * sizeof(float)) + }; int status; diff --git a/src/platform/linux/cuda.cpp b/src/platform/linux/cuda.cpp index b5374b18f6c..5498d9a81d5 100644 --- a/src/platform/linux/cuda.cpp +++ b/src/platform/linux/cuda.cpp @@ -702,6 +702,7 @@ namespace cuda { NVFBC_DESTROY_HANDLE_PARAMS params { NVFBC_DESTROY_HANDLE_PARAMS_VER }; + ctx_t ctx { handle }; if (func.nvFBCDestroyHandle(handle, ¶ms)) { BOOST_LOG(error) << "Couldn't destroy session handle: "sv << func.nvFBCGetLastErrorStr(handle); } diff --git a/src/platform/windows/display_base.cpp b/src/platform/windows/display_base.cpp index 7d34529f27c..3d178dafb02 100644 --- a/src/platform/windows/display_base.cpp +++ b/src/platform/windows/display_base.cpp @@ -569,6 +569,8 @@ namespace platf::dxgi { // Ensure offset starts at 0x0 offset_x -= GetSystemMetrics(SM_XVIRTUALSCREEN); offset_y -= GetSystemMetrics(SM_YVIRTUALSCREEN); + + break; } } diff --git a/src/video.cpp b/src/video.cpp index d66476e27c4..6827b6c794b 100644 --- a/src/video.cpp +++ b/src/video.cpp @@ -1799,28 +1799,6 @@ namespace video { std::unique_ptr make_encode_session(platf::display_t *disp, const encoder_t &encoder, const config_t &config, int width, int height, std::unique_ptr encode_device) { - if (encode_device) { - switch (encode_device->colorspace.colorspace) { - case colorspace_e::bt2020: - BOOST_LOG(info) << "HDR color coding [Rec. 2020 + SMPTE 2084 PQ]"sv; - break; - - case colorspace_e::rec601: - BOOST_LOG(info) << "SDR color coding [Rec. 601]"sv; - break; - - case colorspace_e::rec709: - BOOST_LOG(info) << "SDR color coding [Rec. 709]"sv; - break; - - case colorspace_e::bt2020sdr: - BOOST_LOG(info) << "SDR color coding [Rec. 2020]"sv; - break; - } - BOOST_LOG(info) << "Color depth: " << encode_device->colorspace.bit_depth << "-bit"; - BOOST_LOG(info) << "Color range: ["sv << (encode_device->colorspace.full_range ? "JPEG"sv : "MPEG"sv) << ']'; - } - if (dynamic_cast(encode_device.get())) { auto avcodec_encode_device = boost::dynamic_pointer_cast(std::move(encode_device)); return make_avcodec_encode_session(disp, encoder, config, width, height, std::move(avcodec_encode_device)); @@ -1971,6 +1949,25 @@ namespace video { encoder.platform_formats->pix_fmt_8bit; } + { + auto encoder_name = config.videoFormat == 0 ? encoder.h264.name : + config.videoFormat == 1 ? encoder.hevc.name : + config.videoFormat == 2 ? encoder.av1.name : + "unknown"; + + BOOST_LOG(info) << "Creating encoder " << logging::bracket(encoder_name); + + auto color_coding = colorspace.colorspace == colorspace_e::bt2020 ? "HDR (Rec. 2020 + SMPTE 2084 PQ)" : + colorspace.colorspace == colorspace_e::rec601 ? "SDR (Rec. 601)" : + colorspace.colorspace == colorspace_e::rec709 ? "SDR (Rec. 709)" : + colorspace.colorspace == colorspace_e::bt2020sdr ? "SDR (Rec. 2020)" : + "unknown"; + + BOOST_LOG(info) << "Color coding: " << color_coding; + BOOST_LOG(info) << "Color depth: " << colorspace.bit_depth << "-bit"; + BOOST_LOG(info) << "Color range: " << (colorspace.full_range ? "JPEG" : "MPEG"); + } + if (dynamic_cast(encoder.platform_formats.get())) { result = disp.make_avcodec_encode_device(pix_fmt); } diff --git a/src_assets/common/assets/web/config.html b/src_assets/common/assets/web/config.html index 8c2bce2b32f..8386dbd3673 100644 --- a/src_assets/common/assets/web/config.html +++ b/src_assets/common/assets/web/config.html @@ -49,8 +49,6 @@

{{ $t('config.configuration') }}

v-if="currentTab === 'av'" :config="config" :platform="platform" - :resolutions="resolutions" - :fps="fps" > @@ -128,8 +126,6 @@

{{ $t('config.configuration') }}

saved: false, restarted: false, config: null, - fps: [], - resolutions: [], currentTab: "general", global_prep_cmd: [], tabs: [ // TODO: Move the options to each Component instead, encapsulate. @@ -174,8 +170,6 @@

{{ $t('config.configuration') }}

"install_steam_audio_drivers": "enabled", "adapter_name": "", "output_name": "", - "resolutions": "[352x240,480x360,858x480,1280x720,1920x1080,2560x1080,2560x1440,3440x1440,1920x1200,3840x2160,3840x1600]", - "fps": "[10,30,60,90,120]", "min_fps_factor": 1, }, }, @@ -320,16 +314,6 @@

{{ $t('config.configuration') }}

}); }); - this.fps = JSON.parse(this.config.fps); - //Resolutions should be fixed because are not valid JSON - let res = this.config.resolutions.substring( - 1, - this.config.resolutions.length - 1 - ); - let resolutions = []; - res.split(",").forEach((r) => resolutions.push(r.trim())); - this.resolutions = resolutions; - this.config.global_prep_cmd = this.config.global_prep_cmd || []; this.global_prep_cmd = JSON.parse(this.config.global_prep_cmd); }); @@ -339,16 +323,6 @@

{{ $t('config.configuration') }}

this.$forceUpdate() }, serialize() { - let nl = this.config === "windows" ? "\r\n" : "\n"; - this.config.resolutions = - "[" + - nl + - " " + - this.resolutions.join("," + nl + " ") + - nl + - "]"; - // remove quotes from values in fps - this.config.fps = JSON.stringify(this.fps).replace(/"/g, ""); this.config.global_prep_cmd = JSON.stringify(this.global_prep_cmd); }, save() { @@ -364,19 +338,11 @@

{{ $t('config.configuration') }}

Object.keys(tab.options).forEach(optionKey => { let delete_value = false - if (["resolutions", "fps", "global_prep_cmd"].includes(optionKey)) { + if (["global_prep_cmd"].includes(optionKey)) { let config_value, default_value - if (optionKey === "resolutions") { - let regex = /([\d]+x[\d]+)/g - - // Use a regular expression to find each value and replace it with a quoted version - config_value = JSON.parse(config[optionKey].replace(regex, '"$1"')).toString() - default_value = JSON.parse(tab.options[optionKey].replace(regex, '"$1"')).toString() - } else { - config_value = JSON.parse(config[optionKey]) - default_value = JSON.parse(tab.options[optionKey]) - } + config_value = JSON.parse(config[optionKey]) + default_value = JSON.parse(tab.options[optionKey]) if (config_value === default_value) { delete_value = true diff --git a/src_assets/common/assets/web/configs/tabs/AudioVideo.vue b/src_assets/common/assets/web/configs/tabs/AudioVideo.vue index 1a5b63c07ec..21160dfedbc 100644 --- a/src_assets/common/assets/web/configs/tabs/AudioVideo.vue +++ b/src_assets/common/assets/web/configs/tabs/AudioVideo.vue @@ -11,8 +11,6 @@ import DisplayModesSettings from "./audiovideo/DisplayModesSettings.vue"; const props = defineProps([ 'platform', 'config', - 'resolutions', - 'fps', 'min_fps_factor', ]) @@ -82,8 +80,6 @@ const config = ref(props.config) diff --git a/src_assets/common/assets/web/configs/tabs/audiovideo/DisplayModesSettings.vue b/src_assets/common/assets/web/configs/tabs/audiovideo/DisplayModesSettings.vue index d519d75f727..b901e1ca4a3 100644 --- a/src_assets/common/assets/web/configs/tabs/audiovideo/DisplayModesSettings.vue +++ b/src_assets/common/assets/web/configs/tabs/audiovideo/DisplayModesSettings.vue @@ -6,14 +6,10 @@ import PlatformLayout from '../../../PlatformLayout.vue' const props = defineProps([ 'platform', 'config', - 'resolutions', - 'fps', 'min_fps_factor', ]) const config = ref(props.config) -const resolutions = ref(props.resolutions) -const fps = ref(props.fps) const resIn = ref("") const fpsIn = ref("") @@ -21,50 +17,6 @@ const fpsIn = ref("")