hyprwm / xdg-desktop-portal-hyprland

xdg-desktop-portal backend for Hyprland
BSD 3-Clause "New" or "Revised" License
305 stars 48 forks source link

screensharing not working on hyprland, but works on sway #46

Closed x0rzavi closed 1 year ago

x0rzavi commented 1 year ago

Screen sharing isn't working on neither obs nor firefox, it just shows up as a blank region. However everything is fine on sway. I've tried to reproduce the workflow as much as possible on both the WMs.

hyprland: v0.24.1 xdg-desktop-portal-hyprland: v0.2.1

I'm on gentoo and both the packages are from ::guru repository. I've attached the corresponding logs for pipewire, obs and xdph on sway and hyprland below.

obs_hyprland.txt obs_sway.txt

pipewire_hyprland.txt pipewire_sway.txt

xdph_hyprland.txt xdph_sway.txt

vaxerski commented 1 year ago

nvidia?

edit: doesnt seem like it from logs. Dunno. Try using -git versions of both

x0rzavi commented 1 year ago

tried that, unfortunately it doesn't fix anything. Guess I'll just wait for a future release to magically fix the issue :)

IDontKnow2Code commented 1 year ago

grim also says failed to copy output eDP-1

vaxerski commented 1 year ago

What does the hyprland log say when you try screensharing?

x0rzavi commented 1 year ago

grim also says failed to copy output eDP-1

can confirm the same on v0.24.1

vaxerski commented 1 year ago

brilliant, maybe instead of adding noise you consider adding the thing I asked for to debug this issue further?

x0rzavi commented 1 year ago

What does the hyprland log say when you try screensharing?

[LOG] LayerSurface ebb15f20 arranged: x: 0 y: 1034 w: 1920 h: 46 with margins: t: 0 l: 0 r: 0 b: 0
[LOG] LayerSurface eb7c12d0 arranged: x: 0 y: 0 w: 1920 h: 1080 with margins: t: 0 l: 0 r: 0 b: 0
[LOG] Monitor eDP-1 layers arranged: reserved: 0.000000 0.000000 0.000000 46.000000
[LOG] ScreencopyProtocolManager bound successfully!
[ERR] [screencopy] Cannot read pixels, unsupported format 0
[LOG] New LayerSurface has no preferred monitor. Assigning Monitor eDP-1

Edit: this is while trying to take a screenshot

vaxerski commented 1 year ago

is your system little endian?

x0rzavi commented 1 year ago

is your system little endian?

idk, I use a fairly normal system ig? on a Ryzen 5 3500u.

Here are the hyprland logs while trying to screenshare hyprland.txt

vaxerski commented 1 year ago

check on -git with 25f14294a84df1a2a840a92fd89ff4e1fd72f01e (hyprland)

x0rzavi commented 1 year ago

Screensharing still fails. Screenshots no longer fail but produces a black image, logs below

