Ubuntu 22.04
Support may be working out of the box, but I did not have all the needed packages on upgrading from 20.04.
I was able to have screen sharing working with the following:
(!) if this breaks your audio, see this bug
sudo apt install xdg-desktop-portal-gnome gnome-remote-desktop
And reboot if necessary (or see Troubleshooting section).
YMMV, but for sure pipewire-media-session
(dependency of gnome-remote-desktop
) and xdg-desktop-portal-gnome
are needed and were not installed by do-release-upgrade
from 20.04.
After that I was able to validate screensharing with dpkg/snap/flatpak apps as follows:
Firefox snap
The default Ubuntu 22.04 firefox (snap) uses wayland by default, and supports WebRTC screensharing (test eg with this WebRTC experiment)
Unfortunately some software (Hello M$ Teams) "blacklists" firefox currently.
Chrome wayland dpkg
Chrome 99 is still X11 by default (despite the support flags being available since April 2021), so start it with
google-chrome-stable --enable-features=UseOzonePlatform --ozone-platform=wayland &
And to make it permanent, copy+edit /usr/share/applications/google-chrome.desktop to ~/.local/share/applications/
You also need to enable the WebRTC PipeWire support flag (chrome://flags/#enable-webrtc-pipewire-capturer).
[]
It still suffers from the "double" portal issue discussed in WebRTC/Chromium Updates In 2020, but it's usable.
Kooha flatpak (screen recorder)
sudo apt install flatpak
flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
flatpak install io.github.seadve.Kooha
flatpak run io.github.seadve.Kooha &
[]
Troubleshooting
Commands that can replace rebooting:
systemctl --user enable pipewire-media-session
systemctl --user start pipewire-media-session
systemctl --user restart xdg-desktop-portal-gnome
- Relevant Arch wiki
- wlroots' "It doesn't work" Troubleshooting Checklist
- background: Flatpak portals - how do they work? by Peter Hutterer.
- tip: run apps from command-line and check output for error messages like Error creating screencast session: GDBus.Error:org.freedesktop.DBus.Error.UnknownMethod: No such interface “org.freedesktop.portal.ScreenCast” on object at path /org/freedesktop/portal/desktop -- which means that you don't have a portal implementation -- e.g. this is the expected dbus setup as seen with
d-feet
:
If you see org.freedesktop.impl.portal.desktop.gnome has some interfaces but not the ScreenCast one, it can mean a missing pipewire setup, or that xdg-desktop-portal-gnome
was not restarted to pick it up.