Sunday, May 19, 2024
 Popular · Latest · Hot · Upcoming
18
rated 0 times [  18] [ 0]  / answers: 1 / hits: 31778  / 3 Years ago, mon, may 31, 2021, 3:38:03

How is the status of screen sharing on Wayland? Recently this has become an essential topic for people who telecommute.


I am trying to share my screen on Google Chrome 88 with WebRTC and I run GNOME 3.36 with Wayland with the following packages:



I tried to setup everything from scratch with the following steps:



  1. Build the packages with autotools and install the required dependencies along with their .pc files for pkg-config

  2. Copy the .so shared libraries for pipewire to /usr/local/lib/x86_64-linux-gnu and run ldconfig to refresh the config

  3. Copy the unit files in /usr/local/lib/systemd/user for systemctl and start the services


With everything correctly installed, I enabled chrome://flags/#enable-webrtc-pipewire-capturer and tried this demo and it says "Success!" but I only see a black screen...


EDIT: It looks like the problem has been fixed as of Ubuntu 22.04 LTS. I tried on a Thinkpad X1 laptop, with the default installation and I was able to share my screen on the demo link above.


More From » gnome

 Answers
0

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)


portal in firefox


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).


[portal in chrome]


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 &

[portal in 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:
    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.


[#1986] Tuesday, June 1, 2021, 3 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
howesale

Total Points: 224
Total Questions: 117
Total Answers: 116

Location: Nauru
Member since Thu, May 18, 2023
1 Year ago
;