sway
sway copied to clipboard
Screen drops frames when capturing games
-
Sway Version: 1.8-dev-eaeb173a (Dec 24 2021, branch 'master')
-
Debug Log: https://gist.github.com/VC73/ebc69a2ea01f5fe7d87bd453302ef40c
-
Config: default config with
exec systemctl --user import-environmentTo make xdg-desktop-portal-wlr work -
Description: Opened some game (in this case War thunder using vulkan), the game plays fine but when I start to capture the screen starts dropping frames while capturing the game.
That doesn't surprise me too much. shm-based capture takes a lot of bandwidth, and is a blocking operation due to the graphics APIs.
I see, sadly I guess that not much can be done atm then.
You can try to replace your capture setup with txproto which does support zero-copy dmabuf capture or screencopy with dmabuf.
Setup is not trivial, you need to write lua scripts. There are some examples, though: https://github.com/cyanreg/txproto/tree/master/DOCS/examples
Edit: OBS with the wlrobs plugin should support it as well I think.
Just tried the obs pluging using dmabuf and the result is the same even tough the recording itself is smooth
I can confirm this is still happening, recording Steam games with OBS.
Discord (canary) uses xdg-desktop-portal-wlr for screen capture on Wayland. And I'm getting frames issues only when I start the screen capture. It seems like I'm getting extra frames or something. It stutters. Here:
https://github.com/user-attachments/assets/38af0cb0-b00e-49a0-bdc8-805e5350e7c3
It's even less noticeable when looking at this film because of the framerate of the video.
While without streaming or recording, everything is smooth:
https://github.com/user-attachments/assets/04b218a1-22e5-4dd4-a098-04f88c8174f3
I do have something similar when I capture with OBS, but then I get black frames (dropped frames I guess):
https://github.com/user-attachments/assets/2efabd16-131e-4343-bce2-35786f13441b
My OBS settings are:
My monitor is set with:
output 'LG Electronics LG ULTRAGEAR 403NTEP2C244' resolution [email protected] adaptive_sync on position 0,0
I also tried with 120.017Hz, 99.946Hz and 59.951Hz. Always getting issues. I have adaptative sync ON.
Happening for me as well on RX 7900 XTX, exact same type of stutters as the video the person above me posted