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 Studio 26.1.2 will not open (MacOS) #4

Closed
benmurden opened this issue Apr 23, 2021 · 15 comments
Closed

OBS Studio 26.1.2 will not open (MacOS) #4

benmurden opened this issue Apr 23, 2021 · 15 comments

Comments

@benmurden
Copy link

benmurden commented Apr 23, 2021

I was able to successfully build the project and moved over the .so and data files to OBS, but unfortunately OBS will no longer run.

Removing obs-backgroundremoval.so from the plugins directory allows OBS to run again.

Excerpt from crash report:

Exception Type:        EXC_BAD_INSTRUCTION (SIGILL)
Exception Codes:       0x0000000000000001, 0x0000000000000000
Exception Note:        EXC_CORPSE_NOTIFY

Termination Signal:    Illegal instruction: 4
Termination Reason:    Namespace SIGNAL, Code 0x4
Terminating Process:   exc handler [2894]

Application Specific Information:
detected buffer overflow

Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0   libsystem_c.dylib             	0x00007fff2046210d __chk_fail_overflow + 16
1   libsystem_c.dylib             	0x00007fff2046274c __memcpy_chk + 18
2   libobs.0.dylib                	0x00000001076ac06b obs_register_source_s + 299
3   obs-backgroundremoval.so      	0x0000000028fa3b15 obs_module_load + 21
4   libobs.0.dylib                	0x00000001076aae0e obs_init_module + 78
5   libobs.0.dylib                	0x00000001076abc80 load_all_callback + 64
6   libobs.0.dylib                	0x00000001076abb7e obs_find_modules + 2046
7   libobs.0.dylib                	0x00000001076ab363 obs_load_all_modules + 35
8   com.obsproject.obs-studio     	0x00000001049c87ce OBSBasic::OBSInit() + 734
9   com.obsproject.obs-studio     	0x00000001049a4cd9 OBSApp::OBSInit() + 681
10  com.obsproject.obs-studio     	0x00000001049a8d28 main + 5032
11  libdyld.dylib                 	0x00007fff2052c621 start + 1
@royshil
Copy link
Collaborator

royshil commented Apr 23, 2021

did you copy the model file as well to the data folder?

@benmurden
Copy link
Author

Thanks for the response. Yes, I ran the following commands from the build directory:

$ cp obs-backgroundremoval.so /Applications/OBS.app/Contents/PlugIns
$ cp ../data/SINet_Softmax.onnx /Applications/OBS.app/Contents/Resources/data/obs-plugins/obs-backgroundremoval/

No errors and I can see the files are there.

@royshil
Copy link
Collaborator

royshil commented Apr 24, 2021

"no errors" do you mean it's now working?

can you see any other error? e.g. if you run OBS from the command line like $ /Applications/OBS.app/Contents/MacOS/obs - what do you see in the logs?

@benmurden
Copy link
Author

Sorry, "no errors" in this case referred to the copy operation.

Running $ /Applications/OBS.app/Contents/MacOS/obs gave the following output:

info: Using preferred locale 'en-GB'
info: CPU Name: Intel(R) Core(TM) i5-1038NG7 CPU @ 2.00GHz
info: CPU Speed: 2000MHz
info: Physical Cores: 4, Logical Cores: 8
info: Physical Memory: 32768MB Total
info: OS Name: Mac OS X (NSMACHOperatingSystem)
info: OS Version: Version 11.2.3 (Build 20D91)
info: Kernel Version: 20.3.0
error: hotkeys-cocoa: Getting keyboard keys failed
error: hotkeys-cocoa: Getting keyboard keys failed
info: hotkeys-cocoa: Using layout 'com.apple.keylayout.US'
info: Current Date/Time: 2021-04-26, 11:56:32
info: Browser Hardware Acceleration: true
info: Portable mode: false
QMetaObject::connectSlotsByName: No matching signal for on_advAudioProps_clicked()
QMetaObject::connectSlotsByName: No matching signal for on_advAudioProps_destroyed()
QMetaObject::connectSlotsByName: No matching signal for on_actionGridMode_triggered()
QMetaObject::connectSlotsByName: No matching signal for on_program_customContextMenuRequested(QPoint)
QMetaObject::connectSlotsByName: No matching signal for on_transitionRemove_clicked()
info: OBS 26.1.2 (mac)
info: ---------------------------------
info: ---------------------------------
info: audio settings reset:
	samples per sec: 48000
	speakers:        2
