Update README.md

- Initial rework to be legible in a modern fashion
This commit is contained in:
Doomsdayrs
2020-04-05 02:03:40 -04:00
committed by GitHub
parent bd3d1d6988
commit 631be974ee
+73 -72
View File
@@ -1,31 +1,33 @@
# Linux # Linux
Requirements: ## Requirements:
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 Ubuntu 19.10:
Compilation: sudo apt install 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
* git clone https://github.com/loki-47-6F-64/sunshine.git --recurse-submodules
* cd sunshine && mkdir build && cd build ## Compilation:
* cmake .. - `git clone https://github.com/loki-47-6F-64/sunshine.git --recurse-submodules`
* make - `cd sunshine && mkdir build && cd build`
- `cmake ..`
- `make`: It is suggested to use the `-j C#` flags with this command, `C#` being the number of cores your PC has
Setup: ## Setup:
* sunshine needs access to uinput to create mouse and gamepad events: sunshine needs access to uinput to create mouse and gamepad events:
* Add user to group 'input': "usermod -a -G input username - Add user to group 'input': "usermod -a -G input username
* Create a file: "/etc/udev/rules.d/85-sunshine-input.rules" - Create a file: "/etc/udev/rules.d/85-sunshine-input.rules"
* The contents of the file is as follows: - The contents of the file is as follows:
KERNEL=="uinput", GROUP="input", mode="0660" KERNEL=="uinput", GROUP="input", mode="0660"
* 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.conf is an example configuration file. Modify it as you see fit and use it by running: "sunshine path/to/sunshine.conf"
* path/to/build/dir/sunshine.service is used to start sunshine in the background: - path/to/build/dir/sunshine.service is used to start sunshine in the background:
* cp sunshine.service $HOME/.config/systemd/user/ - `cp sunshine.service $HOME/.config/systemd/user/`
* Modify $HOME/.config/systemd/user/sunshine.conf to point to the sunshine executable - Modify $HOME/.config/systemd/user/sunshine.conf to point to the sunshine executable
* systemctl --user start sunshine - `systemctl --user start sunshine`
* assets/apps.json is an example of a list of applications that are started just before running a stream: - 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 - See below for a detailed explanation
Trouleshooting: ## Trouleshooting:
* If you get "Could not create Sunshine Gamepad: Permission Denied", ensure you are part of the group "input": * If you get "Could not create Sunshine Gamepad: Permission Denied", ensure you are part of the group "input":
* groups * groups
* If Sunshine sends audio from the microphone instead of the speaker, try the following steps: * If Sunshine sends audio from the microphone instead of the speaker, try the following steps:
@@ -35,25 +37,26 @@ Trouleshooting:
######### Windows 10 ############ # Windows 10
## Requirements:
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 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: ## Compilation:
* git clone https://github.com/loki-47-6F-64/sunshine.git --recurse-submodules - `git clone https://github.com/loki-47-6F-64/sunshine.git --recurse-submodules`
* cd sunshine && mkdir build && cd build - `cd sunshine && mkdir build && cd build`
* cmake -G"Unix Makefiles" .. - `cmake -G"Unix Makefiles" ..`
* make - `make`
Setup: ## Setup:
* <optional> Gamepad support: Download and run 'ViGEmBus_Setup_1.16.116.exe' from [https://github.com/ViGEm/ViGEmBus/releases] * <optional> Gamepad support: Download and run 'ViGEmBus_Setup_1.16.116.exe' from [https://github.com/ViGEm/ViGEmBus/releases]
== Static build == ## Static build
Requirements: ### 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 git-lfs 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 git-lfs
Compilation: ### Compilation:
* git lfs install * git lfs install
* git clone https://github.com/loki-47-6F-64/sunshine.git --recurse-submodules * git clone https://github.com/loki-47-6F-64/sunshine.git --recurse-submodules
* cd sunshine && mkdir build && cd build * cd sunshine && mkdir build && cd build
@@ -62,55 +65,53 @@ Compilation:
######### Common ############# # Common
Usage: ## Usage:
* run "sunshine path/to/sunshine.conf" - run "sunshine path/to/sunshine.conf"
* In Moonlight: Add PC manually - In Moonlight: Add PC manually
* When Moonlight request you insert the correct pin on sunshine: - When Moonlight request you insert the correct pin on sunshine, either:
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 - `wget xxx.xxx.xxx.xxx:47989/pin/####`
or - Type in the URL bar of your browser: `xxx.xxx.xxx.xxx:47989/pin/####`
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 - The x's are the IP of your instance, `####` is the pin
* Click on one of the Applications listed - Click on one of the Applications listed
* Have fun :) - Have fun :)
Note: ## Note:
* The Windows key is not passed through by Moonlight, therefore Sunshine maps Right-Alt key to the Windows key - The Windows key is not passed through by Moonlight, therefore Sunshine maps Right-Alt key to the Windows key
* If you set Video Bitrate to 0.5Mb/s: - 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) - 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 - 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. - 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. - 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. - This is rare enough that using this for the desktop environment is tolerable (in my opinion), however for gaming not so much.
Credits: ## Credits:
* Simple-Web-Server [https://gitlab.com/eidheim/Simple-Web-Server] * Simple-Web-Server [https://gitlab.com/eidheim/Simple-Web-Server]
* Moonlight [https://github.com/moonlight-stream] * Moonlight [https://github.com/moonlight-stream]
* Looking-Glass [https://github.com/gnif/LookingGlass] (For showing me how to properly capture frames on Windows, saving me a lot of time :) * Looking-Glass [https://github.com/gnif/LookingGlass] (For showing me how to properly capture frames on Windows, saving me a lot of time :)
## Application List:
- You can use Environment variables in place of values
Application List: - $(HOME) will be replaced by the value of $HOME
* You can use Environment variables in place of values - $$ will be replaced by $ --> $$(HOME) will be replaced by $(HOME)
* $(HOME) will be replaced by the value of $HOME - env: Adds or overwrites Environment variables for the commands/applications run by Sunshine.
* $$ will be replaced by $ --> $$(HOME) will be replaced by $(HOME) - "Variable name":"Variable value"
* env: Adds or overwrites Environment variables for the commands/applications run by Sunshine. - apps: The list of applications
* "Variable name":"Variable value" - name: Self explanatory
* apps: The list of applications - output <optional>: The file where the output of the command is stored
* name: Self explanatory - If it is not specified, the output is ignored
* output <optional>: The file where the output of the command is stored - prep-cmd: A list of commands to be run before/after the application
* If it is not specified, the output is ignored - If any of the prep-commands fail, starting the application is aborted
* prep-cmd: A list of commands to be run before/after the application - do: Run before the application
* If any of the prep-commands fail, starting the application is aborted - If it fails, all 'undo' commands of the previously succeeded 'do' commands are run
* do: Run before the application - undo <optional>: Run after the application has terminated
* If it fails, all 'undo' commands of the previously succeeded 'do' commands are run - This should not fail considering it is supposed to undo the 'do' commands.
* undo <optional>: Run after the application has terminated - If it fails, Sunshine is terminated
* This should not fail considering it is supposed to undo the 'do' commands. - cmd <optional>: The main application
* If it fails, Sunshine is terminated - If not specified, a processs is started that sleeps indefinitely
* 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 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. When the application has been shutdown, the stream shuts down as well.