fix(audio): the network monitor needs no From-radio device

AudioStartMonitor refused before reaching the network branch when From-radio
was empty — which is the NORMAL network setup, so the new speakers checkbox
un-ticked itself the instant it was ticked. The capture-device requirement now
applies only to the USB path that actually captures.
This commit is contained in:
2026-08-29 21:45:18 +02:00
parent 7ac342e2d4
commit 08bc401681
+7 -3
View File
@@ -10681,9 +10681,6 @@ func (a *App) AudioStartMonitor() error {
return fmt.Errorf("audio not initialized") return fmt.Errorf("audio not initialized")
} }
cfg, _ := a.GetAudioSettings() cfg, _ := a.GetAudioSettings()
if strings.TrimSpace(cfg.FromRadio) == "" {
return fmt.Errorf(`no "From radio" capture device set — pick the rig's USB Audio CODEC in Settings → Audio`)
}
// When the rig's audio arrives over the NETWORK (Icom 50003), the monitor // When the rig's audio arrives over the NETWORK (Icom 50003), the monitor
// must be render-only: this button used to start a USB capture from the // must be render-only: this button used to start a USB capture from the
// "From radio" device as well, and that second producer — often another // "From radio" device as well, and that second producer — often another
@@ -10695,6 +10692,13 @@ func (a *App) AudioStartMonitor() error {
applog.Printf("audio: RX monitor start (network sink only → listen=%q)", cfg.ListeningDevice) applog.Printf("audio: RX monitor start (network sink only → listen=%q)", cfg.ListeningDevice)
return a.audioMgr.StartMonitorSink(cfg.ListeningDevice) return a.audioMgr.StartMonitorSink(cfg.ListeningDevice)
} }
// Only the USB path needs a capture device — checked AFTER the network
// branch, which needs none: with From-radio empty (the normal network
// setup) this refusal was un-ticking the speakers checkbox the instant it
// was ticked.
if strings.TrimSpace(cfg.FromRadio) == "" {
return fmt.Errorf(`no "From radio" capture device set — pick the rig's USB Audio CODEC in Settings → Audio`)
}
applog.Printf("audio: RX monitor start (from=%q → listen=%q)", cfg.FromRadio, cfg.ListeningDevice) applog.Printf("audio: RX monitor start (from=%q → listen=%q)", cfg.FromRadio, cfg.ListeningDevice)
a.audioMgr.SetMonitorGain(cfg.FromGain) a.audioMgr.SetMonitorGain(cfg.FromGain)
return a.audioMgr.StartMonitor(cfg.FromRadio, cfg.ListeningDevice) return a.audioMgr.StartMonitor(cfg.FromRadio, cfg.ListeningDevice)