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

SceneSwitcher on ARM (RPi4) #50

Closed
Moustiluigi opened this issue Oct 15, 2020 · 32 comments
Closed

SceneSwitcher on ARM (RPi4) #50

Moustiluigi opened this issue Oct 15, 2020 · 32 comments

Comments

@Moustiluigi
Copy link

I would like to know if there is any way to build SceneSwitcher to make it work with OBS running on a Raspberry Pi 4 (4GB RAM), as the regular so file is not even detected.

Terminal output:

info: ---------------------------------
error: os_dlopen(/usr//lib/obs-plugins/advanced-scene-switcher.so->/usr//lib/obs-plugins/advanced-scene-switcher.so): /usr//lib/obs-plugins/advanced-scene-switcher.so: mauvaise classe ELF : ELFCLASS64

warning: Module '/usr//lib/obs-plugins/advanced-scene-switcher.so' not loaded
warning: Failed to load 'en-US' text for module: 'decklink-ouput-ui.so'
error: os_dlopen(/usr//lib/obs-plugins/libDeckLinkAPI.so->/usr//lib/obs-plugins/libDeckLinkAPI.so): /usr//lib/obs-plugins/libDeckLinkAPI.so: mauvaise classe ELF : ELFCLASS64

warning: Module '/usr//lib/obs-plugins/libDeckLinkAPI.so' not loaded
libDeckLinkAPI.so: cannot open shared object file no such file or directory
warning: A DeckLink iterator could not be created.  The DeckLink drivers may not be installed
info: No blackmagic support
info: FFMPEG VAAPI supported

From what i can understand it's actually tring to load x64 files. Being able to run OBS on a Raspberry Pi 4, even in a very unstable state, is quite new, so i'm unsure how to fix most problems i encounter.
Thanks for your help.

@WarmUpTill
Copy link
Owner

You would have to compile the plugin for arm.
I am not aware of anyone having prebuilt arm binaries available for this plugin.
The x86 prebuilt binaries of the plugin won't be of use as they won't run on arm cpus.

If you built obs itself for arm already it should be as simple as adding the the plugin to the OBS tree, adding its directory to cmake and starting the build again.
(See "Compiling in tree")

Does this help you in any way?

@Moustiluigi
Copy link
Author

I am unsure of how i could compile it for ARM, but I understand what you mean, indeed. Thanks for your answer.

@WarmUpTill
Copy link
Owner

Where did you get an arm version of obs-studio from?
Maybe a crosscompilation toolchain is available there and I could just build it for you. (Although I doubt it)

@Moustiluigi
Copy link
Author

I doubt it too. I mainly followed instructions from this thread. Trying to compile it in tree results in several errors.

@WarmUpTill
Copy link
Owner

Can you share a log?
Maybe it will be easy to resolve.

@Moustiluigi
Copy link
Author

Compiling in tree does not work, as intended, Compiling out of tree outputs this error file while trying to run "sudo make -j4". I might have done something wrong, but fyi, I can successfully run the cmake command.
Here is the content of obs-studio/UI/frontend-plugins/SceneSwitcher/build/CMakeFiles/CMakeOutput.log
I couldn't make a lot of sense of it, i hope it will be useful.

@WarmUpTill
Copy link
Owner

Some header files cannot be found in the first log.
Have you set all cmake variables correctly?
(But it could also be an issue with the cmake file - i have not tried building out of tree in a while)

What is the issue you are facing with building in tree, as you mentioned it is not working as intended?

@Moustiluigi
Copy link
Author

What is the issue you are facing with building in tree, as you mentioned it is not working as intended?

Please correct me if i'm wrong, but by compiling in tree, following the instructions (downloading the code in the right folder, modifying CMakeLists.txt), I presuppose that the plugin should be working (I might be completely wrong). Though, when i start OBS Studio, it isn't recognized at all.
Also OBS doesn't seem to load anything related to the drontend-plugins folder.

Have you set all cmake variables correctly?

I think i set all the variables correctly, as the cmake command outputs no error. This is confusing.
Thanks for your time.

@WarmUpTill
Copy link
Owner

Please correct me if i'm wrong, but by compiling in tree, following the instructions (downloading the code in the right folder, modifying CMakeLists.txt), I presuppose that the plugin should be working (I might be completely wrong). Though, when i start OBS Studio, it isn't recognized at all.
Also OBS doesn't seem to load anything related to the frontend-plugins folder.

Ah, so it built without issues?
Can you find the corresponding *.so file for the plugin in your build folder?
But if not even the frontend tools are working I have my doubts that the plugin will work.

@Moustiluigi
Copy link
Author

I did the entire compilation again, and I hit the same errors when executing "make -j4", and thus there are no so file anywhere in the build folder. Here is a tree of this folder:

/home/pi/obs-studio/UI/frontend-plugins/SceneSwitcher/build
├── CMakeCache.txt
├── CMakeFiles
│   ├── 3.13.4
│   │   ├── CMakeCCompiler.cmake
│   │   ├── CMakeCXXCompiler.cmake
│   │   ├── CMakeDetermineCompilerABI_C.bin
│   │   ├── CMakeDetermineCompilerABI_CXX.bin
│   │   ├── CMakeSystem.cmake
│   │   ├── CompilerIdC
│   │   │   ├── a.out
│   │   │   ├── CMakeCCompilerId.c
│   │   │   └── tmp
│   │   └── CompilerIdCXX
│   │       ├── a.out
│   │       ├── CMakeCXXCompilerId.cpp
│   │       └── tmp
│   ├── advanced-scene-switcher.dir
│   │   ├── build.make
│   │   ├── C.includecache
│   │   ├── cmake_clean.cmake
│   │   ├── CXX.includecache
│   │   ├── DependInfo.cmake
│   │   ├── depend.internal
│   │   ├── depend.make
│   │   ├── flags.make
│   │   ├── link.txt
│   │   ├── progress.make
│   │   └── src
│   │       └── linux
│   ├── cmake.check_cache
│   ├── CMakeDirectoryInformation.cmake
│   ├── CMakeOutput.log
│   ├── CMakeRuleHashes.txt
│   ├── CMakeTmp
│   ├── feature_tests.bin
│   ├── feature_tests.c
│   ├── feature_tests.cxx
│   ├── Makefile2
│   ├── Makefile.cmake
│   ├── Progress
│   │   ├── 1
│   │   ├── 2
│   │   ├── 3
│   │   ├── 4
│   │   ├── 5
│   │   └── count.txt
│   ├── progress.marks
│   └── TargetDirectories.txt
├── cmake_install.cmake
├── Makefile
└── ui_advanced-scene-switcher.h

11 directories, 40 files

Also, i can't tell if the frontend tools are working or not. What i can say however is that there is no output from them in the terminal when i run OBS.

@WarmUpTill
Copy link
Owner

Sorry, I am a bit confused.
The problem is once again that the header file obs-frontend-api.h cannot be found.
Are you compiling in tree or out of tree?

I see that you placed the SceneSwitcher sources in tree under /home/pi/obs-studio/UI/frontend-plugins/SceneSwitcher, but at the same time you created a build folder under /home/pi/obs-studio/UI/frontend-plugins/SceneSwitcher/build.

Can you try modifying /home/pi/obs-studio/UI/frontend-plugins/CMakeLists.txt and add the following line:
add_subdirectory(SceneSwitcher)

Then just switch to /home/pi/obs-studio/build and run "make -j4" there?

(Unless you tried that already of course :) )

@Moustiluigi
Copy link
Author

Can you try modifying /home/pi/obs-studio/UI/frontend-plugins/CMakeLists.txt and add the following line:
add_subdirectory(SceneSwitcher)
Then just switch to /home/pi/obs-studio/build and run "make -j4" there?
(Unless you tried that already of course :) )

