OxygenCobalt / Auxio

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

Music can no longer be found on v3.3.0 onwards #662

Closed HeConnor closed 5 months ago

HeConnor commented 5 months ago

Describe the Bug/Crash

In setting->music folder, I set my own music folder path to "include folder", but no music found.

Then, I found "exclude and include folder" are all same my own music folder path.

Describe the intended behavior

In setting->music folder, I set my own music folder path to "include folder", music can be found.

"exclude folder" was empty.

What android version do you use?

Android 10

What device model do you use?

OnePlus 7T

Bug report

The previous version was ok

Duplicates

OxygenCobalt commented 5 months ago

Can't reproduce this on my Android 14 device, let me check if its an accidental regression on Android 10 and below.

OxygenCobalt commented 5 months ago

I can't reproduce the behavior of them acting the same. I think the issue now is that Auxio can't load any music anymore. "Include folders" is a bit of bad naming since it's moreso restricting what music Auxio can find to a particular folder rather than telling Auxio to look for music in that folder.

Can you please try this Debug APK @HeConnor? I need you to take a bug report following these instructions. There are also instructions in Chinese/中文 – 简体, if that helps.

(Forgot to upload APK, one second)

OxygenCobalt commented 5 months ago

Here's the APK I want you to try @HeConnor

Auxio_Canary.zip

HeConnor commented 5 months ago

Hello OxygenCobalt,

  1. I used Auxio_Canary.zip on my phone, and return a dump file 2024-01-06_12-52-57_079.hprof..bin.zip, (I can't read instructions, I hope it's helpful for you).
  2. I reinstall version 3.2.1, and then set my own music folder path to "include folder", music can be found. But I found "exclude and include folder" are all same my own music folder path (it's same as version 3.3.0, but music can't be found in v3.3.0). You can see my screenshot: example
OxygenCobalt commented 5 months ago

Sadly, that file does not help. I'm also having trouble what you are communicating in the second statement.

In this case, if you cannot provide logs @HeConnor, I want you to test these APK files and tell me which ones work and which ones don't:

Auxio_5562c184157c38a1ad2aed3d30388f41f6106c4f.zip Auxio_673629dd2639537c9e66ca38e8d6d15bd7157797.zip Auxio_ec8e598d3bedfa7051e12ab1b60a4bb98c0be9bf.zip

This will allow me to narrow down exactly where the app broke.

HeConnor commented 5 months ago

em... My work flow:

  1. install app
  2. runing (Grant permissions)
  3. set my own music folder path to "include folder" and save setting
  4. scan music folder

Only Auxio_5562.. is OK!

najdshad commented 5 months ago

I have the same issue on my Samsung A53 (Android 14, One UI 6.0)

Richard38907 commented 5 months ago

Same issue on my OnePlus Nord (PixelExperience - Android 13). V 3.3.0 only too.

OxygenCobalt commented 5 months ago

Alright, here's some more APKs to try @HeConnor @najdshad @Richard38907. Report which ones work.

Auxio_ec8e598.zip Auxio_d59230b.zip Auxio_6956ca5.zip

OxygenCobalt commented 5 months ago

If you also can @najdshad @Richard38907, please take a bug report once music loading fails using the instructions here

Richard38907 commented 5 months ago

Bug report option is suddenly missing in my developer options. Is it possible to generate it from ADB instead?

OxygenCobalt commented 5 months ago

I think adb bugreport also works @Richard38907. Also, make sure you're doing the bug report when music loading fails in one of the debug builds (like Auxio_Canary.zip).

Richard38907 commented 5 months ago

bugreport-CPH2415EEA-UKQ1.230924.001-2024-01-09-21-37-32-dumpstate_log-2570.txt

bugreport-CPH2415EEA-UKQ1.230924.001-2024-01-09-21-37-32.zip

dumpstate-stats.txt

Screenshot_20240109-213900.png

Screenshot_20240109-213839.png

Screenshot_20240109-213656.png

I reproduced the bug on my OnePlus 10t (android 14)

The error is detailed here:

