emersion / xdg-desktop-portal-wlr

xdg-desktop-portal backend for wlroots
MIT License
580 stars 54 forks source link

Flatpak screensharing shows only black screen. #227

Closed archhaze24 closed 1 year ago

archhaze24 commented 2 years ago

I'm trying to use screenshare with Element Desktop and Brave installed as flatpak on sway. However, when I try to select a screen, after selecting it gives me a blank output.

When I tried to test Brave non-flatpak version (from AUR), everything works fine. Also xdp-screen-cast shows me my screen normally. When running flatpak Brave in console and selecting output, it gives me that error, and continues to print it:

[2:743:0723/212207.986617:ERROR:shared_screencast_stream.cc(599)] Dropping DMA-BUF modifier: 72057594037927940 and trying to renegotiate stream parameters
[2:743:0723/212208.016080:ERROR:egl_dmabuf.cc(569)] Failed to record frame: Error creating EGLImage - EGL_BAD_ALLOC
[2:743:0723/212208.016096:ERROR:shared_screencast_stream.cc(599)] Dropping DMA-BUF modifier: 72057594037927940 and trying to renegotiate stream parameters
[2:743:0723/212208.187657:ERROR:egl_dmabuf.cc(569)] Failed to record frame: Error creating EGLImage - EGL_BAD_ALLOC
[2:743:0723/212208.187673:ERROR:shared_screencast_stream.cc(599)] Dropping DMA-BUF modifier: 72057594037927940 and trying to renegotiate stream parameters
[2:743:0723/212208.216020:ERROR:egl_dmabuf.cc(569)] Failed to record frame: Error creating EGLImage - EGL_BAD_ALLOC
[2:743:0723/212208.216036:ERROR:shared_screencast_stream.cc(599)] Dropping DMA-BUF modifier: 72057594037927940 and trying to renegotiate stream parameters
[2:743:0723/212208.249804:ERROR:egl_dmabuf.cc(569)] Failed to record frame: Error creating EGLImage - EGL_BAD_ALLOC
columbarius commented 1 year ago

This might be an issue with the PipeWire version inside the flatpak. Please test if this issue also happens on kde.

yourealwaysbe commented 1 year ago

I have the same issue with org.chromium.Chromium (with WebRTC enabled) and com.github.IsmailMartinez.teams_for_linux. Same error output.

On the other hand, screen sharing works fine for org.mozilla.Firefox and com.obsproject.Studio. Also for the non-flatpak chromium Arch Linux package.

I'm on Sway 1.7, xdg-desktop-portal-wlr 0.6.0, and Pipewire 3.57.

I'm not really sure where the right place to report these errors are, so apologies if this is noise.

columbarius commented 1 year ago

have the same issue with org.chromium.Chromium

Which version of chromium are you using?

yourealwaysbe commented 1 year ago

Which version of chromium are you using?

Yes, sorry, i forgot to include the Flatpak versions

org.chromium.Chromium: 105.0.5195.102 com.github.IsmaelMartinez.teams_for_linux: 1.0.35 com.obsproject.Studio: 28.0.1 org.mozilla.firefox: 104.0.2

I haven't tested under KDE -- i had a quick go this morning but didn't manage to get Plasma up and running, then ran out of time.

columbarius commented 1 year ago

The chromium flatpak needs to bundle a newer version of PipeWire to correctly negotiate hardware capabilities (modifiers). You can try this test build https://github.com/flathub/org.chromium.Chromium/pull/229.

yourealwaysbe commented 1 year ago

Great, that fixes it for me. I'll assume Teams for Linux needs to do similar.

edit: seems to work for Teams for Linux, making a botched job of a pull request below, as you might notice :)

yourealwaysbe commented 1 year ago

Wrt the original reported error, the latest version of com.brave.Brave seems to be on org.freedesktop.Platform 21.08, which probably means a bump to 22.08 might fix it like it did for teams-for-linux and chromium, but that's not an xdg-desktop-portal-wlr issue :)

columbarius commented 1 year ago

Great, let's solve this by updating the browser flatpaks. I'll mark this as an upstream issue and close it. If sth. new happens feel free to reopen it again.