Repository navigation
Conversation
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 1b2cfc57-c6c7-44ce-95c9-72368d409ca8
djdefi
force-pushed
the
fix/mixer-clip-and-hotswap-load
branch
from
August 21, 2026 21:29
48c72b7 to
4ad5108
Compare
This was referenced Aug 22, 2026
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.
Mixer::clip() overflow bug (audio pop/click)
clip()used0x7FFFF(5 hex digits) as the positive clamp value. Thatdoesn't fit in the
int16_treturn type — it silently truncates to-1on the implicit conversion. So whenever the mixed signal exceeds
+32767(loud passages, or effects like Reverb/BitCrusher boostinglevel), the mixer emits a raw
-1sample instead of clamping to fullvolume, producing an audible pop/click.
Fixed to
0x7FFFwith an explicit(int16_t)cast on the pass-throughpath. Verified with an isolated reproduction of the old vs. new logic:
clip_old(40000) == -1,clip_new(40000) == 32767.MixSystem::openChannel() — load a deck without touching the other
Added
openChannel()/_openChannel()so a channel's source file can beloaded or replaced while the mixer is already running, without
disturbing the other deck. Follows the existing request-queue pattern
(
addSpeed/setEffect/etc.): routes through the audio thread via a newMixRequest::OPENwhen running, pausing only the target channel forthe swap.
This is needed by a companion JayD-Firmware change that lets
MixScreenstart playing as soon as one deck is loaded, instead ofblocking until both decks are chosen.