MediaPlayer race condition in audio annunciator
Maintainer antworten meist innerhalb von 1 Tag
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Anfängerfreundlichkeit
- 48/100
- Issue-Typ
- Bug
- Klarheit
- Größtenteils klar
- Aktivitätsstatus
- Aktiv
- Tech-Stack
- java
- Bereich
- audio-video-rtc, desktop
Rechercherichtung
Start by locating speakAlone and the MediaPlayer::stop and MediaPlayer::play calls mentioned in the issue, then trace how player status changes are handled. Reproduce with a 1-second nag period and a 100ms beep, checking whether play runs before the player reaches STOPPED. Done means repeated short beeps are no longer missed and the playback transition is handled reliably.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
I am trying to get the audio annunciator to work with a very short nag period (1 second) and a short clip (100ms) of a beep sound. I have encountered an issue where beeps are frequently missed. I traced this to what appears to be a race condition between MediaPlayer::stop and MediaPlayer::play. In speakAlone, stop is called on every alarm media player, and then play is called on the correct media player. This is all well and good except it would appear that stop does not actually appear to block until the media player status has transitioned to stopped even if the audio clip has finished playing.
Adding a log statement just before play is called e.g.
try {
logger.log(Level.SEVERE, "grioejgoijq " + alarm.getStatus());
alarm.play();
} catch (Exception e) {
logger.log(Level.SEVERE, "Failed to play alarm sound", e);
}
does two things: firstly it more or less randomly logs 'PLAYING' or 'STOPPED' indicating the race condition, and secondly it stops beeps from being missed (yes - adding a log statement fixes the bug). I think this is just because there is more time for the player to stop and so by the time it gets to play it has actually been stopped.
I have looked into fixing this but really not sure how to do it in a simple way - ideally I think we'd just block until the status returns to stopped which can be done with completable futures but it feels like there should be an easier solution - so please let me know any thoughts
- Vorherrschende Sprache
- Java
- Sterne
- 130
- Forks
- 132
- Ø Merge
- 2 T. 11 Std.
- Gemergte PRs (30 T.)
- 23
Entwicklungsumgebung
- Kein Dockerfile und keine Docker-Compose-Datei
- Hat eine Pull-Request-Vorlage
- Kein Beitragsleitfaden
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus ControlSystemStudio/phoebus
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 62/100
ControlSystemStudio/phoebus#3983 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Create CONTRIBUTING.mdOffen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
ControlSystemStudio/phoebus#3979 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 80/100
ControlSystemStudio/phoebus#3962 ·
Maintainer antworten meist innerhalb von 1 Tag
-
PVA/SPVA: track SPVA version independently and move XDG keychain dir pva/<ver> -> spva/<n.n.n>Offen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 65/100
ControlSystemStudio/phoebus#3865 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag
-
Audio annunciator unable to use audio files which have a space in their pathEvtl. vergeben @LordIdra hat das vor 1 Tag übernommen. Offen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 35/100
ControlSystemStudio/phoebus#3992 ·
Maintainer antworten meist innerhalb von 1 Tag
Alle Issues in ControlSystemStudio/phoebus
Ähnliche Issues
-
bug web-server
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
jooby-project/jooby#4035 ·
Maintainer antworten meist innerhalb von 1 Tag
-
L: javascript
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
dependabot/dependabot-core#16744 ·
Maintainer antworten meist innerhalb von 1 Tag
-
intake mcp-intake needs-human-review priority:high type:bug
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 62/100
Ikalus1988/MisakaNet#3987 · 3 Kommentare ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 82/100
quarkiverse/quarkus-google-cloud-services#1187 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 82/100
locationtech/jts#1250 ·