info: ---------------------------------
info: Initializing OpenGL...
info: Loading up OpenGL on adapter Intel Inc. Intel(R) Iris(TM) Plus Graphics OpenGL Engine
info: OpenGL loaded successfully, version 4.1 INTEL-16.1.12, shading language 4.10
info: ---------------------------------
info: video settings reset:
	base resolution:   1920x1080
	output resolution: 1920x1080
	downscale filter:  Bicubic
	fps:               30/1
	format:            NV12
	YUV mode:          709/Partial
info: NV12 texture support not available
info: Audio monitoring device:
	name: Default
	id: default
info: ---------------------------------
warning: Failed to load 'en-US' text for module: 'decklink-captions.so'
warning: Failed to load 'en-US' text for module: 'decklink-ouput-ui.so'
2021-04-26 11:56:32.465 obs[3482:164207] mac-virtualcam(DAL): PlugInMain version=1.3.0
2021-04-26 11:56:32.466 obs[3482:164207] mac-virtualcam(DAL): HardwarePlugIn_QueryInterface 
2021-04-26 11:56:32.466 obs[3482:164207] mac-virtualcam(DAL): HardwarePlugIn_Release sRefCount now = 0
2021-04-26 11:56:32.466 obs[3482:164207] mac-virtualcam(DAL): HardwarePlugIn_InitializeWithObjectID self=0x2bb5a478
2021-04-26 11:56:32.466 obs[3482:164207] mac-virtualcam(DAL): HardwarePlugIn_ObjectSetPropertyData OBSDALDevice(33) kCMIOObjectPropertyListenerAdded self=0x2bb5a478 data(int)=1684629094
2021-04-26 11:56:32.466 obs[3482:164207] mac-virtualcam(DAL): HardwarePlugIn_ObjectSetPropertyData OBSDALDevice(33) kCMIOObjectPropertyListenerAdded self=0x2bb5a478 data(int)=1869180523
2021-04-26 11:56:32.466 obs[3482:164207] mac-virtualcam(DAL): HardwarePlugIn_ObjectSetPropertyData OBSDALDevice(33) kCMIOObjectPropertyListenerAdded self=0x2bb5a478 data(int)=1885762592
warning: A DeckLink iterator could not be created.  The DeckLink drivers may not be installed
info: No blackmagic support
info: [mac-virtualcam] version=1.3.0
info: [VideoToolbox encoder]: Adding VideoToolbox H264 encoders
warning: Failed to load 'en-US' text for module: 'obs-backgroundremoval.so'
[1]    3482 illegal hardware instruction  /Applications/OBS.app/Contents/MacOS/obs

@royshil
Copy link
Collaborator

royshil commented Apr 26, 2021

hmm it's not even loading the module. when the SInet ONNX model file is not in place it crashes... maybe that's the problem?

also - what version of Mac OSX are you running?
this should be supported from 10.13+, but i need to check more thoroughly

@benmurden
Copy link
Author

image

And MacOS version is the latest AFAIK

info: OS Version: Version 11.2.3 (Build 20D91)

@royshil
Copy link
Collaborator

royshil commented Apr 27, 2021

can you try the latest release i've put up yesterday ?

@benmurden
Copy link
Author

I have done just that, but unfortunately ran into the same error when running OBS.

I did notice some warnings when making a fresh build.

[ 33%] Building CXX object CMakeFiles/obs-backgroundremoval.dir/src/background-filter.cpp.o
[ 66%] Building CXX object CMakeFiles/obs-backgroundremoval.dir/src/plugin-main.cpp.o
[100%] Linking CXX shared module obs-backgroundremoval.so
ld: warning: dylib (/usr/local/lib/libopencv_imgproc.4.5.2.dylib) was built for newer macOS version (11.0) than being linked (10.13)
ld: warning: dylib (/usr/local/lib/libopencv_core.4.5.2.dylib) was built for newer macOS version (11.0) than being linked (10.13)
[100%] Built target obs-backgroundremoval

@royshil
Copy link
Collaborator

royshil commented Apr 28, 2021

i don't think these warnings are the reason for the crash.

it's possible we will have to debug this to understand the problem.
you can add log printouts to see where it actually crashes.

another method is to comment out all the code in the plugin, e.g. the

static void *filter_create(obs_data_t *settings, obs_source_t *source)

function - just comment out everything inside there.
compile and run.
if it runs - we have a lead.
then start uncommenting blocks of lines, and when it crashes again.

@benmurden
Copy link
Author

I tried commenting out the contents of filter_create, but that didn't help. I then went on to comment out all the functions referenced in background_removal_filter_info, and still no luck.

