nowrep / obs-vkcapture

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

Obs stops responding #112

Closed tonysilva16 closed 1 year ago

tonysilva16 commented 1 year ago

Hi,

I am trying to capture asseto corsa competizione using obs 28.x with the launch option: env OBS_VKCAPTURE_LINEAR=1 OBS_VKCAPTURE=1 %command%, but when i select the window to capture the game, obs stop responding. I dont know if i am doing something wrong, or if it was not supposed to work with my nvidia driver with this game.

I am running obs and steam using flatpak on a fedora system (x11)

The last log on obs:

info: [linux-vkcapture] Creating texture from dmabuf 1920x1080 modifier:0
info: [linux-vkcapture]  [0] fd:44 stride:7680 offset:0

Log from game:

 [obs-vkcapture] Texture VK_FORMAT_B8G8R8A8_UNORM 1920x1080
[obs-vkcapture] ------------------ vulkan capture started ------------------

Thanks.

nowrep commented 1 year ago

OBS hangs, but the game continues to run? Can you get a backtrace from obs process to see where it hangs?

tonysilva16 commented 1 year ago

Hello,

Yes the game continues to run fine, the obs game capture window (popup) stays black and unresponsive.

This GDB supports auto-downloading debuginfo from the following URLs:
https://debuginfod.fedoraproject.org/ 
Enable debuginfod for this session? (y or [n]) y
Debuginfod has been enabled.
To make this setting permanent, add 'set debuginfod enabled on' to .gdbinit.
Missing separate debuginfo for /usr/lib64/libobs-frontend-api.so.0
Try: dnf --enablerepo='*debug*' install /usr/lib/debug/.build-id/f3/e6839ea571bb1813bf99824bdb01683598df75.debug
Missing separate debuginfo for /usr/lib64/libobs.so.0
Try: dnf --enablerepo='*debug*' install /usr/lib/debug/.build-id/9c/357a4191f889efd46872319fc5844800a5630d.debug
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".
[New Thread 0x7fffddd876c0 (LWP 17474)]
[New Thread 0x7fffdd5866c0 (LWP 17475)]
[New Thread 0x7fffd7d8a6c0 (LWP 17477)]
[New Thread 0x7fffd75896c0 (LWP 17478)]
[New Thread 0x7fffd6d056c0 (LWP 17479)]
[Thread 0x7fffd6d056c0 (LWP 17479) exited]
debug: Found portal inhibitor
[New Thread 0x7fffd6d056c0 (LWP 17481)]
[New Thread 0x7fffd63da6c0 (LWP 17482)]
[New Thread 0x7fffd5bd96c0 (LWP 17483)]
[New Thread 0x7fffd53d86c0 (LWP 17484)]
Attempted path: share/obs/obs-studio/locale/en-US.ini
Attempted path: /usr/share/obs/obs-studio/locale/en-US.ini
Attempted path: share/obs/obs-studio/locale.ini
Attempted path: /usr/share/obs/obs-studio/locale.ini
Attempted path: share/obs/obs-studio/locale/pt-PT.ini
Attempted path: /usr/share/obs/obs-studio/locale/pt-PT.ini
info: Using preferred locale 'pt-PT'
Attempted path: share/obs/obs-studio/themes/Yami.qss
Attempted path: /usr/share/obs/obs-studio/themes/Yami.qss
info: Using EGL/X11
info: CPU Name: Intel(R) Core(TM) i7-7700 CPU @ 3.60GHz
info: CPU Speed: 4037.982MHz
info: Physical Cores: 4, Logical Cores: 8
info: Physical Memory: 15859MB Total, 201MB Free
info: Kernel Version: Linux 6.0.10-300.fc37.x86_64
info: Distribution: "Fedora Linux" 37
info: Session Type: x11
info: Window System: X11.0, Vendor: The X.Org Foundation, Version: 1.20.14
[New Thread 0x7fffd4bd76c0 (LWP 17485)]
[New Thread 0x7fffb3fff6c0 (LWP 17486)]
info: Qt Version: 5.15.7 (runtime), 5.15.7 (compiled)
info: Portable mode: false
Attempted path: share/obs/obs-studio/themes/Dark/no_sources.svg
Attempted path: /usr/share/obs/obs-studio/themes/Dark/no_sources.svg
QMetaObject::connectSlotsByName: No matching signal for on_tbar_position_valueChanged(int)
QMetaObject::connectSlotsByName: No matching signal for on_actionShowTransitionProperties_triggered()
QMetaObject::connectSlotsByName: No matching signal for on_actionHideTransitionProperties_triggered()
info: OBS 28.1.2 (linux)
info: ---------------------------------
info: ---------------------------------
info: audio settings reset:
    samples per sec: 48000
    speakers:        2
    max buffering:   960 milliseconds
    buffering type:  dynamically increasing
