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

Playback stops when finamp is not in the foreground #956

Open
csaavedra opened this issue Nov 16, 2024 · 24 comments
Open

Playback stops when finamp is not in the foreground #956

csaavedra opened this issue Nov 16, 2024 · 24 comments

Comments

@csaavedra
Copy link

This started happening to me several days ago. If I switch off the screen or just go to a different app, finamp will stop playback after less than a minute. Going back to the app will resume playback., but sometimes it will just go to the next song in the queue.

I have no battery optimisations enabled for finamp.

I have tried with Allow Low-Priority Status on Pause enabled and disabled, makes no difference.

This happens with both offline mode and streaming from my Jellyfin server.

I'm using a Pixel 7 with Android 15. Version is 0.6.24.

@Chaphasilor
Copy link
Collaborator

Hey, could you please share some logs?
Also, are you able to pinpoint if this started happening after updating to 0.6.24? That was released about a week ago.

@shangyuj
Copy link

I have the exact same problem with a Pixel 9 Pro on Android 15. Another symptom is the player media control no longer shows up in notifications or lock screen.

@jmshrv
Copy link
Owner

jmshrv commented Nov 16, 2024

This may be because I switched main back to API 34, since the Play Store now requires it. redesign works fine, so maybe there's a dependency update or something that we need to carry over to main

@csaavedra
Copy link
Author

csaavedra commented Nov 16, 2024

Also, are you able to pinpoint if this started happening after updating to 0.6.24? That was released about a week ago.

This is very likely. The app store app says finamp was updated 6 days ago. I started experiencing this 4 days ago but I wasn't using the app on the days before that, so that might definitely be it. I'll try going back to an older version.

@martingagne
Copy link

Hey, I’m encountering the same issue on iOS/iPadOS 18.1 using an iPad Pro M1. When Finamp is not in the foreground, playback stops. This happens both in offline mode and when streaming from my Jellyfin server.

•	OS Version: iPadOS 18.1
•	Device: iPad Pro M1
•	Finamp Version: Latest beta version (used to be just too good—now this bug makes it almost unusable)

I’d be happy to provide logs, but they contain too much sensitive information, like my server name and other details. If there’s a way to anonymize or filter the logs, let me know, and I’ll share them to help resolve this issue.

I hate to complain, but you guys have done a terrific job with this application. In fact, I don’t think it has anything to envy to Apple Music. Thanks for your hard work, and I hope this can be fixed soon!

@jmshrv
Copy link
Owner

jmshrv commented Nov 16, 2024

Interesting that you're seeing it happen on iOS too. I very occasionally have background playback not work (like twice ever) but if it's something that keeps happening that's bad.

As for logs, they're sanitised automatically when you copy/share them. Your server address and token should be censored :)

@martingagne
Copy link

Attached is the log. I manually censored a bit more since I could still see my fileserver URL and a couple of other things.

This bug is a real bummer because I typically use the app for about 12 hours a day - it’s been such a solid client for Jellyfin until now. Unfortunately, I might need to roll back to the previous version for the time being.

The issue is super consistent: as soon as the iPad or iPhone screen goes dark, or I switch apps, the music stops. Let me know if there’s anything else I can do to help troubleshoot this. You’ve done such an amazing job with this app - I really hope this gets sorted out soon!

sanitized_log.txt

@bebopjp
Copy link

bebopjp commented Nov 18, 2024

Same problem here. Playback stops when screen is off after 3-5 minutes. No media controls on notification screen. When I unlock the screen, finamp will start a random track from the album that was previously playing. Started happening in the last week, so likely when the app update occurred.

Pixel 7 pro
Android 15
App version 0.6.24

@bebopjp
Copy link

bebopjp commented Nov 18, 2024

Just reproduced and the only errors right before the audio stop are this. No socket errors from other tasks.

[MusicPlayerBackgroundTask/SEVERE] 2024-11-17 21:13:07.222372: ClientException with SocketException: Failed host lookup: 'redacted' (OS Error: No address associated with hostname, errno = 7), uri=BASEURL/Sessions/Playing/Progress

null

@Chaphasilor
Copy link
Collaborator

@martingagne thanks for the logs. You said that the previous beta version (0.9.11) workes fine for you, and the bug started appearing with this update?

The intereting thing in the logs is that while the app is paused by the OS multiple times (which is normal and wouldn't normally affect playback), it doesn't seem to have quit completely. In the whole log you shared, which spans almost three days, only one startup is logged.
That means it's probably not a crash.

The Android users reported playback stopping a short while after the app goes into the background, but in your case it's immediately. So it could be a different (perhaps related) issue.

Were you able to downgrade to a previous version?

@martingagne
Copy link

martingagne commented Nov 19, 2024 via email

@Chaphasilor
Copy link
Collaborator

@jmshrv can you look up which dependency versions were used during your build? Pubspec allowed for the latest versions of everything related to just_audio, but maybe you hadn't pulled them yet?
I also couldn't find any significant differences in the pubspec and gradle files between main and redesign, aside from some SDK versions (notably dart 2 vs dart 3).

@jmshrv
Copy link
Owner

jmshrv commented Nov 20, 2024

Updated dependencies, pushing a new build now. Just tested and it looks good :)

@shangyuj
Copy link

The problem persists for me unfortunately. I'm on Pixel 9 Pro running Android 15 and I've updated the app to the newest 0.6.25 version. There is still no audio control in the notification center, and audio stops playing shortly after leaving the app but resumes after returning to the app. Here are the last two logs copied after returning to the app after audio stopped:

