mattttvaughn / chronicle

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

Pull down controls stuck #40

Closed ggrensteiner closed 2 years ago

ggrensteiner commented 2 years ago

Media control pull down stuck on "Playing" in android 12. Pause button works to stop the playback, but it does not start playback nor does it change to the "Play" symbol once the media is paused.

Android 12, Samsung UI 4, using current apk 0.51.2

hskrtich commented 2 years ago

I am also running into this issue with 0.51.2

mattttvaughn commented 2 years ago

Yea I've been seeing this behavior for a while on my device as well. Not specific to 0.51.x if my memory serves me

Android 11, OnePlus 8

DarthIJ commented 2 years ago

Also having this issue - posted on Reddit.

Andorid 12 Pixel 6 Pro

runningslow81 commented 2 years ago

I've been seeing this as for as long as I remember. I also have it completely disappear from my pulldown menu on occasion, even when a book is actively playing.

OnePlus 7 Pro - Android 11

mattttvaughn commented 2 years ago

45 should resolve this- seems to do so for me at least. Will close this issue out in the next few days unless anyone reports continued issues on 0.51.3

Apk can be found on the release here: https://github.com/mattttvaughn/chronicle/releases/tag/0.51.3

hskrtich commented 2 years ago

can you increment the version number?

mattttvaughn commented 2 years ago

done @bskrtich thanks. release apk should be updated too

hskrtich commented 2 years ago

thanks!

mattttvaughn commented 2 years ago

Not fully resolved. At least on Android 11, the pause/play button in the notification stops being updated as soon as the app is closed.

Steps to reproduce:

  1. Open the app
  2. Start playing a book
  3. Note that the pause/play buttons in the notification work correctly
  4. Close the app or turn off your phone

Observed:

Expected:

If anyone's interested in taking a look, refer to #45, which I think is probably related

oucil commented 2 years ago

I can confirm that the button does not update after pausing but would add that it also ceases to function, pressing it again does NOT resume playback.

Pixel 3XL

pmayeur commented 2 years ago

When I get this I can use rewind 10 seconds and it fixes the button. Maybe that info will help debug

lks-nbg commented 2 years ago

I think I found the possible cause. NotificationBuilder uses a locally stored version of the album image. When the app goes to the background the bitmap gets recycled and the NotificationBuilder tries to access the recycled bitmap, which results in "undefined behavior" and an "unhandled exception" → frozen notification, sometimes crashes

I/NotificationBuilder: Building notification! state=STATE_PAUSED, playing=false
W/Bitmap: Called getWidth() on a recycle()'d bitmap! This is undefined behavior!
W/Bitmap: Called getHeight() on a recycle()'d bitmap! This is undefined behavior!
I/OnMediaChangedCallback: Created notif: Notification(channel=io.github.mattpvaughn.chronicle.features.player$NOW_PLAYING_CHANNEL pri=0 contentView=null vibrate=null sound=null defaults=0x0 flags=0x8 color=0x00000000 category=transport actions=6 vis=PUBLIC)
E/AppModule$exceptionHandler$$inlined$CoroutineExceptionHandler: Caught unhandled exception! java.lang.IllegalStateException: Can't parcel a recycled bitmap

I will make a quick PR for testing.

ggrensteiner commented 2 years ago

This issue is not resolved in 0.52.0.

The notification works for 1 cycle (pause, then play) and then ceases to function. Also, android auto controls are broken in the same way now. The "random pause" bug interacts with this #32 and when it randomly pauses you cannot press play again in android auto. You have to open your phone and start playback again.