Steamdeck - Streaming Server

Most use-cases for game streaming invovling a steamdeck considers using the steamdeck as the client. Here I explore using the steamdeck as a streaming server and a macbook air as a streaming client.

Networking

Part of the use-case here was not needing to rely on existing realiable network infrastucture, either wired or wireless. Ideally I wanted to have a private network between the 2 devices over USB-C. While this network is primarily for streaming over, it's also an added benifit to be able to share an internet connection from my laptop to the steamdeck via the connection.

BIOS Settings

Usually both the steamdeck and the laptop will act as a host. We want the steamdeck to be able to act as a device, so it can present as a network interface. To do this, we need to enable USB Dual Role (DRD) in the BIOS.

Shutdown your steamdeck, then hold volume-up + power to boot into BIOS/recovery mode. Select Setup Utility → Advanced → USB Configuration → USB Dual Role Device and select DRD.

Network Settings

A user named dafta, created a useful script for sharing the decks internet connection to another device over USB. This is 99% of what we needed, creating the usb network device. The only difference is that we want to consume the internet connection of the laptop, not share the decks internet connection with the laptop. Therefore a few changing to use a DHCP client instead of a DHCP server and removing the NAT rules, we end up with the following script:

usb-ether.sh

Place this in /var/lib/usb-ether (create the directory), along with a systemd service, usb-ether.service:

snippet.ini
[Unit]
Description=USB Networking
 
[Service]
Type=oneshot
ExecStart=/var/lib/usb-ether/usb-ether.sh start -n -R
RemainAfterExit=true
ExecStop=/var/lib/usb-ether/usb-ether.sh stop -n -R
 
 
[Install]
WantedBy=default.target

(We place these scripts in /var due to the steamOS immutable filesystem. Symlink the service:

ln -s /var/lib/usb-ether/usb-ether.service /etc/systemd/system/
TODO: SteamOS Updates will clear out this symlink. It might be possible to use rauc to make a hook to auto create this symlink

Enable at boot:

systemctl enable --now usb-ether

Laptop Side

Now plugging in the steamdeck should create a new network device called “Steam Deck”. Go to “Internet Sharing” and enable it for the correct device

Streaming Software

At this point, the native steam remote play will work.

It's also possible to use sunshine/moonlight. The easiest way to install sunshine on the steamdeck is via Decky. This gives a nice side menu for enable and disabling sunshine.

One quirk is that sunshine will not work at first boot, due to it starting before the display. Therefore you have to manually toggle it off and on.

Bonus Software

SSH-Service

steamdeck-ssh-user Is a useful script for enabling a SSH server as a user service.

MagicBlack

When streaming a game, the steamdeck screen stays on.

MagicBlack is a Decky plugin that emulates the screen turning off by overlaying a giant black box. This is a good enough workaround for OLED displays. Somehow it doesn't apply to the stream!

Use-Cases

My initial use-case was for playing games away from home on larger screen. As I usually have my MacBook with me. But it's also become useful as home.

When playing games at my desk, I've been struggling to find a good KVM/dock solution where I can quickly switch between my laptop and the steamdeck. My monitors have a built-in KVM, but it's slow to switch between. Since the steamdeck only outputs to one display, I ideally want my laptop connected to the other display and a quick way of switching inputs between the two devices.

By keeping my KVM connect to the laptop and streaming the game, I end-up with better experience, where I can play games that are more suited for a keyboard and mouse input while easily being able to “alt-tab” out to do something on my laptop, like send a quick discord message.

It's also nice to be able to use the steamdeck as a controller, while display on the big screen. Gives Wii-U vibes.