From bd3d1d698814e177b2e3dc2e3c24578693b3355e Mon Sep 17 00:00:00 2001 From: doomsdayrs Date: Sun, 5 Apr 2020 01:49:08 -0400 Subject: [PATCH 1/8] Readme, but now MD --- README.txt => README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename README.txt => README.md (99%) diff --git a/README.txt b/README.md similarity index 99% rename from README.txt rename to README.md index 9e7cd22d..9bc7919d 100644 --- a/README.txt +++ b/README.md @@ -1,4 +1,4 @@ -######### Linux ############## +# Linux 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 From 631be974eefad08012cb3d92ce451a94f90da70f Mon Sep 17 00:00:00 2001 From: Doomsdayrs <38189170+Doomsdayrs@users.noreply.github.com> Date: Sun, 5 Apr 2020 02:03:40 -0400 Subject: [PATCH 2/8] Update README.md - Initial rework to be legible in a modern fashion --- README.md | 145 +++++++++++++++++++++++++++--------------------------- 1 file changed, 73 insertions(+), 72 deletions(-) diff --git a/README.md b/README.md index 9bc7919d..1446ed57 100644 --- a/README.md +++ b/README.md @@ -1,31 +1,33 @@ # Linux -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 +## Requirements: +Ubuntu 19.10: -Compilation: - * git clone https://github.com/loki-47-6F-64/sunshine.git --recurse-submodules - * cd sunshine && mkdir build && cd build - * cmake .. - * make + 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 + +## Compilation: +- `git clone https://github.com/loki-47-6F-64/sunshine.git --recurse-submodules` +- `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: - * sunshine needs access to uinput to create mouse and gamepad events: - * Add user to group 'input': "usermod -a -G input username - * Create a file: "/etc/udev/rules.d/85-sunshine-input.rules" - * The contents of the file is as follows: - 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" - * path/to/build/dir/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 +## Setup: +sunshine needs access to uinput to create mouse and gamepad events: +- Add user to group 'input': "usermod -a -G input username +- Create a file: "/etc/udev/rules.d/85-sunshine-input.rules" +- The contents of the file is as follows: + 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" +- path/to/build/dir/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` - * 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 +- 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 -Trouleshooting: +## Trouleshooting: * If you get "Could not create Sunshine Gamepad: Permission Denied", ensure you are part of the group "input": * groups * 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 -Compilation: - * git clone https://github.com/loki-47-6F-64/sunshine.git --recurse-submodules - * cd sunshine && mkdir build && cd build - * cmake -G"Unix Makefiles" .. - * make +## Compilation: +- `git clone https://github.com/loki-47-6F-64/sunshine.git --recurse-submodules` +- `cd sunshine && mkdir build && cd build` +- `cmake -G"Unix Makefiles" ..` +- `make` -Setup: +## Setup: * Gamepad support: Download and run 'ViGEmBus_Setup_1.16.116.exe' from [https://github.com/ViGEm/ViGEmBus/releases] -== Static build == -Requirements: +## Static build +### 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 -Compilation: +### Compilation: * git lfs install * git clone https://github.com/loki-47-6F-64/sunshine.git --recurse-submodules * cd sunshine && mkdir build && cd build @@ -62,55 +65,53 @@ Compilation: -######### Common ############# +# Common -Usage: - * run "sunshine path/to/sunshine.conf" - * In Moonlight: Add PC manually - * When Moonlight request you insert the correct pin on sunshine: - 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 - or - 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 - * Click on one of the Applications listed - * Have fun :) +## Usage: +- run "sunshine path/to/sunshine.conf" +- In Moonlight: Add PC manually +- When Moonlight request you insert the correct pin on sunshine, either: + - `wget xxx.xxx.xxx.xxx:47989/pin/####` + - Type in the URL bar of your browser: `xxx.xxx.xxx.xxx:47989/pin/####` + - The x's are the IP of your instance, `####` is the pin +- Click on one of the Applications listed +- Have fun :) -Note: - * 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: - * 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. +## Note: +- 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: + - 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. -Credits: +## Credits: * Simple-Web-Server [https://gitlab.com/eidheim/Simple-Web-Server] * 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 :) - - -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 : 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 : 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 : The main application - * If not specified, a processs is started that sleeps indefinitely +## 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 : 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 : 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 : 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. From 9fdaf2117f63ff1f2d0d385e1daa3cca75da705c Mon Sep 17 00:00:00 2001 From: Doomsdayrs <38189170+Doomsdayrs@users.noreply.github.com> Date: Sun, 5 Apr 2020 02:08:39 -0400 Subject: [PATCH 3/8] Update README.md - Added links, Moved some parts around for appeal --- README.md | 34 ++++++++++++++++++++++------------ 1 file changed, 22 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index 1446ed57..969cfb7e 100644 --- a/README.md +++ b/README.md @@ -1,18 +1,28 @@ -# Linux +# Introduction +Bla bla what is sunshine -## Requirements: + + +# Building +Building sunshine is super simple! With build guides for Linux and Windows! +[Linux](README.md#linux) +[Windows](README.md#windows-10) + +## Linux + +### Requirements: Ubuntu 19.10: 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 -## Compilation: +### Compilation: - `git clone https://github.com/loki-47-6F-64/sunshine.git --recurse-submodules` - `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: - Add user to group 'input': "usermod -a -G input username - Create a file: "/etc/udev/rules.d/85-sunshine-input.rules" @@ -27,7 +37,7 @@ sunshine needs access to uinput to create mouse and gamepad events: - 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 -## Trouleshooting: +### Trouleshooting: * If you get "Could not create Sunshine Gamepad: Permission Denied", ensure you are part of the group "input": * groups * If Sunshine sends audio from the microphone instead of the speaker, try the following steps: @@ -37,26 +47,26 @@ sunshine needs access to uinput to create mouse and gamepad events: -# 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 -## Compilation: +### Compilation: - `git clone https://github.com/loki-47-6F-64/sunshine.git --recurse-submodules` - `cd sunshine && mkdir build && cd build` - `cmake -G"Unix Makefiles" ..` - `make` -## Setup: +### Setup: * Gamepad support: Download and run 'ViGEmBus_Setup_1.16.116.exe' from [https://github.com/ViGEm/ViGEmBus/releases] -## Static build -### Requirements: +### Static build +#### 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 -### Compilation: +#### Compilation: * git lfs install * git clone https://github.com/loki-47-6F-64/sunshine.git --recurse-submodules * cd sunshine && mkdir build && cd build From 15f347c69c9416cd73039d3e43fae8ec74fb188a Mon Sep 17 00:00:00 2001 From: Doomsdayrs <38189170+Doomsdayrs@users.noreply.github.com> Date: Sun, 5 Apr 2020 02:10:20 -0400 Subject: [PATCH 4/8] Update README.md - Super simple table of contents --- README.md | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 969cfb7e..b2f1f4b8 100644 --- a/README.md +++ b/README.md @@ -1,12 +1,14 @@ # Introduction Bla bla what is sunshine - +Quick Links~: +- [Building](README.md#building) +- [Credits](README.md#credits) # Building Building sunshine is super simple! With build guides for Linux and Windows! -[Linux](README.md#linux) -[Windows](README.md#windows-10) +- [Linux](README.md#linux) +- [Windows](README.md#windows-10) ## Linux From 2d2fd77bc184e6a9f814fc6843caf7938d3f27bf Mon Sep 17 00:00:00 2001 From: Doomsdayrs <38189170+Doomsdayrs@users.noreply.github.com> Date: Sun, 5 Apr 2020 02:11:26 -0400 Subject: [PATCH 5/8] Update README.md - Cleaned up credits --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index b2f1f4b8..18d557f2 100644 --- a/README.md +++ b/README.md @@ -101,9 +101,9 @@ sunshine needs access to uinput to create mouse and gamepad events: ## Credits: - * Simple-Web-Server [https://gitlab.com/eidheim/Simple-Web-Server] - * 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 :) +- [Simple-Web-Server](https://gitlab.com/eidheim/Simple-Web-Server) +- [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 :) ## Application List: - You can use Environment variables in place of values From ed6b919a4d4b2e1717cc5cda166b6ad9b2324a27 Mon Sep 17 00:00:00 2001 From: Doomsdayrs <38189170+Doomsdayrs@users.noreply.github.com> Date: Sun, 5 Apr 2020 14:34:11 -0400 Subject: [PATCH 6/8] Update README.md --- README.md | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/README.md b/README.md index 18d557f2..c98d3e7e 100644 --- a/README.md +++ b/README.md @@ -1,12 +1,10 @@ # Introduction Bla bla what is sunshine -Quick Links~: - [Building](README.md#building) - [Credits](README.md#credits) # Building -Building sunshine is super simple! With build guides for Linux and Windows! - [Linux](README.md#linux) - [Windows](README.md#windows-10) @@ -36,8 +34,7 @@ sunshine needs access to uinput to create mouse and gamepad events: - Modify $HOME/.config/systemd/user/sunshine.conf to point to the sunshine executable - `systemctl --user start sunshine` -- 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 +- assets/apps.json is an [example](README.md#application-list) of a list of applications that are started just before running a stream ### Trouleshooting: * If you get "Could not create Sunshine Gamepad: Permission Denied", ensure you are part of the group "input": From f4e99a1bd6aa682581e14cf347aabaef5dca6fa6 Mon Sep 17 00:00:00 2001 From: Doomsdayrs <38189170+Doomsdayrs@users.noreply.github.com> Date: Sun, 5 Apr 2020 14:46:00 -0400 Subject: [PATCH 7/8] Update README.md --- README.md | 25 +++++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index c98d3e7e..ef91266d 100644 --- a/README.md +++ b/README.md @@ -59,18 +59,18 @@ sunshine needs access to uinput to create mouse and gamepad events: - `make` ### Setup: - * 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 #### 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 #### Compilation: - * git lfs install - * git clone https://github.com/loki-47-6F-64/sunshine.git --recurse-submodules - * cd sunshine && mkdir build && cd build - * cmake -DSUNSHINE_STANDALONE=ON -DSUNSHINE_ASSETS_DIR=assets -G"Unix Makefiles" .. - * make +- `git lfs install` +- `git clone https://github.com/loki-47-6F-64/sunshine.git --recurse-submodules` +- `cd sunshine && mkdir build && cd build` +- `cmake -DSUNSHINE_STANDALONE=ON -DSUNSHINE_ASSETS_DIR=assets -G"Unix Makefiles" ..` +- `make` @@ -109,6 +109,19 @@ sunshine needs access to uinput to create mouse and gamepad events: - env: Adds or overwrites Environment variables for the commands/applications run by Sunshine. - "Variable name":"Variable value" - apps: The list of applications + - Example: + ```json + { + "name":"An App", + "cmd":"command to open app", + "prep-cmd":[ + { + "do":"somecommand", + "undo":"undothatcommand" + } + ] + } + ``` - name: Self explanatory - output : The file where the output of the command is stored - If it is not specified, the output is ignored From ea266b979f8e1f9e979974df29b672e8bad22254 Mon Sep 17 00:00:00 2001 From: Doomsdayrs <38189170+Doomsdayrs@users.noreply.github.com> Date: Fri, 17 Apr 2020 22:46:07 -0400 Subject: [PATCH 8/8] Update README.md - added assets - made a list --- README.md | 51 ++++++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 48 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index ef91266d..6b03086a 100644 --- a/README.md +++ b/README.md @@ -135,6 +135,51 @@ sunshine needs access to uinput to create mouse and gamepad events: - cmd : 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. +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 +```json +{ + "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 +```json +{ + "env":{ + "PATH":"$(PATH);C:\\Program Files (x86)\\Steam" + }, + "apps":[ + { + "name":"Steam BigPicture", + + "output":"steam.txt", + "prep-cmd":[ + {"do":"steam \"steam://open/bigpicture\""} + ] + } + ] +} +```