Fix total-audio-silence-on-any-EQ-change: negate ADAU1701 feedback coeffs
designPeakingEq() mapped the RBJ cookbook's a1/a2 straight into the ADAU1701 Param EQ cell's A0/A1 registers. The cookbook's difference equation subtracts the feedback terms; the ADAU1701 cell adds them. Any nonzero band gain therefore applied positive instead of negative feedback at the target frequency, so the biquad's state diverged and railed to a constant (inaudible DC) value -- the "any EQ/enhancement change goes completely silent, even the beep test tone" bug. Confirmed live: SigmaStudio's own direct safeload writes to the same registers (correctly signed by its own tool) only distorted, never silenced, which pointed at this driver's own coefficient math rather than the DSP chain or the safeload mechanism itself. Adds a host test asserting Jury stability for the ADD-convention denominator across the actual bass/stereo-enhance gain values and the GainDb range extremes, so a regression trips ctest instead of requiring a live listening test to notice. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
@@ -82,12 +82,20 @@ BiquadCoefficients designPeakingEq(FrequencyHz center, GainDb gain,
|
||||
const float a1 = -2.0F * cosOmega;
|
||||
const float a2 = 1.0F - alpha / a;
|
||||
|
||||
// RBJ's cookbook form subtracts the feedback terms
|
||||
// (y = ... - (a1/a0) y[n-1] - (a2/a0) y[n-2]); the ADAU1701 Param EQ
|
||||
// cell's A0/A1 registers add them instead (y = ... + A0 y[n-1] +
|
||||
// A1 y[n-2]), so the normalized RBJ a1/a2 must be negated when they
|
||||
// land in A0/A1. Without this, any nonzero gain applies positive
|
||||
// instead of negative feedback at the band's pole, so the biquad's
|
||||
// state diverges and rails to a constant (inaudible DC) value --
|
||||
// root cause of the 2026-08-25 total-silence-on-any-EQ-change bug.
|
||||
return BiquadCoefficients{
|
||||
.b0 = b0 / a0,
|
||||
.b1 = b1 / a0,
|
||||
.b2 = b2 / a0,
|
||||
.a0 = a1 / a0,
|
||||
.a1 = a2 / a0,
|
||||
.a0 = -(a1 / a0),
|
||||
.a1 = -(a2 / a0),
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user