Skip to content

Comments

JackTrip Audio Bridge VST3 Plugin#1368

Merged
mikedickey merged 25 commits intodevfrom
feature/vst3-audio-bridge
Jan 13, 2025
Merged

JackTrip Audio Bridge VST3 Plugin#1368
mikedickey merged 25 commits intodevfrom
feature/vst3-audio-bridge

Conversation

@mikedickey
Copy link
Collaborator

@mikedickey mikedickey commented Jan 5, 2025

This PR adds support for the "JackTrip Audio Bridge", a new VST3 compatible plugin that makes it much easier to integrate audio from other applications (like digital audio workstations) with JackTrip. A primary design goal has been to keep it simple: all audio sent to the plugin is mixed into audio from your "input device", and all audio coming back from a remote peer or JackTrip server is routed to the plugin's output.

The plugin is designed to be standalone from the JackTrip desktop application, as opposed to being a wrapper around it. This allows us to preserve the focus of the desktop app on providing the best UX for online collaboration, without trying to jam it into an architecture was never meant for that. It also means that you can have any number of plugin instances, running across any number of digital audio applications, with JackTrip being the glue that brings it all online.

The exchange of audio between the plugin and JackTrip's desktop app is accomplished using inter-process communication (IPC), a technique well tested and proven by the namesake JACK Audio Connection Kit. More specifically, we use local sockets or named pipes provided by QLocalSocket. This is built as extension to the protocol initially added to support deep links, and through this is extended to include support for live audio pipes. All the real work is encapsulated into a new AudioSocket class and I would envision this being reusable for other types of plugins, including things like LV2 and LADSPA as well as specialized commercial ones like those in Reason or Universal Audio. It's all open source, and ideally every audio application would just bake in support for JackTrip as a native feature.

The plugin offers a basic GUI with three volume level controls:

  • Send: adjusts level for audio being sent from plugin to JackTrip's input
  • Receive: adjusts level for audio being received by plugin from JackTrip's output
  • Passthrough: adjusts level for audio passing from plugin's input to plugin's output

In addition, there is an LED in the upper-right corner that indicates whether or not it's connected to the JackTrip desktop app. It automatically handles (re)connections whenever the app is available.

jacktrip_audio_bridge

Building the plugin requires Steinberg's VST3 SDK, which is available under a dual-license (GPL3 and proprietary). JackTrip Labs has a proprietary license agreement with Steinberg that allows for binary redistribution without copyleft requirements. It will only be built if you add the parameters vst-sdkdir and vst-libdir to meson setup command, i.e. -Dvst-sdkdir=/opt/vst3sdk -Dvst-libdir=/opt/vst3sdk/lib

TODOs

  • Update CICD to build and package plugin
  • Support peer with different buffer size
  • Support peer with different sample rate? (punting this to a different PR)

@mikedickey mikedickey force-pushed the feature/vst3-audio-bridge branch 2 times, most recently from a4678e9 to 6f9d892 Compare January 5, 2025 18:04
Currently this only builds a VST plugin that does nothing, based
on Steinberg's Hello World example. It should work across platforms
and load OK in all hosts that support VST3.

This plugin is intentionally as simple as possible. It supports
two input channels and two output channels, and has no user
interface. The audio signal it receives will be mixed into your
JackTrip input audio signal, and it will output the audio signal
received back from a remote JackTrip server. There is likely a
lot more that can be added over time, but this is the MVP.

Support for building the VST3 plugin is enabled by providing
the following two parameters to meson setup:

* vst-sdkdir: directory where the VST3 SDK is installed (headers)
* vst-libdir: directory where compiled VST3 libraries are located
Fix crash when 1 input channel
to decouple their lifecycle with AudioInterface
and expire old audio sockets that have lost connections
Required for Reason and possibly other hosts
Moving lost connection detection to AudioSocketWorker

Use a singleton of QCoreApplication in the VST plugin
Working support for connected state LED and volume knobs for
send, receive and passthrough.

Added support for silence flags and bypass VST features.

Added support for VST wysiwyg editor when building debug mode.
Use realtime priority for audio socket threads in desktop app

Move overflow/underflow detection and reporting into worker thread

Split exchangeAudio into sendAudio, receiveAudio, readAudioHeader

Fix for VST passthrough
@mikedickey mikedickey force-pushed the feature/vst3-audio-bridge branch from 6f9d892 to f903077 Compare January 5, 2025 19:07
Fix case of multiple audio socket connections triggering restart cycle

