w23 / obs-kmsgrab

"Zero-copy" Linux screen capture plugin for OBS that uses libdrm and dmabuf
GNU General Public License v2.0
77 stars 13 forks source link

Installation troubles #1

Closed SolitudeSF closed 3 years ago

SolitudeSF commented 3 years ago

Having built/installed both obs-studio and this plugin no new source appears in obs. What is the exact place the files should be placed to? because it doesnt look like installing places them correctly.

w23 commented 3 years ago
  1. Check whether there's a linux-kmsgrab.so in <prefix>/lib*/obs-plugins/, and that there are other plugin sos there too. If not, try previous (https://github.com/w23/obs-kmsgrab/commit/8829f03d936dbc8823d806b44a35f4864c34e69a) commit. I'm still trying to figure out what would be the correct CMake install rule for this.
  2. Have you performed the sudo setcap cap_sys_admin+ep "$CMAKE_PREFIX_PATH/bin/obs-kmsgrab-send" command manually? It's missing from CMake rules currently (would make cmake require sudo, which is not great).
w23 commented 3 years ago

for (1) you can alternatively manually copy the linux-kmsgrab.so to where other plugins are.

SolitudeSF commented 3 years ago

i moved .so to other plugins and setcapped the binary to no effect. maybe it has to do with UNIX_STRUCTURE=0 i built obs with, since thats was listen on wiki. yes, with UNIX_STRUCTURE=1 files are installed correctly. but for some reason obs itself stopped working.

w23 commented 3 years ago

Interesting. It should be completely agnostic to UNIX_STRUCTURE, unless there's something weird with obs-plugintemplate resources installation. I'll look into that. Thanks!

For UNIX_STRUCTURE=0 you have to manually cd into where obs binary is and run it from there.

SolitudeSF commented 3 years ago

in the process of trying to make it work i irreversibly killed my system, so had to reinstall. thats a first one in many years. guessing some volatile part of my setup misinteracted with setcapped binary.

obs allows installing plugins in user directory under $XDG_CONFIG_DIR/obs/plugins. is that a supported scenario here? because that didnt work for me either.

w23 commented 3 years ago

Sorry to hear that. It's hard to imagine how a single setcapped binary could affect the rest of the system though.

Currently, as it is still very experimental, the user-specific XDG_ path is not really supported -- you still need to place the send setcapped binary alongside the obs binary. It's just hardcoded this way. I was planning to change that though, and maybe relax the setcap requirement by replacing it with polkit-sudo or something.

w23 commented 3 years ago

I've tried to address installation destination and binary location issues. If it's still relevant, you can try grabbing the latest master. It also tries to use pkexec instead of setcap'ped binary.

SolitudeSF commented 3 years ago

It's hard to imagine how a single setcapped binary could affect the rest of the system though.

yeah, its wasnt that.

i managed to get linux-kmsgrab to appear in loadeded modules, ~~but no new input source is present.~~ i see: error: [linux-kmsgrab] linux-dmabuf cannot run on non-EGL platforms. what am i missing

w23 commented 3 years ago

You need to somehow force EGL mode. It's automatically on for Wayland (there's no GLX, only EGL). I haven't looked how it's done in master. My fork used to have EGL/GLX switch in Settings.

SolitudeSF commented 3 years ago

i made obs run in EGL mode with OBS_USE_EGL=1 but when i add DMA-BUF source it crashes with obs: symbol lookup error: /home/solitude/app/obs/usr/lib/obs-plugins/linux-kmsgrab.so: undefined symbol: eglGetProcAddress

w23 commented 3 years ago

Hmm. If OBS is using EGL, then this function should have been linked into current process already. Anyway, I've updated this plugin to not depend on EGL directly at all, and use the gs_texture_create_from_dmabuf function provided by OBS. This should fix this particular issue.

SolitudeSF commented 3 years ago

yes, that fixed it. i had to point it to my discrete gpu, but after that it worked. thank you for you time.