nowrep / obs-vkcapture

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

obs-vkcapture doesn't capture with Proton and dxvk git #73

Closed CartoonFan closed 2 years ago

CartoonFan commented 2 years ago

Hey there! I recently became aware that obs-vkcapture stopped working with Proton after dxvk started using Vulkan 1.3 (post-1.10.2, basically). I discovered the bug with proton-tkg (https://github.com/Frogging-Family/wine-tkg-git) and a recent dxvk commit; Proton-7.0 and Proton-GE 7.24, which likely use the latest dxvk release, work normally. Native games also seem to work fine.

From what I read, it seems like it might be enough to just bump the version number in src/obs_vkcapture.json.in. I've put the relevant information and the logs below. Thanks!

OS: Arch Linux GPU: Nvidia GTX 960 Game: The Cat and the Coup (Steam ID# 95700, freely available) steam-95700_proton_7_0.log steam-95700_proton_ge_7_24.log steam-95700_proton_tkg.log 2022-07-17_15-20-11_vkcapture.txt

nowrep commented 2 years ago

From what I read, it seems like it might be enough to just bump the version number in src/obs_vkcapture.json.in. I've put the relevant information and the logs below. Thanks!

That has nothing to do with it. It's backwards compatible. EDIT: Actually it has everything to do with it, api_version is the maximum supported version by the layer. If an application asks higher version, the layer will not be loaded.

I see nothing wrong with the logs, TheCatAndTheCoup seems to not be using Vulkan (OpenGL instead?) but others show successfully starting capture.

CartoonFan commented 2 years ago

From what I read, it seems like it might be enough to just bump the version number in src/obs_vkcapture.json.in. I've put the relevant information and the logs below. Thanks!

That has nothing to do with it. It's backwards compatible.

I see nothing wrong with the logs, TheCatAndTheCoup seems to not be using Vulkan (OpenGL instead?) but others show successfully starting capture.

Hmm...I don't know if I can agree with you there.

Both regular proton and proton-GE show:

[obs-vkcapture] Init Vulkan 1.1.3
30153.891:0138:013c:trace:loaddll:free_modref Unloaded module L"C:\\windows\\system32\\wineopenxr.dll" : builtin
[obs-vkcapture] Injecting VK_KHR_bind_memory2 extension
[obs-vkcapture] Injecting VK_KHR_get_memory_requirements2 extension
[obs-vkcapture] Injecting VK_EXT_image_drm_format_modifier extension

While proton-tkg (the one with the post-1.10.2 dxvk) simply shows:

[obs-vkcapture] Init Vulkan 1.1.3
[obs-vkcapture] Init Vulkan 1.1.3

dxvk's HUD also shows the game using Vulkan: 2022-07-19_11-21_the_cat_and_the_coup_dxvk_1_10_2

I gathered some more logs, as well.

proton-tkg 7.13.r1.g7a2920aa w/ dxvk 1.10.2 (works with vkcapture): steam-95700_proton_tkg_7_13_r1_dxvk_1_10_2.log

proton-tkg 7.13.r1.g7a2920aa w/ dxvk commit 2d937600 (doesn't work with vkcapture): steam-95700_proton_tkg_7_13_r1_dxvk_2d937600.log

nowrep commented 2 years ago

Hmm alright. Does actually changing the number in the json file make it work?

CartoonFan commented 2 years ago

Haha, about that...I actually haven't been able to build from source, even before this :sweat_smile: . I've been using chaotic-aur for both vkcapture-git and obs-studio-git (OBS version is 27.2.0.177-1); the AUR build always fails because it can't find libObs:

$ paru -S aur/obs-vkcapture-git
:: Resolving dependencies...
:: Calculating conflicts...
:: Calculating inner conflicts...

Aur (1)                Old Version     New Version    Make Only
aur/obs-vkcapture-git  r190.4db87cf-1  r46.0645e74-1  No

:: Proceed with installation? [Y/n]: 

:: Downloading PKGBUILDs...
 PKGBUILDs up to date
fetching devel info...
==> Making package: obs-vkcapture-git r46.0645e74-1 (Tue 19 Jul 2022 02:05:03 PM PDT)
==> Retrieving sources...
  -> Updating obs-vkcapture git repo...
==> Validating source files with sha512sums...
    obs-vkcapture ... Skipped
==> Making package: obs-vkcapture-git r46.0645e74-1 (Tue 19 Jul 2022 02:05:05 PM PDT)
==> Checking runtime dependencies...
==> Checking buildtime dependencies...
==> Retrieving sources...
  -> Updating obs-vkcapture git repo...
==> Validating source files with sha512sums...
    obs-vkcapture ... Skipped
==> Removing existing $srcdir/ directory...
==> Extracting sources...
  -> Creating working copy of obs-vkcapture git repo...
Cloning into 'obs-vkcapture'...
done.
==> Starting pkgver()...
==> Updated version: obs-vkcapture-git r190.4db87cf-1
==> Sources are ready.
obs-vkcapture-git-r46.0645e74-1: parsing pkg list...
==> Making package: obs-vkcapture-git r190.4db87cf-1 (Tue 19 Jul 2022 02:05:10 PM PDT)
==> Checking runtime dependencies...
==> Checking buildtime dependencies...
==> WARNING: Using existing $srcdir/ tree
==> Starting pkgver()...
==> Removing existing $pkgdir/ directory...
==> Starting build()...
-- The C compiler identification is GNU 12.1.0
-- The CXX compiler identification is GNU 12.1.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/lib/ccache/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/lib/ccache/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found Vulkan: /lib/libvulkan.so (found version "1.3.221") found components: glslc glslangValidator 
-- Found OpenGL: /usr/lib/libOpenGL.so   
-- Found PkgConfig: /usr/bin/pkg-config (found version "1.8.0") 
-- Checking for module 'x11'
--   Found x11, version 1.8.1
-- Checking for module 'xcb'
--   Found xcb, version 1.15
-- Checking for module 'xcb-xfixes'
--   Found xcb-xfixes, version 1.15
-- Checking for module 'wayland-client'
--   Found wayland-client, version 1.21.0
CMake Error at CMakeLists.txt:44 (find_package):
  By not providing "FindLibObs.cmake" in CMAKE_MODULE_PATH this project has
  asked CMake to find a package configuration file provided by "LibObs", but
  CMake did not find one.

  Could not find a package configuration file provided by "LibObs" with any
  of the following names:

    LibObsConfig.cmake
    libobs-config.cmake

  Add the installation prefix of "LibObs" to CMAKE_PREFIX_PATH or set
  "LibObs_DIR" to a directory containing one of the above files.  If "LibObs"
  provides a separate development package or SDK, be sure it has been
  installed.

-- Configuring incomplete, errors occurred!
See also "/home/jeremiah/.cache/paru/clone/obs-vkcapture-git/src/build/CMakeFiles/CMakeOutput.log".
==> ERROR: A failure occurred in build().
    Aborting...
error: failed to build 'obs-vkcapture-git-r46.0645e74-1': 
error: packages failed to build: obs-vkcapture-git-r46.0645e74-1

Log file is here: CMakeOutput.log

I know it's not directly tied to this issue, but I'm assuming that I'll need to be able to compile the program to test the changes, right?

nowrep commented 2 years ago

You can just edit the installed file at /usr/share/vulkan/implicit_layer.d/obs_vkcapture_64.json. And yes, it doesn't build with the AUR obs.

CartoonFan commented 2 years ago

Thanks for the heads up. Changing the api_version in that file to "1.3.217" seemed to make vkcapture work with that dxvk commit. So...problem solved, I guess?

nowrep commented 2 years ago

Build with OBS master should be fixed now too, can you please test it?

CartoonFan commented 2 years ago

Building seems to work, and the original game still shows up in the OBS preview. However, I also tested with Rabi-Ribi (Steam ID#400910) and that one doesn't seem to be picked up by OBS. To my knowledge, it was working properly before :face_with_spiral_eyes:

I've got a log again. Does this seem like a separate bug? steam-400910_proton_tkg_dxvk_git.log .

nowrep commented 2 years ago

Can you try building from master again, I've changed the api_version to be set to Vulkan version that was used to build with.

CartoonFan commented 2 years ago

Still the same results, unfortunately.

Here's the latest log: steam-400910_proton_tkg_dxvk_git_2.log

nowrep commented 2 years ago

Ok, I assume changing the api_version back to 1.2.135 makes no difference, right?

CartoonFan commented 2 years ago

That looks to be the case :frowning_face:

nowrep commented 2 years ago

Alright, please make a new issue and try again with the older version if it worked there.

nowrep commented 2 years ago

Or maybe also try with api_version 1.3.0, that's what mangohud is using.

CartoonFan commented 2 years ago

Will do. Thanks for all your help!

CartoonFan commented 2 years ago

Or maybe also try with api_version 1.3.0, that's what mangohud is using.

No dice. Looks like I'll still have to make a new issue :smile:

nowrep commented 2 years ago

If you run with VK_LOADER_DEBUG=all env variable it will tell us why the layer wasn't loaded.