Skip to content

Instantly share code, notes, and snippets.

@rondhi
Last active May 7, 2024 06:55
Show Gist options
  • Star 19 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save rondhi/f9163e7649aa734b5421a8f58bd6c49e to your computer and use it in GitHub Desktop.
Save rondhi/f9163e7649aa734b5421a8f58bd6c49e to your computer and use it in GitHub Desktop.
How to stream games from OBS directly from Steam Deck's Gaming Mode

How to stream games from OBS directly from Steam Deck's Gaming Mode (as of 2023-02-26)

DISCLAIMER: As with any guide, please make sure to read through and understand everything before following the steps in this guide. I'm not responsible for you breaking anything on your own device. This guide assumes you have a little background with the linux command line as well as the text editor nano. If not, please educate yourself


Description: It's possible to stream Vulkan and OpenGL games from Gaming Mode on your Steam Deck. This guide is heavily based on robertkirkman's guide, which is linked multiple times throughout this guide. Much thanks to them


Basic summary

  1. Install OBS Studio and OBS VkCapture Plugin via flatpak
  2. Add OBS Studio to Steam
  3. Install rwfus Read-Write OverlayFS for Steam Deck
  4. Add the chaotic-aur repository
  5. Install obs-vkcapture-git via chaotic-aur
  6. Add Game Capture source to OBS
  7. Edit game launch options

In Steam Deck Desktop Mode

1. Install OBS Studio and OBS VkCapture Plugin via flatpak

  • OBS Studio
  • OBS VkCapture Plugin
  • Note: You may notice that the Discover Store also has an OBS VkCapture tools but I haven't been able to get a game capture going that way. I was only able to get a game capture by installing obs-vkcapture via command line/AUR.

According to OBS VkCapture Github

If you use Flatpak OBS, you need to install Flatpak OBS plugin. For capturing games outside Flatpak runtime, you need native build regardless of if you are using Flatpak OBS or not.

OBS-flatpak-install

2. Add OBS Studio to Steam (Source)

a. From the start menu, find OBS Studio, right-click, and add OBS Studio to Steam. I also recommend adding it to your favorites in Steam.

b. In order to get OBS Studio to launch in Gaming Mode: In Steam, edit the launch options for OBS Studio:

LD_PRELOAD= OBS_USE_EGL=1 QT_QPA_PLATFORM=xcb %command% run --branch=stable --arch=x86_64 --command=obs com.obsproject.Studio

OBS-launch-options

3. Install rwfus Read-Write OverlayFS for Steam Deck Source

These instructions may not be up-to-date. Visit the rwfus github page for up-to-date installation instructions.

The advantage of using an OverlayFS is that any packages you install via pacman or AUR will persist even after a SteamOS update. We want to use the dev branch of rwfus because it's been updated for SteamOS 3.4.

