[Wayland] Screensharing doesn't work the screen stays black
Categories
(Core :: WebRTC: Audio/Video, defect, P3)
Tracking
()
Tracking | Status | |
---|---|---|
firefox59 | --- | affected |
People
(Reporter: rhubscher, Assigned: jhorak)
References
(Blocks 1 open bug)
Details
Updated•7 years ago
|
Updated•7 years ago
|
Comment 1•7 years ago
|
||
Comment 2•6 years ago
|
||
Comment 3•5 years ago
|
||
(In reply to Martin Stránský [:stransky] from comment #2)
PipeWire is solved at Bug 1496359.
You can check Fedora or flatpak packages
(https://firefox-flatpak.mojefedora.cz/) which have the PipeWire patches
from Bug 1496359.
I use wayland on an uptodate archlinux installation. I installed pipewire and xdg-desktop-portal{,-gtk}.
firefox 67.0.2
The python script provided in the following links works (so my pipewire installation works)
python3 gnome-screen-cast.py
But I still experience the problem. I can't share my screen (it's black but I can see my cursor).
https://mozilla.github.io/webrtc-landing/gum_test.html
I tried with an empty profile, with firefox nightly (flatpak), with or without GDK_BACKEND=wayland → same problem.
Nevertheless it's seems to work on Fedora :
https://jgrulich.cz/2018/07/04/how-to-enable-and-use-screen-sharing-on-wayland/
I think it's due to this patch (just a guess from the filename):
https://src.fedoraproject.org/rpms/firefox/blob/master/f/firefox-pipewire.patch
So for what I know : this bug isn't resolved on unpatched firefox.
Comment 4•5 years ago
|
||
Nevermind, I didn't saw "RESOLVED FIXED in Firefox 68".
Maybe firefox-nightly failed due to flatpak… I will wait for firefox 68 to reopen this bug if it's still there.
Comment 5•5 years ago
|
||
I just test with firefox 68 developer-edition … and the problem is still there.
Assignee | ||
Updated•5 years ago
|
Assignee | ||
Comment 6•5 years ago
|
||
The problem is that the pipewire support is currently disabled during build. I'll look into it.
Assignee | ||
Comment 7•5 years ago
|
||
Dan: could you please help me out there? I'm trying to set the rtc_use_pipewire
dynamically by adding --with-pipewire
mozconfig option:
https://searchfox.org/mozilla-central/source/media/webrtc/trunk/webrtc/webrtc.gni#74
How can I do that with the gn->moz.build conversion tools?
Comment 8•5 years ago
|
||
(In reply to Jan Horak [:jhorak] from comment #7)
Dan: could you please help me out there? I'm trying to set the
rtc_use_pipewire
dynamically by adding--with-pipewire
mozconfig option:
https://searchfox.org/mozilla-central/source/media/webrtc/trunk/webrtc/webrtc.gni#74
How can I do that with the gn->moz.build conversion tools?
Hi Jan,
It is possible to set gn variables from mozconfig in this file: [1]. But you would still have to generate moz.build files using the process described here: [2]. To be able to do this dynamically we would have to run gn directly during the build rather than generating moz.build files. We have Bug 1534615 on file to do this. Our main concern about switching to running gn directly during the build is making things even more difficult for downstream maintainers. It would be helpful if you could comment on that bug if you have any opinions on this.
Chris worked on the moz.build generation, he might be able to help out here.
Dan
[1] https://searchfox.org/mozilla-central/source/build/gn.mozbuild
[2] https://firefox-source-docs.mozilla.org/build/buildsystem/gn.html
Comment 9•5 years ago
|
||
I'm sorry, Dan is right, this isn't supported by the current conversion scheme. One idea might be to see if we can unconditionally enable but rely on defines to turn on/off the relevant code, but I'm not sure if that's feasible.
Assignee | ||
Comment 10•5 years ago
|
||
I'm still looking into it, enabling pipewire and moz.build
regen with steps from above adds a few source files to compile and some libs too. I doubt I can enable pipewire conditionally without manually changing the generated moz.build
file which is I guess is not allowed.
Comment 12•5 years ago
|
||
I think it makes sense to reopen this one, since bug 1496359 already has landed patches.
Comment 13•5 years ago
|
||
(In reply to Dan Minor [:dminor] from comment #12)
I think it makes sense to reopen this one, since bug 1496359 already has landed patches.
Thanks Dan.
Comment 14•5 years ago
|
||
I think this is related - but when I'm prompted to share my screen by the browser, the options include "Entire Screen" which is completely black. I can still share individual windows, but it seems that only non-Wayland windows are shown (Electron apps, Qt apps).
(If you think this is unrelated, I'm happy to redirect this to a new bug)
Comment 15•5 years ago
|
||
Yup, this is the bug that might cause that behavior. What compositor are you using? Gnome? KDE? Sway? You may need to install xdg-desktop-portal for your compositor as well, but a patched Firefox is currently also necessary because of this issue. Fedora has implemented such a patch.
Comment 16•5 years ago
|
||
I'm on Gnome 3.34.4, and I already have xdg-desktop-portal installed.
I'm using Manjaro/Arch, so I'll see what I can do to get the patch from Fedora working on my setup. Thank you for pointing me in the right direction!
Comment 17•5 years ago
|
||
There's a package in the AUR called fedora-firefox-wayland-bin that is precompiled with the patch. When you installed xdg-desktop-portal, you should have chosen to also install xdg-desktop-portal-gtk for Gnome to work.
Comment 18•5 years ago
|
||
Not sure if this patch isn't ready yet, or some other component in the environment isn't working:
I've added Fedora's patch to AUR/firefox-wayland-hg.
pipewire
andxdg-desktop-portal
are running as I can see them throughsystemctl --user status
. (But I ended up stopping them and running by hand where I can keep a look).
I startedxdg-desktop-portal-wlr
by hand.
setXDG_CURRENT_DESKTOP=sway
.
I can see a screen if I start xdg-screen-cast.py.
Ran firefox and started screen sharing in Hangouts.
When allowing permission there are two options: a blank line, and "Entire Screen".
Nothing happens afterward. No error in debug's console or the terminal in which I ran firefox. Dropping sharing permission shows a failure message, but I believe that's expected.
If I start firefox but first set GTK_USE_PORTAL=1
, than xdg-desktop-portal
immediately crashes (SIGSEGV) with:
(/usr/lib/xdg-desktop-portal:252823): GLib-GIO-CRITICAL **: 14:06:50.914: g_dbus_proxy_call_sync_internal: assertion 'G_IS_DBUS_PROXY (proxy)' failed
Comment 19•5 years ago
|
||
@pedro.laracampos Are you using a wlroots based compositor? Who are you quoting there? If you're struggling with xdg-desktop-portal-wlr, I'd be happy to help you out over on #sway on freenode, because we're a little off topic on this issue. Or feel free to raise an issue over at xdg-desktop-portal-wlr on github. Fair warning, it is in an alpha state, but it does work. I've yet to build and try firefox-wayland-hg.
Comment 20•5 years ago
|
||
The quotes were an accident I was listing my steps with '>'.
Yes I'm using sway (a wlroots based compositor), and I'm quite sure it's working for basic screen sharing. What I'm not sure is what in the combo { firefox-hg + xdg-portal + pipewire.patch + portal-wlr } is not.
But yeah, this is probably very portal-wlr specific, so I'm heading to #sway.
Updated•5 years ago
|
Comment 21•5 years ago
|
||
Screen sharing still doesn't work on Wayland (of native Wayland windows/display) as of Firefox 76 (from Flathub on GNOME 3.36)...
What is holding this up?
Comment 22•5 years ago
|
||
Read the issue?
Comment 23•5 years ago
|
||
I did... if I understand correctly this is a build-system related issue?
Anything we (people not familiar with it) can do to help out?
Comment 24•5 years ago
|
||
Sadly no. Upstream Firefox can't support custom built flags for gn built third party libraries. Unless you want to become intimately familiar with the build system, you likely can't fix this issue for everyone.
You'll see a lot of distros patching their Firefox builds, notably Fedora. We are slowly putting together a compatibility table here: https://github.com/emersion/xdg-desktop-portal-wlr/wiki/Screencast-Compatibility It is very incomplete.
You can also compile Firefox yourself and apply the appropriate patches, but then you're building your own browser with each new release.
Comment 25•5 years ago
|
||
Is firefox going to update its webrtc code for the new pipewire-0.3? I tried applying the Fedora pipewire patch, but even with some modifications I was unable to build it against the new pipewire version because of some missing headers and type declarations.
Comment 26•5 years ago
|
||
It isn't a question of whether or not Firefox will update or not. The WebRTC codebase is developed independently (check out webrtc.org). A patch has already been written for pipewire 0.3 for OpenSuse Tumbleweed. Their patchay serve you better.
This isn't really an issue though, because pipewire 0.3 daemon is backwards compatible with 0.2 consumers. You just need to have the 0.2 libraries installed, which don't conflict name wise. Arch provides a libpipewire02 package that does exactly that, while allowing all of pipewire 0.3 to be installed at the same time. I believe Void Linux has also started packaging the 0.2 libraries independently.
Comment 27•5 years ago
|
||
You just need to have the 0.2 libraries installed, which don't conflict name wise.
Not really possible on my system, because headers come in the same package as the daemon itself.
Comment 28•5 years ago
|
||
What distro do you use? Could you package the libs yourself?
Comment 29•5 years ago
|
||
Also, I forgot, the pipewire 0.3 patch was for OpenSuse Tumbleweed's Chromium package, but like I said, the pipewire codebase is shared, so it should be easy to port this to FF.
Comment 30•5 years ago
|
||
What distro do you use?
Gentoo
Could you package the libs yourself?
I think, I could, but it's not the way it's usually done on Gentoo. libpipewire is a shared librarary?
the pipewire 0.3 patch was for OpenSuse Tumbleweed's Chromium package, but like I said, the pipewire codebase is shared, so it should be easy to port this to FF.
Thanks. I think, I'll try this.
Comment 31•5 years ago
|
||
Could you package the libs yourself?
I think, I could, but it's not the way it's usually done on Gentoo. libpipewire is a shared librarary?
They are shared libraries, yes.
Comment 32•4 years ago
|
||
Hello,
What's the status of this bug?
I see that Fedora is including this patch: https://src.fedoraproject.org/rpms/firefox/blob/master/f/firefox-pipewire-0-3.patch
Shouldn't that patch be included upstream?
GNOME is now defaulting to wayland in a lot of distributions (Debian,...) and not being able to share the desktop is a problem
Comment 33•4 years ago
|
||
(In reply to Dan Shick from comment #24)
Sadly no. Upstream Firefox can't support custom built flags for gn built third party libraries. Unless you want to become intimately familiar with the build system, you likely can't fix this issue for everyone.
Has a bug report been posted for this issue/limitation with gn builds? I'd like to see how the issue is being addressed. Thank you.
Comment 34•4 years ago
|
||
(In reply to ian-s-mcb from comment #33)
Has a bug report been posted for this issue/limitation with gn builds? I'd like to see how the issue is being addressed. Thank you.
If I understand correctly, there are exceedingly few cases where this issue has an impact, this being one. This issue will sort of "go away naturally" when the Wayland/Pipewire codepaths in WebRTC are stable enough that the need for build flags is removed.
I've been tracking distro packages and their patch status here https://github.com/emersion/xdg-desktop-portal-wlr/wiki/Screencast-Compatibility#webrtc-aka-firefoxchromium
Comment 35•4 years ago
|
||
Thank you, Dan. That clears up the bug situation for me.
Comment 36•4 years ago
|
||
(In reply to ian-s-mcb from comment #33)
(In reply to Dan Shick from comment #24)
Sadly no. Upstream Firefox can't support custom built flags for gn built third party libraries. Unless you want to become intimately familiar with the build system, you likely can't fix this issue for everyone.
Has a bug report been posted for this issue/limitation with gn builds? I'd like to see how the issue is being addressed. Thank you.
When Bug 1654407 is fixed, we'll no longer be code generating build files from gn, which will make it much easier to support custom build flags.
Comment 37•4 years ago
|
||
What about the other non-buildsystem related changes in the Fedora patch?
Comment 38•4 years ago
|
||
Out of the box PipeWire support is tracked at Bug 1672944.
Comment 39•4 years ago
|
||
(In reply to Martin Stránský [:stransky] from comment #38)
Out of the box PipeWire support is tracked at Bug 1672944.
Thanks, Martin. I'll follow that bug.
Comment 40•4 years ago
|
||
Let's close it as a dupe of Bug 1672944. Jan is not going to work on that any more, I'll take care of it.
Description
•