Skip to content

Screencast Compatibility

John Zimmermann edited this page Oct 23, 2022 · 43 revisions

This guide contains information on applications compatible with xdg-desktop-portal-wlr. If screencasting works for you in some applications, but not others, please review this guide.

WebRTC (a.k.a. Firefox/Chromium)

WebRTC is a protocol and specification for real-time communication, but it is also a shared codebase and a set of APIs used by Firefox and Chromium to provide screen capture and casting functionality. You can test this functionality using the getUserMedia Test Page over on Mozilla's GitHub.

WebRTC contains support for xdg-desktop-portal based screen casting, but requires a special build flag RTC_USE_PIPEWIRE=true in order to be included. Some distros build their browsers with this flag and some do not.

No matter what browser you are using, the WebRTC code will check that the environment variable XDG_SESSION_TYPE=wayland is set in order to use xdg-desktop-portal. It is set automatically when recent versions of wlroots and systemd are in use.

Browsers

OS Package Name Supported? Notes
Arch chromium Yes Tested version 96.0.4664.45, requires a feature toggle set in chrome://flags search for pipewire to find it. Requires `xdg-desktop-portal` and `xdg-desktop-portal-wlr` installed (ArchWiki).
firefox-wayland-hg Yes Minimal patch against hg trunk. Daily builds available from chaotic-aur
firefox Yes Works out of the box since package version 84.0-1.
Alpine chromium Yes APKBUILD now contains RTC_USE_PIPEWIRE=true flag. Still need to toggle the flag enable-webrtc-pipewire-capturer.
firefox Yes
Fedora chromium Yes Build Flag
firefox Yes Pipewire 0.3 Patch
Gentoo firefox Yes Tested using:
  • media-video/pipewire-0.3.6
  • sys-apps/xdg-desktop-portal-1.7.2[screencast]
  • gui-libs/xdg-desktop-portal-wlr-9999
  • gui-wm/sway-1.4-r2
  • www-client/firefox-78.0.2[screencast]
Use xdp-screen-cast.py to make sure that xdg-desktop-portal and xdg-desktop-portal-wlr are running and work.
Requires the "screencast" USE-flag to be set for Firefox: mkdir -p /etc/portage/package.use && echo 'www-client/firefox screencast' >> /etc/portage/package.use/firefox
chromium Partial Tested using: Gentoo does not enable any Pipewire support in its Chromium package by default but the user can enable it themselves by setting EXTRA_GN='rtc_use_pipewire=true' via portage's package.env. Chromium is only compatible with media-video/pipewire:0/0.2 which cannot be co-installed with media-video/pipewire:0/0.3.
openSUSE Tumbleweed chromium Yes
firefox Yes
Debian chromium Not yet Debian now ships pipewire 0.3 in unstable, meaning only a patch to Chromium is required. Relevant issue
firefox Yes Works out of the box since package version 84.0-1.
Ubuntu chromium Untested
firefox Yes Ubuntu 20.04 lacks support for a lot of the needed libraries. The available xdg-portal-desktop is not compiled with screencast support, there is no xdg-desktop-portal-wlr and only pipewire 0.2 is available but if the libraries are compiled manually, firefox works out of the box since package version 84.0-1. Newer releases including 22.04 include pipewire 0.3, so should work (not tested).

Electron

https://github.com/electron/electron/pull/26022 has landed which means wayland support is now included in Electron 12! However, you might still need to use --enable-features=UseOzonePlatform --ozone-platform=wayland when running electron to take advantage of this.

For pipewire support, the --enable-features=WebRTCPipeWireCapturer flag will also be required on Electron until that flag is removed from Chromium upstream. Many closed source Electron apps (MS VSCode, MS Teams, Slack, etc.) still may not be built using a new enough version of Electron or the correct flags for this feature (or wayland support in general) to work out of the box.

OBS

OBS Studio version 27.0.0 introduced official PipeWire screen capture support. Make sure xdg-desktop-portal-wlr and PipeWire are running properly and add a "Screen Capture (PipeWire)" source in OBS.

For older versions, see obs-xdg-portal

obs-xdg-portal

source: https://gitlab.gnome.org/feaneron/obs-xdg-portal/

xdg-desktop-portal-wlr should be perfectly compatible with obs-xdg-portal, but you should probably be using the wlrobs plugin instead. If you get errors regarding cursor modes, it is likely that you are not letting xdg-desktop-portal-wlr start automatically, or you are not starting it correctly with /usr/lib/xdg-desktop-portal -r & /usr/lib/xdg-desktop-portal-wlr

gnome-network-displays

source: https://gitlab.gnome.org/GNOME/gnome-network-displays

dbus: app_id: org.gnome.NetworkDisplays
dbus: non-monitor cast requested, not replying`

xdp+gstreamer python script

source: https://gitlab.gnome.org/snippets/19

This is probably the simplest/most minimal test to ensure that xdg-desktop-portal-wlr screencasting is working correctly. If you're having issues elsewhere, try this first.