Summoner plugin host illustration

Summoner

An out-of-process audio plugin host.

Summoner is the component that loads and runs VST3 and Audio Unit plugins in a separate helper process, so a crashing or hanging plugin can't take your application down. It is part of Signals & Sorcery, a coherent set of Rust audio building blocks for audio apps, plugins, players and DAWs.

Repositorygithub.com/shiehn/summoner-plugin-host
LicenseMIT, free for commercial and closed-source use
StatusIn preparation
LayerSound and devices (how the layers stack)
Crates (planned names)summoner, summoner-proto, summoner-rt, summoner-scan, summoner-plugin, summoner-testkit

What it is

Third-party plugins are the least trusted code in any audio application. A plugin can crash, deadlock, leak, take too long or corrupt memory. Inside your process, it takes your process with it. Summoner moves every plugin into a helper process and gives your application a supervised, realtime-safe connection to it.

It has two parts:

  1. The library links into your application. It spawns and supervises the helper process, talks to it over a control channel, and gives your audio thread one link per plugin chain.
  2. The host program is a small helper executable that ships with your application. It loads the plugins, runs their audio on its own realtime threads, and owns their editor windows.

What it handles:

  • Scanning. Each plugin is probed in its own short-lived process, with a time budget. A plugin that crashes or hangs during a scan is recorded as such and never stops the scan.
  • Loading chains. Ask for a chain of instruments and effects and get back a realtime link once every slot is loaded and prepared.
  • Realtime block exchange. Audio, MIDI, parameter changes and the transport pass through shared memory, with a doorbell to wake the other side. The audio thread never blocks, locks or allocates.
  • State. Plugin state is read and written as versioned, framed blobs. On save, only slots whose state changed are read back, inside a time and byte budget.
  • Parameters and editors. Parameters are read in pages and set by the plugin's own id. Editor windows open and close in the helper process.
  • Offline render. A synchronous, one-block-at-a-time mode, so bounces use the same plugins and code as live playback.
  • Failure handling. Crashes, hangs and protocol faults are detected, reported as events and recovered from. The helper respawns with backoff, chains reload with their last known state, and a plugin that keeps crashing is quarantined.

Usage example

Your application talks to Summoner through two bounded queues: commands in and events out. Sending a command never waits. A full queue returns "busy" at once.

Illustrative sketch

This is the planned shape of the public API, taken from the READMEopen in new window. It is not final.

use std::sync::{mpsc, Arc};
use summoner::{ChainSpec, Command, Config, Event, Host, PluginRef};

// Start the supervisor. It spawns the helper process and does the handshake.
let (events_tx, events) = mpsc::sync_channel(4096);
let config = Config::new("path/to/summoner-host".into(), 48_000.0, Arc::new(MyStateHasher));
let host = Host::start(config, events_tx)?;

// Ask for a chain: one instrument followed by one effect.
let spec = ChainSpec::stereo()
    .slot(PluginRef::vst3("/Library/Audio/Plug-Ins/VST3/MySynth.vst3", synth_class_id))
    .slot(PluginRef::audio_unit(effect_type, effect_subtype, effect_manufacturer));
host.send(Command::Load { key: 1, spec, states: vec![] })?;

// React to what happens, on your control thread.
for event in events {
    match event {
        Event::ChainReady { key, link, slots, .. } => audio.install(key, link, slots),
        Event::ChainDown { key, reason } => audio.silence(key, reason),
        Event::StateRead { key, slot, blob, .. } => project.store_state(key, slot, blob),
        _ => {}
    }
}

On the audio thread, a chain's link is called once per block:

fn process(&mut self, io: &mut AudioIo, midi: &[TimedMidi], transport: &Transport) {
    // No allocation, no lock, no blocking: one shared-memory exchange and at most one wake.
    self.link.exchange(io, midi, transport);
}

If the helper misses a deadline, the block is filled with silence (or the dry input, for an effect) and counted. Your audio thread is never held up.

Failures are part of the API

What happensWhat Summoner doesWhat your application sees
The helper crashesrespawns it with backoff, reloads every chain with its last known stateChainDown, then ChainReady again
A plugin crashes the helperblames that slot and quarantines the plugin as an empty pass-throughthe chain comes back with that slot marked quarantined
The helper stops answeringthe wedge detector kills it and treats it as a crashChainDown with reason wedge
The helper speaks another protocol versionrefuses it and doesn't respawnChainDown with reason incompatible

The summoner-testkit crate holds a test double of the host program. It speaks the real protocol over trivial DSP, and knobs make it crash, hang or run slow, so your tests can cover every failure path without a single third-party plugin.

How it fits in the ecosystem

Summoner sits in the sound and devices row. Dependencies point down, never up.

Below it (what it depends on), only the floor:

  • Runecraft (repoopen in new window) for the log contract, the realtime helpers and the process and shared-memory primitives. Every Summoner crate is #![forbid(unsafe_code)]; the system calls live in Runecraft.
  • Orrery (repoopen in new window) for the transport it passes to plugins: tempo, position, loop points and bar start.

Above it (what can use it):

Neither is required. An effects rack, a batch processor or a plugin test rig can use Summoner with nothing else from Signals & Sorcery.

What it deliberately doesn't do: no audio graph or mixing (that is Leyline), no audio devices (your app or Aethergate owns the device), no project model, and no plugin authoring (crates such as nih-plug and clack serve that well).

Extend and display
The engine
Musical structure
Signal flow
ComponentRepositoryRoleStatus
Runecraftrunecraft-audio-coreShared contracts, realtime safety, process isolation and realtime-safe logging: the floor every other component stands onIn preparation
Orreryorrery-musical-timeTempo and meter, transports, bar, beat and sample maths, timed MIDIIn preparation
Summonersummoner-plugin-hostOut-of-process VST3 and Audio Unit plugin hosting with crash isolationIn preparation
Aethergateaethergate-audio-platformAudio devices (cpal, CoreAudio, a fake device for tests) and shared-memory metersPlanned
Leylineleyline-audio-graphA realtime audio graph with delay compensation, and a compiler from an edit model to a graphPlanned
Cantripscantrips-audio-dspBuilt-in mixer DSP: sampler, fader, pan, meters, compressorPlanned
Scriptoriumscriptorium-audio-mediaDecode and encode, a sample store, streaming voices, crash-safe recordingPlanned
Tapestrytapestry-session-modelTracks, clips, lanes and scenes; edits with undo; a crash-safe project storePlanned
Processionprocession-timeline-engineWhat plays in each block: regions, notes, automation, launchesPlanned
Grimoiregrimoire-daw-engineThe assembled engine and its headless JSON-RPC protocolPlanned
Familiarfamiliar-plugin-sdkAn SDK for plugins and panels that extend a Signals & Sorcery enginePlanned
Glyphworkglyphwork-audio-uiAudio UI widgets: meters, knobs, faders, waveformsPlanned

Status

In preparation. The crates exist and are tested, but they live in another repository today. The repositoryopen in new window holds the README until the first public release. The public API is still being reviewed, so names and signatures may change.

PlatformPlugin formatsStatus
macOS (Apple silicon)VST3, Audio Unitwhere it runs today
WindowsVST3planned
LinuxVST3planned
AnyCLAPplanned

An in-process mode, for simple tools that would rather trade isolation for simplicity, is planned behind the same API. WebAssembly is out of scope (a browser can't load native plugins), but a web build could drive a native Summoner through Grimoire's protocol.

VST is a registered trademark of Steinberg Media Technologies GmbH. Audio Unit is a trademark of Apple Inc.

Last Updated:
Contributors: shiehn