Skip to content

Fix audio ducking issue by using Android's automatic audio focus management#13169

Open
eubnara wants to merge 1 commit intoTeamNewPipe:devfrom
eubnara:fix-audio-ducking
Open

Fix audio ducking issue by using Android's automatic audio focus management#13169
eubnara wants to merge 1 commit intoTeamNewPipe:devfrom
eubnara:fix-audio-ducking

Conversation

@eubnara
Copy link

@eubnara eubnara commented Feb 1, 2026

What is it?

  • Bugfix (user facing)
  • Feature (user facing) ⚠️ Your PR must target the refactor branch
  • Codebase improvement (dev facing)
  • Meta improvement to the project (dev facing)

Description of the changes in your PR

Fix audio ducking issue by using Android's automatic audio focus management

Previously, manual audio focus handling caused volume to not be restored after transient ducking on some devices.

This change removes manual AudioFocusRequest management and relies on ExoPlayer's built-in audio focus handling (handleAudioFocus=true), which properly manages automatic ducking as recommended in: https://developer.android.com/media/optimize/audio-focus#automatic-ducking Fixes #9710

Fixes the following issue(s)

APK testing

The APK can be found by going to the "Checks" tab below the title. On the left pane, click on "CI", scroll down to "artifacts" and click "app" to download the zip file which contains the debug APK of this PR. You can find more info and a video demonstration on this wiki page.

Due diligence

  • I read the contribution guidelines.
  • The proposed changes follow the AI policy.
  • I tested the changes using an emulator or a physical device.
    • I tested with my phone.

@github-actions github-actions bot added the size/medium PRs with less than 250 changed lines label Feb 1, 2026
@TobiGr TobiGr added bug Issue is related to a bug player Issues related to any player (main, popup and background) labels Feb 1, 2026
@TobiGr TobiGr added this to v0.28.x Feb 3, 2026
@github-project-automation github-project-automation bot moved this to Todo in v0.28.x Feb 3, 2026
@ShareASmile ShareASmile moved this from Todo to In Progress in v0.28.x Feb 7, 2026
…gement

Previously, manual audio focus handling caused volume to not be restored after transient ducking on some devices.

This change removes manual AudioFocusRequest management and relies on ExoPlayer's built-in audio focus handling (handleAudioFocus=true), which properly manages automatic ducking as recommended in: https://developer.android.com/media/optimize/audio-focus#automatic-ducking
Fixes TeamNewPipe#9710
@simonai1254
Copy link

Successfully tested on a Samsung Galaxy S25 Ultra with Android 16 / OneUI 8.0;
Audio Ducking now restores to the correct volume after returning to focus.

@Yann-P
Copy link

Yann-P commented Mar 11, 2026

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Issue is related to a bug player Issues related to any player (main, popup and background) size/medium PRs with less than 250 changed lines

Projects

Status: In Progress

Development

Successfully merging this pull request may close these issues.

Issue with volume after interruption

4 participants