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
+6
View File
@@ -718,6 +718,12 @@ class AudioPipeline:
ch0 = Send output (to amp input) ch0 = Send output (to amp input)
ch1 = Return output (to amp FX return) ch1 = Return output (to amp FX return)
""" """
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() ch0 = audio_in[0, :].copy()
ch1 = audio_in[1, :].copy() ch1 = audio_in[1, :].copy()