AudioTrack AAC dynamic range compression persists across MediaItem transitions when reusing AudioSession
@tianyif is already working on this.
Since Mar 11, 2026.
- 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.
- Initialize a single ExoPlayer instance.
- Load and play an HLS/AAC stream that does not contain DRC metadata (e.g., a standard stereo podcast).
- Note the baseline audio volume.
- Without destroying the player, call player.setMediaItem() to transition to a live HLS stream that does contain DRC/EBU R 128 metadata.
- Note that the audio level correctly drops/compresses as the OS reacts to the broadcast metadata.
- Call player.setMediaItem() to transition back to the stream from Step 2.
- 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 bugreportto android-media-github@google.com after filing this issue.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.