fix: a new playback raced the previous one for the audio device

Reported precisely: press play again and it stops the current message, but you
then have to wait the whole length of the message before it will play — otherwise
the radio is keyed and the PTT released at once.

Play only SIGNALLED the previous playback to stop and started a new one straight
away. The old goroutine still held the WASAPI render client for a moment, so the
new client could not start; it returned immediately and the PTT tail was all that
was left. The log now shows both halves of that: a play line, then a release
120 ms later.

Stopping now waits for the goroutine to have returned — the point of stopping
before starting again — bounded at 1.5 s so a wedged device cannot freeze the
operator's click, and saying so in the log if it ever comes to that.
This commit is contained in:
2026-07-31 19:05:09 +02:00
parent 4fe5811fd2
commit 6d54100bc9
2 changed files with 38 additions and 5 deletions
+4 -2
View File
@@ -4,11 +4,13 @@
"date": "",
"en": [
"Cluster filters gain NEW POTA and NEW COUNTY, alongside the existing status chips.",
"A playback that fails to start now says so in the log instead of ending silently after a tenth of a second."
"A playback that fails to start now says so in the log instead of ending silently after a tenth of a second.",
"Replaying a recording before the previous one has finished now works: the new playback waits for the audio device to be free instead of keying the radio and releasing at once."
],
"fr": [
"Les filtres du cluster gagnent NEW POTA et NEW COUNTY, à côté des pastilles de statut existantes.",
"Une lecture qui ne démarre pas le signale désormais dans le journal, au lieu de s'arrêter en silence au bout d'un dixième de seconde."
"Une lecture qui ne démarre pas le signale désormais dans le journal, au lieu de s'arrêter en silence au bout d'un dixième de seconde.",
"Relancer un enregistrement avant la fin du précédent fonctionne désormais : la nouvelle lecture attend que le périphérique audio soit libre, au lieu de passer en émission et de relâcher aussitôt."
]
},
{