[New Thread 0x7fffb37fe6c0 (LWP 17487)]
Missing separate debuginfo for /usr/lib64/libobs-opengl.so.1
Try: dnf --enablerepo='*debug*' install /usr/lib/debug/.build-id/ca/46a0dc52716a5111c205d18a1aa0f52201ef99.debug
Missing separate debuginfo for /usr/lib64/libobsglad.so.1
Try: dnf --enablerepo='*debug*' install /usr/lib/debug/.build-id/ed/d8ca108216bc39aa1ae23043836175a3016b52.debug
info: ---------------------------------
info: Initializing OpenGL...
[New Thread 0x7fffb0dff6c0 (LWP 17488)]
[New Thread 0x7fffa93ff6c0 (LWP 17489)]
[New Thread 0x7fffa8bfe6c0 (LWP 17490)]
[New Thread 0x7fff9d3ff6c0 (LWP 17491)]
[New Thread 0x7fff9cbfe6c0 (LWP 17492)]
[New Thread 0x7fff8ffff6c0 (LWP 17493)]
[New Thread 0x7fff8f7fe6c0 (LWP 17494)]
[New Thread 0x7fff8effd6c0 (LWP 17495)]
info: Loading up OpenGL on adapter Intel Mesa Intel(R) HD Graphics 630 (KBL GT2)
info: OpenGL loaded successfully, version 4.6 (Core Profile) Mesa 22.2.3, shading language 4.60
info: ---------------------------------
info: video settings reset:
    base resolution:   1280x720
    output resolution: 1280x720
    downscale filter:  Bicubic
    fps:               30/1
    format:            NV12
    YUV mode:          Rec. 709/Partial
[New Thread 0x7fff8e7fc6c0 (LWP 17496)]
info: NV12 texture support not available
info: P010 texture support not available
[New Thread 0x7fff8d7fb6c0 (LWP 17497)]
info: Audio monitoring device:
    name: Predefinição
    id: default
