androidx / androidx/media

Move fade-in of buffer into AudioTrackAudioOutput, as not every output has same requirement as AudioTrack

Open
#3,394 0 comments 0 reactions 1 assignee View on GitHub

@tonihei is already working on this.

Since Sep 2, 2026.

enhancement needs triage
Dominant language
Java
Stars
3k
Forks
955
Avg merge
12d 14h
Merged PRs (30d)
2

Description

[REQUIRED] Use case description

I'm using AudioOutput based on libusb, so Android audio stack is uninvolved. DefaultAudioSink adds fade-in to every beginning playback after AudioSink.flush() - see also https://github.com/androidx/media/commit/5e3dcea1bfffff0f641d34829d6965a89c791b68 -, but this isn't needed in this case as it's not going into AudioTrack, and volume fade is already accounted for.

Proposed solution

Move the maybeRampUpVolume() logic into AudioTrackAudioOutput, where it doesn't affect custom audio outputs. The commit and logic was explicitly designed around where AudioTrack does or doesn't fade, and other outputs should add this if needed, or don't add it if not.

Happy to provide a PR for this if this solution makes sense!

Alternatives considered

Add a on/off setting to DefaultAudioSink for this fade which I change in lockstep with output provider.

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.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.