Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

obs-glcapture Fails to Capture #16

Closed
ibrokemypie opened this issue Jul 1, 2021 · 7 comments
Closed

obs-glcapture Fails to Capture #16

ibrokemypie opened this issue Jul 1, 2021 · 7 comments

Comments

@ibrokemypie
Copy link

When trying to use obs-glcapture to capture anything (including glxgears) I just get this output:

[obs-vkcapture] Init 0.7
297 shaders loaded in 0.3716s
[obs-vkcapture] Texture GL_RGBA 1920x1080
[obs-vkcapture] Failed to get buffer from pixmap
[obs-vkcapture] shtex init failed
[obs-vkcapture] gl_init failed
[obs-vkcapture] Texture GL_RGBA 1920x1080
[obs-vkcapture] Failed to get buffer from pixmap
[obs-vkcapture] shtex init failed
[obs-vkcapture] gl_init failed
[obs-vkcapture] Texture GL_RGBA 1920x1080
[obs-vkcapture] Failed to get buffer from pixmap
[obs-vkcapture] shtex init failed
[obs-vkcapture] gl_init failed
[obs-vkcapture] Texture GL_RGBA 1920x1080
[obs-vkcapture] Failed to get buffer from pixmap
[obs-vkcapture] shtex init failed
[obs-vkcapture] gl_init failed
[obs-vkcapture] Texture GL_RGBA 1920x1080
[obs-vkcapture] Failed to get buffer from pixmap
[obs-vkcapture] shtex init failed
[obs-vkcapture] gl_init failed

This is on an amd vega card with the latest mesa and amdgpu drivers

@nowrep
Copy link
Owner

nowrep commented Jul 1, 2021

Do you have DRI3 enabled?

xdpyinfo | grep DRI3

@ibrokemypie
Copy link
Author

yep

xdpyinfo | grep DRI3
    DRI3

@nowrep
Copy link
Owner

nowrep commented Jul 1, 2021

diff --git a/src/glinject.c b/src/glinject.c
index 7bdc8f8..abedc57 100644
--- a/src/glinject.c
+++ b/src/glinject.c
@@ -28,6 +28,8 @@ with this program. If not, see <https://www.gnu.org/licenses/>
 #include <unistd.h>
 #include <stdlib.h>
 
+#include <xcb/xcb.h>
+
 static bool gl_seen = false;
 static bool gl_loaded = false;
 static struct egl_funcs egl_f;
@@ -313,8 +315,10 @@ static bool gl_shtex_init()
         glx_f.BindTexImageEXT(data.display, data.glxpixmap, P_GLX_FRONT_LEFT_EXT, NULL);
 
         void *cookie = x11_f.xcb_dri3_buffer_from_pixmap(data.xcb_con, data.xpixmap);
-        P_xcb_dri3_buffer_from_pixmap_reply_t *reply = x11_f.xcb_dri3_buffer_from_pixmap_reply(data.xcb_con, cookie, NULL);
+        xcb_generic_error_t *err;
+        P_xcb_dri3_buffer_from_pixmap_reply_t *reply = x11_f.xcb_dri3_buffer_from_pixmap_reply(data.xcb_con, cookie, &err);
         if (!reply) {
+            hlog("error: %d", err->error_code);
             hlog("Failed to get buffer from pixmap");
             return false;
         }

Can you post output with this patch applied?

@ibrokemypie
Copy link
Author

The output is

[obs-vkcapture] Init 0.7
[obs-vkcapture] Texture GL_RGBA 920x490
[obs-vkcapture] error: 4
[obs-vkcapture] Failed to get buffer from pixmap
[obs-vkcapture] shtex init failed
[obs-vkcapture] gl_init failed
[obs-vkcapture] Texture GL_RGBA 920x490
[obs-vkcapture] error: 4
[obs-vkcapture] Failed to get buffer from pixmap
[obs-vkcapture] shtex init failed
[obs-vkcapture] gl_init failed
[obs-vkcapture] Texture GL_RGBA 920x490
[obs-vkcapture] error: 4

@nowrep
Copy link
Owner

nowrep commented Jul 12, 2021

I'm not really sure how to debug this, but just to make sure: Does it work with EGL (obs-glcapture eglgears_x11) and Vulkan (obs-vkcapture vkcube)?

@nowrep
Copy link
Owner

nowrep commented Jul 18, 2021

Ok I actually got hit by this, when running on XWayland. Any chance it was on XWayland in your case too?

@nowrep
Copy link
Owner

nowrep commented Jul 18, 2021

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants