[fix](trx-backend-soapysdr): prevent double agc on mono wfm

Co-authored-by: Codex <codex@openai.com>
Signed-off-by: Stan Grams <sjg@haxx.space>
This commit is contained in:
2026-02-28 20:30:12 +01:00
parent 244f91d97b
commit 3d8fd32488
@@ -654,8 +654,16 @@ impl ChannelDsp {
// AGC is applied to WFM output too so all modes share the same target level.
let audio = if let Some(decoder) = self.wfm_decoder.as_mut() {
let mut out = decoder.process_iq(&decimated);
for s in &mut out {
*s = self.audio_agc.process(*s);
if !self.wfm_stereo && self.output_channels >= 2 {
for pair in out.chunks_exact_mut(2) {
let mono = self.audio_agc.process(pair[0]);
pair[0] = mono;
pair[1] = mono;
}
} else {
for s in &mut out {
*s = self.audio_agc.process(*s);
}
}
out
} else {