Only thing that got OBS to run was commenting out obs_register_source(&background_removal_filter_info); from plugin-mail.cpp, which I suppose is expected, because it prevents the entire module from loading.

I now suspect there's an issue with one of the included libraries on my machine. Will keep investigating.

@royshil
Copy link
Collaborator

royshil commented Apr 29, 2021

@benmurden i've added a script to build opencv with static linking - see the README,

<project>/build/ $ ../scripts/makeOpenCV_osx.sh

then build the plugin as usual.

i hope this will reduce the library surface area and reduce potential problems.

also - make sure to link build and link vs. the right version of libOBS
e.g. if you're running OBS 26.1.1 (run OBS and check the version) - build and link vs v26.1.1
if you're building on your own - check out the right tag from the git repo.

@benmurden
Copy link
Author

After checking out the tag 26.1.2 of the obs-studio repo I was able to compile and run the plugin successfully. 🎉

I sincerely apologise for not having realized this sooner. Thanks for your help getting it going!

@royshil
Copy link
Collaborator

royshil commented Apr 30, 2021

glad to hear you were successful ! i'm closing this issue

@GladstoneFilho
Copy link

GladstoneFilho commented Jun 9, 2021

After checking out the tag 26.1.2 of the obs-studio repo I was able to compile and run the plugin successfully. 🎉

I sincerely apologise for not having realized this sooner. Thanks for your help getting it going!

Hi benmurden. I still having my OBS crashing on OSx. Could you help me?
I didn't understand what did you do to have successfully

I'm using OBS 27.0.0 and OSX 10.15.7

@benmurden
Copy link
Author

I didn't try with 27.0.0, but if you checkout that tag and compile against that i.e. not master then you should be good to go.

$ git fetch --all --tags
$ git checkout tags/27.0.0

