Closed Bug 1731428 Opened 4 months ago Closed 4 months ago

[DMABuf screen sharing] Screen-sharing regression on Wayland (Google Meet) on AMD/non-Intel with DmaBuf sharing

Categories

(Core :: Widget: Gtk, defect)

Firefox 92
x86_64
Linux
defect

Tracking

()

RESOLVED FIXED
94 Branch
Tracking Status
firefox-esr78 --- unaffected
firefox-esr91 --- fixed
firefox92 --- wontfix
firefox93 --- wontfix
firefox94 --- fixed

People

(Reporter: physkets, Assigned: rmader)

References

(Blocks 1 open bug, Regression)

Details

(Keywords: regression)

Attachments

(7 files)

User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:92.0) Gecko/20100101 Firefox/92.0

Steps to reproduce:

Attempted to start sharing my screen.

Also attempted the same from a fresh profile, with similar results.

Actual results:

The usual dialogs open, asking me to choose the window I would like to share, but it doesn't actually share anything after I select one. Also, the button to share-screen remains greyed out, so I can't stop or re-share without ending the call.

In some cases, even the dialog with the options does not pop-up.

Expected results:

The window should have been shared.

Thanks for the report!
Are you able to find a regression range?
$ pip3 install mozregression
$ MOZ_ENABLE_WAYLAND=1 mozregression --good 91 --bad 92 --pref gfx.webrender.all:true -a https://meet.google.com

Blocks: wayland
Component: Graphics → Widget: Gtk
OS: Unspecified → Linux
Hardware: Unspecified → x86_64
Attached image Failure message

This (attached screenshot) is the message the Google Meet displays when the sharing fails.

71138e0818edfeccad7c180b1eca9da8ba65e611 stransky — Bug 1676837 [Wayland] Specify supported buffer dataTypes and modifier used for pipewire screencast, r=ng

Thanks!

Does this problem still occur with latest Nightly?
$ MOZ_ENABLE_WAYLAND=1 mozregression --launch 2021-09-17 --pref gfx.webrender.all:true -a https://meet.google.com

If it has been fixed, you could find out what has fixed it:
$ MOZ_ENABLE_WAYLAND=1 mozregression --find-fix --bad 92 --good 2021-09-17 --pref gfx.webrender.all:true -a https://meet.google.com

Has Regression Range: --- → yes

With the latest, even the permission dialog that allows selection of the window to share, does not pop-up when I click the button to begin sharing.

Nor do the usual microphone & camera permission dialogs that usually popup as soon as I begin a call.

Are you running xdg-desktop-portal 0.10.0?
Might be connected to https://bugzilla.mozilla.org/show_bug.cgi?id=1731469

