-
-
Notifications
You must be signed in to change notification settings - Fork 8.8k
Add a VST3 host filter to obs-studio #12752
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
base: master
Are you sure you want to change the base?
Conversation
60a94ac to
6071bff
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
GitHub's new PR view doesn't seem to like the immensity of this PR.. 😄
But as a first action, the VST3 SDK should not be vendored-in, it should be added to obs-deps instead (where it's then pre-built as a library) and a CMake find module added.
Also as this is a "fresh" plugin, we should do things the right way:
- Use platform-specific implementation files and platform-independent header files.
- This allows the API(s) to be generic and called in a generic fashion and then the implementation of that generic function does the platform specific thing
- E.g. there should be an implementation of
getDefaultSearchPathsin a file calledVST3Scanner_Windows.cpp,VST3Scanner_macOS.cpp,VST3Scanner_Linux.cpp, etc. implementing the general definition of the same function.
- Each C++ class has to be put into its own pair of header and implementation file. This avoids unnecessary recompilations of every class just because a single detail of one class is changed in
VST3Plugin.h- This also makes reviews and maintenance easier, as everything is properly encapsulated and separation of concerns is replicated by separation of implementation.
- Split up implementation of the
libobssource API and thenlibobsproperties API into separate files (seemac-avcaptureas an example). In general opt for shorter source files that implement a single aspect of the API instead of combining everything into a single "obs-whatever.c" file. In general I find it better to have a plugin be split up into these parts:- Implementation of the module API
- Implementation(s) of a specific "source" API, one for each type (source, filter, output, etc.)
- Implementation(s) of the property API for each source type
- Implementation of the actual self-contained object that manages resources (for anything but a pure C plugin that would mean the C++/ObjC/Swift instance of an object)
- Again, see
mac-avcaptureor this Swift-based example
- Every time a source file has a long "line separating comment", it means the file is too long and contains too much - split it up per the comment above.
- Do not use
_prefixunderscores for "private" variables in C++, those names are reserved by the standard library. Always usepostfix_underscores. - Use our modern header include order (see the updated files in
frontendfor examples`:#include "working_directory_file.h"(file in the same directory as the one doing the inclusion)#include <first_party_file.h>(file provided by some other part of the project or a first-party shared library)#include <third_party/file.h>(file provided by a third party library)#include <standard_library.h>(file provided by the C or C++ standard library, with C++ includes coming first)
- Also use
#importby default for ObjC/ObjC++
Those are just the things I saw at first glance, will look into the implementation in-depth after those things are addressed.
|
The Steinberg sdk is not conceived as a precompiled library but as a set of interfaces and optional helper classes which each plugin or host implements selectively. |
|
In that case we'd just omit the compilation step, but it should still be provided as a "header-only" library via Despite the name, as long as the target provided by the find module provides header files and source files as its |
Ah, that was the info i was missing. If it can be done through cmake, that's nice. |
Note that this is only necessary if you want the SDK source files to also appear with your plugin sources in the IDE. Usually you only provide the include path and just include the SDK's files where necessary. But you can of course add them as sources and then in your target you can set the "FOLDER" property for all these files to put them visually in a subdirectory. Here's an example from the obs-studio/frontend/CMakeLists.txt Lines 105 to 117 in c025f21
Haven't checked whether |
|
The devil's in the details. |
What does the patch do? If it's necessary for Linux compatibility to begin with it should be upstreamed to the SDK repo and implemented by Steinberg then. We are in no hurry to implement VST3 support in the project, and it's not OBS Studio's responsibility to contort itself to somehow "make it work". We need to aim for zero band-aids, in-tree patches, or other workarounds, as those require the most maintenance work and have the potential to break at even the smallest upstream change. |
|
One of the patches could be upstreamed (zeroing of the buffers on creation). |
|
So what this reads to me is that the VST3 SDK is not really an SDK in the common sense, but more a "VST template": You take their source code and then write/change your own stuff around it, throw away the pieces you don't need and keep the ones you do? |
It is both.
Going forward i see these options:
From talks with @Fenrirthviti it was conveyed to me that linux support was desired but given that sdk difficulty, it seems a new arbitration is required. |
|
I think the main issue with Linux seems to me that architecturally there is no need to provide a system package? Because it sounds like every VST is effectively compiled "on top" of the SDK code, so the SDK becomes the VST. And because of that, no VST would ever need to dynamically link to a system-wide VST library. I'll need to marinate on that. @tytan652 what's your take? If we need to carry a dependency around in-tree (despite all our efforts to stop doing that) because Linux needs it and thus cannot be cordoned off to Using |
|
|
VST3 assumes two system path:
According to those paths:
None of our official packages are correctly supported. Throwing the VST3 SDK in obs-deps-buildstream is not inconceivable, same to the PPA (it has already its own build of libajantv2). PS: For the sake of sanity and simplicity I do not take in account unofficial packaging, it will be on the concerned packager⋅s. |
This bars complete linux support (which I really don't mind ;) ). This leaves only linux support away from flatpak, say ubuntu. This means either one modifies obs-deps to accommodate vst3 sdk for linux or we pull it in deps folder as a submodule or in-tree in the obs-vst3 folder. Maybe the simplest is to plainly remove support for linux. I have no preference tbh. |
No this is incorrect. |
A finder to Steinberg VST3 SDK is added in cmake. Signed-off-by: pkv <[email protected]>
6071bff to
20a057e
Compare
This adds a VST3 host to obs-studio on Windows, macOS and Linux. Only audio effects are enabled. Instruments and MIDI are not supported. A maximum of 1 main bus, 1 sidechain input bus and 1 main output bus are enabled. Note that VST3 are not supported on Wayland by the SDK which allows only X11 on Linux. Signed-off-by: pkv <[email protected]>
This pulls the VST3 SDK for CI builds. Signed-off-by: pkv <[email protected]>
This is to ensure test builds are working. This commit should be removed on merging of the PR. Signed-off-by: pkv <[email protected]>
Description
This PR implements a VST3 host for obs-studio, limited to audio effects (MIDI & instruments are excluded; they would require that obs supports MIDI natively which is not (yet?) the case).
Sidechain is supported.
Only one main input bus and one main output bus are supported.
This follows the announcement by Steinberg that VST3 SDK is from v3.8.0 licensed under a dual license (MIT or proprietary).
Clarification was also done by Steinberg on request of obs-studio project about logo usage which used to be mandatory and was in contradiction to GPL v3.
Ref: https://www.steinberg.net/developers/vstsdk/
VST3 has been written for windows, macOS and linux X11 platforms.
Note that 3.8.0 adds also a preview Wayland support (contributed by Presonus).
Ref: https://steinbergmedia.github.io/vst3_dev_portal/pages/Versions/Version+3.8.0.html
Wayland support will be added later.
Screenshots:

VST3 with sidechain

Motivation and Context
VST3 are the current standard for audio filters so they are a must have for any tool doing audio processing.
It's been a feature often requested by users.
How Has This Been Tested?
The following tests have been done on windows 11 23H2, macOS 15, linux Ubuntu 24.04 (X11 with proprietary nvidia drivers).
✅ Filter Lifecycle and Scene Integration
✅ Plugin Compatibility Tests
✅ Sidechain and Source Enumeration
✅ Stress and Performance Tests
✅ Error Handling & Logging
✅ Multiplatform support
Types of changes
Checklist: