Rack development blog

Coming in Rack v2: There is no more “engine thread”. The engine can only be stepped (i.e. advanced in time) by other threads, such as the audio driver thread managed by VCV Audio or the encoder thread in VCV Recorder. This restructuring has a number of massive benefits.

  • Support for multiple audio drivers. You can use your laptop’s headphone jack, your USB audio interface, Expert Sleepers Eurorack audio interface, etc. all at the same time. No more crashes or deadlocks. Of course, only one audio driver can “drive” the engine clock rate. Other audio drivers might drop samples if their clock rates don’t match exactly. This is selectable by enabling “Primary audio module” in the module’s context menu.

2019-10-29-153606_1600x900_scrot

  • In order for each audio buffer to be delivered to your audio device, the audio thread no longer has to lock itself (telling the OS to put it to sleep), wait on the engine thread, and unlock itself (waiting for the OS to schedule the thread again). This saves 1-10 microseconds per audio buffer on average, but more importantly, it saves 100-1000 microseconds when the CPU has an unusually high workload, which could result in audio glitches.
  • The new “Host” audio driver used in Rack for DAWs will run all module code (in Module::process()) directly in the “DAW thread”. Locking the DAW thread to wait on another thread is somewhat unacceptable.
  • Modules like VCV Recorder that can run much faster than real-time can render minutes of audio in only seconds, if they are chosen as the “Primary audio module”.
  • Stability (i.e. probability of crashing) is improved, simply because there are fewer threads dancing around complicated mutexes/shared data.
  • The “Real-time priority” menu item is removed, since the thread priority is now managed elsewhere (RtAudio, etc.)
33 Likes