[SOLVED} Looking glass obs plugin crashing obs

This might be better posted on an obs forum, however I’ll try here first.

I can build the obs-plugin and install it into my local user following the docs, without errors. So I suspect it’s building fine. I followed: OBS plugin — Looking Glass B4 documentation

When I select the Looking Glass source in obs I get a segfault at ivshmemOpenDev.

#0  0x00007fff7806b930 in ivshmemOpenDev () at /home/m/.config/obs-studio/plugins/looking-glass-obs/bin/64bit/liblooking-glass-obs.so

I can run the looking-glass-client no problems and have access to the kvmfr0 device.

[m@m-q35-arch: ~/Downloads/Drivers/looking-glass-B4-rc3/obs]$ ls -al /dev/kvmfr0 
crw-rw---- 1 m m 234, 0 Oct 17 14:41 /dev/kvmfr0

I guess there might be something with the common/ivshmem.h is not working as expected. Purely based on ivshmemOpenDev() bring defined in there. I’m sort of out of my depth here…

I’m running in a VM->VM setup. Do I need to update the device in lg.c? I tried both the default /dev/shm/looking-glass and my /dev/kvmfr0 devices and both have the same result.
163 obs_data_set_default_string(defaults, "shmFile", "/dev/kvmfr0");

The build looks like this:

[m@m-q35-arch: ~/Downloads/Drivers/looking-glass-B4-rc3/obs/build]$ cmake ..
-- BFD libs: /usr/lib/libbfd.so
-- BFD libs: /usr/lib/libbfd.so
-- The following features have been enabled:

 * ENABLE_BACKTRACE, Backtrace support.

-- Configuring done
-- Generating done
-- Build files have been written to: /home/m/Downloads/Drivers/looking-glass-B4-rc3/obs/build
[m@m-q35-arch: ~/Downloads/Drivers/looking-glass-B4-rc3/obs/build]$ make clean
[m@m-q35-arch: ~/Downloads/Drivers/looking-glass-B4-rc3/obs/build]$ make 
[  4%] Building C object lgmp/CMakeFiles/lgmp.dir/src/host.c.o
[  8%] Building C object lgmp/CMakeFiles/lgmp.dir/src/client.c.o
[ 12%] Building C object lgmp/CMakeFiles/lgmp.dir/src/status.c.o
[ 16%] Linking C static library liblgmp.a
[ 16%] Built target lgmp
[ 20%] Building C object common/src/platform/linux/CMakeFiles/lg_common_platform_code.dir/debug.c.o
[ 24%] Building C object common/src/platform/linux/CMakeFiles/lg_common_platform_code.dir/crash.c.o
[ 28%] Building C object common/src/platform/linux/CMakeFiles/lg_common_platform_code.dir/sysinfo.c.o
[ 32%] Building C object common/src/platform/linux/CMakeFiles/lg_common_platform_code.dir/thread.c.o
[ 36%] Building C object common/src/platform/linux/CMakeFiles/lg_common_platform_code.dir/event.c.o
[ 40%] Building C object common/src/platform/linux/CMakeFiles/lg_common_platform_code.dir/ivshmem.c.o
[ 44%] Building C object common/src/platform/linux/CMakeFiles/lg_common_platform_code.dir/time.c.o
[ 48%] Linking C static library liblg_common_platform_code.a
[ 48%] Built target lg_common_platform_code
[ 52%] Building C object common/CMakeFiles/lg_common.dir/src/stringutils.c.o
[ 56%] Building C object common/CMakeFiles/lg_common.dir/src/stringlist.c.o
[ 60%] Building C object common/CMakeFiles/lg_common.dir/src/option.c.o
[ 64%] Building C object common/CMakeFiles/lg_common.dir/src/framebuffer.c.o
[ 68%] Building C object common/CMakeFiles/lg_common.dir/src/KVMFR.c.o
[ 72%] Building C object common/CMakeFiles/lg_common.dir/src/countedbuffer.c.o
[ 76%] Building C object common/CMakeFiles/lg_common.dir/src/runningavg.c.o
[ 80%] Linking C static library liblg_common.a
[ 80%] Built target lg_common
[ 84%] Generating version.c, _version.c
[ 84%] Generating version.c, _version.c
[ 88%] Building C object CMakeFiles/looking-glass-obs.dir/version.c.o
[ 92%] Building C object CMakeFiles/looking-glass-obs.dir/main.c.o
[ 96%] Building C object CMakeFiles/looking-glass-obs.dir/lg.c.o
[100%] Linking C shared library liblooking-glass-obs.so
[100%] Built target looking-glass-obs

Why are you using the “Release Candidate”? This is older then B4.

Please update then try again

Will update and try again. Thanks!

It was probably an oversight and downloaded rc3 by mistake. Is it worth removing the rc version once it gets promoted to release?
i.e. b4-rc3 is older than b4, but b4-rc3 is still available for dl. This might be (lazy on my side) how I came to get rc3 as I probably didn’t check the rc version was behind the stable release.

I actually just came up with a solution to this over the weekend:

I have a 3 monitor setup, but I’m sure this can be tailored to less

I have my monitors in | Linux | Windows | Linux | arrangement, with the middle monitor disabled. What I did was reenable that middle monitor, but place it “below” the others with xrandr, allowing synergy to never accidentally go into that monitor.

I then switched my middle monitor input to Linux, opened looking glass, got obs capturing it, and then switched back to Windows.

This gave me a near 0 delay and it was no different than normal for me because I was still using my windows monitor input as normal.

Honestly worked perfectly and was very easy to setup once I came up with the idea.

What does this have to do with the topic here??

This is very inefficient and will bog your system down as you’re capturing twice now. The LG OBS plugin leverages the fact that the captured screen is already in RAM and just uses it directly. You also don’t need to mess around with your monitor setup, or even have a monitor.

No, they are retained so people can roll back through versions if a bug cropped up they didn’t notice until later.

1 Like

building the B4 version (non rc3) works perfectly.

1 Like