Commit 9f9b282
feat: add Audio Unit plugin support for per-app and per-device effects
Enable third-party and system AU effect plugins to be loaded and applied
to individual applications or output devices, similar to SoundSource.
Audio pipeline:
- Non-interleaved stereo rendering with pre-allocated deinterleave buffers
- RT-safe AU hosting via AudioUnitRender with monotonic sample time tracking
- Immutable AUEffectChain with atomic swap + deferred destruction (500ms)
- Signal flow: EQ → AutoEQ → [Per-App AU] → [Per-Device AU] → Loudness → Limiter
- Tail time tracking for reverb/delay effects (continues rendering after silence)
- Crossfade support with independent AU instances per tap
- Device AU chains reload correctly on device switch
Plugin management:
- AUPluginScanner discovers kAudioUnitType_Effect and kAudioUnitType_MusicEffect
- Live detection via kAudioComponentRegistrationsChangedNotification
- Factory preset enumeration and selection per effect
- AU parameter state persisted on window close and app quit (ClassInfo plist)
- Crash guard integration: FNV-1a hash tracking, crash file write via POSIX,
auto-disable offending plugins on next launch
- Full persistence: per-app chains, per-device chains, bypass state, favorites,
crash history
UI:
- Hierarchical plugin picker with search, favorites (with namespaced ForEach IDs),
and crash warnings
- Effect chain view with enable/disable, bypass, factory presets, remove
- Failed plugin instantiation shown with warning icon
- AUGenericView floating windows for parameter editing
- Device FX button with ExpandableGlassRow integration
Architecture:
- AUChainState model consolidates entries, bypass, and failedEntryIDs
- AudioEngine owns observable AU state (appAU/deviceAU dictionaries);
SettingsManager handles persistence only
- Favorites and crash history use @Observable-tracked closures for views,
with @State in popover content (NSPanel observation boundary)
Includes 45 unit tests covering descriptor codable, scanner discovery,
AU instantiation, RT rendering (lowpass attenuation, reverb tail),
bypass passthrough, settings persistence, and crash history.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>1 parent 50a846e commit 9f9b282
20 files changed
Lines changed: 2933 additions & 19 deletions
File tree
- FineTuneTests
- FineTune
- Audio
- AUPlugins
- Engine
- Settings
- Views
- Components
- Rows
- Sheets
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
0 commit comments