Files for my website bwc9876.dev
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Fix typo in About

Ben C 4f9879ab eed5518c

+47 -20
+46 -18
src/content/posts/headless_steam_remote_play.md
··· 5 5 cowsay: We have Stadia at home 6 6 --- 7 7 8 - For a while, I've wanted a setup where I can simply SSH into my desktop, start Steam, and use remote play to play my games. 8 + For a while, I've wanted a setup where I can simply SSH into my desktop, start Steam, and use remote 9 + play to play my games. 9 10 10 - Gamescope offers a backend called `headless` that allows me to do this, after some messing around I got it working mostly. 11 + Gamescope offers a backend called `headless` that allows me to do this, after some messing around I 12 + got it working mostly. 11 13 12 - There's other software like [Sunshine](https://github.com/LizardByte/Sunshine) that seem cool and have NixOS modules. I chose to avoid these because of the extra setup they need, and my use-case is a lot simpler than what they're made for. 14 + There's other software like [Sunshine](https://github.com/LizardByte/Sunshine) that seem cool and 15 + have NixOS modules. I chose to avoid these because of the extra setup they need, and my use-case is 16 + a lot simpler than what they're made for. 13 17 14 18 ## Steam/Gamescope Setup 15 19 16 - First some manual setup for Steam, I had to enable Remote Play and pair my laptop to my desktop for the first time. when you first try to connect to a device to remote play from it, you need to enter a PIN on the host. 20 + First some manual setup for Steam, I had to enable Remote Play and pair my laptop to my desktop for 21 + the first time. when you first try to connect to a device to remote play from it, you need to enter 22 + a PIN on the host. 17 23 18 - Luckily I have a monitor plugged into my desktop so I just turned that on, opened Steam in a graphical session, and got everything set up. Hopefully I only have to do this once (but also Steam loves to clear my preferences so we'll see). 24 + Luckily I have a monitor plugged into my desktop so I just turned that on, opened Steam in a 25 + graphical session, and got everything set up. Hopefully I only have to do this once (but also Steam 26 + loves to clear my preferences so we'll see). 19 27 20 28 My NixOS setup for steam and gamescope is this: 21 29 ··· 36 44 37 45 ### Extest 38 46 39 - We disable extest since it's not really needed, and it will panic when you try to send any input to a game Steam launches. `false` is the default so you can omit the line, but figured I should mention it. 47 + We disable extest since it's not really needed, and it will panic when you try to send any input to 48 + a game Steam launches. `false` is the default so you can omit the line, but figured I should mention 49 + it. 40 50 41 51 ### capSysNice 42 52 43 - This is an [already discussed](https://github.com/NixOS/nixpkgs/issues/351516) issue. The way I'm launching gamescope is causing issues with bubblewrap passing the sysnice capability to Steam. I just disable that and renice it later. 53 + This is an [already discussed](https://github.com/NixOS/nixpkgs/issues/351516) issue. The way I'm 54 + launching gamescope is causing issues with bubblewrap passing the sysnice capability to Steam. I 55 + just disable that and renice it later. 44 56 45 - I'm like 80% sure this is a skill issue on my part to be honest. Most stuff says this has been fixed, at least in the NixOS module for Steam. 57 + I'm like 80% sure this is a skill issue on my part to be honest. Most stuff says this has been 58 + fixed, at least in the NixOS module for Steam. 46 59 47 60 ## Running Steam 48 61 49 - With Steam set up and those options enabled, we can run gamescope. My laptop uses a 2256x1504 resolution so I'm setting that here. I set both gamescope's resolution (`-W/-H`) and Steams (`-w`/`-h`). 62 + With Steam set up and those options enabled, we can run gamescope. My laptop uses a 2256x1504 63 + resolution so I'm setting that here. I set both gamescope's resolution (`-W/-H`) and Steams 64 + (`-w`/`-h`). 50 65 51 66 ```sh 52 67 gamescope -W 2256 -H 1504 -w 2256 -h 1504 --backend headless --steam -- steam -tenfoot -pipewire-dmabuf 53 68 ``` 54 69 55 - We launch gamescope with our preferred resolution, with a headless backend and Steam integration enabled. Then we launch Steam in big picture mode. 70 + We launch gamescope with our preferred resolution, with a headless backend and Steam integration 71 + enabled. Then we launch Steam in big picture mode. 56 72 57 73 I'll usually start this in a GNU screen session so it doesn't stop Steam if my SSH session drops. 58 74 ··· 62 78 63 79 ## Renicing 64 80 65 - Finally just renice all gamescope processes because it can start to degrade in performance after a while allegedly. 81 + Finally just renice all gamescope processes because it can start to degrade in performance after a 82 + while allegedly. 66 83 67 84 ```sh 68 85 sudo renice -n -20 -p $(pgrep -d " " "gamescope") 69 86 ``` 70 87 71 - Not the best solution but works fine. You could also repeat this for Steam and the game you're running once it launches. 88 + Not the best solution but works fine. You could also repeat this for Steam and the game you're 89 + running once it launches. 72 90 73 91 ## Final Results 74 92 75 - On a wired connection all the games I've tested are responsive and work very well besides some minor issues that are more a Linux/NixOS thing™ than specific to this. Here's a screenshot from Portal 2 with the overlay enabled. 93 + On a wired connection all the games I've tested are responsive and work very well besides some minor 94 + issues that are more a Linux/NixOS thing™ than specific to this. Here's a screenshot from Portal 2 95 + with the overlay enabled. 76 96 77 97 ![Portal 2 metrics on Remote Play](../../assets/blog/steamrp_portal2.png) 78 98 79 - Consistently I get <1ms input latency and ~20ms display latency in-game, which for me is perfectly acceptable. I'm able to have all the settings on high now without my laptop becoming a nice and toasty 100°C. 99 + Consistently I get <1ms input latency and ~20ms display latency in-game, which for me is perfectly 100 + acceptable. I'm able to have all the settings on high now without my laptop becoming a nice and 101 + toasty 100°C. 80 102 81 - The nice thing is how I can choose to start this whenever I want remotely; I don't need a Steam session always open on a display on my desktop. I do wish Steam would let me add non-steam games in the big-picture UI because I still have to do that manually. 103 + The nice thing is how I can choose to start this whenever I want remotely; I don't need a Steam 104 + session always open on a display on my desktop. I do wish Steam would let me add non-steam games in 105 + the big-picture UI because I still have to do that manually. 82 106 83 107 ## Conclusion 84 108 85 - I'm sure Sunshine is way better in both performance and versatility but this works well enough for me and requires far less setup that I can deal with it. Security-wise I didn't want to introduce an entirely new service just to stream games, especially since it has an entire auth system to set up. 109 + I'm sure Sunshine is way better in both performance and versatility but this works well enough for 110 + me and requires far less setup that I can deal with it. Security-wise I didn't want to introduce an 111 + entirely new service just to stream games, especially since it has an entire auth system to set up. 86 112 87 - Connecting via SSH is already easy since I use keys, and Steam handles everything for the actual remote play authentication for me already, so I see it as a much simpler setup. 113 + Connecting via SSH is already easy since I use keys, and Steam handles everything for the actual 114 + remote play authentication for me already, so I see it as a much simpler setup. 88 115 89 - Of course Sunshine does a lot more than Steam so it's not really a fair comparison. I might end up trying it anyways to see how well it works. 116 + Of course Sunshine does a lot more than Steam so it's not really a fair comparison. I might end up 117 + trying it anyways to see how well it works. 90 118 91 119 First blog post in 2 years, maybe I'll make another one this decade!
+1 -2
src/pages/index.astro
··· 40 40 </p> 41 41 <p> 42 42 I'm currently in college majoring in Computer Science. I'm hoping to graduate in 2027 with a 43 - Bachelors in Computer Science and a minor in Professional Technical Writing. to use for 44 - programming competitions. 43 + Bachelors in Computer Science and a minor in Professional Technical Writing. 45 44 </p> 46 45 </div> 47 46