hyprwm / xdg-desktop-portal-hyprland

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

screensharing freezes as soon as preview becomes inactive #93

Closed muni-corn closed 8 months ago

muni-corn commented 1 year ago

i first noticed this in discord on firefox when friends were telling me my stream was frozen or broken, but now i've observed it on OBS and can provide steps to hopefully reproduce this issue:

  1. in OBS, create a scene with a Screen Capture (PipeWire) source. you can select a monitor or a window with the share picker.
  2. create a new, empty scene that doesn't include the screen capture source. (or, you can add the existing source and then hide it with the eye icon)
  3. switch back to the scene with screen capture to observe that the screen capture has frozen.

i've tried checking journalctl --user-unit xdg-desktop-portal-hyprland.service --follow and get nothing but a spam of these logs:

screenshot of a kitty terminal with duplicate log lines saying "frame callbacks initialized"

versions:

hyprland @ hyprwm/hyprland@4ddcda93f5887792a953332bf1b487e4b2c3b4ed xdph @ 0224695 obs 29.1.3

GrizzlT commented 1 year ago

I'm experiencing this issue as well using the master branch. Instead of freezing, I get a black screen whenever I try to screenshare. Logs are identical as OP's screenshot.

jbigler commented 11 months ago

I am also experiencing the same issue. There is something strange that I noticed during my testing in OBS. Test 1: 1) Open a terminal window 2) Add Window Capture source of terminal window to OBS 3) Scroll / type in terminal, changes are captured. 4) Switch to Scene 2 5) Switch back to scene 1 5) Scroll / type in terminal, changes are STILL captured.

Test 2: 1) Open a terminal window 2) Add Window Capture source of terminal window to OBS 3) Scroll / type in terminal, changes are captured. 4) Switch to Scene 2 5) Scroll / type in terminal 6) Switch back to Scene 1 7) The capture is still at the image when the scene was changed, and typing / scrolling in the terminal is no longer captured.

Note: If I do this with a GUI app such as a web browser then it doesn't matter if I interact with it at all, when I switch scenes the capture will always be frozen.

I am attaching the logs from xdg-desktop-portal-hyprland -v. You can see that during the first switch from paused to streaming on line 3094 that the capture continues, that was my first test above without changing the terminal.

The next change in scene is on line 7055. I changed to scene 2 and the stream state is paused, however there is a frame enqueued afterward when I begin typing in the terminal, Then on line 7074 when I change back to Scene 1 and the stream state changes from paused to streaming there is no longer anything being enqueued. Finally I deleted the capture source from OBS.

xdph3.log

Running Arch Linux 6.5.8 NVIDIA 535.113.01 aur/hyprland-nvidia 0.31.0-2 aur/xdg-desktop-portal-hyprland-git @d8daa2a OBS 29.1.3 (Flatpak)

31JSON commented 10 months ago

I am experiencing this as well, and have logs similar to jbigler. It's basically preventing me from using Hyprland while streaming.

Arch Linux: 6.5.9-arch1-1 Mesa 23.2.1-2 Hyprland: 0.30.0-1 XDPH: 1.2.5-1 OBS: 30.0.0-2

ifiinlist commented 8 months ago

I'm having this issue too. I really want to use window capture but as @jbigler described window capture and screen capture both freeze on scene change.

vaxerski commented 8 months ago

likely fixed with 536e6ed5701a7cbec5de143d0bc9de0cbd43e75b

ifiinlist commented 8 months ago

likely fixed with 536e6ed

Yes!! It works. Thank you!! Screen capture and Window capture both work even after scene change. But when capturing a window if the window gets resized somehow or I resize it then that capture freezes.

vaxerski commented 8 months ago

separate bug I guess, even tho it shant happen