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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user