loki-47-6F-64 / sunshine

Host for Moonlight Streaming Client
GNU General Public License v3.0
1.75k stars 155 forks source link

Sunshine icon

Introduction

Sunshine is a Gamestream host for Moonlight

AppVeyor Build Status Downloads

Building

Linux

If you do not wish to clutter your PC with development files, yet you want the very latest version... You can use these build scripts They make use of docker to handle building Sunshine automatically

Requirements:

Ubuntu 20.04: Install the following:

Common

sudo apt install cmake gcc-10 g++-10 libssl-dev libavdevice-dev libboost-thread-dev libboost-filesystem-dev libboost-log-dev libpulse-dev libopus-dev libevdev-dev

X11

sudo apt install libxtst-dev libx11-dev libxrandr-dev libxfixes-dev libxcb1-dev libxcb-shm0-dev libxcb-xfixes0-dev

KMS

This requires additional setup.

sudo apt install libdrm-dev libcap-dev

Wayland

This is for wlroots based compositores, such as Sway

sudo apt install libwayland-dev

Cuda + NvFBC

This requires proprietary software On Ubuntu 20.04, the cuda compiler will fail since it's version is too old, it's recommended you compile the sources with the build scripts

sudo apt install nvidia-cuda-dev nvidia-cuda-toolkit

Warning:

You might require ffmpeg version >= 4.3. Check the troubleshooting section for more information.

Compilation:

Setup:

sunshine needs access to uinput to create mouse and gamepad events:

Additional Setup for KMS:

Please note that cap_sys_admin may as well be root, except you don't need to be root to run it. It's necessary to allow Sunshine to use KMS

Trouleshooting:

Windows 10

Requirements:

First you need to install MSYS2, then startup "MSYS2 MinGW 64-bit" and install the following packages using pacman -S:

mingw-w64-x86_64-binutils mingw-w64-x86_64-openssl mingw-w64-x86_64-cmake mingw-w64-x86_64-toolchain mingw-w64-x86_64-opus mingw-w64-x86_64-x265 mingw-w64-x86_64-boost git mingw-w64-x86_64-make cmake make gcc

Compilation:

Setup:

Common

Usage:

Shortcuts:

All shortcuts start with CTRL + ALT + SHIFT, just like Moonlight

Credits:

Application List:

Note: You can change the Application List in the "Apps" section of the User Interface https://xxx.xxx.xxx.xxx:47990/

  1. When an application is started, if there is an application already running, it will be terminated.
  2. When the application has been shutdown, the stream shuts down as well.
  3. In addition to the apps listed, one app "Desktop" is hardcoded into Sunshine. It does not start an application, instead it simply starts a stream.

Linux

{
    "env":{ 
        "DISPLAY":":0",
        "DRI_PRIME":"1",
        "XAUTHORITY":"$(HOME)/.Xauthority",
        "PATH":"$(PATH):$(HOME)/.local/bin"
    },
    "apps":[
    {
        "name":"Low Res Desktop",
        "prep-cmd":[
        { "do":"xrandr --output HDMI-1 --mode 1920x1080", "undo":"xrandr --output HDMI-1 --mode 1920x1200" }
        ]
    },
    {
        "name":"Steam BigPicture",

        "output":"steam.txt",
        "cmd":"steam -bigpicture",
        "prep-cmd":[]
    }
    ]
}

Windows

{
    "env":{
        "PATH":"$(PATH);C:\\Program Files (x86)\\Steam"
    },
    "apps":[
    {
        "name":"Steam BigPicture",

        "output":"steam.txt",
        "prep-cmd":[
            {"do":"steam \"steam://open/bigpicture\""}
        ]
    }
    ]
}