From 63219484152160ba62a101b6e5c76c827b10d49c Mon Sep 17 00:00:00 2001 From: rouggy Date: Sat, 29 Aug 2026 15:34:18 +0200 Subject: [PATCH] fix(icom): fold the 7760's stereo RX stream down to the mono it plays as MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The rig keeps sending two-channel LPCM after rxcodec asks for one — 1280-byte payloads, 320 stereo frames per 20 ms tick, right channel all zeros in the capture. Played as mono that interleaving is half-speed metallic garble. A stereo-sized packet is folded to its left channel; a 640-byte mono packet from a rig that honours the request passes through untouched. --- app.go | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/app.go b/app.go index 72e0f60..ed7350f 100644 --- a/app.go +++ b/app.go @@ -15573,6 +15573,20 @@ func (a *App) reloadCAT() { if err != nil { return } + // The IC-7760 streams TWO-channel LPCM whatever the conninfo + // asks for (rxcodec 0x02 was requested, 1280-byte payloads + // kept arriving — 320 stereo frames per 20 ms tick, right + // channel all zeros). Played as mono that is half-speed + // metallic garble. A stereo-sized packet is folded to its + // left channel; a 640-byte mono packet (a rig that honours + // the request) passes through untouched. + if len(pcm) == 1280 { + mono := make([]byte, len(pcm)/2) + for i := 0; i+3 < len(pcm); i += 4 { + mono[i/2], mono[i/2+1] = pcm[i], pcm[i+1] + } + pcm = mono + } a.audioMgr.PushMonitorAudio(pcm) // And to the QSO recorder, which has no device to capture from // on this backend. It drops the samples unless a recording is