toasterofbread / spmp

A YouTube Music client with a focus on customisation of colours and song metadata. Built with Compose Multiplatform for Android and desktop.
GNU General Public License v3.0
1k stars 42 forks source link

Playback of any song fails after swiping away the media notification #358

Closed luimu64 closed 3 weeks ago

luimu64 commented 1 month ago

Checklist

Steps to reproduce

  1. Open the app and start playing any song
  2. Close the app
  3. Disable "pin media player" (is called differently in different roms) to completely hide any media player session when the media isn't playing and the media player app isn't open.
  4. Get rid of the media player widget completely
  5. Open the app again

Expected behavior

Songs should play even after closing the app completely

Actual behavior

Songs do not play after closing the app completely. I need to restart the whole phone for spmp to start working again.

Screenshots / recordings

https://github.com/user-attachments/assets/e38f3bb5-f77a-43cd-b634-21f20a2a9c83

The first time there is sound, second time there isn't, forgot to record sound.

Logs

logcat.log

SpMp version

0.3.2

SpMp platform

Android

OS version

Android 11

Additional information

The recording and logs are from chinese phone called duoqin f22. The issue seems to kinda exist on my android 14 phone too but spmp recovers with simple restart of the app unlike on my f22. My uneducated guess would be that you need to check whether the session exists before trying to reuse it or just recreate it on app launch every time. I also tested whether this is purely a rom issue by playing something from cromite (privacy friendly chrome alternative) and doing the exact same steps and cromite always recovered.

toasterofbread commented 3 weeks ago

The notification should be removed automatically as soon as you clear the app from recents while nothing is playing, so the bug occurs before you dismiss it manually. What's the behaviour when clearing the app without removing the notification manually?

luimu64 commented 3 weeks ago

Without clearing the notification manually it would linger indefinitely. I can't reproduce the bug anymore in the newest version so I guess whatever was changed in between 0.3.2 and 0.4.0 fixed this since nothing changed on the phone itself. Can still reproduce in the latest version after further testing, not sure why it didn't occur few first times I closed the app. After even further testing this is how it works now in 0.4.0:

The original issue is now seemingly fixed. Feel free to close this as completed or ask more info if you want to investigate the non-closing notification.