[LOG] LayerSurface 7836b130 arranged: x: 0 y: 1034 w: 1920 h: 46 with margins: t: 0 l: 0 r: 0 b: 0
[LOG] LayerSurface 784d1ff0 arranged: x: 0 y: 0 w: 1920 h: 1080 with margins: t: 0 l: 0 r: 0 b: 0
[LOG] Monitor eDP-1 layers arranged: reserved: 0.000000 0.000000 0.000000 46.000000
[LOG] Cleanup: destroyed a layersurface
[LOG] Hiding the cursor (timeout)
[LOG] Keybind triggered, calling dispatcher (64, , 65377)
[LOG] Executing WAYLAND_DISPLAY=wayland-1 DISPLAY=:0 grimblast --notify copysave output ~/Pictures/Screenshots/$(date +%F+%H:%M:%S).png
[LOG] Process Created with pid 3695
[LOG] ScreencopyProtocolManager bound successfully!
[LOG] New LayerSurface has no preferred monitor. Assigning Monitor eDP-1
[LOG] Registered signal for owner 7886b190: 78861708 -> 7886b368 (owner: layerSurface)
[LOG] Registered signal for owner 7886b190: 77ab1c00 -> 7886b230 (owner: layerSurface)
[LOG] Registered signal for owner 7886b190: 77ab1c10 -> 7886b298 (owner: layerSurface)
[LOG] Registered signal for owner 7886b190: 77ab1c20 -> 7886b300 (owner: layerSurface)
[LOG] Registered signal for owner 7886b190: 77ab1c30 -> 7886b3d0 (owner: layerSurface)
[LOG] LayerSurface 77ab1b40 (namespace notifications layer 2) created on monitor eDP-1
[LOG] LayerSurface 7836b130 arranged: x: 0 y: 1034 w: 1920 h: 46 with margins: t: 0 l: 0 r: 0 b: 0
[LOG] LayerSurface 784d1ff0 arranged: x: 0 y: 0 w: 1920 h: 1080 with margins: t: 0 l: 0 r: 0 b: 0
[LOG] LayerSurface 7836b138 arranged: x: 1620 y: 934 w: 300 h: 100 with margins: t: 0 l: 0 r: 0 b: 0
[LOG] Monitor eDP-1 layers arranged: reserved: 0.000000 0.000000 0.000000 46.000000
[LOG] LayerSurface 7836b130 arranged: x: 0 y: 1034 w: 1920 h: 46 with margins: t: 0 l: 0 r: 0 b: 0
[LOG] LayerSurface 784d1ff0 arranged: x: 0 y: 0 w: 1920 h: 1080 with margins: t: 0 l: 0 r: 0 b: 0
[LOG] LayerSurface 7836b138 arranged: x: 1620 y: 826 w: 300 h: 208 with margins: t: 0 l: 0 r: 0 b: 0
[LOG] Monitor eDP-1 layers arranged: reserved: 0.000000 0.000000 0.000000 46.000000
[LOG] LayerSurface 77ab1b40 mapped
[LOG] Registered signal for owner 7886b1a8: 78861728 -> 7886b1b0 (owner: CWLSurface)
[LOG] CWLSurface 7886b1a8 called init()
[LOG] LayerSurface 7836b130 arranged: x: 0 y: 1034 w: 1920 h: 46 with margins: t: 0 l: 0 r: 0 b: 0
[LOG] LayerSurface 784d1ff0 arranged: x: 0 y: 0 w: 1920 h: 1080 with margins: t: 0 l: 0 r: 0 b: 0
[LOG] LayerSurface 7836b138 arranged: x: 1620 y: 826 w: 300 h: 208 with margins: t: 0 l: 0 r: 0 b: 0
[LOG] Monitor eDP-1 layers arranged: reserved: 0.000000 0.000000 0.000000 46.000000
vaxerski commented 1 year ago

nvidia? if so, black screen means no nvidia patches

x0rzavi commented 1 year ago

amd igpu :)

ghost commented 1 year ago

Try using -git versions of both

this fixed it for me (AUR)

IDontKnow2Code commented 1 year ago

nvidia? if so, black screen means no nvidia patches

I have Intel iris xe graphics no nvidia. It still gives me black output. I use hyprland-git and grim-git from AUR.

Log while taking screenshot


[LOG] Executing WAYLAND_DISPLAY=wayland-1 DISPLAY=:0 grimblast --notify save active
[LOG] Process Created with pid 73637
[LOG] ScreencopyProtocolManager bound successfully!
[LOG] Registered signal for owner 55eeb11bd840: 55eeb11cc2b8 -> 55eeb11bda18 (owner: layerSurface)
[LOG] Registered signal for owner 55eeb11bd840: 55eeb120fc70 -> 55eeb11bd8e0 (owner: layerSurface)
[LOG] Registered signal for owner 55eeb11bd840: 55eeb120fc80 -> 55eeb11bd948 (owner: layerSurface)
[LOG] Registered signal for owner 55eeb11bd840: 55eeb120fc90 -> 55eeb11bd9b0 (owner: layerSurface)
[LOG] Registered signal for owner 55eeb11bd840: 55eeb120fca0 -> 55eeb11bda80 (owner: layerSurface)
[LOG] LayerSurface 55eeb120fbb0 (namespace notifications layer 3) created on monitor eDP-1
[LOG] LayerSurface 55eeb1fbc8a0 arranged: x: 0 y: 0 w: 1920 h: 45 with margins: t: 0 l: 0 r: 0 b: 0
[LOG] LayerSurface 55eeb173b910 arranged: x: 0 y: 0 w: 1920 h: 1080 with margins: t: 0 l: 0 r: 0 b: 0
[LOG] LayerSurface 55eeb17ac1b0 arranged: x: 1409 y: 59 w: 497 h: 88 with margins: t: 14 l: 14 r: 14 b: 14
[LOG] Monitor eDP-1 layers arranged: reserved: 0.000000 45.000000 0.000000 0.000000
[LOG] LayerSurface 55eeb120fbb0 mapped
[LOG] Registered signal for owner 55eeb11bd858: 55eeb11cc2d8 -> 55eeb11bd860 (owner: CWLSurface)
[LOG] CWLSurface 55eeb11bd858 called init()
[LOG] LayerSurface 55eeb1fbc8a0 arranged: x: 0 y: 0 w: 1920 h: 45 with margins: t: 0 l: 0 r: 0 b: 0
[LOG] LayerSurface 55eeb173b910 arranged: x: 0 y: 0 w: 1920 h: 1080 with margins: t: 0 l: 0 r: 0 b: 0
[LOG] LayerSurface 55eeb17ac1b0 arranged: x: 1409 y: 59 w: 497 h: 88 with margins: t: 14 l: 14 r: 14 b: 14
[LOG] Monitor eDP-1 layers arranged: reserved: 0.000000 45.000000 0.000000 0.000000
[LOG] LayerSurface 55eeb120fbb0 unmapped
[LOG] Framebuffer created, status 36053
[LOG] Callback 55eeb11bd888 -> 55eeb11bd880, CWLSurface removed.
[LOG] CWLSurface 55eeb11bd858 called destroy()
[LOG] LayerSurface 55eeb120fbb0 destroyed
[LOG] Callback 55eeb11bda40 -> 55eeb11bda38, layerSurface removed.
[LOG] Callback 55eeb11bd908 -> 55eeb11bd900, layerSurface removed.
[LOG] Callback 55eeb11bd970 -> 55eeb11bd968, layerSurface removed.
[LOG] Callback 55eeb11bd9d8 -> 55eeb11bd9d0, layerSurface removed.
[LOG] Callback 55eeb11bdaa8 -> 55eeb11bdaa0, layerSurface removed.
[LOG] LayerSurface 55eeb1fbc8a0 arranged: x: 0 y: 0 w: 1920 h: 45 with margins: t: 0 l: 0 r: 0 b: 0
[LOG] LayerSurface 55eeb173b910 arranged: x: 0 y: 0 w: 1920 h: 1080 with margins: t: 0 l: 0 r: 0 b: 0
[LOG] Monitor eDP-1 layers arranged: reserved: 0.000000 45.000000 0.000000 0.000000
[LOG] Cleanup: destroyed a layersurface
mordax7 commented 1 year ago

