fix(icom): fold the 7760's stereo RX stream down to the mono it plays as

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.
This commit is contained in:
2026-08-29 15:34:18 +02:00
parent 89e239d83f
commit 6321948415
+14
View File
@@ -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