android.database.sqlite.SQLiteException: near "OR": syntax error (code 1 SQLITE_ERROR): , while compiling: SELECT _id, date_added, date_modified, _size, duration, mime_type, title, year, album, album_id, artist, album_artist, _display_name, volume_name, relative_path, cd_track_number, disc_number FROM audio WHERE ((((is_pending=0 AND NOT _modifier=4) OR (is_pending=1 AND lower(_data) NOT REGEXP '.*/.pending-(\d+)-([^/]+)$' AND owner_package_name IN ( 'org.oxycblt.auxio' )))) AND (is_trashed=0) AND (volume_name IN ( 'external_primary' ))) AND (NOT _size=0 AND is_music=1 AND NOT ( OR (volume_name LIKE ? AND relative_path LIKE ?))) at android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:186) at android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:142) at android.content.ContentProviderProxy.query(ContentProviderNative.java:495) at android.content.ContentResolver.query(ContentResolver.java:1255) at android.content.ContentResolver.query(ContentResolver.java:1181) at android.content.ContentResolver.query(ContentResolver.java:1137) at org.oxycblt.auxio.music.fs.StorageUtilKt.safeQuery(Unknown Source:6) at org.oxycblt.auxio.music.fs.MediaStoreExtractorImpl.query(SourceFile:369) at org.oxycblt.auxio.music.MusicRepositoryImpl$indexImpl$mediaStoreQueryJob$1.invokeSuspend(SourceFile:37) at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(Unknown Source:8) at kotlinx.coroutines.DispatchedTask.run(Unknown Source:94) at androidx.fragment.app.Fragment$4.run(SourceFile:43) at kotlinx.coroutines.scheduling.TaskImpl.run(Unknown Source:2) at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(SourceFile:92)

OxygenCobalt commented 5 months ago

I think two issues are being reported here. Yours is a logic problem that lead to an error, which is distinct from no music being found at all @Richard38907. I've just fixed the issue. I'd recommend removing all of your music folders for now, as that's the current reason why the music loading is failing.

dreamsyntax commented 5 months ago

Commenting as I've also ran into this on FDroid version. Longtime user who had previously upgraded from an inplace v3. Will build your latest changes.

OxygenCobalt commented 5 months ago

Please respond with any kind of relevant log information @dreamsyntax!

dreamsyntax commented 5 months ago

Please respond with any kind of relevant log information @dreamsyntax!

I saved this while still on the FDroid build

android.database.sqlite.SQLiteException: near "OR": syntax error (code 1 SQLITE_ERROR): , while compiling: SELECT _id, date_added, date_modified, _size, duration, mime_type, title, year, album, album_id, artist, album_artist, _display_name, volume_name, relative_path, cd_track_number, disc_number FROM audio WHERE ((((is_pending=0 AND NOT _modifier=4) OR (is_pending=1 AND lower(_data) NOT REGEXP '.*/\.pending-(\d+)-([^/]+)$' AND owner_package_name IN ( 'org.oxycblt.auxio' )))) AND (is_trashed=0) AND (volume_name IN ( 'external_primary' ))) AND (NOT _size=0 AND is_music=1 AND  ( OR (volume_name LIKE ? AND relative_path LIKE ?)))
    at android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:186)
    at android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:142)
    at android.content.ContentProviderProxy.query(ContentProviderNative.java:495)
    at android.content.ContentResolver.query(ContentResolver.java:1235)
    at android.content.ContentResolver.query(ContentResolver.java:1167)
    at android.content.ContentResolver.query(ContentResolver.java:1123)
    at org.oxycblt.auxio.music.fs.StorageUtilKt.safeQuery(Unknown Source:6)
    at org.oxycblt.auxio.music.fs.MediaStoreExtractorImpl.query(SourceFile:369)
    at org.oxycblt.auxio.music.MusicRepositoryImpl$indexImpl$mediaStoreQueryJob$1.invokeSuspend(SourceFile:37)
    at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(Unknown Source:8)
    at kotlinx.coroutines.DispatchedTask.run(Unknown Source:94)
    at androidx.fragment.app.Fragment$4.run(SourceFile:43)
    at kotlinx.coroutines.scheduling.TaskImpl.run(Unknown Source:2)
    at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(SourceFile:92)

I am on Android 14 / GOS

OxygenCobalt commented 5 months ago