That's already what I did, and I already sent the logs of this command above.

Are you compiling in tree or out of tree?

I am kinda clueless on which one I should do. Compiling in tree doesn't seem to do anything, and compiling out of tree results in errors when doing "make -j4".

I should probably download "obs-frontend-api.h" somewhere and see if it fixes anything?

@WarmUpTill
Copy link
Owner

I should probably download "obs-frontend-api.h" somewhere and see if it fixes anything?

Unless you are building a very old version of OBS this file should be part of the OBS sources.

@Moustiluigi
Copy link
Author

image
The file always has been there, in the OBS sources.

@Moustiluigi
Copy link
Author

Moustiluigi commented Oct 21, 2020

Okay, my bad. I was helped by a friend with more knowledge in software dev. than me. To sum up, I didn't understood that compiling from tree meant that I had to rebuild OBS entierly. Thus, following the thread i sent earlier, that's what I did, and it succesfully compiled. I didn't test it yet, that's why i'm not closing the thread on this comment. I'll report the issues, if I find any.

@Pisdu
Copy link

Pisdu commented Oct 29, 2020

Okay, my bad. I was helped by a friend with more knowledge in software dev. than me. To sum up, I didn't understood that compiling from tree meant that I had to rebuild OBS entierly. Thus, following the thread i sent earlier, that's what I did, and it succesfully compiled. I didn't test it yet, that's why i'm not closing the thread on this comment. I'll report the issues, if I find any.

