fix: a playback that never starts no longer fails silently

From an operator's log, playing a recording on the air repeatedly:

  18:52:40.148 play → 18:52:48.420 PTT released   8.2 s, the whole take
  18:52:57.759 play → 18:52:57.879 PTT released   0.12 s, nothing came out

Those 120 ms are the PTT release tail alone: the render device refused to start
and playPCM returned an error that was thrown away. The call reported success
every time, which is what "it plays once and then never again" looks like from
the outside — and why the search went to the recorder, which was innocent.

The error is now logged with the device name.
This commit is contained in:
2026-07-31 18:55:48 +02:00
parent d42e6669e1
commit 4fe5811fd2
2 changed files with 11 additions and 3 deletions
+7 -1
View File
@@ -131,7 +131,13 @@ func (m *Manager) Play(deviceID, path string, gainPct int) error {
m.playStop = stop
m.mu.Unlock()
go func() {
_ = playPCM(deviceID, pcm, rate, ch, bits, stop)
// The error was discarded. A device that refuses to start returns here
// instantly, the PTT is released 120 ms later, and NOTHING says why —
// which is exactly what a station heard as "it plays once, then never
// again": the call succeeded, the sound did not.
if err := playPCM(deviceID, pcm, rate, ch, bits, stop); err != nil {
LogSink("audio: playback on %q failed: %v", DeviceName(deviceID), err)
}
m.mu.Lock()
if m.playStop == stop {
m.playStop = nil