nowrep / obs-vkcapture

OBS Linux Vulkan/OpenGL game capture
GNU General Public License v2.0
508 stars 25 forks source link

Mangohud capture not working (doesn't show or flickers) on Control DX12 after intro movies #116

Closed mmbossoni closed 1 year ago

mmbossoni commented 1 year ago

I've first noticed this with Lutris flatpak on Nobara, but confirmed with Heroic on Arch as well Capture starts fine and shows Mangohud and game. After intro movies, reaching game menu, Mangohud capture stops. If game stays on background (0fps?) it shows again, but interacting with game make it disappear

Operating System: Arch Linux KDE Plasma Version: 5.26.4 KDE Frameworks Version: 5.101.0 Qt Version: 5.15.7 Kernel Version: 6.0.13-272-tkg-pds (64-bit) Graphics Platform: Wayland Processors: 16 × AMD Ryzen 7 5700X 8-Core Processor Memory: 15.5 GiB of RAM Graphics Processor: NVIDIA GeForce GTX 1070/PCIe/SSE2 Manufacturer: Micro-Star International Co., Ltd. Product Name: MS-7A37 System Version: 1.0

mmbossoni commented 1 year ago
DEBUG | DRIVER:   Copying old device 0 into new device 0
INFO | LAYER:     Inserted device layer "VK_LAYER_MANGOHUD_overlay" (/usr/$LIB/libMangoHud.so)
INFO | LAYER:     Inserted device layer "VK_LAYER_OBS_vkcapture_64" (/usr/lib/libVkLayer_obs_vkcapture.so)
DRIVER | LAYER:   vkCreateDevice layer callstack setup to:
DRIVER | LAYER:      <Application>
DRIVER | LAYER:        ||
DRIVER | LAYER:      <Loader>
DRIVER | LAYER:        ||
LAYER:               VK_LAYER_OBS_vkcapture_64
LAYER:                       Type: Implicit
LAYER:                           Disable Env Var:  DISABLE_OBS_VKCAPTURE
LAYER:                       Manifest: /usr/share/vulkan/implicit_layer.d/obs_vkcapture_64.json
LAYER:                       Library:  /usr/lib/libVkLayer_obs_vkcapture.so
LAYER:                 ||
LAYER:               VK_LAYER_MANGOHUD_overlay
LAYER:                       Type: Implicit
LAYER:                           Disable Env Var:  DISABLE_MANGOHUD
LAYER:                       Manifest: /usr/share/vulkan/implicit_layer.d/MangoHud.json
LAYER:                       Library:  /usr/$LIB/libMangoHud.so
LAYER:                 ||
DRIVER | LAYER:      <Device>
[obs-vkcapture] CreateDevice
DEBUG | DRIVER:   vkCreateDevice extension VK_KHR_get_physical_device_properties2 not available for devices associated with ICD libGLX_nvidia.so.0
DRIVER | LAYER:          Using "NVIDIA GeForce GTX 1070" with driver: "libGLX_nvidia.so.0"
[2022-12-19 20:16:54.163] [MANGOHUD] [info] [overlay.cpp:795] Uploading is disabled (permit_upload = 0)
[obs-vkcapture] CreateDevice VK_SUCCESS
[obs-vkcapture] CreateXlibSurfaceKHR
[obs-vkcapture] CreateSwapchainKHR VK_SUCCESS
[obs-vkcapture] GetSwapchainImagesKHR VK_SUCCESS
[obs-vkcapture] GetSwapchainImagesKHR VK_SUCCESS
[obs-vkcapture] DestroySwapchainKHR
[obs-vkcapture] CreateSwapchainKHR VK_SUCCESS
[obs-vkcapture] GetSwapchainImagesKHR VK_SUCCESS
[obs-vkcapture] GetSwapchainImagesKHR VK_SUCCESS
[obs-vkcapture] Texture VK_FORMAT_B8G8R8A8_UNORM 1366x768
[obs-vkcapture] Available modifiers:
[obs-vkcapture]  0: modifier:216172782119018517 planes:1
[obs-vkcapture]  1: modifier:216172782119018516 planes:1
[obs-vkcapture]  2: modifier:216172782119018515 planes:1
[obs-vkcapture]  3: modifier:216172782119018514 planes:1
[obs-vkcapture]  4: modifier:216172782119018513 planes:1
[obs-vkcapture]  5: modifier:216172782119018512 planes:1
[obs-vkcapture]  6: modifier:0 planes:1
[obs-vkcapture] Got planes 1 fd 511
[obs-vkcapture] Got modifier 216172782119018516
[obs-vkcapture] ------------------ vulkan capture started ------------------
mmbossoni commented 1 year ago

Interesting, using another issue workaround for ordering seems to make things work VK_ADD_LAYER_PATH=/usr/share/vulkan/implicit_layer.d VK_LOADER_LAYERS_ENABLE=VK_LAYER_OBSvkcapture*

nowrep commented 1 year ago

So, it's fixed now? :)

mmbossoni commented 1 year ago

Only if I force this ordering stuff. In that case I get Application -> Loader -> Mangohud -> vkcapture -> Device

When layers are In the case I get Application -> Loader -> vkcapture -> Mangohud -> Device it doesn't work (Dx11 applications never show it, dx 12 show it flickering). Don't know which is the proper ordering.

Probably same thing as https://github.com/nowrep/obs-vkcapture/issues/14?

nowrep commented 1 year ago

Yes, the ordering here is important.

mmbossoni commented 1 year ago

@nowrep , just for peace of mind: vkcapture should always be near device?

nowrep commented 1 year ago

It depends on if you want to capture other layers (mangohud) or not. So in this case, "near device" means it will capture what you see on the screen (including mangohud overlay).