For me the screen sharing works on Firefox.

Chromium broke since the upgrade from version 111 to 112.

rudolf81 commented 1 year ago

For me the screen sharing works on Firefox.

Chromium broke since the upgrade from version 111 to 112.

Can confirm. With XDPH installed, and gnome and wrl portals removed, I could not get screensharing working in latest 112 Chrome. After I saw @mordax7's comment above, I tried FF, and it worked! and then I tried Chromium 111 and it worked!

FFS

I installed 111 form here: https://github.com/macchrome/linchrome/releases/tag/v111.5563.115-M111.0.5563.115-r1097615-portable-ungoogled-Lin64

Set flags for ozone, and wirepipe, and enabled override software rendering, and made sure I had vaapi installed, and then ran chromium 111 with cli flags: /opt/ungoogled-chromium_111.0.5563.115_1.vaapi_linux/chrome --disable-features=UseChromeOSDirectVideoDecoder --enable-features=VaapiVideoDecoder

That vaapi stuff might not be needed but seems to have been recommended in that link above.

vaxerski commented 1 year ago

I was pretty sure I fixed it, maybe I broke it again. Ugh.

vaxerski commented 1 year ago

fixed in c0e233955568fbea4e859336f6d3d14d51294d7c

x0rzavi commented 1 year ago

fixed in c0e2339

Unfortunately, neither did it fix my screensharing nor did it fix the black screenshot issue others have reported too :)

Edit: I've compiled both hyprland and xdg-desktop-portal-hyprland from the latest commits at the time of posting of this comment

devadathanmb commented 1 year ago

fixed in c0e2339

Unfortunately, neither did it fix my screensharing nor did it fix the black screenshot issue others have reported too :)

Edit: I've compiled both hyprland and xdg-desktop-portal-hyprland from the latest commits at the time of posting of this comment

I can confirm too. This bug was fixed at some point as pointed out in this thread but seems like it has appeared again.

EDIT : Now using latest hyprland release 0.25.0 this issue seemed to be fixed. But now chromium 113 release introduced more weird issues in the UI but that seems like more of a chromium related issue since I got the same results in hyprland and sway.

x0rzavi commented 1 year ago

I have mistakenly turned on bitdepth 10, which is definitely the root cause here in my case. Everything seems fine now, both screensharing and screenshot work as usual.

devadathanmb commented 1 year ago

I have mistakenly turned on bitdepth 10, which is definitely the root cause here in my case. Everything seems fine now, both screensharing and screenshot work as usual.

Although you had something else this actually was an issue with hyprland lol. Anyways, seems like it has been fixed.