info: ---------------------------------
Missing separate debuginfo for /usr//lib64/obs-plugins/decklink-captions.so
Try: dnf --enablerepo='*debug*' install /usr/lib/debug/.build-id/22/1e5bd4f8b27209b33cfdd0d0c5cf2cd86ad089.debug
warning: Failed to load 'en-US' text for module: 'decklink-captions.so'
Missing separate debuginfo for /usr//lib64/obs-plugins/decklink-output-ui.so
Try: dnf --enablerepo='*debug*' install /usr/lib/debug/.build-id/94/fb3c7557167bdaf1378678191750fe2a96152e.debug
warning: Failed to load 'en-US' text for module: 'decklink-output-ui.so'
Missing separate debuginfo for /usr//lib64/obs-plugins/decklink.so
Try: dnf --enablerepo='*debug*' install /usr/lib/debug/.build-id/3a/6c7a8054ad72151a95b89fd32d1c82e4a695d0.debug
libDeckLinkAPI.so: impossível abrir ficheiro-objecto partilhado: Ficheiro ou pasta inexistente
warning: A DeckLink iterator could not be created.  The DeckLink drivers may not be installed
warning: Failed to initialize module 'decklink.so'
Missing separate debuginfo for /usr//lib64/obs-plugins/frontend-tools.so
Try: dnf --enablerepo='*debug*' install /usr/lib/debug/.build-id/76/687673eccf1572e7a4a00778d0801d5772cde9.debug
Missing separate debuginfo for /usr/lib64/libobs-scripting.so.1
Try: dnf --enablerepo='*debug*' install /usr/lib/debug/.build-id/f3/10381c1a6aed42fcd51d48111d9e233a8d3bab.debug
[New Thread 0x7fff8cffa6c0 (LWP 17498)]
Missing separate debuginfo for /usr/lib64/obs-scripting/_obspython.so
Try: dnf --enablerepo='*debug*' install /usr/lib/debug/.build-id/c5/f81bdbdfff1099243467c34ea9b3cb97b53206.debug
Missing separate debuginfo for /usr//lib64/obs-plugins/image-source.so
Try: dnf --enablerepo='*debug*' install /usr/lib/debug/.build-id/17/2da063784c40707d588d05c2852e74279a575f.debug
Missing separate debuginfo for /usr//lib64/obs-plugins/linux-alsa.so
Try: dnf --enablerepo='*debug*' install /usr/lib/debug/.build-id/51/49703f4b9fb2e25d8cc4b1f1397c2cf023fc88.debug
Missing separate debuginfo for /usr//lib64/obs-plugins/linux-capture.so
Try: dnf --enablerepo='*debug*' install /usr/lib/debug/.build-id/c5/1f6eca3bf8870984d583f2ab98838b305a3f43.debug
Missing separate debuginfo for /usr//lib64/obs-plugins/linux-jack.so
Try: dnf --enablerepo='*debug*' install /usr/lib/debug/.build-id/d4/2ecbb85c3a487197b471077ccb93e0dff2b8f2.debug
Missing separate debuginfo for /usr//lib64/obs-plugins/linux-pipewire.so
Try: dnf --enablerepo='*debug*' install /usr/lib/debug/.build-id/35/13646b8ef4ecdbec04dbadb9ce53da58ce50d5.debug
info: [pipewire] Available captures:
info: [pipewire]     - Desktop capture
info: [pipewire]     - Window capture
Missing separate debuginfo for /usr//lib64/obs-plugins/linux-pulseaudio.so
Try: dnf --enablerepo='*debug*' install /usr/lib/debug/.build-id/7d/e9c21e643c9061574fdef5d9fbc77d8bde9ab3.debug
Missing separate debuginfo for /usr//lib64/obs-plugins/linux-v4l2.so
Try: dnf --enablerepo='*debug*' install /usr/lib/debug/.build-id/04/8bd1c8599a006b5cba1f0233ce194a05e6f419.debug
warning: Failed to load 'pt-PT' text for module: 'linux-vkcapture.so'
[New Thread 0x7fff6be746c0 (LWP 17499)]
info: [linux-vkcapture] plugin loaded successfully (version 1.2.1)
Missing separate debuginfo for /usr//lib64/obs-plugins/obs-ffmpeg.so
Try: dnf --enablerepo='*debug*' install /usr/lib/debug/.build-id/b1/0443b55a44616b97e75014adfdacb3096cd663.debug
info: NVENC supported
info: FFMPEG VAAPI supported
Missing separate debuginfo for /usr//lib64/obs-plugins/obs-filters.so
Try: dnf --enablerepo='*debug*' install /usr/lib/debug/.build-id/67/390628a8be2f25d4061e17aa7054bf12e07980.debug
Missing separate debuginfo for /usr//lib64/obs-plugins/obs-libfdk.so
Try: dnf --enablerepo='*debug*' install /usr/lib/debug/.build-id/43/bac704cc3f747c75399b24e992184314a57a47.debug
Missing separate debuginfo for /usr//lib64/obs-plugins/obs-outputs.so
Try: dnf --enablerepo='*debug*' install /usr/lib/debug/.build-id/b8/1e6f28665259805548d30f39b05488ec34f9b8.debug
Missing separate debuginfo for /usr//lib64/obs-plugins/obs-transitions.so
Try: dnf --enablerepo='*debug*' install /usr/lib/debug/.build-id/df/893033552b3b665e15cf4c90537258426535d1.debug
Missing separate debuginfo for /usr//lib64/obs-plugins/obs-vst.so
Try: dnf --enablerepo='*debug*' install /usr/lib/debug/.build-id/0a/bf25292dfdde6c8173b2eb6b5aef2e303ce50f.debug
Missing separate debuginfo for /usr//lib64/obs-plugins/obs-x264.so
Try: dnf --enablerepo='*debug*' install /usr/lib/debug/.build-id/26/7b02707eb26607f38228f81ed70e9fa83a0c65.debug
Missing separate debuginfo for /usr//lib64/obs-plugins/rtmp-services.so
Try: dnf --enablerepo='*debug*' install /usr/lib/debug/.build-id/33/6e9689939351a974a3af20f23b391a3946c62e.debug
[New Thread 0x7fff6956c6c0 (LWP 17500)]
[New Thread 0x7fff68d6b6c0 (LWP 17501)]
Missing separate debuginfo for /usr//lib64/obs-plugins/text-freetype2.so
Try: dnf --enablerepo='*debug*' install /usr/lib/debug/.build-id/90/8ca9c2b741d3813c8ce1b21d54529156ba5db5.debug
Missing separate debuginfo for /usr//lib64/obs-plugins/vlc-video.so
Try: dnf --enablerepo='*debug*' install /usr/lib/debug/.build-id/f3/3fdeaac8a7bbefbaed0e98fcc2e3fda05fe868.debug
error: os_dlopen(libvlc.so.5->libvlc.so.5): libvlc.so.5: impossível abrir ficheiro-objecto partilhado: Ficheiro ou pasta inexistente

