Wayland Screensharing broken in Ubuntu 21.10

Bug #1950040 reported by Esokrates
48
This bug affects 8 people
Affects Status Importance Assigned to Milestone
chromium-browser (Ubuntu)
Fix Released
Undecided
Nathan Teodosio
firefox (Ubuntu)
Fix Released
Undecided
Unassigned
gnome-shell (Ubuntu)
Invalid
Undecided
Unassigned
pipewire (Ubuntu)
Invalid
Undecided
Unassigned
xdg-desktop-portal (Ubuntu)
Invalid
Undecided
Unassigned
xdg-desktop-portal-gtk (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

Freshly installed Ubuntu 21.10, screen sharing does not work with any browser, tested the following options:

- Firefox snap
- Firefox deb
- Chromium snap
- Chromium flatpak

Steps to reproduce:

1. Go to https://www.webrtc-experiment.com/Pluginfree-Screen-Sharing/#7325517390736006
2. Select to share the whole desktop in the xdg-desktop-portal
3. Notice the orange screen share indicator in Gnome-Shell but actually nothing is shared in the browser.

This should be handled high priority since this is a critical feature during the pandemic.

Filed against ubuntu-meta since I don't know exactly which package to blame, whether it's pipewire, xdg-desktop portal or some problem directely with mutter / gnome-shell, please reassign accordingly.

Revision history for this message
Esokrates (esokrarkose) wrote :

Relevant output in journal:

Nov 06 11:14:08 pc xdg-desktop-por[6355]: Unhandled parent window type
Nov 06 11:14:08 pc xdg-desktop-por[6355]: Failed to associate portal window with parent window
Nov 06 11:14:08 pc GeckoMain[11893]: gdk_wayland_window_configure: assertion 'height > 0' failed

Searching for the first two lines reveals others in the Community have the same problem, see for example https://askubuntu.com/questions/1372140/obs-wayland-screen-capture-not-working-on-gnome

Revision history for this message
Esokrates (esokrarkose) wrote :

Downgrading to the following package versions from Ubuntu 21.04 makes screen sharing work on Ubuntu 21.10:

gstreamer1.0-pipewire_0.3.24-3_amd64.deb
libpipewire-0.3-0_0.3.24-3_amd64.deb
libpipewire-0.3-modules_0.3.24-3_amd64.deb
libspa-0.2-modules_0.3.24-3_amd64.deb
pipewire_0.3.24-3_amd64.deb
pipewire-bin_0.3.24-3_amd64.deb

Revision history for this message
Esokrates (esokrarkose) wrote (last edit ):

Everything run via flatpak still has broken screensharing, Firefox from deb package and Google Chrome via deb package work fine with the downgraded packages from #2.

Revision history for this message
Esokrates (esokrarkose) wrote (last edit ):

For Chromium via Flatpak I get

[304:456:1106/144346.048939:ERROR:base_capturer_pipewire.cc(206)] PipeWire stream state error: wrong resource type/version
[304:456:1106/144346.048966:ERROR:base_capturer_pipewire.cc(193)] PipeWire remote error: wrong resource type/version
[304:456:1106/144346.048990:ERROR:base_capturer_pipewire.cc(193)] PipeWire remote error: unknown resource 2 op:2
[304:456:1106/144346.048997:ERROR:base_capturer_pipewire.cc(193)] PipeWire remote error: unknown resource 2 op:3
[304:463:1106/144350.093931:ERROR:base_capturer_pipewire.cc(206)] PipeWire stream state error: wrong resource type/version
[304:463:1106/144350.093962:ERROR:base_capturer_pipewire.cc(193)] PipeWire remote error: wrong resource type/version
[304:463:1106/144350.093979:ERROR:base_capturer_pipewire.cc(193)] PipeWire remote error: unknown resource 2 op:2
[304:463:1106/144350.093985:ERROR:base_capturer_pipewire.cc(193)] PipeWire remote error: unknown resource 2 op:3

Firefox flatpak is also unable to share screen, despite the package downgrade in #2.

So to sum up: Flatpak packages do not have functioning screensharing, even with downgraded packages.

When not using Flatpak packages, the downgrade from #2 makes screensharing work (tested with Firefox deb, Firefox snap, Google Chrome deb).

Revision history for this message
Esokrates (esokrarkose) wrote :

Instead of downgrading (see #2) it also helps to install the package "pipewire-media-session". This looks like a packaging bug somewhere, since that would need to be a hard dependency somewhere.
Flatpak apps remain broken though w.r.t screen-sharing.

no longer affects: ubuntu-meta (Ubuntu)
Revision history for this message
Esokrates (esokrarkose) wrote (last edit ):

Tagged regression-release since Wayland Screensharing worked fine in Ubuntu 21.04.
@vanvugt, could you have a look?

tags: added: regression-release
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Testing on Ubuntu 22.04. Screen sharing in Wayland sessions is *working* for the Firefox snap but not the Chromium snap and not the Chrome deb either.

Actually that's expected for Chrome/Chromium because they used Xwayland by default so can't access the screen. The weird thing is that running Chrome on native Wayland does still have the bug:

  google-chrome --enable-features=UseOzonePlatform --ozone-platform=wayland

Since it's working in Firefox though, and the same package versions are in 21.10 and 22.04, it doesn't sound like the bug should be assigned to those packages.

Changed in gnome-shell (Ubuntu):
status: New → Invalid
Changed in pipewire (Ubuntu):
status: New → Invalid
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

I've just tested 21.10 and can reproduce the bug in Firefox there. It appears the cause is Firefox version 93 in Ubuntu 21.10, whereas Ubuntu 22.04 has Firefox 94. So here's how to fix it in Ubuntu 21.10:

  snap remove firefox
  snap install firefox --candidate

Chrome/Chromium will need a different fix but it doesn't even officially enable Wayland support yet.

Changed in xdg-desktop-portal (Ubuntu):
status: New → Invalid
Changed in firefox (Ubuntu):
status: New → Fix Released
Changed in chromium-browser (Ubuntu):
status: New → Confirmed
Revision history for this message
Esokrates (esokrarkose) wrote :

@vanvugt: Thanks for having a look. Have you tried firefox from flatpak or any other flatpak application?
Also is the "pipewire-media-session" package installed by default? It didn't seem to be the case for me.

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

I haven't tried any flatpaks.

And yes "pipewire-media-session" appears to be installed by default (for me) in fresh installations of 21.10 and 22.04.

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

If you had downgraded packages like in comment #2 then it's possible "pipewire-media-session" might have been removed at the same time. But that doesn't matter now. This appears to be a browser bug, fixed in Firefox 94.

Revision history for this message
Esokrates (esokrarkose) wrote :

Would you mind trying flatpaks? Those had working screensharing and do not work anymore for me with 21.10.

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Flatpaks are not part of Ubuntu so I'm not going to spend any time on that.

Revision history for this message
Olivier Tilloy (osomon) wrote :

Note that firefox 94.0 is now in the stable channel, so there is no need to switch to the candidate channel to get the update.

Revision history for this message
Kevin (the7thstranger) wrote :

@vanvugt Are you sure it works?

I'm currently testing Ubuntu 22.04 (completely updated as of writing) with the 94.0.2-2 Firefox snap. When I go to https://meet.jit.si/ and click the screen sharing button, I can only select "Use operating system settings". When I do that, nothing happens. I don't get an xdg-desktop-portal popup asking me what I want to share.

Simply nothing happens; basically the same as with the Firefox snap on 20.04, which doesn't have any PipeWire support in Mutter, so is expected to fail.

The only relevant line in the logs is "gdk_wayland_window_configure: assertion 'height > 0' failed", just like the OP had.

I've tested this with both an installed system and a live usb session.

Revision history for this message
Kevin (the7thstranger) wrote :

I noticed that both the Firefox and Chromium snaps do work in Debian 11, which uses an older xdg-desktop-portal than Ubuntu 22.04. I wondered what would happen if I'd install xdg-desktop-portal and xdg-desktop-portal-gtk 1.8 from 21.10 in 22.04, and it turns out that this fixes it.

So I guess that both the Firefox and Chromium snaps are incompatible with xdg-desktop-portal 1.10.

(The Firefox deb and Flatpak show the same problem by the way. Downgrading xdg-desktop-portal fixes it everywhere.)

Revision history for this message
Daniel van Vugt (vanvugt) wrote (last edit ):

It *did* work but indeed it seems it doesn't work anymore :(

Ubuntu 22.04
Firefox snap 94.0.2-2

Changed in firefox (Ubuntu):
status: Fix Released → Confirmed
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Kevin, thanks for figuring that out.

After more testing I can confirm it's only xdg-desktop-portal-gtk you need to downgrade to 1.8:

https://launchpad.net/ubuntu/+archive/primary/+files/xdg-desktop-portal-gtk_1.8.0-1build1_amd64.deb

Changed in xdg-desktop-portal-gtk (Ubuntu):
status: New → Confirmed
Changed in firefox (Ubuntu):
status: Confirmed → Fix Released
tags: added: jammy
Revision history for this message
Olivier Tilloy (osomon) wrote :

This sounds like https://bugzilla.mozilla.org/show_bug.cgi?id=1731495, which claims that the regression was worked around in Firefox 94, and that workaround was backported to 93. So presumably the problem shouldn't happen with 94.0.2-2 as a snap and xdg-desktop-portal-gtk 1.10.

Revision history for this message
marco (mander) wrote :

Firefox 96 deb on 22.04 is broken again.

Revision history for this message
Olivier Tilloy (osomon) wrote :

Just tested the following on a laptop running fully up-to-date 22.04, in the default Wayland session:
 - firefox snap (97.0)
 - firefox deb (97.0)
 - chromium snap (98.0.4758.80)

Screen sharing (entire screen and selected windows) works as expected in all cases.

marco, could you please test again and share feedback here?

Revision history for this message
Olivier Tilloy (osomon) wrote :

Tentatively marking the xdg-desktop-portal-gtk task fixed, per my last comment. Feel free to re-open if it's not working for you.

Changed in xdg-desktop-portal-gtk (Ubuntu):
status: Confirmed → Fix Released
Changed in chromium-browser (Ubuntu):
status: Confirmed → Invalid
Changed in chromium-browser (Ubuntu):
status: Invalid → Confirmed
Changed in chromium-browser (Ubuntu):
status: Confirmed → Invalid
Revision history for this message
Torsten Bronger (bronger) wrote :

My Chromium 101.0.4951.54 on 22.04 cannot share screen in Big Blue Button – the shared image ist just black with the mouse pointer.

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

This bug is closed.

But screen sharing is expected to be broken on Chromium+Wayland due to bug 1897454.

Revision history for this message
Matej Kovacic (matej-kovacic) wrote :

Weel, the bug may be closed, but it is not gone. I have Ubuntu 22.10 with Firefox 106.0 (Mozilla Firefox Snap for Ubuntu / canonical-002 - 1.0) and when I open https://www.webrtc-experiment.com/Pluginfree-Screen-Sharing/ and try to share one window - Firefox just crashes.

I installed pipewire-media-session package, but of course it doesn't help.

Revision history for this message
Shaw Terwilliger (sterwill) wrote (last edit ):

I also have crash problems with Ubuntu 22.04 with recent versions of Firefox. I can share my whole screen, but not a single window. I did _not_ experience crashes with 22.04 and slightly older versions of Firefox. Some time in the last month, a new version of Firefox came along (I install with snap) and single window sharing stopped working.

One of my crash logs if someone wants to check if this is strictly related to this bug:

https://crash-stats.mozilla.org/report/index/99a89d4b-74f3-477b-b9e2-188d10221116

P.S. I just found https://bugzilla.mozilla.org/show_bug.cgi?id=1790496 which I think is tracking my issue.

Revision history for this message
Nathan Teodosio (nteodosio) wrote : Chromium

I verified that full screen sharing doesn't work out of the box in
Chromium and Google Chrome.

However, the fix suggested by https://superuser.com/a/1481800 works,
namely to enable the flag in
chrome://flags/#enable-webrtc-pipewire-capturer.

Changed in chromium-browser (Ubuntu):
status: Invalid → Triaged
assignee: nobody → Nathan Pratta Teodosio (nteodosio)
Changed in chromium-browser (Ubuntu):
status: Triaged → Fix Committed
Changed in chromium-browser (Ubuntu):
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.