Documentation
¶
Overview ¶
Command rtsynth renders audio from a Go thread promoted to the real-time scheduling class and joined to the audio device's workgroup.
A dedicated Go OS thread synthesizes samples into a short lock-free ring; the AudioUnit render callback drains the ring on Core Audio's IO thread. The ring is deliberately shallow, so if the synth thread misses its cadence the callback underruns and the gap is audible as a dropout.
Run it twice to hear what promotion buys:
go run . -harmonics 64 # promoted: survives CPU load go run . -harmonics 64 -no-promote # default class: glitches under load
with something like "yes > /dev/null &" per CPU in another terminal. Underruns are counted and reported either way.