info: [vlc-video]: Couldn't find VLC installation, VLC video source disabled
[Thread 0x7fff68d6b6c0 (LWP 17501) exited]
error: NvFBC is defunct on OBS version >= 28. Abort.
warning: Failed to initialize module 'nvfbc.so'
info: ---------------------------------
info:   Loaded Modules:
info:     vlc-video.so
info:     text-freetype2.so
info:     rtmp-services.so
info:     obs-x264.so
info:     obs-vst.so
info:     obs-transitions.so
info:     obs-outputs.so
info:     obs-libfdk.so
info:     obs-filters.so
info:     obs-ffmpeg.so
info:     linux-vkcapture.so
info:     linux-v4l2.so
info:     linux-pulseaudio.so
info:     linux-pipewire.so
info:     linux-jack.so
info:     linux-capture.so
info:     linux-alsa.so
info:     image-source.so
info:     frontend-tools.so
info:     decklink-output-ui.so
info:     decklink-captions.so
info: ---------------------------------
QLayout: Attempting to add QLayout "" to OBSBasic "OBSBasic", which already has a layout
QWidget::setTabOrder: 'first' and 'second' must be in the same window
info: ==== Startup complete ===============================================
info: All scene data cleared
info: ------------------------------------------------
[New Thread 0x7fff68d6b6c0 (LWP 17502)]
info: pulse-input: Server name: 'PulseAudio (on PipeWire 0.3.61) 15.0.0'
info: pulse-input: Audio format: s32le, 48000 Hz, 2 channels
info: pulse-input: Started recording from 'alsa_output.pci-0000_00_1f.3.analog-stereo.monitor' (default)
info: [Loaded global audio device]: 'Áudio da área de trabalho'
info: pulse-input: Server name: 'PulseAudio (on PipeWire 0.3.61) 15.0.0'
info: pulse-input: Audio format: s16le, 48000 Hz, 1 channels
info: pulse-input: Started recording from 'alsa_input.usb-MUSIC-BOOST_Trust_GXT_232_Microphone-00.mono-fallback' (default)
info: [Loaded global audio device]: 'Microfone/Auxiliar'
info: Switched to scene 'Cena'
info: ------------------------------------------------
info: Loaded scenes:
info: - scene 'Cena':
info:     - source: 'Game Capture' (vkcapture-source)
info: ------------------------------------------------
[New Thread 0x7fff57fff6c0 (LWP 17503)]
[New Thread 0x7fff577fe6c0 (LWP 17504)]
[New Thread 0x7fff56ffd6c0 (LWP 17505)]
[New Thread 0x7fff567fc6c0 (LWP 17506)]
[New Thread 0x7fff55ffb6c0 (LWP 17507)]
[New Thread 0x7fff557fa6c0 (LWP 17508)]
[New Thread 0x7fff54ff96c0 (LWP 17509)]
Attempted path: share/obs/obs-studio/images/overflow.png
Attempted path: /usr/share/obs/obs-studio/images/overflow.png
[Thread 0x7fff6956c6c0 (LWP 17500) exited]
info: adding 42 milliseconds of audio buffering, total audio buffering is now 42 milliseconds (source: Áudio da área de trabalho)

