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

Unable to resume playback from Media Controls after stopping app #7134

Closed
4 tasks done
coezbek opened this issue Apr 24, 2024 · 3 comments
Closed
4 tasks done

Unable to resume playback from Media Controls after stopping app #7134

coezbek opened this issue Apr 24, 2024 · 3 comments
Labels
Type: Possible bug Issues that seem to be a bug, but haven't been confirmed yet

Comments

@coezbek
Copy link

coezbek commented Apr 24, 2024

Checklist

  • I have used the search function for OPEN issues to see if someone else has already submitted the same bug report.
  • I have also used the search function for CLOSED issues to see if the problem is already solved and just waiting to be released.
  • I will describe the problem with as much detail as possible.
  • If the bug only to occurs with a certain podcast, I will include the URL of that podcast.

App version

3.3.2

Where did you get the app from

Other

Android version

14 (AP1A.240405.002)

Device model

Google Pixel 7a

First occurred

Since 12 months

Steps to reproduce

  1. Start a podcast
  2. Draw down the drawer
  3. Observe the Media Controls show the podcast and buttons for pausing/rewinding/etc.
  4. Click on the button "1 app is active" at the very bottom of the screen.
  5. Stop AntennaPod in the "Active apps" screen by pressing "Stop"
  6. Close the "Active apps" screen
  7. Observe that the Media Controls only show the "Play" button
  8. Attempt to restart playback by pressing the "Play" button
  9. Observe that the button is switching to "Pause" button, but playback isn't starting.

Expected behaviour

The podcast should continue playing

Current behaviour

Nothing happens. The user needs to restart the app and restart the podcast from the AntennaPod media controls.

As discussed in issue #6576 there is something going on with the Media Controls due to the aggressive battery management in newer Android versions. It would be nice if AntennaPod could restart itself and continue playing.

Logs

2024-04-24 20:45:11.938 10475-10475 ziparchive              de.danoeh.antennapod.debug           W  Unable to open '/data/app/~~R_cOdsx1S3qHkc3Fkv3hGg==/de.danoeh.antennapod.debug-56qAtvmsSpf-7-eLh_ieKg==/base.dm': No such file or directory
2024-04-24 20:45:11.938 10475-10475 ziparchive              de.danoeh.antennapod.debug           W  Unable to open '/data/app/~~R_cOdsx1S3qHkc3Fkv3hGg==/de.danoeh.antennapod.debug-56qAtvmsSpf-7-eLh_ieKg==/base.dm': No such file or directory
2024-04-24 20:45:12.201 10475-10475 nativeloader            de.danoeh.antennapod.debug           D  Configuring clns-4 for other apk /data/app/~~R_cOdsx1S3qHkc3Fkv3hGg==/de.danoeh.antennapod.debug-56qAtvmsSpf-7-eLh_ieKg==/base.apk. target_sdk_version=34, uses_libraries=, library_path=/data/app/~~R_cOdsx1S3qHkc3Fkv3hGg==/de.danoeh.antennapod.debug-56qAtvmsSpf-7-eLh_ieKg==/lib/arm64:/data/app/~~R_cOdsx1S3qHkc3Fkv3hGg==/de.danoeh.antennapod.debug-56qAtvmsSpf-7-eLh_ieKg==/base.apk!/lib/arm64-v8a, permitted_path=/data:/mnt/expand:/data/user/0/de.danoeh.antennapod.debug
2024-04-24 20:45:12.222 10475-10475 GraphicsEnvironment     de.danoeh.antennapod.debug           V  Currently set values for:
2024-04-24 20:45:12.223 10475-10475 GraphicsEnvironment     de.danoeh.antennapod.debug           V    angle_gl_driver_selection_pkgs=[]
2024-04-24 20:45:12.223 10475-10475 GraphicsEnvironment     de.danoeh.antennapod.debug           V    angle_gl_driver_selection_values=[]
2024-04-24 20:45:12.223 10475-10475 GraphicsEnvironment     de.danoeh.antennapod.debug           V  Global.Settings values are invalid: number of packages: 0, number of values: 0
2024-04-24 20:45:12.223 10475-10475 GraphicsEnvironment     de.danoeh.antennapod.debug           V  Neither updatable production driver nor prerelease driver is supported.
2024-04-24 20:45:12.244 10475-10475 Compatibil...geReporter de.danoeh.antennapod.debug           D  Compat change id reported: 279646685; UID 10416; state: DISABLED
2024-04-24 20:45:12.247 10475-10475 WM-WrkMgrInitializer    de.danoeh.antennapod.debug           D  Initializing WorkManager with default configuration.
2024-04-24 20:45:12.287 10475-10475 UserPreferences         de.danoeh.antennapod.debug           D  Creating new instance of UserPreferences
2024-04-24 20:45:12.319 10475-10475 NativeCrypto            de.danoeh.antennapod.debug           V  Registering org/conscrypt/NativeCrypto's 288 native methods...
2024-04-24 20:45:12.320 10475-10493 Compatibil...geReporter de.danoeh.antennapod.debug           D  Compat change id reported: 160794467; UID 10416; state: ENABLED
2024-04-24 20:45:12.324 10475-10475 ntennapod.debug         de.danoeh.antennapod.debug           W  Accessing hidden method Ljava/security/spec/ECParameterSpec;->getCurveName()Ljava/lang/String; (unsupported, reflection, allowed)
2024-04-24 20:45:12.342 10475-10475 SleepTimerPreferences   de.danoeh.antennapod.debug           D  Creating new instance of SleepTimerPreferences
2024-04-24 20:45:12.354 10475-10493 Compatibil...geReporter de.danoeh.antennapod.debug           D  Compat change id reported: 194532703; UID 10416; state: ENABLED
2024-04-24 20:45:12.354 10475-10493 Compatibil...geReporter de.danoeh.antennapod.debug           D  Compat change id reported: 253665015; UID 10416; state: ENABLED
2024-04-24 20:45:12.354 10475-10493 Compatibil...geReporter de.danoeh.antennapod.debug           D  Compat change id reported: 311402873; UID 10416; state: DISABLED
2024-04-24 20:45:12.372 10475-10475 PlaybackService         de.danoeh.antennapod.debug           D  Service created.
2024-04-24 20:45:12.404 10475-10475 PlaybackService         de.danoeh.antennapod.debug           D  Received onBind event
2024-04-24 20:45:12.417 10475-10475 PlaybackService         de.danoeh.antennapod.debug           D  OnGetRoot: clientPackageName=com.android.systemui; clientUid=10217 ; rootHints=Bundle[{android.service.media.extra.RECENT=true}]
2024-04-24 20:45:12.417 10475-10475 PlaybackService         de.danoeh.antennapod.debug           D  OnGetRoot: Returning BrowserRoot 2131886195
2024-04-24 20:45:12.434 10475-10475 MediaSessionCompat      de.danoeh.antennapod.debug           D  onPlay()
@coezbek coezbek added the Type: Possible bug Issues that seem to be a bug, but haven't been confirmed yet label Apr 24, 2024
@ByteHamster
Copy link
Member

