2020-01-19 20:33:04 +00:00
######### Linux ##############
2019-12-05 00:11:09 +00:00
Requirements:
2020-01-09 21:03:56 +00:00
Ubuntu 19.10: cmake libssl-dev libavdevice-dev libboost-thread-dev libboost-filesystem-dev libboost-log-dev libpulse-dev libopus-dev libxtst-dev libx11-dev libxfixes-dev libevdev-dev libxcb1-dev libxcb-shm0-dev libxcb-xfixes0-dev
2019-12-05 00:11:09 +00:00
Compilation:
* git clone <repository> --recurse-submodules
* mkdir build && cd build
2019-12-21 23:05:00 +00:00
* cmake ..
2019-12-05 00:11:09 +00:00
* make
2019-12-08 18:21:48 +00:00
Setup:
2020-01-17 19:36:47 +00:00
* sunshine needs access to uinput to create mouse and gamepad events:
* Add user to group 'input': "usermod -a -G input username
2020-01-30 13:46:08 +00:00
* Create a file: "/etc/udev/rules.d/85-sunshine-input.rules"
2020-01-17 23:16:53 +00:00
* The contents of the file is as follows:
2020-01-30 13:46:08 +00:00
KERNEL=="uinput", GROUP="input", mode="0660"
2019-12-08 18:21:48 +00:00
* assets/sunshine.conf is an example configuration file. Modify it as you see fit and use it by running: "sunshine path/to/sunshine.conf"
* assets/sunshine.service is used to start sunshine in the background:
* cp sunshine.service $HOME/.config/systemd/user/
* Modify $HOME/.config/systemd/user/sunshine.conf to point to the sunshine executable
* systemctl --user start sunshine
2019-12-16 21:39:50 +00:00
* assets/apps.json is an example of a list of applications that are started just before running a stream:
* See below for a detailed explanation
2019-12-08 18:21:48 +00:00
2020-01-19 20:33:04 +00:00
Trouleshooting:
2020-01-30 13:46:08 +00:00
* If you get "Could not create Sunshine Gamepad: Permission Denied", ensure you are part of the group "input":
* groups
2020-01-19 20:33:04 +00:00
* If Sunshine sends audio from the microphone instead of the speaker, try the following steps:
* pacmd list-sources | grep "name:"
* Copy the name to the configuration option "audio_sink"
* restart sunshine
2020-01-26 22:27:22 +00:00
######### Windows 10 ############
2020-01-19 20:33:04 +00:00
Requirements:
MSYS2 : mingw-w64-x86_64-openssl mingw-w64-x86_64-cmake mingw-w64-x86_64-toolchain mingw-w64-x86_64-ffmpeg mingw-w64-x86_64-boost
Compilation:
* git clone <repository> --recurse-submodules
* mkdir build && cd build
* cmake -G"Unix Makefiles" ..
* make
Setup:
* <optional> Gamepad support: Download and run 'ViGEmBus_Setup_1.16.116.exe' from [https://github.com/ViGEm/ViGEmBus/releases]
######### Common #############
2019-12-05 00:11:09 +00:00
Usage:
2020-01-17 19:36:47 +00:00
* run "sunshine path/to/sunshine.conf"
2019-12-05 00:11:09 +00:00
* In Moonlight: Add PC manually
* When Moonlight request you insert the correct pin on sunshine:
2020-01-17 19:36:47 +00:00
wget xxx.xxx.xxx.xxx:47989/pin/xxxx -- where the first few x's are substituted by the ip of Sunshine and the final 4 x'es are substituted by the pin
2019-12-05 00:11:09 +00:00
or
2020-01-17 19:36:47 +00:00
Type in the URL bar of your browser: xxx.xxx.xxx.xxx:47989/pin/xxxx -- where the first few x's are substituted by the ip of the final 4 x'es are subsituted by the pin
2019-12-05 00:12:48 +00:00
* Click on one of the Applications listed
2019-12-05 00:11:09 +00:00
* Have fun :)
2019-12-08 18:21:48 +00:00
2019-12-05 00:11:09 +00:00
Note:
* The Windows key is not passed through by Moonlight, therefore Sunshine maps Right-Alt key to the Windows key
2019-12-21 23:05:00 +00:00
* If you set Video Bitrate to 0.5Mb/s:
* Sunshine will use CRF or QP to controll the quality of the stream. (See example configuration file for more details)
* This is less CPU intensive and it has lower average bandwith requirements compared to manually setting bitrate to acceptable quality
* However, it has higher peak bitrates, forcing Sunshine to drop entire frames when streaming 1080P due to their size.
* When this happens, the video portion of the stream appears to be frozen.
* This is rare enough that using this for the desktop environment is tolerable (in my opinion), however for gaming not so much.
2019-12-08 18:28:14 +00:00
Credits:
* Simple-Web-Server [https://gitlab.com/eidheim/Simple-Web-Server]
* Moonlight [https://github.com/moonlight-stream]
2020-01-07 22:15:55 +00:00
* Looking-Glass [https://github.com/gnif/LookingGlass] (For showing me how to properly capture frames on Windows, saving me a lot of time :)
2019-12-16 21:39:50 +00:00
Application List:
* You can use Environment variables in place of values
* $(HOME) will be replaced by the value of $HOME
* $$ will be replaced by $ --> $$(HOME) will be replaced by $(HOME)
* env: Adds or overwrites Environment variables for the commands/applications run by Sunshine.
* "Variable name":"Variable value"
* apps: The list of applications
* name: Self explanatory
* output <optional>: The file where the output of the command is stored
* If it is not specified, the output is ignored
* 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 <optional>: Run after the application has terminated
* This should not fail considering it is supposed to undo the 'do' commands.
* If it fails, Sunshine is terminated
* cmd <optional>: The main application
* If not specified, a processs is started that sleeps indefinitely
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.
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.