fix: name the audio device in diagnostics instead of quoting its GUID

The watchdog fired exactly as intended and said:

  no audio at all from "{0.0.1.00000000}.{6a27abfd-f277-496b-b6f1-f92ec284c636}"

which tells the operator nothing they can act on. "DAX RX 1 (FlexRadio DAX)"
points straight at the DAX panel.

Endpoint ids are what gets CONFIGURED and stored, so they are what the recorder
holds; the friendly name is resolved only when something has gone wrong. When
the endpoint cannot be found at all the id is still shown — a device that has
disappeared explains an empty recording too.
This commit is contained in:
2026-07-31 00:11:29 +02:00
parent c9f7279a01
commit a93f52d2b9
3 changed files with 39 additions and 12 deletions
+5 -5
View File
@@ -155,7 +155,7 @@ func (r *Recorder) Start(fromDev, micDev string, prerollSec int) error {
r.lastA = time.Now()
r.srcMu.Unlock()
}); err != nil {
LogSink("recorder: capture from %q failed: %v", fromDev, err)
LogSink("recorder: capture from %q failed: %v", DeviceName(fromDev), err)
}
}()
if twoSrc {
@@ -170,7 +170,7 @@ func (r *Recorder) Start(fromDev, micDev string, prerollSec int) error {
r.lastB = time.Now()
r.srcMu.Unlock()
}); err != nil {
LogSink("recorder: capture from %q failed: %v", micDev, err)
LogSink("recorder: capture from %q failed: %v", DeviceName(micDev), err)
}
}()
}
@@ -193,11 +193,11 @@ func (r *Recorder) Start(fromDev, micDev string, prerollSec int) error {
aQuiet, bQuiet := r.lastA.IsZero(), r.lastB.IsZero()
r.srcMu.Unlock()
if aQuiet {
LogSink("recorder: no audio at all from %q after 3 s — the device opened but nothing is streaming", fromDev)
AlertSink("No audio from %s — nothing is being recorded", fromDev)
LogSink("recorder: no audio at all from %q after 3 s — the device opened but nothing is streaming", DeviceName(fromDev))
AlertSink("No audio from %s — nothing is being recorded", DeviceName(fromDev))
}
if twoSrc && bQuiet {
LogSink("recorder: no audio at all from %q after 3 s — the device opened but nothing is streaming", micDev)
LogSink("recorder: no audio at all from %q after 3 s — the device opened but nothing is streaming", DeviceName(micDev))
}
}()