AudioManager skips foreground recovery between sounds when no sources are playing
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 64/100
- Tipo di issue
- Bug
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Stack tecnologico
- typescript
- Ambito
- backend
Direzione di ricerca
The issue points to packages/core/src/audio/AudioManager.ts, especially _onVisibilityChange() and its foreground recovery guard. Read that code first, then locate the engine regression suite and cover the silent interval, explicit caller suspension, and cold-context cases described here. Done when those cases verify recovery only for a previously running context without overriding explicit suspension or creating a cold context.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Problem
An already unlocked/running AudioContext is suspended when the page becomes hidden, but AudioManager skips foreground recovery if no AudioSource is currently playing (_playingCount === 0). This can leave a state-aware ambient-audio controller waiting for a running context until another explicit resume/user interaction.
This is distinct from #3098: that PR allows a real gesture to supersede a pending programmatic resume. In this case, the foreground recovery attempt is never started.
Reproduction
- Within a real user gesture, successfully await
AudioManager.resume(). - Leave no sources playing (for example, all one-shots have ended or the soundscape is currently silent).
- Hide the page.
_onVisibilityChange()suspends the existing context. - Return to the foreground and wait beyond the 100 ms recovery delay.
- Observe that the context remains suspended and no new native
resume()is issued. A controller that only starts new environmental voices while the context is running cannot restart them automatically.
Calling AudioManager.resume() explicitly can recover it; this is not a claim that every later direct AudioSource.play() necessarily fails.
Expected
Recover a previously running context after a visibility-induced suspension, including intervals between sounds. Preserve explicit caller AudioManager.suspend() semantics, do not create/unlock a cold context on page visibility alone, and retain the gesture fallback required by browser policy.
Evidence
Checked the actual AudioManager source at #3098 HEAD 788e6f5b8c694f3eb2c1c5677b52dae925005778:
- Visibility suspension and recovery guard: hidden suspends the context unconditionally if it exists, while foreground recovery returns early for
_playingCount <= 0. - Executed that source with a mocked AudioContext and visibility events, after successfully resuming once:
| State before hide | State after showing and waiting 160 ms | Total native resume calls |
|---|---|---|
| 0 playing sources, no explicit suspend | suspended | 1 |
| 1 playing source, no explicit suspend | running | 2 |
| 0 playing sources, explicit caller suspend | suspended | 1 |
The mechanism is deterministically reproduced with mocked audio hardware; this report does not claim physical iOS validation. Please cover the silent interval, explicit suspension, and cold-context cases in the engine regression suite.
- Lingua principale
- TypeScript
- Stelle
- 5.9k
- Fork
- 413
- Merge medio
- 16h 17m
- PR unite (30g)
- 41
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Nessuna guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di galacean/engine
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 64/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 85/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 52/100
I maintainer di solito rispondono entro 1 giorno
-
RFC: Adopt Unity-style Collider components and hierarchical Rigidbody ownershipForse già presa Una pull request collegata a questa issue è aperta o già unita. Aperta
Difficoltà 5/5 Più di una settimana Idoneità per principianti 20/100
I maintainer di solito rispondono entro 1 giorno
-
SkinnedMeshRenderer should derive default rootBone-space localBounds from mesh and skinForse già presa Una pull request collegata a questa issue è aperta o già unita. Apertaenhancement
Difficoltà 4/5 3-5 giorni Idoneità per principianti 42/100
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di galacean/engine
Issue simili
-
bug impact:low Team: SecuritySolution Team:Defend Workflows v9.6.0
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
elastic/kibana#306401 · 3 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
agentes-chat/agentes-chat#927 ·
I maintainer di solito rispondono entro 1 giorno
-
[Bug]: Webapp workspace fails to render in Safari — "Can't find variable: requestIdleCallback"Apertacomp/desktop P2 type/bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
NousResearch/hermes-agent#157702 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
I maintainer di solito rispondono entro 1 giorno
-
e2e-failure ready-to-code
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 72/100
redhat-developer/rhdh-plugin-export-overlays#4794 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno