16

Has anyone got screensharing working under wayland using pipewire?

As far as I can tell, it should be possible to share the screen from Chrome / Chromium after installing the pipewire package and adding your user to the audio and video groups. Except that Chrom(e|ium) is still using libpipewire0.2 and Groovy only ships with libpipewire0.3.

Bonus points if you've made slack work.

"Switch back to Xorg" is not a viable answer here. Various things (notably pen input) don't work correctly (in my configuration, anyway) in Xorg and are not going to any time soon.

muru
  • 193,181
  • 53
  • 473
  • 722
Tom
  • 1,054
  • 3
  • 14
  • 25

6 Answers6

19

I should note for those who come after me that this is partly fixed in Ubuntu 21.04, with the following caveats:

  • Enabling WebRTC with pipewire works in Chrome / Chromium. To do so, open chrome://flags/#enable-webrtc-pipewire-capturer in chrome and change "WebRTC PipeWire support" to Enabled
  • Sharing through Slack works if you start Slack with slack --enable-features=WebRTCPipeWireCapturer
  • Sharing through Teams doesn't work (yet - waiting for the Teams team to update the version of Electron they use)
  • Sharing on multiple monitors appears to do weird things. On my laptop, if try to share one of my external screens which has a different resolution, the other end gets a weird interlace-pattern version of my screen. It looks like pipewire is assuming that the resolution of the image it receives matches the resolution of the "first" screen on the system and messes up the video encoding accordingly.
Max N
  • 199
  • 2
  • 11
Tom
  • 1,054
  • 3
  • 14
  • 25
  • 6
    In summary: opening chrome://flags/#enable-webrtc-pipewire-capturer in chrome and change "WebRTC PipeWire support" to "Enabled" makes screen sharing work in Ubuntu 21.04 for e.g. the MS Teams web app running in Chrome. On my machine. :tm: – Echsecutor Jun 08 '21 at 10:20
3

You can install this package manually but you will have to check for updates manually here.

First, download the deb file (assuming you are using the amd64 version of Ubuntu):

wget 'http://mirrors.kernel.org/ubuntu/pool/universe/p/pipewire/libpipewire-0.2-1_0.2.7-1_amd64.deb'

Then, install the package:

sudo apt install ./libpipewire-0.2-1_0.2.7-1_amd64.deb

Since libpipewire0.3 uses a totally different set of files, there should be no conflict.

Again, you will have to manually check for updates. The current version is 0.2.7-1. When you see a newer version, just click on "amd64" under "Architecture" and then you can either click on one of the mirrors to download the file or copy the link and paste it into the terminal to use the wget command to use the same method as above. Just make sure to use the correct filename with the apt command so that you don't install the wrong file (like an older downloaded version).

Finally, there is some additional information on the Archlinux wiki that you may want to check out where they mention that you might have to install xdg-desktop-portal and enable the chromium flag chrome://flags/#enable-webrtc-pipewire-capturer to get it to work.

mchid
  • 42,315
  • 7
  • 94
  • 147
  • Thanks for the answer, but this doesn't work for me. I've installed `libpipewire-0.2-1:amd64` and `xdg-desktop-portal` was already installed. I've set the chrome flag you mention. But when I go to share a screen, the shared content is just a black screen. – Tom Dec 17 '20 at 10:39
  • Should also add that I have `/usr/bin/pipewire` and `/usr/bin/pipewire-media-session -d bluez5` processes running. – Tom Dec 17 '20 at 10:41
  • I couldn't get this working either. – James Ward Feb 08 '21 at 22:29
  • 1
    Installing pipewire 0.2 is no longer necessary in Ubuntu 21.04. Opening chrome://flags/#enable-webrtc-pipewire-capturer in chrome and changing "WebRTC PipeWire support" to "Enabled" is still necessary at the time of writing. – Echsecutor Jun 08 '21 at 10:22
1

if you are using sway(or antother composer using wlroots) and recent chrome (post 2023)

you have to update xdg-desktop-portal-wlr to version >= 0.7.0

install the dependancies

sudo apt install libpipewire-0.3-dev libinih-dev libgbm-dev\
                 libdrm-dev libsystemd-dev scdoc

build it yourself from https://github.com/emersion/xdg-desktop-portal-wlr/releases

then build

tar xf xdg-desktop-portal-wlr-0.*.tgz
cd xdg-desktop-portal-wlr-0.*
meson build
ninja -C build

and install

sudo ninja -C build install

restart chrome

enjoy screen sharing

ref https://forum.manjaro.org/t/screensharing-stopped-working-after-stable-update-2023-04-11-with-chromium-wayland-pipewire/138687

0

Install libpipewire0.2 and enable WebRTC with Pipewire flag in chromium.

BeastOfCaerbannog
  • 12,964
  • 10
  • 49
  • 77
  • 1
    This is basically the same answer as the first one, and, as mentioned in comments there, doesn't work. – Tom Feb 09 '21 at 11:47
0

Arch with Gnome 41.3 Install:

  • libpipewire02
  • xdg-desktop-portal Enable chrome flag:
  • chrome://flags/#enable-webrtc-pipewire-capturer
  • 1
    The site is about Ubuntu. Arch is off-topic. – ChanganAuto Jan 17 '22 at 15:23
  • This does not provide an answer to the question. Once you have sufficient [reputation](https://askubuntu.com/help/whats-reputation) you will be able to [comment on any post](https://askubuntu.com/help/privileges/comment); instead, [provide answers that don't require clarification from the asker](https://meta.stackexchange.com/questions/214173/why-do-i-need-50-reputation-to-comment-what-can-i-do-instead). - [From Review](/review/late-answers/1199512) – ChanganAuto Jan 17 '22 at 15:23
0

Managed to make screenshare work everywhere on Ubuntu 22.04 switching graphic driver from the default "X.Org X Server" to proprietary and tested option, in my case, from Nvidia (nvidia-driver-510).