Repository navigation
Offline renders give third-party plugins a moment before they start - #56
Open
marcin-koziol wants to merge 1 commit into
Open
marcin-koziol wants to merge 1 commit into
marcin-koziol wants to merge 1 commit into
Conversation
A self-frozen track played its first seconds silent: TONE3000 (a NAM amp) queues its models for loading after its state is restored and plays silence until they are ready, and the self-freeze job rendered the cache on fresh instances at once, faster than real time. The cache of a guitar track starting at its clip was silent for its first 2.29 s (the take sounds from its first frame); played from that cache, the track was not heard, its meter showing nothing, until then. Bounces starting near such a plugin's first notes lost them the same way. OfflineRenderer now warms up before the first block when it hosts a third-party plugin (PluginInstance::third_party: CLAP, VST3, LV2, AU and sandboxed instances): WARM_UP_SECONDS (2 s) of real time, the transport stopped, blocks of silence paced like a device's, then on while an instance says it is still loading (60 s at most). Plugins give no sign of a model loaded on a thread of their own, hence the fixed time. Built-in plugins and the tests' own fakes do not pay for it. KEY_VERSION goes to 2: caches made without the warm-up are not taken. Test offline_warm_up.rs: a plugin silent for its first 300 ms of real time; a render of its first quarter second was silent throughout without the warm-up, and sounds from its first frame with it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
After a while some audio tracks started late: the first seconds of a clip were silent, and the track's meter showed nothing either. MIDI tracks were fine.
The cause was self-freeze. Once the load had been high for a while, a track was rendered to a disk cache on fresh plugin instances, and the engine then played that cache. The rendering started immediately and ran faster than real time. TONE3000, a NAM amp, queues its models for loading after its state is restored and plays silence until they are ready (its log says "queued for load", then "NAM model prepared"). So the cache came out silent at its start. For a guitar track, the cache starts exactly at the clip, and its first 2.29 s are digital silence, while the take itself has sound from its first frame. Bounces lose a plugin's first notes the same way when they start close to them.
Change
PluginInstance::third_party(). It defaults tofalse; CLAP, VST3, LV2, AU and sandboxed instances returntrue.OfflineRendererhosts a third-party plugin, it now warms up before the first block:WARM_UP_SECONDS(2 s) of real time with the transport stopped, feeding blocks of silence at a device's pace. After that it keeps waiting while an instance reportsloading(), for 60 s at most. A plugin gives no sign that a model loaded on its own thread is ready, so the warm-up is a fixed time.KEY_VERSIONgoes to 2, so caches made without the warm-up are not reused.The cost: every offline render or self-freeze cache with third-party plugins starts 2 s later.
Tests
crates/faderframe-engine/tests/offline_warm_up.rs: a plugin that stays silent for its first 300 ms of real time. Without the warm-up, a render of its first quarter second is silent throughout. With it, the render has sound from frame 0.cargo test -p faderframe-engine: 404 passed.🤖 Generated with Claude Code