OxygenCobalt / Auxio

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

Auxio (Media3 ExoPlayer?) is struggling to build/update libraries #691

Closed Tom4tot closed 4 months ago

Tom4tot commented 4 months ago

Describe the Bug/Crash

Every time I modify my library (around 22k songs, 60GB), Auxio is really struggling to keep up with changes and I have to reinstall it multiple times (or erase the app's data). It happens because I'm currently updating my main library and therefore, I'm often changing tags, paths, testing new programs to duplicate my library on my phone, so it's just easier to delete everything on my phone and add everything back, with the updated files.

Lately, it was mixing my old library with my new one (so most songs were duplicated, but only one of the two actually still exists). Reinstalling the app, rescanning, refreshing: none helped.

I'm finally finding a fix by moving all my files to a new folder and use the "Music folders" setting to only include this folder, but again, it takes a long time for the library to rebuild.

That's another issue: this morning, it took 4+ hours to rebuild my library, and at the end, I couldn't play any file because they were indexed at the old, wrong, location.

I find it crazy that in 2024, with UFS 3.1 storage (Pixel 6), it's so slow to build a library, when Foobar can do it within seconds for much bigger libraries, and update in real time.

I assume you can't do much and that you are limited by the Media3 ExoPlayer, so I would like to know if at least there's a way to fix things at the system level? In the past, deleting the data of the media store system app was helping, but it seems to not exist anymore? Currently, my phone is reporting 168GB of audio even though I only have 128GB of storage... Despite rebooting.

One last bug: it seems that modifying settings while the music library is loading makes the app bug, and it can't load the library anymore; it stucks on the "loading your music library" screen without mentioning how many files are being found. Therefore, I have to wait for the process to end before changing any setting.

Describe the intended behavior

Finding audio files should be a faster process and it should take into account deleted/moved files more consistently and reliably.

What android version do you use?

Android 14 I'm currently using the 3.4 Auxio pre-release but I don't think

What device model do you use?

Pixel 6 - Graphene OS

Bug report

I'll be happy to log anything if it can help.

Duplicates

OxygenCobalt commented 4 months ago

Yeah, this is a sign that your phones media database is buckling under the load of your music library. MediaStore is already finicky with making sure that stale song entries are removed, I imagine having 22k songs makes it even worse.

IMO it's kind of impossible to design a mobile music player capable of handling libraries of that size. Android's FS functionality is just too slow. Something like SubSonic would be more suitable here, but I can't meaningfully port Auxio to such a protocol currently.

One last bug: it seems that modifying settings while the music library is loading makes the app bug, and it can't load the library anymore; it stucks on the "loading your music library" screen without mentioning how many files are being found. Therefore, I have to wait for the process to end before changing any setting.

What kind of settings? If I can reproduce this I'll spin it off into another issue.

Tom4tot commented 4 months ago

What kind of settings? If I can reproduce this I'll spin it off into another issue.

I haven't double checked to reproduce, but I think it's the "automatic reloading" one, that doesn't play well when the library is already currently loading. I don't see which other setting would screw things up anyway. If I have the opportunity to reload my library, I will try (hopefully not tbh).

OxygenCobalt commented 4 months ago

I can try to reproduce that myself.

As for everything else, you're kind of on your own. Perhaps #322 might alleviate your troubles? There's more development pressure to make sure the file system itself is sane versus a media database barely anyone uses, so it might help. Nothing can stop the app taking like 4 hours to load 22k songs though.

Tom4tot commented 4 months ago

I can try to reproduce that myself.

As for everything else, you're kind of on your own. Perhaps #322 might alleviate your troubles? There's more development pressure to make sure the file system itself is sane versus a media database barely anyone uses, so it might help. Nothing can stop the app taking like 4 hours to load 22k songs though.

I don't have the technical knowledge to know if it would help or not, but your reasoning makes sense!

I didn't expect any miracle solution creating this thread to be honest, I just wanted to share my pain and maybe some other users can relate or share their workarounds.

I was also wondering if there was a way for the app to prioritize the library loading process so it would take less time, or do you think it's actually already taking 100% of disk usage? Currently, the process is slow AND is making my phone warm to the touch the whole time). Also, if Android closes Auxio, the operation has to be completely restarted (I think), so a way to make sure the app doesn't close in the background would be welcomed. I never noticed the "persistent notification" when using the "automatic reloading" setting, is that normal?