libretro / libretro/RetroArch

AudioTrack repeatedly stops/resumes when returning from menu (regression since 1.20.0 on Android)

Open
#17,892 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C
Stars
14.1k
Forks
2.2k
Avg merge
7h 35m
Merged PRs (30d)
51

Description

Is there an existing issue for this?
  • This is a bug in RetroArch frontend
  • I have searched the existing issues
Description

On Android builds of RetroArch 1.20.0 and 1.21.0, when opening the Quick Menu during gameplay and then resuming the core, the AudioTrack system goes into a loop of repeated stop/start behavior. This did not happen in version 1.19.x or 1.9.12, so it appears to be a regression.

Expected behavior

Audio should pause once when entering the menu, and resume once when returning to the game, with minimal AudioTrack activity.

Actual Behavior:
Hundreds of repeated log entries occur after resuming gameplay:

D PlayerBase::stop() from IPlayer

D stop() called with XXXX frames delivered
I` Skip ramp
`
This continues rapidly and may negatively impact performance.

Steps to reproduce the bug

Steps to Reproduce:
Launch any core (tested with Genesis Plus GX, Snes9x).

Start any game with audio enabled.

Open the RetroArch Quick Menu.

Return to gameplay (Resume).

Observe the log output.

Version/Commit

1.21.0

Bisect Results

No response

Present in the nightly version

I don't know

Platform & operating system

android

Affected Cores

No response

Environment information

Tested On:
Device: Samsung Galaxy Note 8

Android Version: 9

RetroArch versions:

✅ 1.19.0 → OK (only 1 stop/resume logged)

✅ 1.9.12 → OK

❌ 1.20.0 → Affected

❌ 1.21.0 → Affected

Audio driver: aaudio and opensl (tested both)

Disabling menu sounds via Settings → Audio → Menu Sounds resolves the issue: the repeated log spam stops entirely.

Using opensl or aaudio doesn't make a difference — the bug still occurs.

Appears to be related to audio resume handling in the Android audio subsystem.

Could be a side-effect of recent changes in menu pause/audio behavior.

Relevant log output
2025-05-12 12:51:23.304 AudioTrack  D  stop() called with 3264 frames delivered  
2025-05-12 12:51:23.304 AudioTrack  I  Skip ramp  
2025-05-12 12:51:23.320 PlayerBase  D  PlayerBase::stop() from IPlayer  
... (repeats for 50+ entries) ...

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the Quick Menu resume flow on Android with menu sounds enabled, comparing 1.19.0 with 1.20.0 or 1.21.0 and checking the Android audio resume handling. Verify the behavior with both aaudio and opensl; done means returning to gameplay causes one audio stop/resume cycle rather than repeated AudioTrack log entries.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, c
Domain
audio-video-rtc, mobile-dev
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.