Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

demo-session process restarted when swiped away from paused state #1359

Closed
1 task done
TomVarga opened this issue May 9, 2024 · 3 comments
Closed
1 task done

demo-session process restarted when swiped away from paused state #1359

TomVarga opened this issue May 9, 2024 · 3 comments
Assignees

Comments

@TomVarga
Copy link

TomVarga commented May 9, 2024

Version

Media3 main branch

More version details

753f607

1.3.1

Devices that reproduce the issue

API 34 emulator

Devices that do not reproduce the issue

No response

Reproducible in the demo app?

Yes

Reproduction steps

Play audio from the demo-session app
Background the app
Pause from media notification
Swipe away the app

2024-05-09.18-11-25.mp4

Expected result

process is not started again

Actual result

process is started again

service-restarted.log

Media

example: Jazz & Blues in the demo-session sample app

Bug Report

  • You will email the zip file produced by adb bugreport to [email protected] after filing this issue.

I have tried to "disable" playback resmuption to see if that helps at my branch: https://github.com/TomVarga/media/tree/disabled-playback-resumption

but does not seem to help.

I can see in the logs

18:11:39.725   564-593   ActivityManager          I  Start proc 15123:androidx.media3.demo.session/u0a200 for service {androidx.media3.demo.session/androidx.media3.demo.session.PlaybackService}

but it's unclear why it's happening.

@TomVarga
Copy link
Author

TomVarga commented May 9, 2024

I suspect maybe the issue is that playback resmuption (system UI) causing the process to restart, but I don't know how to verify that, or better yet how to fully opt out of playback resmuption including from the system UI too. Any help on figuring this out would be greatly appreciated.

I thought the demo-session app would already be opting out, but maybe it isn't?

@TomVarga
Copy link
Author

TomVarga commented May 9, 2024

Potentially related or duplicate of android/uamp#541

Also maybe #1136

@marcbaechinger
Copy link
Contributor

Thanks for reporting!

This looks like a duplicate of #805 which is a bug in Android. onTaskRemoved is not called by the system when the service is terminated and hence the service can not properly be stopped which makes it ActivityManager restart.

Android 14 (API 34)

---------------------------- PROCESS STARTED (9932) for package androidx.media3.demo.session ----------------------------
2024-05-10 10:52:58.748  9932-9932  mssandroid14            androidx.media3.demo.session         D  onCreate
2024-05-10 10:52:58.763  9932-9932  ExoPlayerImpl           androidx.media3.demo.session         I  Init f297a99 [AndroidXMedia3/1.4.0-alpha01] [emu64xa, sdk_gphone64_x86_64, Google, 34]
---------------------------- PROCESS ENDED (9932) for package androidx.media3.demo.session ----------------------------
2024-05-10 10:53:12.975   536-2190  ActivityManager         system_server                        W  Scheduling restart of crashed service androidx.media3.demo.session/.PlaybackService in 1000ms for start-requested
---------------------------- PROCESS STARTED (10007) for package androidx.media3.demo.session ----------------------------
2024-05-10 10:53:14.612 10007-10007 mssandroid14            androidx.media3.demo.session         D  onCreate
2024-05-10 10:53:14.635 10007-10007 ExoPlayerImpl           androidx.media3.demo.session         I  Init a2b60c7 [AndroidXMedia3/1.4.0-alpha01] [emu64xa, sdk_gphone64_x86_64, Google, 34]
2024-05-10 10:53:14.864 10007-10007 mssandroid14            androidx.media3.demo.session         D  onTaskRemoved
2024-05-10 10:53:14.874 10007-10007 ExoPlayerImpl           androidx.media3.demo.session         I  Release a2b60c7 [AndroidXMedia3/1.4.0-alpha01] [emu64xa, sdk_gphone64_x86_64, Google, 34] [media3.common, media3.exoplayer, media3.decoder, media3.session]
2024-05-10 10:53:14.880 10007-10007 mssandroid14            androidx.media3.demo.session         D  onDestroy

Android 13 (API 33)

024-05-10 10:51:47.305  5775-5775  mssandroid14            androidx.media3.demo.session         D  onCreate
2024-05-10 10:51:47.318  5775-5775  ExoPlayerImpl           androidx.media3.demo.session         I  Init c8fd406 [AndroidXMedia3/1.4.0-alpha01] [emu64xa, sdk_gphone_x86_64, Google, 33]
2024-05-10 10:52:14.857  5775-5775  mssandroid14            androidx.media3.demo.session         D  onTaskRemoved
2024-05-10 10:52:14.868  5775-5775  ExoPlayerImpl           androidx.media3.demo.session         I  Release c8fd406 [AndroidXMedia3/1.4.0-alpha01] [emu64xa, sdk_gphone_x86_64, Google, 33] [media3.common, media3.exoplayer, media3.decoder, media3.session, media3.datasource, media3.ui, media3.extractor]
2024-05-10 10:52:14.919  5775-5775  mssandroid14            androidx.media3.demo.session         D  onDestroy

I'm closing this issue as a duplicate of #805. Please comment there if you have some additional information or questions.

@androidx androidx locked and limited conversation to collaborators Jul 10, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants