diag(icom net): name the audio stream when CI-V goes quiet
The RX audio stream is experimental and shares the rig's session with CI-V. The shape in an operator's log is unmistakable: audio packets arriving by the hundred while not one CI-V reply comes back, the watchdog tearing the session down, twenty seconds' pause, and the whole thing again — read from outside as "the Icom keeps disconnecting", with nothing pointing at the switch that would end it. The log now says it, and names the setting. icomAudio counts what it has delivered so the line distinguishes "audio is enabled" from "audio is arriving", which is the half that makes it a suspect.
This commit is contained in:
@@ -67,12 +67,26 @@ type icomAudio struct {
|
||||
txOuter uint16
|
||||
txSend uint16
|
||||
lastRx atomic.Int64 // UnixNano of last packet (liveness)
|
||||
rxCount atomic.Int64 // packets delivered on this stream
|
||||
|
||||
done chan struct{}
|
||||
closeOnce sync.Once
|
||||
}
|
||||
|
||||
func (a *icomAudio) markRx() { a.lastRx.Store(time.Now().UnixNano()) }
|
||||
func (a *icomAudio) markRx() {
|
||||
a.lastRx.Store(time.Now().UnixNano())
|
||||
a.rxCount.Add(1)
|
||||
}
|
||||
|
||||
// packets reports whether the stream is actually delivering — the difference
|
||||
// between "audio is on" and "audio is arriving", which is what makes it worth
|
||||
// naming as a suspect when CI-V has gone quiet on the same session.
|
||||
func (a *icomAudio) packets() int64 {
|
||||
if a == nil {
|
||||
return 0
|
||||
}
|
||||
return a.rxCount.Load()
|
||||
}
|
||||
|
||||
// Close tears the audio stream down (disconnect a few times; UDP is lossy).
|
||||
func (a *icomAudio) Close() {
|
||||
|
||||
@@ -496,6 +496,17 @@ func (n *icomNet) civPump() {
|
||||
}
|
||||
debugLog.Printf("icom net: no CI-V DATA for 10 s (transport last heard %s ago; last scope frame %s ago; last socket error: %v; missing-seq backlog: %d; CI-V commands SENT since the last answer: %d)",
|
||||
time.Since(lastPkt).Round(time.Second), scopeAge, lastErr, len(n.rxMissing), n.txCiv.Load()-n.txAtData.Load())
|
||||
// THE AUDIO STREAM IS THE FIRST SUSPECT, AND ONLY THE LOG CAN SAY SO.
|
||||
//
|
||||
// The RX audio stream is experimental and shares the rig's session with
|
||||
// CI-V. The shape seen in the field is exactly this one: audio packets
|
||||
// arriving by the hundred while not one CI-V reply comes back, the
|
||||
// watchdog tearing the session down, and the whole thing beginning
|
||||
// again — a loop an operator reads as "the Icom keeps disconnecting",
|
||||
// with nothing pointing at the switch that would end it.
|
||||
if n.audio != nil && n.audio.packets() > 0 {
|
||||
debugLog.Printf("icom net: the RX audio stream is running and still delivering while CI-V has gone quiet — that option is experimental and shares this session. If the drops continue, turn OFF \"Stream RX audio over the network\" in Settings → CAT and see whether control steadies.")
|
||||
}
|
||||
// And try the gentle repair before the 30 s watchdog tears the whole
|
||||
// session down: if the rig quietly closed the CI-V data flow (the
|
||||
// transport is still chatting, so the session itself stands), saying
|
||||
|
||||
Reference in New Issue
Block a user