mirror of
https://github.com/storytold/soundcraft.git
synced 2026-10-27 12:06:51 -06:00
The audio thread overwrote the shared meter snapshot every block (~94 blocks/s at 512 frames, 48 kHz) while the UI read it 20-60 times a second, so it only ever saw the latest block and short transients were under-read. Blocks are now folded together (max of each channel's peak and of the gain reduction; plugin failures keep the latest count) until the UI takes them with Player::take_meters, which also starts a new period. Blocks rendered while the UI holds the lock wait in an audio-side accumulator instead of being lost; the audio thread still only try_locks. Stopping, starting and locating now zero the meters in place instead of clearing the maps, so playing again no longer re-allocates every track's entry on the audio thread. The UI thread works out which tracks a session update deleted and tells the audio thread, which drops just their entries. The Mix window and the Renderer now read the snapshot the app takes once per poll instead of reading the player themselves, so a period's peaks are not split between readers. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>