PipePipe icon indicating copy to clipboard operation
PipePipe copied to clipboard

[Bug] Background play audio drops a few seconds after minimizing the app

Open Couchy opened this issue 5 months ago • 43 comments

Checklist

  • [x] I make sure that the issue is NOT a duplicate of pinned issues
  • [x] I make sure I am using the LATEST version - check here
  • [x] I understand that issues with limited impact, such as those occurring on specific devices or under specific network conditions, will not be fixed
  • [ ] I have attached the error report in the issue

Describe the bug

Audio drops out a few seconds after selecting "play in background", then minimizing the app or locking the phone.

Version

5.2.0

Frequency

Often (80-90% of the time)

Device

Pixel 9, Android 17

Steps to reproduce the bug

  1. Long press a video > "Start playing in the background"
  2. Minimize the app or lock the phone
  3. Audio drops (but the media keeps playing) until the app is brought to foreground again

Additional context

I have "allow background usage" enabled in app permissions. One workaround is to start playing the video first (not in background) then switch to "play in background". After that, the audio will keep working even when the app loses focus. This might be a regression in 5.2.0, since this only started happening after updating.

Couchy avatar Jun 29 '26 00:06 Couchy

It's can also related to System Update (since Android 17 stable is released last month) Can you downgrade to 5.1.1 and check if the issue persists? You can first backup your data.

InfinityLoop1308 avatar Jun 29 '26 00:06 InfinityLoop1308

It's working fine after downgrading to 5.1.1

Couchy avatar Jun 29 '26 00:06 Couchy

is there any error report?

InfinityLoop1308 avatar Jun 29 '26 00:06 InfinityLoop1308

Not that I can see - there was no error notification.

Couchy avatar Jun 29 '26 00:06 Couchy

I did not do further testing (yet), but noticed this:

  1. Start playing a video
  2. Minimize the app or lock the phone
  3. Audio drops after a few seconds

However, after trying the suggested workaround (start playing the video first (not in background) then switch to "play in background"), it seemed to work again for this specific video, even after force stopping the app and clearing cache.

Starting another video and locking ths screen lead to the audio stopping after a few seconds.

nimdaz avatar Jun 29 '26 20:06 nimdaz

I did not do further testing (yet), but noticed this:

1. Start playing a video

2. Minimize the app or lock the phone

3. Audio drops after a few seconds

However, after trying the suggested workaround (start playing the video first (not in background) then switch to "play in background"), it seemed to work again for this specific video, even after force stopping the app and clearing cache.

Starting another video and locking ths screen lead to the audio stopping after a few seconds.

Hello are u using SABR by any chance ?

Priveetee avatar Jun 29 '26 20:06 Priveetee

@Priveetee "Force SABR" is disabled, is that what you mean?

On android 17 btw, since that was mentioned before.

nimdaz avatar Jun 29 '26 21:06 nimdaz

https://developer.android.com/about/versions/17/changes/bg-audio

Relevant?

Couchy avatar Jun 29 '26 23:06 Couchy

https://developer.android.com/about/versions/17/changes/bg-audio

Relevant?

Thx u, yes it can be :)

Priveetee avatar Jun 30 '26 04:06 Priveetee

For what it's worth I am now experiencing this on 5.2.1-beta2 (force SABR enabled)

dvg48 avatar Jun 30 '26 17:06 dvg48

Likely Android 17 issue since @Couchy and @dvg48 are all using android 17

InfinityLoop1308 avatar Jul 01 '26 01:07 InfinityLoop1308

Likely Android 17 issue since @Couchy and @dvg48 are all using android 17

Seems like it, but I tried this adb command given on the page I linked, and it didn't help.

adb shell cmd audio set-enable-hardening disable

Couchy avatar Jul 01 '26 01:07 Couchy

I think it's a regression (bug) in Android 17 release since I can't reproduce it on an Android 17 (beta) simulator

InfinityLoop1308 avatar Jul 01 '26 01:07 InfinityLoop1308

even with adb shell cmd audio set-enable-hardening throw

InfinityLoop1308 avatar Jul 01 '26 01:07 InfinityLoop1308

Ah, the command they listed is wrong. The actual command is "set-hardening" (no enable). If I do this, the problem goes away, so this is in fact the issue.

adb shell cmd audio set-hardening disable

Couchy avatar Jul 01 '26 01:07 Couchy

I set it to "throw" and saw this error when the audio cuts out:

2026-06-30 22:14:55.975 18374 24073 InfinityLoop1309.NewPipeEnhanced E MediaCodecAudioRenderer : Audio sink error androidx.media3.exoplayer.audio.AudioSink$WriteException: AudioTrack write failed: -4 at androidx.media3.exoplayer.audio.DefaultAudioSink.drainOutputBuffer(r8-map-id-8bc81477e132b1fa6e332502f5ec7c31732304b8f4f8e724c0c3cc42eda8da5f:219) at androidx.media3.exoplayer.audio.DefaultAudioSink.processBuffers(r8-map-id-8bc81477e132b1fa6e332502f5ec7c31732304b8f4f8e724c0c3cc42eda8da5f:1) at androidx.media3.exoplayer.audio.DefaultAudioSink.handleBuffer(r8-map-id-8bc81477e132b1fa6e332502f5ec7c31732304b8f4f8e724c0c3cc42eda8da5f:429) at androidx.media3.exoplayer.audio.MediaCodecAudioRenderer.processOutputBuffer(r8-map-id-8bc81477e132b1fa6e332502f5ec7c31732304b8f4f8e724c0c3cc42eda8da5f:46) at androidx.media3.exoplayer.mediacodec.MediaCodecRenderer.drainOutputBuffer(r8-map-id-8bc81477e132b1fa6e332502f5ec7c31732304b8f4f8e724c0c3cc42eda8da5f:281) at androidx.media3.exoplayer.mediacodec.MediaCodecRenderer.render(r8-map-id-8bc81477e132b1fa6e332502f5ec7c31732304b8f4f8e724c0c3cc42eda8da5f:84) at androidx.media3.exoplayer.ExoPlayerImplInternal.doSomeWork(r8-map-id-8bc81477e132b1fa6e332502f5ec7c31732304b8f4f8e724c0c3cc42eda8da5f:133) at androidx.media3.exoplayer.ExoPlayerImplInternal.handleMessage(r8-map-id-8bc81477e132b1fa6e332502f5ec7c31732304b8f4f8e724c0c3cc42eda8da5f:386) at android.os.Handler.dispatchMessageImpl(Handler.java:138) at android.os.Handler.dispatchMessage(Handler.java:125) at android.os.Looper.loopOnce(Looper.java:296) at android.os.Looper.loop(Looper.java:397) at android.os.HandlerThread.run(HandlerThread.java:139) log_2026_06_30_22_17_50.log

Couchy avatar Jul 01 '26 02:07 Couchy

test this: https://send.vis.ee/download/a7a66f5264a61910/#d_sxjrBMBnQDR-kXf6YX8w

InfinityLoop1308 avatar Jul 01 '26 10:07 InfinityLoop1308

test this: https://send.vis.ee/download/a7a66f5264a61910/#d_sxjrBMBnQDR-kXf6YX8w

This didn't fix it.

Couchy avatar Jul 01 '26 11:07 Couchy

@Couchy do you have log?

InfinityLoop1308 avatar Jul 01 '26 11:07 InfinityLoop1308

@Couchy do you have log?

log_2026_07_01_07_53_48.log

Couchy avatar Jul 01 '26 11:07 Couchy