androidx / androidx/media

AudioTrack AAC dynamic range compression persists across MediaItem transitions when reusing AudioSession

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

@tianyif is already working on this.

Since Mar 11, 2026.

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

Description

Version

Media3 1.9.2

More version details

When transitioning between MediaItems within the same ExoPlayer instance, the audio dynamic range compression (DRC) triggered by the first item persists into subsequent items.

I am not an audio enginer so this might not be a correct understanding, but... If a user plays a live HLS AAC broadcast containing DRC/EBU R 128 metadata, the Android hardware dynamic range compression (or OS mixer???) correctly lowers the volume. However, when the player transitions to our standard HLS podcast stream (which does not contain DRC metadata), the volume remains heavily compressed and low.

Note:
The solution for our team was to override the AAC metadata when the stream is created.

Devices that reproduce the issue

Any device we tried.
Pixel 5, Pixel 6 pro, Motorola razr 50 ultra...

Devices that do not reproduce the issue

No response

Reproducible in the demo app?

No,- you will need to add customized streams

Reproduction steps

Unfortually I no longer have a stream that can be used to reproduce this issue.

  1. Initialize a single ExoPlayer instance.
  2. Load and play an HLS/AAC stream that does not contain DRC metadata (e.g., a standard stereo podcast).
  3. Note the baseline audio volume.
  4. Without destroying the player, call player.setMediaItem() to transition to a live HLS stream that does contain DRC/EBU R 128 metadata.
  5. Note that the audio level correctly drops/compresses as the OS reacts to the broadcast metadata.
  6. Call player.setMediaItem() to transition back to the stream from Step 2.
  7. Observe: The audio level.
Expected result

The audio level is similar in step 3 and step 7

Actual result

The audio remains suppressed/compressed. The hardware DSP state from the live broadcast has "infected" the standard stream because the AudioSession was reused.

Media

Sorry our team now overrides the AAC metadata in our streams to fix the issue

Bug Report
  • You will email the zip file produced by adb bugreport to android-media-github@google.com after filing this issue.

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.