obsproject / obs-studio

OBS Studio - Free and open source software for live streaming and screen recording
https://obsproject.com
GNU General Public License v2.0
58.4k stars 7.8k forks source link

Pipewire capture of Fullescren Xwayland Applications Freezes Whenever Focused; Only on Xwayland, not on Wayland #6353

Closed HurricanePootis closed 2 years ago

HurricanePootis commented 2 years ago

Operating System Info

Other

Other OS

Arch Linux

OBS Studio Version

27.2.4

OBS Studio Version (Other)

No response

OBS Studio Log URL

https://gist.github.com/HurricanePootis/d1191ed84b23612965774183c5baeaa8

OBS Studio Crash Log URL

No response

Expected Behavior

Whenever I select a fullscreen XWayaland window to capture, I expect that it records normally and fine whenever I am actively focused on the window.

Current Behavior

However, the XWayland window freezes whenever I focus on it. It records fine whenever, lets say, I'm focused on OBS and looking at the view port and menus. It's just that, whenever I go ahead and go into the fullscreen app I'm capturing, in the video file, it's frozen.

And, this is only on XWayland apps. Running Team Fortress 2 default on XWayland will cause the recording to freeze whenever I focus on the app, but it works fine with SDL_VIDEODRIVER=wayland.

Here is a video of me running Team Fortress 2 on XWayland Demonstrating the problem https://user-images.githubusercontent.com/53066639/163861699-adedf4b3-a21d-49f4-8e84-11f3e9fb5d88.mp4

Steps to Reproduce

  1. Run Wayland
  2. Launch OBS, making sure QT_QPA_PLATFORM=wayland
  3. Capture a XWayland Fullscreen Application Window (e.g., Team Fortress 2)
  4. Spend time capturing the application while you're not focused on it
  5. Focus on the app and spend some time doing stuff on it
  6. View the finish file and find that whenever you focused the app on step 5, the recording froze ...

Anything else we should know?

I am compiling OBS with these build flags

CPUARCH=znver1
CFLAGS="-march=$CPUARCH -O3 -pipe -fno-plt -fexceptions \
        -Wp,-D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security \
        -fstack-clash-protection -fcf-protection"
CXXFLAGS="$CFLAGS -Wp,-D_GLIBCXX_ASSERTIONS"
LDFLAGS="-Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now"
LTOFLAGS="-flto=auto"

Even still, whenever using obs compiled for generic x86_64, or compiled on my system, or even the latest git release, it freezes on fullscreen XWayland Apps.

I am using KDE Wayland, running: qt5-wayalnd 5.15.3+kde+r41-1 KDE Plasma 5.24.4 wayland 1.20.0 wayland-protocols 1.25 pipewire 0.3.50 xdg-desktop-portal 1.14.2

kkartaltepe commented 2 years ago

File bugs about rendering to your compositor.

HurricanePootis commented 2 years ago

I mean, whenever I am not focused on the XWayland window, I can see the app in all of its unfrozen glory inside of the OBS preview, so it seems like my compositor is able to send data to OBS just fine.

How are you aware this is not a obs problem, but a kwin one?

kkartaltepe commented 2 years ago

If your compositor was able to send data to obs just fine it would be sending data, but instead you see it frozen in obs.

melvyn2 commented 2 years ago

Can't reproduce on arch-repo obs 27.2.4-2 and kwin 5.25.3-1 wayland.

MaddyGuthridge commented 1 year ago

I've got this happening under Gnome 42 on Fedora

DeeJayLSP commented 7 months ago

As someone who have been experiencing this problem I would like to add that it only happens when the application is fullscreen or borderless, but not windowed.