Include monitor and volume adjustments in signal sent to audio sockets

Clean up SocketClient
@mikedickey mikedickey force-pushed the feature/vst3-audio-bridge branch from 12f8337 to 68d37e6 Compare January 7, 2025 01:00
Updates to adapt to process callbacks with nframes that do not match
buffer size passed to setupProcessing (i.e. Audacity)

Automatic adjustment of receive queue latency

Added support for VST plugin logging for debugging
@mikedickey mikedickey force-pushed the feature/vst3-audio-bridge branch from a8618cb to 29f21ca Compare January 8, 2025 17:45
Fixing bug where local socket server always fails when launch
is automatically started after an install (incl upgrade)

Bumping version to 2.5.0-beta0 for pre-beta testing
@mikedickey mikedickey force-pushed the feature/vst3-audio-bridge branch from 4ca6fd2 to a1cd052 Compare January 9, 2025 22:12
state from processor to controller, since some hosts (i.e. Audacity)
do not support the use of outputParameterChanges in process()

Update volume knobs to use 199 steps versus continuous, since the
images include 200

namespace cleanup
@mikedickey mikedickey force-pushed the feature/vst3-audio-bridge branch from a1cd052 to 5c9a6f9 Compare January 9, 2025 22:23
Attempt at making sliders more natural through logarithmic scaling
@mikedickey mikedickey force-pushed the feature/vst3-audio-bridge branch from 15b638b to 42589ac Compare January 10, 2025 01:14
Fixing some bugs in plugin's moduleinfo.json file that caused
it to fail validation

Mark VST sdk and other third party libraries as system headers
since we presume these are already available as systems libraries
because some DAWs (namely Ardour) don't seem to support the latter

Switching some logging from qDebug() to iostreams

Other misc updates for Linux
Otherwise, the linker silently allows missing symbol references.
That makes it very unreliable across VST hosts because the ones
that have already loaded the missing symbols will work but those
that have not fail to load.

This makes the plugin work also in Carla. Still not working in
Audacity, but then again no VST3 plugins seem to work with it,
even the VST3 SDK examples!

Add support for setBusArrangement() to enforce either mono -> mono
or stereo -> stereo. Otherwise, the plugin appears to support 64
inputs and 64 outputs, which is incorrect.
VST plugins connected state

Fixing some clag formatting issues
Bumping version to 2.5.0-beta1 and updated changelog
@mikedickey mikedickey marked this pull request as ready for review January 13, 2025 11:02
@mikedickey
Copy link
Collaborator Author

This is now building and installing on all platforms, and I tested with a variety of apps on each one. I think it's ready for a beta.

@mikedickey mikedickey requested review from cchafe and nwang92 January 13, 2025 11:04
@cchafe
Copy link
Collaborator

cchafe commented Jan 13, 2025

Can you point me to the build assets? If there's a linux VST, I'll take it for a spin.

@nwang92
Copy link
Contributor

nwang92 commented Jan 13, 2025

Can you point me to the build assets? If there's a linux VST, I'll take it for a spin.

Seems like one of the artifacts JackTrip-eaaec2a-Linux-* produced in https://github.com/jacktrip/jacktrip/actions/runs/12751489391?pr=1368 should have it

@cchafe
Copy link
Collaborator

cchafe commented Jan 13, 2025

Works great with Ardour under linux!

@mikedickey
Copy link
Collaborator Author

mikedickey commented Jan 13, 2025

Can you point me to the build assets? If there's a linux VST, I'll take it for a spin.

Seems like one of the artifacts JackTrip-eaaec2a-Linux-* produced in https://github.com/jacktrip/jacktrip/actions/runs/12751489391?pr=1368 should have it

Also I'm mirroring signed builds in the jacktriplabs repo for testing https://github.com/jacktriplabs/jacktrip/actions/runs/12755817883

The call to WaitFreeFrameBuffer::pop seems to be copying more
bytes than it should and somehow causing corruption. This works
around it but I'm not 100% sure why.
@mikedickey mikedickey force-pushed the feature/vst3-audio-bridge branch from e17d0b1 to 40af605 Compare January 13, 2025 20:48
@mikedickey mikedickey requested a review from nwang92 January 13, 2025 21:08
@mikedickey mikedickey merged commit c1b2692 into dev Jan 13, 2025
20 checks passed
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

Successfully merging this pull request may close these issues.

3 participants