[Chopper/INFO] 2024-11-22 03:27:56.063932: --> POST BASEURL/Sessions/Playing/Progress
Content-Type: application/json; charset=utf-8
Authorization: MediaBrowser UserId="cbca3f987e664ea7a945e76ea9610536", Token="TOKEN", Client="Finamp", Device="Pixel 9 Pro", DeviceId="b8e3f517ed788367", Version="0.6.25"
content-length: 445

{"CanSeek":true,"Item":null,"ItemId":"2dd616d778fda3eefb0c4f783c5aaef1","SessionId":null,"MediaSourceId":null,"AudioStreamIndex":null,"SubtitleStreamIndex":null,"IsPaused":false,"IsMuted":false,"PositionTicks":2111270000,"PlaybackStartTimeTicks":null,"VolumeLevel":null,"Brightness":null,"AspectRatio":null,"PlayMethod":"DirectPlay","LiveStreamId":null,"PlaySessionId":null,"RepeatMode":"RepeatNone","NowPlayingQueue":null,"PlaylistItemId":null}
--> END POST

null

[Chopper/INFO] 2024-11-22 03:27:56.099415: <-- 204 No Content POST BASEURL/Sessions/Playing/Progress
x-response-time-ms: 3.9925
date: Fri, 22 Nov 2024 09:27:56 GMT
server: Kestrel
content-length: 0
<-- END HTTP

null

@jmshrv
Copy link
Owner

jmshrv commented Nov 22, 2024

Thanks for letting me know, I'll keep looking into it. For now, I'd recommend you switch to the beta, which isn't affected by this

@Chaphasilor
Copy link
Collaborator

@shangyuj were those two logs the only logs that were shown? Or did you just leave out the other logs?
Because it those really are the only logs then the app is definitely getting killed in the background and not just paused.

@DickChang
Copy link

I've got the same issue. version 0.6.25. pixel 7a. android 15

@rawkhopper
Copy link

0.6.25 on Pixel 6 with Android 14 has this same issue. It plays for maybe a minute and the just stops. As soon as I unlock the phone and push play it resumes.

@Chaphasilor
Copy link
Collaborator

@DickChang @rawkhopper give the beta a try. You can switch to it through the Play Store at the bottom of Finamp's store page

@Thecrafterja
Copy link

I had the same problem on a pixel 9 with Android 15. After switching to the beta provided through google playstore, finamp is working fine again.
The media control is also appearing again 👍

@Chaphasilor fyi

@demaniak
Copy link

demaniak commented Dec 19, 2024

Just to clock in and say "here also - exact same issue".

Recently (I think like...yesterday?) f-droid updated to 0.6.25, and today I'm seeing everything reported here.

I'll try the beta I guess, see what happens.

UPDATE: indeed, the beta seems to be working perfectly :)
ALso, thank your for not killing support for older jellyfin like 10.8.13!

@Chaphasilor
Copy link
Collaborator

Got a few questions for you:

  1. Playback just pauses and you can just hit play again to resume, yes?
  2. Could it be that the pausing happens right after you receive a notification? Maybe you could try this out with a friend :)
  3. Does the playback progress slider in the media notification keep moving?
  4. To those of you that observed skipped tracks, like @bebopjp and @csaavedra, could you check if Finamp the skipped tracks were reported in the Activity tab of your Jellyfin server's admin dashboard?

Combined with your mentions of missing media notifications (also in #977), I'm now suspecting something being wrong with audio_session or audio_service, which handle audio ducking (reducing volume for notifications, pausing and resuming for calls) and the media notification, respectively.

PS @demaniak we'll try not to enforce a minimum version, but also don't guarantee compatibility for older (minor) versions. So you should try to upgrade as soon as you can!

@demaniak
Copy link

demaniak commented Dec 19, 2024

Got a few questions for you:

1. Playback just _pauses_ and you can just hit play again to resume, yes?

2. Could it be that the pausing happens right after you receive a notification? Maybe you could try this out with a friend :)

3. Does the playback progress slider in the media notification keep moving?

4. To those of you that observed skipped tracks, like @bebopjp and @csaavedra, could you check if Finamp the skipped tracks were reported in the Activity tab of your Jellyfin server's admin dashboard?

Combined with your mentions of missing media notifications (also in #977), I'm now suspecting something being wrong with audio_session or audio_service, which handle audio ducking (reducing volume for notifications, pausing and resuming for calls) and the media notification, respectively.

PS @demaniak we'll try not to enforce a minimum version, but also don't guarantee compatibility for older (minor) versions. So you should try to upgrade as soon as you can!

  1. Not..exactly. It's weird. When in this state, Just hitting play does nothing. Hitting next, does nothing (where "nothing" is defined as "seems to move to next song but does not play" .BUT, hitting the "play random songs from all songs" - that gets music flowing again. For approx 2 songs, then...back to square one. Mostly. Sometimes I get to 3 or 4 songs.

  2. no notifications (yeah I'm a friendless hermit :p )

  3. No, for me, the slider is stuck at 0 in these cases

  4. Um, just a data point on that from my side - I have in this period also noticed "shortened" tracks - the track would end prematurely and then go on to the next track (or, just stop as explained above).

FWIW, the beta is working very nicely, control widget back in business etc

Regarding upgrade: yeah... the 10.9+ releases has some wonky memory use issues (in some cases/platforms), but I know I'll have to give it a try again sometime in near future :(

@Chaphasilor
Copy link
Collaborator

Good news everyone!
Seems like there are some new permissions required for Android 14+ that are requested in the beta but not on stable:
ryanheise/just_audio#1363 (comment)

We'll add the missing permissions and push an update ASAP!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

10 participants