royshil pushed a commit that referenced this issue Mar 7, 2023
* Add obs-plugintemplate files (#1)

* Add obs-plugintemplate files

* Rename

* Update CMakeLists.txt

* Update main.yml

* files

* Update CMakeLists.txt

* Fix

* Update .Brewfile

* Update main.yml

* Update main.yml

* check-cmake.sh

* Update main.yml

* Update main.yml

* Build my opencv (#2)

* BuildMyOpenCV.cmake

* Update BuildMyOpenCV.cmake

* Update BuildMyOpenCV.cmake

* Update BuildMyOpenCV.cmake

* Update BuildMyOpenCV.cmake

* check-cmake

* Update main.yml

* Update buildspec.json

* Update CMakeLists.txt

* Build my onnxruntime (#3)

* fix

* Update BuildMyOnnxruntime.cmake

* Enable arm64

* 0.5.2

* Update BuildMyOnnxruntime.cmake

* Update .Brewfile

* Update BuildMyOnnxruntime.cmake

* Update BuildMyOnnxruntime.cmake

* fix

* Fix

* Update BuildMyOnnxruntime.cmake

* Update BuildMyOnnxruntime.cmake

* Update BuildMyOnnxruntime.cmake

* Update BuildMyOnnxruntime.cmake

* a

* Create .gitmodules

* Create onnxruntime

* Update onnxruntime

* Update BuildMyOnnxruntime.cmake

* Update BuildMyOnnxruntime.cmake

* fix

* Update BuildMyOnnxruntime.cmake

* ARCHITECTURE

* Apply

* Update BuildMyOnnxruntime.cmake

* fix

* Update BuildMyOnnxruntime.cmake

* Update BuildMyOnnxruntime.cmake

* Update BuildMyOnnxruntime.cmake

* Update BuildMyOnnxruntime.cmake

* Update BuildMyOnnxruntime.cmake

* aaa

* Enable Windows build (#4)

* Enable Windows build

* Update main.yml

* Update BuildMyOnnxruntime.cmake

* Update BuildMyOnnxruntime.cmake

* Update BuildMyOnnxruntime.cmake

* Fix linkage

* Remove /WX

* Update ObsPluginHelpers.cmake

* Update BuildMyOnnxruntime.cmake

* Update BuildMyOnnxruntime.cmake

* Update BuildMyOnnxruntime.cmake

* Update BuildMyOnnxruntime.cmake

* Update BuildMyOnnxruntime.cmake

* Update CMakeLists.txt

* Fix

* Update CMakeLists.txt

* a

* Update BuildMyOnnxruntime.cmake

* Update BuildMyOnnxruntime.cmake

* Disable DML

* Update BuildMyOnnxruntime.cmake

* Update BuildMyOnnxruntime.cmake

* Update BuildMyOnnxruntime.cmake

* Update background-filter.cpp

* Update BuildMyOnnxruntime.cmake

* Disable DML

* Fix segfault (#6)

* Update Model.h

* 0.5.6

* Ccache macos (#8)

* Ccache

* Update main.yml

* Update main.yml

* Update main.yml

* Update main.yml

* Update BuildMyOnnxruntime.cmake

* Update BuildMyOnnxruntime.cmake

* Update BuildMyOnnxruntime.cmake

* Revert "Update BuildMyOnnxruntime.cmake"

This reverts commit 44d9caa.

* Revert "Update BuildMyOnnxruntime.cmake"

This reverts commit 9294106.

* Direct ml (#7)

* Update BuildMyOnnxruntime.cmake

* Update BuildMyOnnxruntime.cmake

* Update BuildMyOnnxruntime.cmake

* Update BuildMyOnnxruntime.cmake

* Update BuildMyOnnxruntime.cmake

* Update BuildMyOnnxruntime.cmake

* Update BuildMyOnnxruntime.cmake

* Update BuildMyOnnxruntime.cmake

* Update BuildMyOnnxruntime.cmake

* Update CMakeLists.txt

* Update CMakeLists.txt

* Update CMakeLists.txt

* dml

* 0.5.7

* Update CMakeLists.txt

* Update BuildMyOnnxruntime.cmake

* Update BuildMyOnnxruntime.cmake

* Update BuildMyOnnxruntime.cmake

* Update BuildMyOnnxruntime.cmake

* a

* Update main.yml

* Update BuildMyOnnxruntime.cmake

* Update main.yml

* Update BuildMyOnnxruntime.cmake

* Update BuildMyOnnxruntime.cmake

* Fix

* Update BuildMyOnnxruntime.cmake

* Update main.yml

* Linux build (#9)

* linux

* 0.5.8

* Update BuildMyOnnxruntime.cmake

* Update setup_ccache (#10)

* bump version (#11)

* Use ninja on windows (#12)

* Update main.yml

* Update main.yml

* Use Ninja

* Update BuildMyOnnxruntime.cmake

* Update main.yml

* ccache

* Update BuildMyOpenCV.cmake

* Update BuildMyOnnxruntime.cmake

* Update BuildMyOnnxruntime.cmake

* Update BuildMyOnnxruntime.cmake

* Update BuildMyOnnxruntime.cmake

* Update main.yml

* Update main.yml

* Update main.yml

* Update main.yml

* Update main.yml

* Update BuildMyOnnxruntime.cmake

* Update main.yml

* Update main.yml

* Update CMakeLists.txt

* Update BuildMyOnnxruntime.cmake

* Long path

* Update main.yml

* Update BuildMyOnnxruntime.cmake

* Update main.yml

* Update main.yml

* Update main.yml

* Update main.yml

* Update main.yml

* Update main.yml

* Update main.yml

* Update main.yml

* Update main.yml

* Update main.yml

* Update main.yml

* Update main.yml

* Update main.yml

* Update

* Update BuildMyOnnxruntime.cmake

* Update BuildMyOnnxruntime.cmake

* Update BuildMyOnnxruntime.cmake

* Windows opencv ccache (#13)

* Update BuildMyOpenCV.cmake

* Update BuildMyOpenCV.cmake

* Update BuildMyOpenCV.cmake

* Update BuildMyOpenCV.cmake

* Update BuildMyOpenCV.cmake

* Update BuildMyOpenCV.cmake

* Update BuildMyOpenCV.cmake

* Update main.yml

* Update BuildMyOpenCV.cmake

* bump 0.5.10 (#14)

* Cleanup (#15)

* Cleanup

* bump version

* Fix ep (#16)

* Update BuildMyOnnxruntime.cmake

* Update BuildMyOpenCV.cmake

* Update main.yml (#18)

* Update main.yml

* Update main.yml

* Update main.yml

* Update main.yml

* Update main.yml

* Update main.yml

* Update main.yml

* Update main.yml

* Update main.yml

* Update main.yml

* Update main.yml

* Update main.yml

* Update main.yml

* 0.5.12

* Fix

* Update package-macos.zsh

* Update package-linux.zsh

* Update CMakeLists.txt

* ci

* Fix

* Update background-filter.cpp

* Fix

* clang-format

* cmake-format

* Update BuildMyOpenCV.cmake

* Update BuildMyOnnxruntime.cmake

* Fix errors

* Use -isystem

* Use list in set_target_properties

* INTERFACE_INCLUDE_DIRECTORIES must be on IMPORTED TARGET

* Update ObsPluginHelpers.cmake
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

3 participants