Technical notes
How it was measured, and why it is built this way.
Each note explains one part: the method, the numbers, the versions and the date of the measurement. The reference of each project is on its own page; these notes are the reasoning behind it.
Qualifying plugins
How a plugin's memory is judged
/notes/how-a-plugins-memory-is-judged
A plugin's memory is measured per instance, watched for growth, bounded by a hard limit and judged against each host's budget, so that no plugin is qualified as good on a host it would hurt.
Plugins that change a callee-saved register
/notes/plugins-that-change-a-callee-saved-register
A plugin that returns with a callee-saved register changed breaks its host later and somewhere else. The host core now guards every plugin call, records the first change, and the qualification offers such a plugin isolated only.
The plugin host
"Pins on first use: how plugin-hostd trusts a plugin binary"
/notes/pins-on-first-use
plugin-hostd records the hash of a plugin's files and of its parameter layout the first time the plugin is added, checks them on every later add, and refuses loudly when they change, so that a standalone host gets pins without a controller sending them.
"Chains: plugins in series in one worker, and a crashed member quarantined"
/notes/chains-plugins-in-series-in-one-worker
A chain runs a strip's plugins in order inside one worker process, so they wake once per cycle instead of once each; when a member crashes, it alone is quarantined and the rest of the chain goes on.
"The grouping planner: the fewest workers that pins and history allow"
/notes/the-grouping-planner
Given a strip's plugins in signal order, the planner puts consecutive plugins that may share a process into one worker and leaves the others alone, judged by their pins, their cost and what they did on this machine; it stays off by default until the benchmark shows it wins.
Zynthian on a Raspberry Pi 5
Why most LV2 plugins on a Zynthian need inferred port groups
/notes/why-lv2-plugins-on-zynthian-need-inferred-port-groups
Half the LV2 plugins installed on a Zynthian have more than four controls and no port groups, so the touchscreen cuts them into screens of four in port order. A generated bundle that replaces the plugin's own description, never its files, can add groups that every Zynthian consumer reads.
From a plugin file to a page on the screen
/notes/from-a-plugin-file-to-a-page
Five stages turn a CLAP or LV2 file into a menu row with its figures, controller pages and a MOD GUI on a Zynthian. Each stage has one owner, writes one artefact in a fixed place, and the stages after it read that artefact and nothing else.
"plugin-hostd on a Raspberry Pi 5: what was measured and how"
/notes/plugin-hostd-on-a-raspberry-pi-5
On a Raspberry Pi 5 running Zynthian with an audio interface, a plugin-hostd chain has the lowest DSP load of the four hosts measured, omx-clap-host, mod-host and jalv being the others, at 48 and at 96 kHz, and uses about half the memory of mod-host. This note gives the device, the method and every table.
"Instruments on a Pi 5: Surge XT voices across the cores"
/notes/instruments-on-a-pi-5
An instrument that computes every voice on one core sets the polyphony a Pi 5 can play, however idle the other cores are. Surge XT does not split its voices into tasks, so the cores it can use come from running each instrument in a worker of its own, spread over the audio cores.
"One worker per chain or one process per plugin: the trade-offs"
/notes/one-worker-per-chain-or-one-process-per-plugin
Grouping a chain into one worker saves most of the memory and much of the CPU that one process per plugin spends, and a crash still costs only the plugin that crashed; the price is that plugins sharing a process must be trusted, which is what qualification decides.
The host core
"Could the host take VST3? The adapter seam and its cost"
/notes/could-the-host-take-vst3
A VST3 adapter is possible in plain C against Steinberg's C API, under licences a GPL host can use, and a spike hosted a real VST3 effect end to end. It would cost about 6200 lines and three weeks, for a thin demand, so it is not being built; what would change that is written down.
"Audio layouts: every port a plugin declares, and how the host judges the fit"
/notes/audio-layouts-and-how-the-host-judges-the-fit
The host used to admit a mono or stereo main pair and refuse everything else, which left out 84 of 975 LV2 plugins that mod-host hosts. Now the library describes every audio port a plugin declares, and whoever runs the plugin judges whether it can carry that layout, refusing by name rather than folding a layout down.
"One JACK client for a chain: what it saves and what it does not"
/notes/one-jack-client-for-a-chain
Running N plugins in series inside one JACK client, instead of N clients linked in series, is bit-identical and cuts the cycle's end time by 30 to 56 % at the median and the host's CPU by a third or more, with no xrun and no worse tail; the saving is the wake-ups, not the plugins.
"Hosting paths compared: mod-host, omx-clap-host, the LV2 adapter and in-process"
/notes/hosting-paths-compared
The same plugins cost the same per plugin on every hosting path, within about a microsecond, and no path adds latency. The differences in the whole graph come from CPU idle states and the number of nodes, not from how a host runs a plugin; what separates the paths is memory, start-up and what a crash takes with it.
"CPU idle states and plugin hosting: what holding cpu_dma_latency buys"
/notes/cpu-idle-states-and-plugin-hosting
Holding /dev/cpu_dma_latency at 10 µs, so no core sleeps deeper than C1, cuts the audio graph's cycle three to five times on every host measured and removes the overruns, for one to four watts; holding it at 0 costs sixty watts for a little more. With the hold, mod-host's lead over the other hosts disappears.
"The LV2 adapter against mod-host and jalv: size and structure"
/notes/the-lv2-adapter-against-mod-host-and-jalv
The LV2 adapter that presents an LV2 plugin as a CLAP plugin makes the same lilv calls in the same order as mod-host and jalv. Its code is smaller and less branched than mod-host's core and 1.4 times jalv's, and nearly all of that difference is features the CLAP contract requires and jalv does not offer.