Files
ARMSX2/platforms
jpolo1224 e2aa896bd4 Android: ambient music on the game library screen
Plays a looping ambient track on the library, like a console dashboard, and
stops the moment a game boots. Toggle in App settings, on by default.

Library-only is deliberate. SPU2 output goes through Oboe and Android has
been seen reclaiming that stream when the VM pauses, so a second long-lived
stream over gameplay would land on top of an existing problem. Gating on the
VM state also matches what the hardware dashboards do.

Defers to whatever is already playing rather than starting a second stream
over a podcast, and handles audio focus: permanent loss releases the player,
transient loss pauses and resumes.

Starting is retried on a timer because the boot splash video carries its own
audio track and MainActivity is launched from its completion callback, so the
first attempt races the splash stream tearing down. A single attempt lost
that race and never retried, leaving music working only after a game had been
launched and exited.

The player is built by hand instead of MediaPlayer.create, which prepares
internally and would leave the media audio attributes ignored.

Track: Calm Ambient 1 (Synthwave 4k) by The Cynic Project, released CC0.
Attribution is not required by that licence but the author asks for it, so it
is credited in the About screen.
2026-07-20 18:22:04 -04:00
..
2026-07-19 11:57:37 +02:00