fix(audio): prewarm process taps, apply AutoEQ during crossfade, cut startup CPU, and improve streaming detection - #409
Open
FelikZ wants to merge 1 commit into
Conversation
… cut startup CPU from silent taps, and improve streaming change detection - apply destination AutoEQ profile during device crossfade and destructive switch — eliminates the 1-2s window where unprocessed audio (no preamp) hits the output device at full volume - skip biquad processing for flat EQ bands to cut startup CPU from silent taps (ronitsingh10#245) - filter non-streaming apps from AudioEngine.apps to avoid creating unnecessary taps - include hasRunningProcess in AppFingerprint so play/pause transitions trigger onAppsChanged - snapshot previous fingerprints for reliable streaming change detection - add autoEQProfile parameter to ProcessTapControlling protocol with convenience overloads - update test RecordingProcessTapController to match new protocol signatures - adjust ProcessingPipelineTests expectation: flat EQ now bit-exact passthrough
This was referenced Aug 8, 2026
Author
3 tasks
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.
Hand written summary:
When using heavy preamp profiles (-23db in my case) there are annoying bugs:
All of the above seem fixed here.
From AI details:
Fixes #170.
Fixes #245.
Summary
Prewarm process taps before playback
Keeps Core Audio process objects visible to the engine even before they are actively streaming, so FineTune can create process taps before the first audible buffer. Avoids raw/unprocessed audio leak when playback starts.
Apply destination AutoEQ profile during device crossfade
When switching output devices (e.g. MacBook speakers → USB DAC with EQ preset), the secondary tap now receives the destination's AutoEQ profile before the crossfade begins. Previously, the profile was applied only after the crossfade completed, leaving a 1–2s window where audio hit the device without preamp reduction — dangerous when the preset applies heavy negative gain (e.g. −23 dB).
Cut startup CPU from silent taps and flat EQ (#245)
Improve streaming change detection
Files changed
AudioEngine.swift,ProcessTapController.swift,ProcessTapControlling.swift,AudioProcessMonitor.swift,EQProcessor.swift,EQSettings.swift,AudioEngineTapInitialStateTests.swift,ProcessingPipelineTests.swiftTesting
./test.shpasses.xcrun swiftc -parsepasses on all changed files.git diff --checkclean.