jmshrv / finamp

A Jellyfin music client for mobile
Mozilla Public License 2.0
2.01k stars 130 forks source link

App doesn't stay in memory in the background when paused #822

Open fionnafire opened 4 months ago

fionnafire commented 4 months ago

I notice this especially when driving and having multiple stops, with google maps in the foreground and finamp playing music in the background, I turn off the car and the music stops like normal but when I get back in the car I have to reopen finamp from scratch and set a new play queue because it doesn't save what I was just listening to. With Spotify for instance, it just starts playing again from where it paused no matter how long ago that was.

Chaphasilor commented 4 months ago

Hey, there's a setting for that. In the "Audio Service" section, disable the "Enter low-priority state when paused" option and Finamp should not get killed any more :)

That's also the default behavior in the redesign/beta, but if you had the stable version installed before switching to the beta the old settings would've still been active.

If you haven't switched to the beta yet I'd highly recommend that to you! But as explained above, you'll still have to manually update the setting in that case...

fionnafire commented 4 months ago

I know about the setting, and it's been disabled since I installed the beta and yet the problem I posted still happens. I'm sure my phone isn't running out of RAM because Spotify doesn't have this problem.

Chaphasilor commented 4 months ago

Hmm. Can you confirm that the setting for restoring the latest queue is enabled? That should be working even if the app gets closed in the background.

Also, what phone are you using?

caligari87 commented 3 months ago

I have (essentially) this same problem. I lose the now playing queue as soon as playback stops and the app isn't focused. I have the appropriate options toggled so far as I can tell. I've also never had the app successfully restore the now playing queue without manual intervention.

Screenshot_20240806-064206.png

Chaphasilor commented 3 months ago

@caligari87 that is very odd. Could you please attach some logs?

caligari87 commented 3 months ago

finamp-logs.txt

Sure. Hopefully this is the right item.

Chaphasilor commented 3 months ago

@caligari87 sorry for taking so long to get back, currently on vacation. I can see that in the logs the periodic queues seem to be empty for some reason, and that would be what should be restored. Something seems to have gone wrong on August 3rd, around 4pm, when the playback queue got cleared.

Maybe I'm just misunderstanding what you mean exactly. Are you actively stopping playback, or are you pausing the music? If you stop playback, the queue is cleared, and it might be that there is a bug that interferes with restoring the queue after manually stopping playback. Could you please explain again exactly what you are doing?

If you're pausing the music, I'm not sure what exactly went wrong, but I'd suggest clearing the entire app data by long pressing the app icon, going to app info, and then finding the button that clears the storage. This will clear your settings and all of your downloads, but should hopefully at least get Finamp to restore the queue again. I'm not sure if it will help with the background playback though.

caligari87 commented 3 months ago

@Chaphasilor thanks for the response. 99% of the time I'm listening to music in the car (via Tailscale connection to my Jellyfin server), so based on your description of what should happen, it seems my car is presumably sending a "stop" signal when I turn the radio off or turn the car off.

I'll have to do further testing and see if there's any combination of pausing either via Bluetooth controls or the app itself, which preserves my play queue when I turn off the car. It actually resumed correctly once without intervention when I started the car the other day, but I can't remember what I did before that.

That said, preserving the queue regardless seems to be the norm for other music players I've used, both for local libraries and streaming services, and that's the behavior I've grown to expect I guess.

misterjmw commented 1 month ago

I have the same issue. Android 14, Pixel 9, this seems to have started after the last one or two beta builds. Prior to that it resumed every time. Now I connect to Bluetooth (in the car) open the app and it's like a fresh start every time. No "restoring queue" message, just a fresh UI.

My settings, RE: restoring, are the same as the other users in this ticket.

Chaphasilor commented 1 month ago

@misterjmw So this only happens in the car? Not with other bluetooth headphones or speakers?

Can you also share logs please, and a screenshot of the "Restore Now Playing" screen?

misterjmw commented 1 month ago

@misterjmw So this only happens in the car? Not with other bluetooth headphones or speakers?

Can you also share logs please, and a screenshot of the "Restore Now Playing" screen?

@Chaphasilor

I can't honestly say I've tried anywhere but the car, I don't use Bluetooth often. I will see about capturing logs, in the meantime I do see some 'queue' related entries in the log from today, despite not having used finamp today.

I'm not sure exactly what the "Restore Now Playing" screen is.

Previously; I would open the app and a bar would appear across the bottom saying something like "Restoring queue" (apologies, it was month+ ago, and my memory isn't amazing, the verbiage may be different). Yesterday, I had played Finamp on the way to work, got back in the car after work, launch Finamp and nothing is shown. It loads my 'albums' page and that's it. No 'restoring' notification, no pop-up or prompt of any kind.

Audio Service Settings: finamp-audio-service

Not sure what this is: finamp-queue-log-dates

nor this:

finamp-queue-log-restore

Chaphasilor commented 1 month ago

You can access the "Restore Now Playing" screen through the side drawer menu:
Screenshot_20241012-110509.png

There you can manually pick previous queues to load up again.
From your logs it seems like the queues are still there, so the issue likely happend while actually restoring the queue, and not before.

The full logs file might help. You can extract it by clicking on the "share" button (three connected dots, top right) on the logs screen.

misterjmw commented 1 month ago

You can access the "Restore Now Playing" screen through the side drawer menu: Screenshot_20241012-110509.png

There you can manually pick previous queues to load up again. From your logs it seems like the queues are still there, so the issue likely happend while actually restoring the queue, and not before.

The full logs file might help. You can extract it by clicking on the "share" button (three connected dots, top right) on the logs screen.

I'm not sure how I missed that button, but I'll grab logs the next time I run into this (this week sometime). Thanks again!

misterjmw commented 1 month ago

You can access the "Restore Now Playing" screen through the side drawer menu:

There you can manually pick previous queues to load up again. From your logs it seems like the queues are still there, so the issue likely happend while actually restoring the queue, and not before.

The full logs file might help. You can extract it by clicking on the "share" button (three connected dots, top right) on the logs screen.

Alright, Now that I know the button to restore a playlist exists, I've got to refine my comment a bit. If I press the "Restore Now Playing" button, then pick a list to restore from, everything seems to behaves. However it doesn't do this automatically. I've toggled the setting back and forth to no avail. At present it seems like I can 'restore now playing' but I must do it manually.

To my untrained eye, my logs look like @caligari87's logs, however I don't know what I'm looking for.

finamp-logs-shorter.txt

Chaphasilor commented 2 weeks ago

Does this still happen with the latest update?

misterjmw commented 2 weeks ago

Does this still happen with the latest update?

Seems to, I should be able to pull my logs, but I went out for lunch and the album I was listening to didn't start. Knowing I can pull the menu out and get it going makes like MUCH easier than having to find the playlist again, but no, it still doesn't resume.