Hi , tried to compile without success , sorry . DId you maybe had success and be so kind to share it please ?
Thanks a lot !!

@WarmUpTill
Copy link
Owner

Did you run into compilation issues or issues at runtime?
Could you share a log?

Unfortunately I do not have a setup on which to compile it on and I am not sure if corss-compiling would work.

@Pisdu
Copy link

Pisdu commented Oct 30, 2020

Did you run into compilation issues or issues at runtime?
Could you share a log?

Unfortunately I do not have a setup on which to compile it on and I am not sure if corss-compiling would work.

Hi thanks , here the logs
pi@raspberrypi:~ $ cd SceneSwitcher
pi@raspberrypi:~/SceneSwitcher $ cmake -DBUILD_OUT_OF_TREE=1 -DLIBOBS_INCLUDE_DIR="/home/pi/obs-studio/libobs"
CMake Warning:
No source or binary directory provided. Both will be assumed to be the
same as the current working directory, but note that this warning will
become a fatal error in future CMake releases.

CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
Please set them or make sure they are set and tested correctly in the CMake files:
LIBOBS_FRONTEND_API_LIB
linked by target "advanced-scene-switcher" in directory /home/pi/SceneSwitcher
LIBOBS_FRONTEND_INCLUDE_DIR
used as include directory in directory /home/pi/SceneSwitcher
used as include directory in directory /home/pi/SceneSwitcher
used as include directory in directory /home/pi/SceneSwitcher
used as include directory in directory /home/pi/SceneSwitcher
used as include directory in directory /home/pi/SceneSwitcher
used as include directory in directory /home/pi/SceneSwitcher
used as include directory in directory /home/pi/SceneSwitcher

-- Configuring incomplete, errors occurred!
See also "/home/pi/SceneSwitcher/CMakeFiles/CMakeOutput.log".
pi@raspberrypi:/SceneSwitcher $ -DLIBOBS_FRONTEND_INCLUDE_DIR="/home/pi/obs-studio/UI/obs-frontend-api"
-bash: -DLIBOBS_FRONTEND_INCLUDE_DIR=/home/pi/obs-studio/UI/obs-frontend-api: No such file or directory
pi@raspberrypi:
/SceneSwitcher $ -DLIBOBS_FRONTEND_API_LIB="/usr/lib/libobs-frontend-api.so.0.0"
-bash: -DLIBOBS_FRONTEND_API_LIB=/usr/lib/libobs-frontend-api.so.0.0: No such file or directory
pi@raspberrypi:~/SceneSwitcher $ -DCMAKE_INSTALL_PREFIX=/usr ..

@Pisdu
Copy link

Pisdu commented Oct 30, 2020

Double checked and dirs
DLIBOBS_INCLUDE_DIR
DLIBOBS_FRONTEND_INCLUDE_DIR
DLIBOBS_FRONTEND_API_LIB
are there

@WarmUpTill
Copy link
Owner

Judging by the log you sent above it looks like you seem to accidentally have set some cmake variables incorrectly.

Instead of running a single cmake command with all its parameters you seem to have ran some of the arguments as separate commands.
For example "-DLIBOBS_FRONTEND_API_LIB="/usr/lib/libobs-frontend-api.so.0.0"" should have been part of the cmake call but you have called it as a separate command, which does not work.

If you built OBS yourself I would recommend that you also add the Scene Switcher as part of that build.
This will save you the trouble of setting all the cmake variables.

(I have described this in a previous comment)

@Pisdu
Copy link

Pisdu commented Oct 30, 2020

I see , well as i already told im not in compiling stuff so , if you will be son kind to explain me . I compliled OBS studio using the script mentioned here : https://obsproject.com/forum/threads/obs-raspberry-pi-build-instructions.115739/

@WarmUpTill
Copy link
Owner

Assuming that your obs-studio source code directory is located under /home/pi/obs-studio run the following commands:

cd
cd obs-studio/UI/frontend-plugins
git clone https://github.com/WarmUpTill/SceneSwitcher.git

Then edit the file /home/pi/obs-studio/UI/frontend-plugins/CMakeLists.txt and add the following line:
add_subdirectory(SceneSwitcher)

Finally run:

cd
cd obs-studio/build
make -j4
sudo make install

Let me know if you run into issues or have any questions.

@Pisdu
Copy link

Pisdu commented Oct 30, 2020