info: [linux-vkcapture] Creating texture from dmabuf 1920x1080 modifier:0
info: [linux-vkcapture]  [0] fd:48 stride:7680 offset:0
[Thread 0x7fff8d7fb6c0 (LWP 17497) exited]
[Thread 0x7fffd53d86c0 (LWP 17484) exited]
[Thread 0x7fffd5bd96c0 (LWP 17483) exited]
[Thread 0x7fffd63da6c0 (LWP 17482) exited]
[Thread 0x7fffd6d056c0 (LWP 17481) exited]
^C
Thread 1 "obs" received signal SIGINT, Interrupt.
futex_wait (private=0, expected=2, futex_word=0x5555561ae190) at ../sysdeps/nptl/futex-internal.h:146
146   int err = lll_futex_timed_wait (futex_word, expected, NULL, private);
Missing separate debuginfos, use: dnf debuginfo-install ffmpeg-libs-5.1.2-3.fc37.x86_64 libavdevice-5.1.2-3.fc37.x86_64 libftl-0.9.14-11.fc37.x86_64 opencore-amr-0.1.6-2.fc37.x86_64 vo-amrwbenc-0.1.3-17.fc37.x86_64 x264-libs-0.164-3.20220602gitbaee400f.fc37.x86_64 x265-libs-3.5-4.fc37.x86_64 xvidcore-1.3.7-8.fc37.x86_64
(gdb) bt
#0  futex_wait (private=0, expected=2, futex_word=0x5555561ae190) at ../sysdeps/nptl/futex-internal.h:146
#1  __GI___lll_lock_wait (futex=futex@entry=0x5555561ae190, private=0) at lowlevellock.c:49
#2  0x00007ffff44b1432 in lll_mutex_lock_optimized (mutex=0x5555561ae190) at pthread_mutex_lock.c:48
#3  ___pthread_mutex_lock (mutex=0x5555561ae190) at pthread_mutex_lock.c:93
#4  0x00007ffff69ab3d7 in gs_enter_context () from /usr/lib64/libobs.so.0
#5  0x00007ffff6971deb in obs_display_create () from /usr/lib64/libobs.so.0
#6  0x000055555561dc0d in OBSQTDisplay::CreateDisplay (this=0x5555575ecb50, force=<optimized out>)
    at /usr/src/debug/obs-studio-28.1.2-2.fc37.x86_64/UI/qt-display.cpp:179
#7  0x000055555561de17 in OBSQTDisplay::paintEvent (this=0x5555575ecb50, event=0x7fffffffc940)
    at /usr/src/debug/obs-studio-28.1.2-2.fc37.x86_64/UI/qt-display.cpp:186
#8  0x00007ffff59f1818 in QWidget::event (this=0x5555575ecb50, event=0x7fffffffc940) at kernel/qwidget.cpp:9043
#9  0x00007ffff59aed12 in QApplicationPrivate::notify_helper (this=<optimized out>, receiver=0x5555575ecb50, e=0x7fffffffc940)
    at kernel/qapplication.cpp:3637
#10 0x00007ffff4ca8278 in QCoreApplication::notifyInternal2 (receiver=0x5555575ecb50, event=0x7fffffffc940) at kernel/qcoreapplication.cpp:1064
#11 0x00007ffff59e9ab9 in QWidgetPrivate::sendPaintEvent (this=this@entry=0x5555576c7760, toBePainted=...) at kernel/qwidget.cpp:5477
#12 0x00007ffff59ea801 in QWidgetPrivate::drawWidget (this=0x5555576c7760, pdev=0x5555575ecb60, rgn=..., offset=..., flags=..., 
    sharedPainter=<optimized out>, repaintManager=<optimized out>) at kernel/qwidget.cpp:5427
#13 0x00007ffff59eaf73 in QWidgetPrivate::paintOnScreen (this=0x5555576c7760, rgn=...) at kernel/qwidget.cpp:1801
#14 0x00007ffff5a0e22c in QWidgetWindow::event (this=0x5555576be4c0, event=0x7fffffffccc0) at kernel/qwidgetwindow.cpp:347
#15 0x00007ffff59aed12 in QApplicationPrivate::notify_helper (this=<optimized out>, receiver=0x5555576be4c0, e=0x7fffffffccc0)
    at kernel/qapplication.cpp:3637
