YorVeX / ObsCSharpExample

Example for an OBS plugin written in C# containing various standard items like output, filter, source or a settings dialog in the OBS Tools menu. Meant to be used both to learn writing OBS plugins in C# and as a template for creating new plugins or plugin content like a source or an output.
MIT License
11 stars 2 forks source link

Doesn't work on Linux x64 #2

Closed YorVeX closed 1 year ago

YorVeX commented 1 year ago

NativeAOT doesn't support cross-compiling, but the project includes script files to prepare a WSL environment and produce a Linux x64 build on Windows using this environment. This works fine and since the WSL environment is based on Ubuntu 20.04 it creates a Linux library linked against glibc 2.31 that should have a relatively good range of compatibility. However, the plugin produced that way crashes OBS on startup.

OBS does load the module (at least it's listed under loaded modules in the log) when it is stripped down to export the very basic obs_module_set_pointer, obs_module_ver and obs_module_load functions and these methods don't do anything except return the version (obs_module_ver) and true (obs_module_load). As soon as only the simple blogva call to produce a log message is made, the plugin makes OBS crash on startup.

I personally have no experience debugging applications on Linux and also no ambitions to extend my knowledge in that field. Any help figuring this out would be much appreciated and I would then port over any solutions to my other C# plugins like xObsBeam, xObsAsyncImageSource and xObsBrowserAutoRefresh to make them available for Linux too.

Slkoshka commented 1 year ago

It works now with NetObsBindings 0.0.1.33-alpha (tested on Ubuntu 20.04 in WSL, should work on a real system too) 🎉

I don't have time right now to make a PR, but the only changes that are needed is to update the package reference to a newer version and replace ObsBase.blogva call with ObsBase.blog (and remove the third null argument which is not needed anymore).

image

YorVeX commented 1 year ago

Thanks again for your work @Slkoshka ! Fixed with https://github.com/YorVeX/ObsCSharpExample/commit/1591bc78bb5677fb873bb207aa904ee530ec4d6b.

YorVeX commented 1 year ago

Also my other projects xObsBeam, xObsAsyncImageSource and xObsBrowserAutoRefresh were updated now and they all passed a quick and dirty test in a Ubuntu VM.