Open up the the terminal app (by default, it's Konsole on SteamOS). Keyboard shortcut is usually CTRL+ALT+T. Enter the following commands one by one.

cd ~
wget -O rwfus.zip https://github.com/ValShaped/rwfus/releases/download/v0.4.1-beta1/rwfus-0.4.1-beta1.zip && unzip rwfus.zip -d rwfus
cd rwfus
chmod +x rwfus

These commands download the latest rwfus release. Side note: if you don't have a sudo password set up, use passwd, then enter the rest of the commands to install rwfus.

sudo ./rwfus --install
sudo pacman-key --init
sudo pacman-key --populate
sudo pacman -Sy

4. Add the chaotic-aur repository

First, you should educate yourself on what the Arch User Respository (AUR) is. It's a community driven repository which is meant to help users build packages from source. It's up to the user to verify the contents of the package.

The Chaotic AUR is a repository of pre-built packages. Please see this on the safety of using Chaotic AUR and AUR in general. Is chaotic-aur safe to use?

Add the chaotic repository to your list of repository mirrors. Find up-to-date instructions here

sudo pacman-key --recv-key FBA220DFC880C036 --keyserver keyserver.ubuntu.com
sudo pacman-key --lsign-key FBA220DFC880C036
sudo pacman -U 'https://cdn-mirror.chaotic.cx/chaotic-aur/chaotic-keyring.pkg.tar.zst' 'https://cdn-mirror.chaotic.cx/chaotic-aur/chaotic-mirrorlist.pkg.tar.zst'

Now to add the chaotic-aur mirror to the repository list. We do this by appending some text to the end of the /etc/pacman.conf file. You can do this by editing the file with nano or vi with root access.

sudo nano /etc/pacman.conf
[chaotic-aur]
Include = /etc/pacman.d/chaotic-mirrorlist

Finally, refresh the repository list

sudo pacman -Sy

5. Install obs-vkcapture-git via chaotic-aur

sudo pacman -S obs-studio chaotic-aur/obs-vkcapture-git

After confirming, you should have obs-vkcapture installed. You can make sure you have it installed by typing

obs-vkcapture

And you should see something like

WARNING: Please use obs-gamecapture instead.
ERROR: No program supplied

Usage: obs-gamecapture <program>

7. Add Game Capture source to OBS

  • You can add a Game Capture source within OBS. Default settings are fine.
  • I suggest right-clicking the source and selecting Transform > Fit to Screen so it fits to the canvas no matter what resolution you're playing at.

add-game-capture-source

8. Edit game launch options

Once you have obs-vkcapture installed, edit a game's launch options with the line below. The Game Capture source will capture whatever game you're running with these launch options:

obs-gamecapture %command%

edit-game-launch-options

In Steam Deck Gaming Mode

  1. Press the Steam button. Go to Library. Press R1 until you get to NON-STEAM. Launch OBS Studio (you can also find it in your Favorites if you favorited it earlier in the guide)
  2. Press the Steam button. Go to Library. Launch your desired game
  3. As long as the game you choose supports OpenGL or Vulkan, OBS Studio should be able to capture that game.
  4. Have fun streaming on the go!

OBS-gaming-mode

Note: Even if the game is OpenGL or Vulkan, there's no guarantee that OBS will be able to capture the game. Your mileage may vary.

Other tips

  • If you don't want to pull from chaotic AUR all the time, you can remove the repository from pacman.conf by commenting out the lines with # and then refresh the repository list:
#[chaotic-aur]
#Include = /etc/pacman.d/chaotic-mirrorlist
  • You can use Droidcam OBS plugin to use your smartphone as a webcam source in OBS. More info here
  • Another possible smartphone-as-a-camera method is VDO Ninja
  • If you want to isolate game audio, you can use Helvum (found in Discover Store) and a Jack audio source within OBS to isolate the game sounds
  • In case you want to stream over to Discord or something, you can enable Virtual Camera in OBS

Install OBS VirtualCam (Source)

sudo pacman -S linux-neptune-headers libappindicator-gtk3
sudo pacman -S v4l2loopback-dkms v4l2loopback-utils

Support

If you need any support, feel free to post open a support post in the help channel on the Steam Deck discord and tag @rondhi#1234

@atsen-dev
Copy link

I've same problem too, last week it was working but not recently following some update...

@Cyphs
Copy link

Cyphs commented Mar 31, 2024

I was able to get it working by downgrading the OBS version to 30.0.2.

To downgrade, make sure OBS Studio is installed like normal, then open the terminal (Konsole) and enter:

sudo flatpak update --commit=e641d66f8f509ff18c1e82bfd6e32e0e0021e56cb01d1471b00f56d82ea8bfa1 com.obsproject.Studio

If you need to install GStreamer, enter:

flatpak install com.obsproject.Studio.Plugin.Gstreamer

Should be good for now until a fix for newer versions are found. Just don't update it in the Discover app.

Actually, I only tried 30.0.2 because of a YouTube video, so unsure exactly what update broke it. If you want to get the commits for other previous versions, type: flatpak remote-info --log flathub com.obsproject.Studio
Then compare it to the release dates on GitHub or wherever.

@rondhi
Copy link
Author

rondhi commented Mar 31, 2024

@Cyphs thanks for this information! I was leaning towards the issue being caused by OBS 30.1, so this kinda confirms it.

@SuDunPo
Copy link

SuDunPo commented Apr 2, 2024

@Cyphs thanks dude!

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