Okay, that's the same error as everyone else but @HeConnor and @najdshad are seemingly facing.

OxygenCobalt commented 5 months ago

v3.3.1 should have a patch for your issues @dreamsyntax @Richard38907 (I hope). Please test them as soon as possible.

5x44 commented 5 months ago

I was having the same problem on my device running Android 13, accessing the /Library/Music Folders settings, I noticed that the app is adding the /Include directories to /Exclude, making the app accept and at the same time reject processing music from these directories, I had to choose only one directory for the app to process music. In version 3.3.0 (F-Droid) it is no longer possible to add more than one directory in /Include without giving an error, that is, /Include must be limited to a single path, to run music in more than one directory you must remove both paths of /Include, /Exclude, I did not test if this results in error on Huawei devices.

OxygenCobalt commented 5 months ago

I was having the same problem on my device running Android 13, accessing the /Library/Music Folders settings, I noticed that the app is adding the /Include directories to /Exclude, making the app accept and at the same time reject processing music from these directories

I don't really know what this means.

Anyway, I didn't actually fix the issue. It turns out there were two distinct issues that could both cause the same error, and I only fixed one. Have to release another patch...

OxygenCobalt commented 5 months ago

I've just released 3.3.2, which should at minimum fix the music loading failing. As for the broken include/exclude behavior, without any more information I can't meaningfully resolve it.

Abcd1234-dot commented 5 months ago

I just updated to latest version v 3.3.2 and unfortunately the issue is not resolved for my case yet. It could be a different one in my case than the logs available above.

I describe it in detail, note it I am now on v3.3.2 and issue started to occur since updating to v3.3.0. There are two separate issues for me. Include folder & Exclude folder issue. Include folder : When I try to add any folder which has many music files (.mp3 specifically)(those files gets loaded along with all others when Include is empty!) it shows no music found pop-up. Exclude folder : When I try to add any folder, it just loads all the music files of whole device (Internal + External storage) regardless of whatever I added.

I tried debug version you mentioned above, but there's no visible error in my case as @Richard38907 showed in screenshots.

OxygenCobalt commented 5 months ago

What's your device version @MysterioABC?

OxygenCobalt commented 5 months ago

Figured out the issue. I was selecting for some extremely malformed paths, something like storage/emulated/0Music. I believe I've fixed it now in this debug build, can you try it @MysterioABC?

Auxio_Canary.zip

Abcd1234-dot commented 5 months ago

Issue seems to be fixed in latest update you just pushed. Thank you!!

dreamsyntax commented 5 months ago

Is there a time window for F-Droid to host v3.3.3? I kept a bugged state to purposely test going from v3.3.0, but I'm stuck on the F-Droid signed version.

OxygenCobalt commented 5 months ago

Yep, usually F-Droid does one big build job per week and so all releases are delayed. Extremely frustratingly, they picked up 3.3.1, which had the broken patch, but not 3.3.2 or 3.3.3 @dreamsyntax.

This is really motivating me to revisit accrescent.

dreamsyntax commented 5 months ago

Yep, usually F-Droid does one big build job per week and so all releases are delayed. Extremely frustratingly, they picked up 3.3.1, which had the broken patch, but not 3.3.2 or 3.3.3 @dreamsyntax.

This is really motivating me to revisit accrescent.

Thanks for the info, I did not know that about F-Droid.

I took a peek at accrescent (never heard of it), it seems quite barren. Would you be opposed to https://github.com/Tobi823/ffupdater including Auxio? Naming of the tool aside, it updates apps based on github releases.

OxygenCobalt commented 5 months ago

I took a peek at accrescent (never heard of it), it seems quite barren.

It's the up-and-coming store, still in really early development. I expect it to become a pretty major competitor to F-Droid soon, it's generally more secure and modern at the cost of it not being as appealing to hardcore free software advocates (No alternative instances, closed-source allowed)

Would you be opposed to https://github.com/Tobi823/ffupdater including Auxio? Naming of the tool aside, it updates apps based on github releases.

No, not really.

dreamsyntax commented 4 months ago

Last update from me, F-Droid finally pushed v3.3.3, and the install I persisted did properly recover the library and playlists once installed.