fix: _process_4cm handles 1D mono input gracefully
CI / test (push) Has been cancelled

When routing mode is '4cm' but JACK provides mono audio (1D array),
the _process_4cm method crashes with IndexError on audio_in[0,:].
Treat mono input as guitar channel with silent return channel.

This happens when JACK is configured with 1 capture port (mono mode)
but routing_mode is set to '4cm' — e.g. after a settings sweep that
toggles routing_mode without changing JACK port config.
This commit is contained in:
2026-06-18 18:25:12 -04:00
parent 4039ee963d
commit d7889c6f23
+8 -2
View File
@@ -718,8 +718,14 @@ class AudioPipeline:
ch0 = Send output (to amp input)
ch1 = Return output (to amp FX return)
"""
ch0 = audio_in[0, :].copy()
ch1 = audio_in[1, :].copy()
if audio_in.ndim == 1:
# Mono input in 4CM mode — treat entire input as guitar
# channel, create silent return channel
ch0 = audio_in.copy()
ch1 = np.zeros_like(audio_in)
else:
ch0 = audio_in[0, :].copy()
ch1 = audio_in[1, :].copy()
# ── 60Hz mains hum notch filter on both channels ────────────
b0, b1, b2 = self._notch_b0, self._notch_b1, self._notch_b2