Closed fzwoch closed 4 years ago
I think its fairly safe (runs on my machine) to try and setup this library to only reference its own symbols via something like
diff --git a/plugins/obs-filters/CMakeLists.txt b/plugins/obs-filters/CMakeLists.txt
index 0b827209e..5653f4552 100644
--- a/plugins/obs-filters/CMakeLists.txt
+++ b/plugins/obs-filters/CMakeLists.txt
@@ -85,6 +85,7 @@ target_link_libraries(obs-filters
libobs
${obs-filters_PLATFORM_DEPS}
${obs-filters_NOISEREDUCTION_LIBRARIES})
+target_link_options(obs-filters PRIVATE "-Wl,-Bsymbolic-functions")
set_target_properties(obs-filters PROPERTIES FOLDER "plugins")
install_obs_plugin_with_data(obs-filters data)
If that works I think we can consider carrying it upstream.
Confirmed, works for me too.
Maybe worth if
guarding for Linux or Linux and macOS only?
Can you let me know if this alternate patch works too? (My platform doesnt have the conflicting libcodec2)
diff --git a/plugins/obs-filters/CMakeLists.txt b/plugins/obs-filters/CMakeLists.txt
index 0b827209e..e15cff488 100644
--- a/plugins/obs-filters/CMakeLists.txt
+++ b/plugins/obs-filters/CMakeLists.txt
@@ -20,6 +20,7 @@ if(NOT LIBRNNOISE_FOUND)
"rnnoise/src/*.h"
"rnnoise/include/*.h")
add_definitions(-DCOMPILE_OPUS)
+ set_property(SOURCE ${rnnoise_SOURCES} PROPERTY COMPILE_FLAGS "-fno-semantic-interposition")
include_directories("rnnoise/include")
source_group("rnnoise" FILES ${rnnoise_SOURCES})
set(LIBRNNOISE_FOUND TRUE)
@@ -85,6 +86,7 @@ target_link_libraries(obs-filters
libobs
${obs-filters_PLATFORM_DEPS}
${obs-filters_NOISEREDUCTION_LIBRARIES})
+# target_link_options(obs-filters PRIVATE "-Wl,-Bsymbolic-functions")
set_target_properties(obs-filters PROPERTIES FOLDER "plugins")
install_obs_plugin_with_data(obs-filters data)
Nope, that one does not work. Then it will still call into libcodec2.so
.
This one seemed to work for me though:
diff --git a/plugins/obs-filters/CMakeLists.txt b/plugins/obs-filters/CMakeLists.txt
index 0b827209..44563f40 100644
--- a/plugins/obs-filters/CMakeLists.txt
+++ b/plugins/obs-filters/CMakeLists.txt
@@ -20,6 +20,7 @@ if(NOT LIBRNNOISE_FOUND)
"rnnoise/src/*.h"
"rnnoise/include/*.h")
add_definitions(-DCOMPILE_OPUS)
+ set_property(SOURCE ${rnnoise_SOURCES} PROPERTY COMPILE_FLAGS "-fvisibility=protected")
include_directories("rnnoise/include")
source_group("rnnoise" FILES ${rnnoise_SOURCES})
set(LIBRNNOISE_FOUND TRUE)
Platform
Operating system and version: Linux Debian Sid OBS Studio version: 26.0.0
Expected Behavior
Should be able to use RNNoise noise suppression filter for any audio source.
Current Behavior
Using RNNoise noise suppression filter results in a segmentation fault.
Steps to Reproduce
Additional information
Notice that in the callstack
pitch_downsample()
symbol is called from/lib/x86_64-linux-gnu/libcodec2.so.0.9
. That library is probably pulled in by FFMPEG. The intention probably was to use the symbol fromplugins/obs-filters/rnnoise/src/pitch.c
.So it seems like
libcodec2.so
and OBS Studio share portions of code and there are duplicate symbol names inlibcodec2.so
and OBS Studio executable. I'm unsure about the symbol loading strategy of the dynamic loader on Linux - but it seems like the symbol from the loaded shared library gets precedence over the internal symbol in OBS Studio.Since the symbols can be incompatible to each and OBS Studio was compiled with a different expectation than
libcodec2.so
delivers a segmentation fault is likely..