(In reply to co1umbarius from comment #7)

Are you running xdg-desktop-portal 0.10.0?
Might be connected to https://bugzilla.mozilla.org/show_bug.cgi?id=1731469

That means xdg-desktop-portal 1.10.0 not 0.10.0

I'm running xdg-desktop-portal version: 1.8.1 . Ya, that might be it. But why do versions of FF before that particular commit, work?
Version 1.10.0 is undergoing testing in my Linux distribution, and I will report back, once I receive that update (hopefully in a couple of days).

I'm running xdg-desktop-portal version: 1.8.1 myself and screencast is working in FF for me. Version 1.10.0 is in testing, because it needs applications to patch the dbus variant type themself. So this shouldn't be related to your problem.

In that case, are we back to square one? I will report after the update to xdg-desktop-portal anyway.

What Desktop-Environment are you on? I'm on KDE-Plasma, and using its Wayland session.

I'm using sway with FF Wayland enabled. Have you tried if screencast is working in Plasma, via the obs PipeWire plugin or https://gitlab.gnome.org/-/snippets/19? Would be interesting to know, if screencast itself has problems, or if it's FF UI. Had issues like you describe around half a year ago, but now it's working. Are you running any git packages related to this, like pipewire or kwin? You could check with
pw-dot --detail -o pw.dot && xdot pw.dot if you have any remaining pipewire screencast nodes open after the screencast freezes.

Screen-recording on OBS via its Pipewire backend works fine.

I now have xdg-desktop-portal version 1.10.1, and the issue remains.

@Ryan Any information on why it won't be fixed?

(In reply to physkets from comment #15)

@Ryan Any information on why it won't be fixed?

This bug report wasn't closed. The previous update just said that this issue isn't important enough to make an emergency update for the currently released version (Firefox 92).

I tested this out on a Wayland session of the Gnome desktop environment, and screen-sharing works fine. So it would seem that this issue is KDE specific.

Cross-reported on the KDE bug-tracker: https://bugs.kde.org/show_bug.cgi?id=443049

Hi,

I'm having this problem on gnome so it's not kde specific.

Firefox 92.0,
xdg-desktop-portal-gtk 1.8.0-1
ubuntu 21.04

Hi, I'm one of KWin, the Plasma Wayland compositor, developers and the original author of the current screen-sharing code.

At the moment on my system it works but I know it's a bit a hit-and-miss because the spec has changed considerably over the last few months. Therefore it depends on: The Plasma version you are running, the firefox version you are using and the patches your distribution is including into firefox, as I know some distros are highly patched, especially in this area where the webrtc and pipewire versions bundled are out of date.

If there's exact confirmed issues that we can reproduce generally, I'll be happy to look into those.

For me screen sharing doesn't work with

gsettings set org.gnome.mutter experimental-features "['dma-buf-screen-sharing']"

enabled under Gnome, but works with vanilla settings.

(In reply to Ernst Sjostrand from comment #21)

For me screen sharing doesn't work with

gsettings set org.gnome.mutter experimental-features "['dma-buf-screen-sharing']"

enabled under Gnome, but works with vanilla settings.

This is experimental and 'not-ready-yet' feature. It does not bring any improvements unless GL is used on client side to handle the screen transformations (if there's anyone). You can safely turn it off without any regret.

Blocks: pipewire
No longer blocks: wayland
Summary: Screen-sharing regression on Wayland (Google Meet) → [DMABuf screen sharing] Screen-sharing regression on Wayland (Google Meet)

It should be noted that Firefox currently actively advertises DmaBuf support for screen sharing[1] even though the implementation for that is not particular great[2]. This should usually not affect Intel GPUs, but is likely to have serious issues on e.g. dedicated AMD GPUs.

Gnome currently disables DmaBuf sharing on non-Intel (unless dma-buf-screen-sharing is set), while KDE (correctly) uses it when the application advertises support for it.

The easiest solution here is likely to stop advertising the DmaBuf flag and then make bug 1729743 happen.

1: https://searchfox.org/mozilla-central/source/third_party/libwebrtc/webrtc/modules/desktop_capture/linux/base_capturer_pipewire.cc#132
2: https://searchfox.org/mozilla-central/source/third_party/libwebrtc/webrtc/modules/desktop_capture/linux/base_capturer_pipewire.cc#439

See Also: → 1729743

Right now we only support simple mem-copy from a given DmaBuf instead
of using the driver to get the data. This can fail in many ways, e.g.
if buffer modifiers are used.
Until we support proper handling of DmaBuf, stop advertising it to
Pipewire.

Here's a try build, would be great if someone affected could verify that it fixes the issue: https://treeherder.mozilla.org/jobs?repo=try&revision=1b6cc06284df1d7040d604490754c2fc0b842108

When compilation has succeeded, you can either manually download it (B > Artifacts) or simply launch it with mozregression:
$ pip3 install --upgrade mozregression
$ MOZ_ENABLE_WAYLAND=1 mozregression --repo try --launch 626ec21c7479a541fb96c8084539662e5da4e952 --pref gfx.webrender.all:true

Assignee: nobody → robert.mader
Attachment #9243293 - Attachment description: WIP: Bug 1731428 - Do not advertise DmaBuf support for Pipewire screen sharing → Bug 1731428 - Do not advertise DmaBuf support for Pipewire screen sharing, r=stransky

Ouch, stupid typo, here's a new build: https://treeherder.mozilla.org/#/jobs?repo=try&revision=626ec21c7479a541fb96c8084539662e5da4e952

And a small addition to Jans nice explanation, the direct download would be B > Artifacts > target.tar.bz2

(In reply to Robert Mader [:rmader] from comment #25)

Here's a try build, would be great if someone affected could verify that it fixes the issue: https://treeherder.mozilla.org/jobs?repo=try&revision=1b6cc06284df1d7040d604490754c2fc0b842108

Hi,

It does not.

Gnome, ubuntu 21.04.

Can I provide some logs to help?

(In reply to tomkatudor@gmail.com from comment #28)

(In reply to Robert Mader [:rmader] from comment #25)

Here's a try build, would be great if someone affected could verify that it fixes the issue: https://treeherder.mozilla.org/jobs?repo=try&revision=1b6cc06284df1d7040d604490754c2fc0b842108

Hi,

It does not.

Gnome, ubuntu 21.04.

Can I provide some logs to help?

Yes!

Can you provide communication from dbus using:
$ dbus-monitor --session

And output from pipewire monitor:
$ pw-mon

Run both in a terminal (keep them running) and try to share a screen and attach the results here.

(In reply to grulja from comment #29)

(In reply to tomkatudor@gmail.com from comment #28)

(In reply to Robert Mader [:rmader] from comment #25)

Here's a try build, would be great if someone affected could verify that it fixes the issue: https://treeherder.mozilla.org/jobs?repo=try&revision=1b6cc06284df1d7040d604490754c2fc0b842108

Hi,

It does not.

Gnome, ubuntu 21.04.

Can I provide some logs to help?

Yes!

Can you provide communication from dbus using:
$ dbus-monitor --session

And output from pipewire monitor:
$ pw-mon

Run both in a terminal (keep them running) and try to share a screen and attach the results here.

I have some bad news, this morning the screen share worked, with google meet, both on the try version and on the standard installed version.
Between the two attempts was a sleep of the laptop of several hours.

Just because I was asked will try to attach the logs, but I'm baffled.

Attached file dbus, old firefox
Attached file dbus, try firefox

Ernst, physkets, can you also give the build from comment 27 a try? Because IIUC both of you have systems where issues would be expected (AMD + KDE/Gnome with dma-buf-screen-sharing), while tomkatudor does not (Gnome, ubuntu 21.04, likely without dma-buf-screen-sharing), suggesting an an unrelated problem.

For the record, you need to run with MOZ_ENABLE_WAYLAND=1

Flags: needinfo?(physkets)
Flags: needinfo?(ernstp)

I did disable dma-buf screen sharing as you recommend, though I now tried with both.

The build in comment 27 works with both dma-buf screen sharing enabled and disabled now!

Flags: needinfo?(ernstp)

(In reply to Ernst Sjostrand from comment #36)

The build in comment 27 works with both dma-buf screen sharing enabled and disabled now!

Thanks for the confirmation! Given that Gnome with dma-buf-screen-sharing behaves like KDE the patch should fix the original issue - even though triggering a performance drop on Intel until bug 1729743 is fixed. That in turn would increase performance for everyone.

Pushed by robert.mader@posteo.de:
https://hg.mozilla.org/integration/autoland/rev/c9fcbf863ff9
Do not advertise DmaBuf support for Pipewire screen sharing, r=stransky
Status: UNCONFIRMED → RESOLVED
Closed: 4 months ago
Resolution: --- → FIXED
Target Milestone: --- → 94 Branch
Summary: [DMABuf screen sharing] Screen-sharing regression on Wayland (Google Meet) → [DMABuf screen sharing] Screen-sharing regression on Wayland (Google Meet) on AMD/non-Intel with DmaBuf sharing

That build does not work for me, but not because it has the same issue.
In this build, it doesn't even give me the permissions window where I can select windows.

Flags: needinfo?(physkets)

(In reply to physkets from comment #40)

That build does not work for me, but not because it has the same issue.
In this build, it doesn't even give me the permissions window where I can select windows.

Are you sure you ran it with MOZ_ENABLE_WAYLAND=1 and in a Wayland session?

Edit: uh, you might be running into bug 1731495

Ah, okay. Looks like that will land only in v94. That's a long wait. But its fixed, and that's great!

Comment on attachment 9243293 [details]
Bug 1731428 - Do not advertise DmaBuf support for Pipewire screen sharing, r=stransky

ESR Uplift Approval Request

  • If this is not a sec:{high,crit} bug, please state case for ESR consideration: This patch disables a fastpath which can cause problems on certain hardware. Up until now, the fast path has also been disabled by Gnome Shell in those cases, but with Gnome 42 it will most likely stop doing so, assuming most relevant software has adopted by then (either by disabling the fastpath, this bug, or handling it correctly, bug 1729743). As Gnome 42 will be released in spring, FF 91 will still be in use, so we'll need this patch then.
    Also: this should fix screen sharing for some KDE users.
  • User impact if declined: Screen sharing will break for Wayland users when they upgrade to Gnome 42 in spring.
  • Fix Landed on Version: 94
  • Risk to taking this patch: Low
  • Why is the change risky/not risky? (and alternatives if risky): 1. disabling the fast path results in falling back to the more reliable slow path.
  1. code change is trivial.
  2. Apart from worse performance no regressions are know.
  • String or UUID changes made by this patch:
Attachment #9243293 - Flags: approval-mozilla-esr91?

Comment on attachment 9243293 [details]
Bug 1731428 - Do not advertise DmaBuf support for Pipewire screen sharing, r=stransky

Thanks for the detailed risk assessment. Approved for 91.5esr.

Attachment #9243293 - Flags: approval-mozilla-esr91? → approval-mozilla-esr91+
You need to log in before you can comment on or make changes to this bug.