Skip to content

Instantly share code, notes, and snippets.

@nenkoru
Last active February 17, 2025 04:15
Show Gist options
  • Select an option

  • Save nenkoru/63c9e4d2bb92edb19a5de86f7efcfe10 to your computer and use it in GitHub Desktop.

Select an option

Save nenkoru/63c9e4d2bb92edb19a5de86f7efcfe10 to your computer and use it in GitHub Desktop.
How to enable streaming from Steam Deck using Sunshine without Flatpak with HW encoding
  1. Download an official release of sunshine with .AppImage extension on your Steam Deck. https://github.com/LizardByte/Sunshine/releases/tag/latest
  2. Move it to the home directory .local folder: mkdir -p ~/.local/sunshine/ && mv ~/Downloads/sunshine.AppImage ~/.local/sunshine/
  3. Add root user to the audio group: sudo usermod -aG audio root
  4. Execute the following to put the systemd unit file to autorun sunshine upon Steam Deck startup:
sudo tee /etc/systemd/system/sunshine.service << 'EOF'
[Unit]
StartLimitBurst=4

[Service]
User=root
Group=root
Environment=LD_LIBRARY_PATH=/usr/lib
Environment=PULSE_SERVER=unix:/run/user/1000/pulse/native
Environment=XDG_RUNTIME_DIR=/run/user/1000
ExecStart=/home/deck/.local/sunshine/sunshine.AppImage
Restart=on-failure
RestartSec=5s

[Install]
WantedBy=multi-user.target
EOF
  1. Update systemd unit files db and enable unit file: sudo systemctl daemon-reload && sudo systemctl enable sunshine.service --now
  2. Check if everything is correct and the service is running by: sudo systemctl status sunshine.service
  3. Access sunshine's webui: https://localhost:47990 (or if have another device on the lan access webui by the steam deck's lan ip)

Note: Audio on steam deck won't be working when streaming to a client but would return to normal when a client disconnects. It's maybe possible to run a systemd service as a default deck user, however it requires to give CAP_SYS_ADMIN to the binary, but giving that permission would make it impossible to ovveride LD_LIBRARY_PATH due to security implications.
And it's needed to be overriden due to an issue when libva tries to load drivers not from Steam Deck's default /usr/lib/dri but /usr/x86_64_gnu/lib. It might be worth to unlock the read-only filesystem and link those to this path, but I don't think its worth enough the hassle. When tried LIBVA_DRIVERS_PATH is ignored for whatever reason.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment