mattttvaughn / chronicle

GNU General Public License v3.0
216 stars 58 forks source link

Unable to PAUSE playback in 0.52.0 #67

Open Neipas09 opened 2 years ago

Neipas09 commented 2 years ago

When I open an audiobook that i've "downloaded" for offline playback and click the play button, it will flash/change from the PLAY icon to the PAUSE icon and then right back to PLAY, making it so I can't pause the playback. The only way i can get it to stop playing is by swiping the app up in the "Recently Opened Apps" section, forcing the app to close.

I've included a screen recording of the issue happening. https://photos.app.goo.gl/XFthNN2pRJcpKKoA9

mattttvaughn commented 2 years ago

thank you for including the screen recording!

lks-nbg commented 2 years ago

Is this possibly related to #40? I have seen this behavior in the past but it has not occured to me since #58 (which is not released yet)

I could not see the media notification. Have you disabled it?

Neipas09 commented 2 years ago

Is this possibly related to #40? I have seen this behavior in the past but it has not occured to me since #58 (which is not released yet)

Unless i'm reading this website wrong, It looks like that #58 was merged into Release 0.52.0 and that's the version I have installed right now.

I could not see the media notification. Have you disabled it?

I haven't disabled anything. In fact, I've uninstalled the app, rebooted my phone, and reinstalled v0.52.0 via the apk in the Releases section on this site. I seem to no longer have the media player in the notification section...and I think that started after v0.51.0

My phone is a Pixel 6 on Android 12 Phone Info

lks-nbg commented 2 years ago

Unless i'm reading this website wrong, It looks like that #58 was merged into Release 0.52.0 and that's the version I have installed right now.

Release 0.52.0 includes a fix for the notification but not the mentioned #58. Here you can see all changes that were made after the release: https://github.com/mattttvaughn/chronicle/compare/0.52.0...develop

I haven't disabled anything. In fact, I've uninstalled the app, rebooted my phone, and reinstalled v0.52.0 via the apk in the Releases section on this site. I seem to no longer have the media player in the notification section...and I think that started after v0.51.0

I think the notification not showing at all, suggests an unhandled exception like in #40.

@mattttvaughn Could you provide a new release with the latest changes, so we can see if the issue is already fixed or needs further investigation?

mattttvaughn commented 2 years ago

Pre-release 0.52.1: https://github.com/mattttvaughn/chronicle/releases/tag/0.52.1

I'm still seeing this behavior for downloaded files.

Debugging tokens and logging not included in releases, fyi

lks-nbg commented 2 years ago

After investigating / debugging on two devices, this is what I found:

By digging through the logfiles I found this after pressing play in audiobook details view:

I/OnMediaChangedCallback: Playback state changed to STATE_ERROR 1648887414631
I/NotificationBuilder: Building notification! track=, index=0
I/NotificationBuilder: Building notification! chapter=, index=0
I/NotificationBuilder: Building notification! state=STATE_ERROR, playing=false
I/NotificationBuilder: Loading art uri: 
I/OnMediaChangedCallback: Created notif: Notification(channel=io.github.mattpvaughn.chronicle.features.player$NOW_PLAYING_CHANNEL shortcut=null contentView=null vibrate=null sound=null defaults=0x0 flags=0x8 color=0x00000000 category=transport actions=5 vis=PUBLIC)
I/MediaServiceConnection$MediaControllerCallback: MediaController session ready
I/AudiobookDetailsViewModel: is this book playing? false, this this book active? false
I/MainActivityViewModel: Observing playback: PlaybackState {state=7, position=0, buffered position=0, speed=0.0, updated=494216012, actions=2461191, error code=1, error message=Auto is disabled in Chronicle. Please re-enable in app settings, custom actions=[Action:mName='Skip backwards, mIcon=2131230938, mExtras=null, Action:mName='Skip forwards, mIcon=2131230907, mExtras=null, Action:mName='Skip to next, mIcon=2131230942, mExtras=null, Action:mName='Skip to previous, mIcon=2131230943, mExtras=null], active item id=-1}
I/AudiobookDetailsViewModel: Playback state: STATE_ERROR, (Auto is disabled in Chronicle. Please re-enable in app settings)
I/AudiobookMediaSessionCallback: Playing media from ID!
I/AudiobookMediaSessionCallback: Starting playback for book=7085 track=ACTIVE_TRACK at offset USE_SAVED_TRACK_PROGRESS

So I checked the settings and found that android auto was in fact disabled. Not sure if this happend after building the app a few times or somehow else. However after enabling android auto in the settings and going back to the audiobook details view I could start the audiobook again and the play/pause button was working and the notification appeared again. Going direclty from the settings to the mini-player did not work. You have to restart from audiobook details!

So I think I found workaround by re-enabling android auto.

@Neipas09 & @mattttvaughn could you please check if this works for you too?

Neipas09 commented 2 years ago

I disabled the Android Auto manually in the Settings... No desire or need for it. But yes, I can confirm that after re-enabling it in Settings, the Play button changes to Pause, and i'm able to Play/Pause like normal.