#16 0x00007ffff4ca8278 in QCoreApplication::notifyInternal2 (receiver=0x5555576be4c0, event=0x7fffffffccc0) at kernel/qcoreapplication.cpp:1064
#17 0x00007ffff516c1a5 in QGuiApplicationPrivate::processExposeEvent (e=0x555557701590) at kernel/qguiapplication.cpp:3254
#18 0x00007ffff514a02c in QWindowSystemInterface::sendWindowSystemEvents (flags=flags@entry=...) at kernel/qwindowsysteminterface.cpp:1169
#19 0x00007fffddf178de in xcbSourceDispatch (source=<optimized out>) at qxcbeventdispatcher.cpp:105
#20 0x00007ffff3916cbf in g_main_dispatch (context=0x7fffd8005010) at ../glib/gmain.c:3444
#21 g_main_context_dispatch (context=0x7fffd8005010) at ../glib/gmain.c:4162
#22 0x00007ffff396c598 in g_main_context_iterate.constprop.0 (context=0x7fffd8005010, block=1, dispatch=1, self=<optimized out>)
    at ../glib/gmain.c:4238
#23 0x00007ffff3913f40 in g_main_context_iteration (context=0x7fffd8005010, may_block=1) at ../glib/gmain.c:4303
#24 0x00007ffff4cf938a in QEventDispatcherGlib::processEvents (this=0x555555ac8800, flags=...) at kernel/qeventdispatcher_glib.cpp:423
#25 0x00007ffff4ca6cca in QEventLoop::exec (this=this@entry=0x7fffffffcf90, flags=..., flags@entry=...)
    at ../../include/QtCore/../../src/corelib/global/qflags.h:69
#26 0x00007ffff4caed92 in QCoreApplication::exec () at ../../include/QtCore/../../src/corelib/global/qflags.h:121
#27 0x00007ffff515fbe0 in QGuiApplication::exec () at kernel/qguiapplication.cpp:1863
#28 0x00007ffff59aec89 in QApplication::exec () at kernel/qapplication.cpp:2829
#29 0x00005555555eb44d in run_program (argv=<optimized out>, argc=<optimized out>, logFile=...)
    at /usr/src/debug/obs-studio-28.1.2-2.fc37.x86_64/UI/obs-app.cpp:2357
--Type <RET> for more, q to quit, c to continue without paging--c
#30 main (argc=<optimized out>, argv=<optimized out>) at /usr/src/debug/obs-studio-28.1.2-2.fc37.x86_64/UI/obs-app.cpp:3244

I am not sure if this is what you are looking for, i typed the command OBS_USE_EGL=1 gdb -ex=r --args obs and when it hangs i pressed ctrl + c and types bt.

nowrep commented 1 year ago

Yes, thank you. In this case I'll need you to type thread apply all bt.

Also, can you try to run OBS on your nvidia gpu (same as the game)? From the log it looks like it is running on the intel gpu.

tonysilva16 commented 1 year ago

Well running obs on the nvidia graphics fixed it, i am now getting but i guess is a nvidia problem now.

info: [linux-vkcapture] Creating texture from dmabuf 1920x1080 modifier:0
info: [linux-vkcapture]  [0] fd:18 stride:7680 offset:0
error: glEGLImageTargetTexture2DOES failed, glGetError returned GL_INVALID_OPERATION(0x502)
error: [linux-vkcapture] Could not create texture from dmabuf source
nowrep commented 1 year ago

Please try with and without OBS_VKCAPTURE_LINEAR=1. Also please get a full backtrace (type thread apply all bt instead of just bt after it hangs in gdb) when running obs on intel gpu.

tonysilva16 commented 1 year ago

Running the game without OBS_VKCAPTURE_LINEAR=1 fixed the issue and is working. I rebooted the system to always use the primary gpu, and i am not sure how to start obs without using the nvidia gpu, without rebooting again, but i can do it later and post the logs here.

Thanks for the help, it didint even cross my mind to run obs using nvidia gpu.