If you already know about #6576, why do you create a duplicate then? This is already tracked in #6576

@coezbek
Copy link
Author

coezbek commented Apr 24, 2024

Sorry, I was feeling that this is a bit different. In #6576 the reporter is reporting that AntennaPod is not resisting it being removed from memory (unlike for instance Spotify which stays longer).

Here I am trying to understand why AntennaPod wouldn't start when clicking play.

It seemed to me the discussion in #6576 was focused on preventing Media Controls from unloading AntennaPod.

@coezbek
Copy link
Author

coezbek commented Apr 24, 2024

I spend an hour trying to understand what is happening but am lost in the intents/state handling of what is happening or is supposed to happen if ACTION_MEDIA_BUTTON intent occurs. With the following patch, after clicking the Play button the last playing episode comes up again in the Media Control and another click on the play button starts the episode.

diff --git a/playback/service/src/main/java/de/danoeh/antennapod/playback/service/PlaybackService.java b/playback/service/src/main/java/de/danoeh/antennapod/playback/service/PlaybackService.java
--- a/playback/service/src/main/java/de/danoeh/antennapod/playback/service/PlaybackService.java	(revision c56facd141a34d33ef38c0bdbee04a9944de8de7)
+++ b/playback/service/src/main/java/de/danoeh/antennapod/playback/service/PlaybackService.java	(date 1713990104959)
@@ -305,6 +305,9 @@
         if (mediaPlayer == null) {
             mediaPlayer = new LocalPSMP(this, mediaPlayerCallback); // Cast not supported or not connected
         }
+        if (media == null) { // Media is null here if app is restarted from ACTION_MEDIA_BUTTON
+            media = DBReader.getFeedMedia(PlaybackPreferences.getCurrentlyPlayingFeedMediaId());
+        }
         if (media != null) {
             mediaPlayer.playMediaObject(media, !media.localFileAvailable(), wasPlaying, true);
         }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Possible bug Issues that seem to be a bug, but haven't been confirmed yet
Projects
None yet
Development

No branches or pull requests

2 participants