Skip to content

Fix background play notification volume adjustment#13284

Open
utafrali wants to merge 1 commit intoTeamNewPipe:devfrom
utafrali:fix/issue-13283-issue-with-background-play-notification-
Open

Fix background play notification volume adjustment#13284
utafrali wants to merge 1 commit intoTeamNewPipe:devfrom
utafrali:fix/issue-13283-issue-with-background-play-notification-

Conversation

@utafrali
Copy link
Copy Markdown

What is it?

  • Bugfix (user facing)

Description of the changes in your PR

Removed the animated volume ducking behavior from audio focus handling. The -based approach was causing issues with volume adjustment in background playback notifications. Replaced the complex animation logic with direct volume control, which is more reliable and predictable.

Changes:

  • Removed animation-related imports and the method
  • Removed constant
  • Removed from the audio focus request builder
  • Simplified to directly set volume to 1.0f

This simplification eliminates the timing issues that were affecting notification volume adjustment during background playback.

Fixes the following issue(s)

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.

Replace the ValueAnimator-based animateAudio() call in onAudioFocusGain()
with a direct player.setVolume(1.0f). The ValueAnimator relies on the
Choreographer/main thread rendering loop, which is throttled or suspended
when the app is backgrounded (especially with battery optimizations on
Android 12+). This left the volume stuck at 0.2f until the user foregrounded
the app. Also remove setWillPauseWhenDucked(true) since the app ducks
volume rather than pausing, aligning the declared intent with actual behavior
so the system reliably delivers AUDIOFOCUS_GAIN on newer Android versions.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@github-actions github-actions bot added the size/small PRs with less than 50 changed lines label Feb 23, 2026
@utafrali
Copy link
Copy Markdown
Author

Closing this PR as it has been open for 1d 18h without maintainer feedback. If the fix is still needed, I'd be happy to reopen or submit an updated version. Thank you for your time!

@utafrali utafrali closed this Feb 24, 2026
@TobiGr
Copy link
Copy Markdown
Contributor

TobiGr commented Feb 24, 2026

hello and thank you for the PR. Please be patient. This is a not-for-profit open source project which is mostly maintained by volunteers. There are currently 43 open PRs in this repository alone. You'll get a review together with #13169 because both PRs are somehow related.

@TobiGr TobiGr added bug Issue is related to a bug player Issues related to any player (main, popup and background) player notification Anything to do with the MediaStyle notification labels Feb 24, 2026
@utafrali utafrali reopened this Mar 1, 2026
@utafrali
Copy link
Copy Markdown
Author

utafrali commented Mar 1, 2026

Sorry about closing this prematurely — I should've been more patient. Reopening so it can be reviewed alongside #13169 as you mentioned. No rush at all.

@utafrali
Copy link
Copy Markdown
Author

utafrali commented Mar 2, 2026

Got it, thanks for the update.

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 notification Anything to do with the MediaStyle notification player Issues related to any player (main, popup and background) size/small PRs with less than 50 changed lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

issue with background play notification volume adjustment

2 participants