OxygenCobalt / Auxio

A simple, rational music player for android
GNU General Public License v3.0
1.82k stars 120 forks source link

Random crash while using resource-hungry foreground apps #362

Closed breversa closed 1 year ago

breversa commented 1 year ago

Describe the Bug/Crash

  1. Start Auxio
  2. Play music
  3. Start your favorite navigation app (I use Magic Earth, and OsmAnd) with voice guidance
  4. Auxio randomly crashes after a few seconds/minutes… or not.

Describe the intended behavior

Auxio should keep playing music even when voice guidance plays over it

What android version do you use?

Android 10

What device model do you use?

Samsung Galaxy S9 (SM-G960F)

Relevant log output

It's hard to get a log since this issue usually happens while driving. :-/

Duplicates

breversa commented 1 year ago

Maybe it has something to due with music volume lowering while voice guidance plays over it?

But Auxio seemingly crashes at anytime, not only when voice guidance plays.

OxygenCobalt commented 1 year ago

Okay, if it's crashing at any time, it's a more general issue. Please obtain a stack trace. I'd imagine you can replicate your usage even when you are not driving.

It's definitely moments like these that make me wish I could add telemetry, but then I remember how much hate I would get for it :sweat_smile:

breversa commented 1 year ago

Sadly I've so far been unable to reproduce it when not using voice guidance. :-(

AdAway has optional and disabled-by-default telemetry to sentry.io, IIRC.

OxygenCobalt commented 1 year ago

Taking a bug report may be useful. That way, if a crash occurs, you can immediately grab a stack trace as soon as possible. See here for some more guidance (Perhaps I should start pointing to this instead of making people use logcat)?

breversa commented 1 year ago

bugreport-starltexx-QQ3A.200805.001-2023-02-25-12-26-43.zip

Here's the bug report you asked for!

OxygenCobalt commented 1 year ago

Looks like this isn't a crash at all. Your phone is just killing Auxio for no reason.

The only log referencing Auxio dying is this:

02-25 12:26:29.915  1000  4664 26214 I ActivityManager: Process org.oxycblt.auxio (pid 8047) has died: prcp FGS 
02-25 12:26:29.915  1046  4507  9080 D BufferPoolAccessor: Destruction - bufferpool2 0x37a0efdc30 cached: 0/0M, 0/0% in use; allocs: 40712, 100% recycled; transfers: 40711, 100% unfetced
02-25 12:26:29.915  root  4479  4479 I Zygote  : Process 8047 exited due to signal 9 (Killed)

There's no crash information or stack trace. Your phone just stoppped the app. I also noticed a ton of activity from a net.osmand (I'm assuming that's an OpenStreetMaps app) before the log telling that Auxio was killed, alongside similar logs that signify other apps being killed. What I think is occurring here is that either:

There is nothing I can do about this, I'd imagine.

breversa commented 1 year ago

Thanks for you analysis! I've forwarded your finding to the OsmAnd team. :)

breversa commented 9 months ago

Hello, the OsmAnd team thinks that it’s actually the OS killing Auxio when under heavy load (not necessarily voice guidance), and not OsmAnd itself. I fear the issue might be somewhere between the OS, OsmAnd, and Auxio. :(

What I find weird is that only Auxio crashes when I use OsmAnd, and no other background app (such as NewPipe).

breversa commented 1 week ago

Hello! I keep having this issue, mostly when using OsmAnd (due to https://github.com/osmandapp/OsmAnd/issues/19927, I presume), but also sometimes with other foreground apps.

While I understand that it’s most probably an issue with the OS killing background apps, I’m puzzled by the fact that Auxio is so often the unlucky victim of that killing (much more than NewPipe, for instance), so I’m wondering what NewPipe does that Auxio doesn’t, to prevent it from being killed that regularly.

Someone suggested increasing the (background?) priority of Auxio. Is that something that can be done?

I’m willing to test any Auxio build to help mitigate that issue. :-)

OxygenCobalt commented 1 week ago

Hello! I keep having this issue, mostly when using OsmAnd (due to https://github.com/osmandapp/OsmAnd/issues/19927, I presume), but also sometimes with other foreground apps.

While I understand that it’s most probably an issue with the OS killing background apps, I’m puzzled by the fact that Auxio is so often the unlucky victim of that killing (much more than NewPipe, for instance), so I’m wondering what NewPipe does that Auxio doesn’t, to prevent it from being killed that regularly.

Someone suggested increasing the (background?) priority of Auxio. Is that something that can be done?

I’m willing to test any Auxio build to help mitigate that issue. :-)

I really wonder if I'm getting punished for keeping my music library in-memory, or maybe because of my image loader or ExoPlayer. How large is your library?

breversa commented 1 week ago

My library is about 300 music files = 8 GiB (mostly FLAC, with a bit of Ogg Vorbis, MP3, and some odd Opus/AAC/WMA/other formats), most with embedded cover art, stored on the external SD card.

OxygenCobalt commented 1 week ago

Hm. I don't know then. It probably isnt helping that theres even a small amount of load, but OsmAnds likely huge resource consumption is making it much worse.

OxygenCobalt commented 1 week ago

Also, it's a samsung. Theyre notorious for doing stuff like this even on minimal load.

breversa commented 1 week ago

Yes, OsmAnd has obviously a resource usage issue, but other apps are not getting killed as regularly as Auxio (if ever). I’m working with the dev team to try and sort this out. And Auxio also crashed with other apps (although less often).

Yes, it’s a Samsung, but totally not stock OS (/e/OS is basically LineageOS + built-in MicroG) either.