Hi , THANKS A LOT AGAIN , complilng process stopped with errors
[ 58%] Built target obs-x264
[ 58%] Linking CXX shared module linux-capture.so
c++: error: CMakeFiles/linux-capture.dir/linux-capture.c.o: No such file or directory
c++: error: CMakeFiles/linux-capture.dir/xcursor.c.o: No such file or directory
c++: error: CMakeFiles/linux-capture.dir/xcursor-xcb.c.o: No such file or directory
c++: error: CMakeFiles/linux-capture.dir/xhelpers.c.o: No such file or directory
c++: error: CMakeFiles/linux-capture.dir/xshm-input.c.o: No such file or directory
c++: error: CMakeFiles/linux-capture.dir/xcomposite-main.cpp.o: No such file or directory
c++: error: CMakeFiles/linux-capture.dir/xcompcap-main.cpp.o: No such file or directory
c++: error: CMakeFiles/linux-capture.dir/xcompcap-helper.cpp.o: No such file or directory
[ 59%] Built target obs-x264-test
make[2]: *** [plugins/linux-capture/CMakeFiles/linux-capture.dir/build.make:202: plugins/linux-capture/linux-capture.so] Error 1
make[1]: *** [CMakeFiles/Makefile2:749: plugins/linux-capture/CMakeFiles/linux-capture.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
[ 61%] Built target obs-vst
[ 64%] Built target libobs-opengl
make: *** [Makefile:152: all] Error 2

@Pisdu
Copy link

Pisdu commented Oct 30, 2020

Wait , recompiled Obs studio , re lauched with your instructions and scene switcher compiling finished successfully.
But i cannot find scene switcher under menu / tools
Cannot also find under /home/pi/.config/obs-studio/plugins and /usr/lib/obs-plugins

@WarmUpTill
Copy link
Owner

If compiling worked you should find the plugin's so-file using this command:

cd
find obs-studio/build -name advanced-scene-switcher.so

Does installing it manually help?
If it does not, can you share a log file of the OBS startup?

@Pisdu
Copy link

Pisdu commented Oct 30, 2020

Hi , searched everywhere but advanced-scene-switcher.so is not there
Here's Obs log

07:46:18 PM.871: Physical Cores: 4, Logical Cores: 4
07:46:18 PM.872: Physical Memory: 3744MB Total, 3250MB Free
07:46:18 PM.872: Kernel Version: Linux 5.9.1-v8+
07:46:18 PM.872: Distribution: "Debian GNU/Linux" "10"
07:46:18 PM.872: Window System: X11.0, Vendor: The X.Org Foundation, Version: 1.20.4
07:46:18 PM.874: Portable mode: false
07:46:18 PM.952: OBS 26.0.2-41-gade4c4cf (linux)
07:46:18 PM.952: ---------------------------------
07:46:19 PM.070: ---------------------------------
07:46:19 PM.070: audio settings reset:
07:46:19 PM.070: samples per sec: 48000
07:46:19 PM.070: speakers: 2
07:46:19 PM.092: ---------------------------------
07:46:19 PM.092: Initializing OpenGL...
07:46:19 PM.216: Loading up OpenGL on adapter Broadcom V3D 4.2
07:46:19 PM.216: glEnable failed, glGetError returned GL_INVALID_ENUM(0x500)
07:46:19 PM.216: OpenGL loaded successfully, version 3.3 (Core Profile) Mesa 20.3.0-devel (git-0fe5490724), shading language 3.30
07:46:19 PM.347: ---------------------------------
07:46:19 PM.347: video settings reset:
07:46:19 PM.347: base resolution: 1536x864
07:46:19 PM.347: output resolution: 1228x690
07:46:19 PM.347: downscale filter: Bicubic
07:46:19 PM.347: fps: 30/1
07:46:19 PM.347: format: NV12
07:46:19 PM.347: YUV mode: 709/Partial
07:46:19 PM.347: NV12 texture support not available
07:46:19 PM.364: Audio monitoring device:
07:46:19 PM.364: name: Default
07:46:19 PM.364: id: default
07:46:19 PM.364: ---------------------------------
07:46:19 PM.369: Failed to load 'en-US' text for module: 'decklink-ouput-ui.so'
07:46:19 PM.619: A DeckLink iterator could not be created. The DeckLink drivers may not be installed
07:46:19 PM.619: No blackmagic support
07:46:19 PM.695: FFMPEG VAAPI supported
07:46:19 PM.727: [obs-websocket] you can haz websockets (version 4.8.0)
07:46:19 PM.727: [obs-websocket] qt version (compile-time): 5.11.3 ; qt version (run-time): 5.11.3
07:46:19 PM.735: [obs-websocket] module loaded!
07:46:19 PM.755: VLC found, VLC video source enabled
07:46:19 PM.759: Loading iOS Camera Plugin (version 2.6.1)
07:46:19 PM.759: ---------------------------------
07:46:19 PM.759: Loaded Modules:
07:46:19 PM.759: obs-ios-camera-source.so
07:46:19 PM.759: vlc-video.so
07:46:19 PM.759: text-freetype2.so
07:46:19 PM.759: rtmp-services.so
07:46:19 PM.759: obs-x264.so
07:46:19 PM.759: obs-websocket.so
07:46:19 PM.759: obs-vst.so
07:46:19 PM.760: obs-transitions.so
07:46:19 PM.760: obs-outputs.so
07:46:19 PM.760: obs-libfdk.so
07:46:19 PM.760: obs-filters.so
07:46:19 PM.760: obs-ffmpeg.so
07:46:19 PM.760: linux-v4l2.so
07:46:19 PM.760: linux-pulseaudio.so
07:46:19 PM.760: linux-jack.so
07:46:19 PM.760: linux-decklink.so
07:46:19 PM.760: linux-capture.so
07:46:19 PM.760: linux-alsa.so
07:46:19 PM.760: image-source.so
07:46:19 PM.760: frontend-tools.so
07:46:19 PM.760: decklink-ouput-ui.so
07:46:19 PM.760: ---------------------------------
07:46:19 PM.760: ==== Startup complete ===============================================
07:46:19 PM.769: All scene data cleared
07:46:19 PM.769: ------------------------------------------------
07:46:19 PM.786: [obs-ios-camera-plugin] Creating instance of plugin!
07:46:19 PM.787: [obs-ios-camera-plugin] Loaded Settings: Connecting to device
07:46:19 PM.787: [obs-ios-camera-plugin] Connecting to device
07:46:19 PM.799: alsa-input: PCM 'default' rate set to 48000
07:46:19 PM.799: alsa-input: PCM 'default' channels set to 2
07:46:19 PM.810: Switched to scene 'Scene'
07:46:19 PM.810: ------------------------------------------------
07:46:19 PM.810: Loaded scenes:
07:46:19 PM.810: - scene 'Scene':
07:46:19 PM.810: - source: 'Audio Capture Device (ALSA)' (alsa_input_capture)
07:46:19 PM.810: - source: 'iOS Camera' (ios-camera-source)
07:46:19 PM.810: ------------------------------------------------
07:46:19 PM.830: [obs-ios-camera-plugin] Activating
07:46:20 PM.364: adding 21 milliseconds of audio buffering, total audio buffering is now 21 milliseconds (source: Audio Capture Device (ALSA))

@Pisdu
Copy link

Pisdu commented Oct 30, 2020

checked again , here's compilation log
CMake Error at /home/pi/obs-build/obs-studio/build/UI/frontend-plugins/SceneSwitcher/cmake_install.cmake:47 (file):
file INSTALL cannot find
"/home/pi/obs-build/obs-studio/build/UI/frontend-plugins/SceneSwitcher/advanced-scene-switcher.so".
Call Stack (most recent call first):
/home/pi/obs-build/obs-studio/build/UI/frontend-plugins/cmake_install.cmake:44 (include)
/home/pi/obs-build/obs-studio/build/UI/cmake_install.cmake:72 (include)
cmake_install.cmake:46 (include)

@WarmUpTill
Copy link
Owner

Then I would assume that the compilation failed.
I am sorry but I can only guess what went wrong with the current logs.

@Pisdu
Copy link

Pisdu commented Oct 30, 2020

Thanks for patience , you are very kind , you mean you need full logs ?

@WarmUpTill
Copy link
Owner

WarmUpTill commented Oct 30, 2020

No problem.
I assume more logs could maybe help - I am just not sure what to look for yet.

But in general the previous log you shared with the linking issues ...
[ 58%] Linking CXX shared module linux-capture.so
c++: error: CMakeFiles/linux-capture.dir/linux-capture.c.o: No such file or directory
... seem very unusual.
I am not sure what would be causing such strange behavior.
Maybe it is due to the limited resources available on the PI4, but it is hard to say.

But let us maybe work this out in a conversation on the OBS website and report back here when we got it to work, just so we do not spam this thread with sharing build logs over and over.
So feel free to send me a PM there.

@Pisdu
Copy link

Pisdu commented Oct 30, 2020

ok ! thanks

@WarmUpTill
Copy link
Owner

It looks like cleaning the build environment and installing all dependencies (libxss-dev) seemed to resolve the issues and plugin was built successfully for arm and can be loaded by OBS.

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