WarmUpTill / SceneSwitcher

An automation tool for OBS Studio
https://obsproject.com/forum/resources/automatic-scene-switching.395/
GNU General Public License v2.0
990 stars 79 forks source link

unresolvable reference to symbol XScreenSaverQueryInfo #601

Closed eribertomota closed 2 years ago

eribertomota commented 2 years ago

Hi @WarmUpTill,

I don't know if this issue was already solved. However, in 1.19.2, when building, I am getting the following warning:

dpkg-shlibdeps: warning: debian/obs-advanced-scene-switcher/usr/lib/x86_64-linux-gnu/obs-plugins/advanced-scene-switcher-lib.so.1 contains an unresolvable reference to symbol XScreenSaverQueryInfo: it's probably a plugin
dpkg-shlibdeps: warning: 1 similar warning has been skipped (use -v to see it)

When running OBS, I can see:

error: os_dlopen(/usr//lib/x86_64-linux-gnu/obs-plugins/advanced-scene-switcher-lib.so->/usr//lib/x86_64-linux-gnu/obs-plugins/advanced-scene-switcher-lib.so): /usr//lib/x86_64-linux-gnu/obs-plugins/advanced-scene-switcher-lib.so: undefined symbol: XScreenSaverAllocInfo

warning: Module '/usr//lib/x86_64-linux-gnu/obs-plugins/libadvanced-scene-switcher.so' not loaded

This problem occurs with libproc2-dev (Debian Experimental) and libprocps-dev (Debian Unstable). I don't know if this extra lintian message is correlated to the problem: package-has-unnecessary-activation-of-ldconfig-trigger[1].

[1] https://lintian.debian.org/tags/package-has-unnecessary-activation-of-ldconfig-trigger

Thanks in advance.

Regards,

Eriberto

WarmUpTill commented 2 years ago

Hello, usually the XScreenSaverAllocInfo function and others should be available in libXss.so. Is this library no longer available in the Debian Experimental / Debian Unstable?

In the linked PR I made this dependency optional by only trying to resolve the symbols at runtime instead of at build time. The only functionality lost if the symbols are not available is the "idle detection".

eribertomota commented 2 years ago

Hello, usually the XScreenSaverAllocInfo function and others should be available in libXss.so. Is this library no longer available in the Debian Experimental / Debian Unstable?

Yes, it is available and it is a build dependency for SceneSwitcher. See below:

Source: obs-advanced-scene-switcher
Section: video
Priority: optional
Maintainer: Joao Eriberto Mota Filho <eriberto@debian.org>
Build-Depends: cmake,
               debhelper-compat (= 13),
               libasio-dev,
               libcurl4-openssl-dev,
               libobs-dev (>= 26.1.2),
               libopencv-dev,
               libproc2-dev | libprocps-dev,
               libxss-dev,
               libxtst-dev,
               libwebsocketpp-dev,
               qtbase5-dev

In the linked PR I made this dependency optional by only trying to resolve the symbols at runtime instead of at build time. The only functionality lost if the symbols are not available is the "idle detection".

I think it won't solve the issue. We will lost this feature. This issue is new, from version 1.19.2, not present in 1.19.2 without the changes for libproc2-dev.

Regards,

Eriberto

WarmUpTill commented 2 years ago

I think it won't solve the issue. We will lost this feature.

The functionality is not lost if the library exists at runtime, which should be the case as it is listed in the dependencies of the plugin, correct?

This issue is new, from version 1.19.2, not present in 1.19.2 without the changes for libproc2-dev.

I see. Sorry I missed that part initially. It seems the issue arose due to the Xss from this line not being added to a corresponding target_link_libraries() call: set("${PROJECT_NAME}_PLATFORM_LIBS" Xss ${PROCPS_LIBRARY})

But as mentioned above with the linked PR this will not be an issue as the necessary functions will be resolved at runtime instead. (Like how it is already done with libcurl, Xtst)

This has the upside of the prebuilt binaries of the plugin being able to be used in environments in which this library does not exist.

Is that OK for you as well, or will this cause issues on your end?

eribertomota commented 2 years ago

Ok, using the PR the source code builds now, but... I can't see -lXss. See below:

# cat obs-advanced-scene-switcher_1.19.2-3_amd64.build | grep -i xss
-- Found X11: /usr/include  found components: Xtst Xss
WarmUpTill commented 2 years ago

That is to be expected. With the PR the plugin will not link against Xss at build time. The symbols will be resolved at runtime instead.

eribertomota commented 2 years ago

Ok, so all right. Thanks!