OxygenCobalt / Auxio

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

Version 3.0.0 #300

Closed OxygenCobalt closed 1 year ago

OxygenCobalt commented 1 year ago

Version 3.0.0 of Auxio.

Test APK: Auxio_3.0.0.zip

@Kraxen72 @foss- @alanorth @illdeletethis Care to test this before I merge? I want to start making a habit out of having a preliminary testing period like NewPipe so I can avoid really bad issues from working their way into the release.

OxygenCobalt commented 1 year ago

Additional people: @e-zk @Gateway31

KraXen72 commented 1 year ago

yes, will get to it soon when im on wifi and not cellular

e-zk commented 1 year ago

@OxygenCobalt after selecting "refresh music" in settings I get a "Music Loading Failed" message box. When I hit the "Retry" button it does the scanning thing and nothing changes, the error message stays.

Force stop and reopen doesn't fix it.

Doing a complete rescan by selecting "rescan music" however seems to get the message box to go away.

So seems like "refresh music" is just broken on my device?

Show screenshots ![Screenshot_20221230-112031](https://user-images.githubusercontent.com/58356365/210025530-8bddff1d-3e60-46a0-8ab4-e113ed73c7d1.png) ![Screenshot_20221230-112205](https://user-images.githubusercontent.com/58356365/210025524-1cb4ed0b-ed39-4f38-9fd5-f96b8431fd8c.png)
OxygenCobalt commented 1 year ago

Definitely seems like the cache is broken. Can't reproduce on my device. Care to get a stack trace @e-zk?

If you don't know how, you can follow these steps:

  1. Use a desktop/laptop to download the android platform tools from here.
  2. Extract the downloaded file to a folder.
  3. Enable USB debugging on your phone (Instructions), and then connect your phone to a laptop. You will get a prompt to "Allow USB debugging" when you run the logcat command. Accept this.
  4. Open up a terminal/command prompt in that folder and run ./adb -d logcat AndroidRuntime:E *:S`
  5. Copy and paste the output to this issue

If I were to guess, it's because I'm putting the cache data in the cache directory for my app, which may be unstable. If that's the case, I'll have to move it to app storage, which is not "correct" but also the only way I'll get it working.

e-zk commented 1 year ago

@OxygenCobalt relevant lines from my logcat:

12-30 13:26:13.943  7532 19098 E Auxio.Indexer: Music indexing failed
12-30 13:26:13.943  7532 19098 E Auxio.Indexer: java.lang.NumberFormatException: For input string: ""
12-30 13:26:13.943  7532 19098 E Auxio.Indexer:         at java.lang.Integer.parseInt(Integer.java:757)
12-30 13:26:13.943  7532 19098 E Auxio.Indexer:         at java.lang.Integer.parseInt(Integer.java:865)
12-30 13:26:13.943  7532 19098 E Auxio.Indexer:         at org.oxycblt.auxio.music.extractor.ParsingUtilKt.parseId3v1Genre(ParsingUtil.kt:10)
12-30 13:26:13.943  7532 19098 E Auxio.Indexer:         at org.oxycblt.auxio.music.Song.<init>(Music.kt:1126)
12-30 13:26:13.943  7532 19098 E Auxio.Indexer:         at org.oxycblt.auxio.music.system.Indexer$buildSongs$2.invokeSuspend(Indexer.kt:35)
12-30 13:26:13.943  7532 19098 E Auxio.Indexer:         at org.oxycblt.auxio.music.system.Indexer$buildSongs$2.invoke(Indexer.kt:13)
12-30 13:26:13.943  7532 19098 E Auxio.Indexer:         at org.oxycblt.auxio.music.extractor.MetadataExtractor.parse(MetadataExtractor.kt:270)
12-30 13:26:13.943  7532 19098 E Auxio.Indexer:         at org.oxycblt.auxio.music.extractor.MetadataExtractor$parse$1.invokeSuspend(Unknown Source:12)
12-30 13:26:13.943  7532 19098 E Auxio.Indexer:         at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:9)
12-30 13:26:13.943  7532 19098 E Auxio.Indexer:         at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:107)
12-30 13:26:13.943  7532 19098 E Auxio.Indexer:         at kotlinx.coroutines.internal.LimitedDispatcher.run(LimitedDispatcher.kt:12)
12-30 13:26:13.943  7532 19098 E Auxio.Indexer:         at kotlinx.coroutines.scheduling.TaskImpl.run(Tasks.kt:3)
12-30 13:26:13.943  7532 19098 E Auxio.Indexer:         at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:82)
12-30 13:26:13.993  7532  7532 W View    : requestLayout() improperly called by android.widget.LinearLayout{5e4304f V.E...... ......ID 0,607-1080,3007 #7f0a0203 app:id/queue_sheet} during layout: running second layout pass
12-30 13:26:13.993  7532  7532 W View    : requestLayout() improperly called by androidx.coordinatorlayout.widget.CoordinatorLayout{2ee3aae V.E...... ......ID 0,607-1080,3007 #7f0a01ee app:id/playback_sheet} during layout: running second layout pass
12-30 13:26:14.027  7532 19040 W Auxio.Covers: Unable to extract album cover due to an error: kotlinx.coroutines.JobCancellationException: DeferredCoroutine was cancelled; job=DeferredCoroutine{Cancelling}@bc86c01
12-30 13:26:14.027  7532 19117 W Auxio.Covers: Unable to extract album cover due to an error: kotlinx.coroutines.JobCancellationException: DeferredCoroutine was cancelled; job=DeferredCoroutine{Cancelling}@f047aa6
12-30 13:26:14.027  7532 19117 W Auxio.Covers: Unable to extract album cover due to an error: kotlinx.coroutines.JobCancellationException: DeferredCoroutine was cancelled; job=DeferredCoroutine{Cancelling}@f047aa6
12-30 13:26:14.027  7532 19117 W Auxio.Covers: Unable to extract album cover due to an error: kotlinx.coroutines.JobCancellationException: DeferredCoroutine was cancelled; job=DeferredCoroutine{Cancelling}@f047aa6
12-30 13:26:14.027  7532 19117 W Auxio.Covers: Unable to extract album cover due to an error: kotlinx.coroutines.JobCancellationException: DeferredCoroutine was cancelled; job=DeferredCoroutine{Cancelling}@f047aa6
12-30 13:26:14.027  7532 19117 W Auxio.Covers: Unable to extract album cover due to an error: kotlinx.coroutines.JobCancellationException: DeferredCoroutine was cancelled; job=DeferredCoroutine{Cancelling}@f047aa6
12-30 13:26:14.027  7532 19117 W Auxio.Covers: Unable to extract album cover due to an error: kotlinx.coroutines.JobCancellationException: DeferredCoroutine was cancelled; job=DeferredCoroutine{Cancelling}@f047aa6
12-30 13:26:14.027  7532 19117 W Auxio.Covers: Unable to extract album cover due to an error: kotlinx.coroutines.JobCancellationException: DeferredCoroutine was cancelled; job=DeferredCoroutine{Cancelling}@f047aa6
12-30 13:26:14.027  7532 19117 W Auxio.Covers: Unable to extract album cover due to an error: kotlinx.coroutines.JobCancellationException: DeferredCoroutine was cancelled; job=DeferredCoroutine{Cancelling}@f047aa6
12-30 13:26:14.027  7532 19117 W Auxio.Covers: Unable to extract album cover due to an error: kotlinx.coroutines.JobCancellationException: DeferredCoroutine was cancelled; job=DeferredCoroutine{Cancelling}@f047aa6
12-30 13:26:14.027  7532 19117 W Auxio.Covers: Unable to extract album cover due to an error: kotlinx.coroutines.JobCancellationException: DeferredCoroutine was cancelled; job=DeferredCoroutine{Cancelling}@f047aa6
12-30 13:26:14.029  7532 19104 W Auxio.Covers: Unable to extract album cover due to an error: kotlinx.coroutines.JobCancellationException: DeferredCoroutine was cancelled; job=DeferredCoroutine{Cancelling}@7864094
12-30 13:26:14.049   991   991 E MetadataRetrieverClient: failed to extract an album art
12-30 13:26:14.049  3088  3234 E MediaMetadataRetrieverJNI: getEmbeddedPicture: Call to getEmbeddedPicture failed.
12-30 13:26:14.053  3088  3234 W MediaProvider: java.io.IOException: No album art found
12-30 13:26:14.053  3088  3234 W MediaProvider:         at android.media.ThumbnailUtils.createAudioThumbnail(ThumbnailUtils.java:201)
12-30 13:26:14.053  3088  3234 W MediaProvider:         at com.android.providers.media.MediaProvider$7.getThumbnailBitmap(MediaProvider.java:6858)
12-30 13:26:14.053  3088  3234 W MediaProvider:         at com.android.providers.media.MediaProvider$Thumbnailer.ensureThumbnail(MediaProvider.java:6826)12-30 13:26:14.053  3088  3234 W MediaProvider:         at com.android.providers.media.MediaProvider.ensureThumbnail(MediaProvider.java:8059)
12-30 13:26:14.053  3088  3234 W MediaProvider:         at com.android.providers.media.MediaProvider.openFileCommon(MediaProvider.java:7942)
12-30 13:26:14.053  3088  3234 W MediaProvider:         at com.android.providers.media.MediaProvider.openTypedAssetFileCommon(MediaProvider.java:8037)
12-30 13:26:14.053  3088  3234 W MediaProvider:         at com.android.providers.media.MediaProvider.openTypedAssetFile(MediaProvider.java:7981)
12-30 13:26:14.053  3088  3234 W MediaProvider:         at android.content.ContentProvider$Transport.openTypedAssetFile(ContentProvider.java:561)
12-30 13:26:14.053  3088  3234 W MediaProvider:         at android.content.ContentProviderNative.onTransact(ContentProviderNative.java:327)
12-30 13:26:14.053  3088  3234 W MediaProvider:         at android.os.Binder.execTransactInternal(Binder.java:1307)
12-30 13:26:14.053  3088  3234 W MediaProvider:         at android.os.Binder.execTransact(Binder.java:1265)
12-30 13:26:14.054  7532 18900 W Auxio.Covers: Unable to extract album cover due to an error: java.io.FileNotFoundException: No album art found
OxygenCobalt commented 1 year ago

Very weird issue @e-zk.

Something like this is seemingly occurring:

I really don't know how the cache is returning [""]. It should be null, so perhaps there's some garbage elsewhere in the extractor. But otherwise I can band-aid the symptom by fixing the bugged numeric genre logic and adding some extra validation to the cache.

bodayw commented 1 year ago

I encountered the "Music Loading Failed" error as well. Here are the steps to reproduce it 100% on my side:

  1. Clear the app data
  2. Open the app, grant storage permission
  3. Wait the initial full scan to finish
  4. Go to settings, change replaygain preference to "prefer album"
  5. Go back the music library, the error should appear.

Tapping retry won't fix it. Go to settings and do a full re-scan would fix it, though.

bodayw commented 1 year ago

Also noticed two typos in the doc/wiki:

CHANGELOG.md : reciever -> receiver

https://github.com/OxygenCobalt/Auxio/wiki/Advanced-Functionality#musicbrainz-ids A common issue with large music libraries is an inability to separate different items that have the same time. same time -> same name?

OxygenCobalt commented 1 year ago
  1. Uh oh. Exactly the big issue I'm fearing. Care to take a stack trace too @bodayw so I can confirm it's the same issue? This is really frustrating since I can't reproduce it in my library so I can only guess at what's going on.
  2. Yep. Those are two typos. Will fix them.
OxygenCobalt commented 1 year ago

Reproduced the issue. Seems to be caused by genres consisting of nothing but space values. When these are restored from the cache, the whitespace is removed, leaving only empty strings that cause the parser to crash.

I've managed to band-aid this issue. In a future version I will need to handle this better.

OxygenCobalt commented 1 year ago

Here's a new debug APK before I go to sleep. It should have the genre fix. You can unzip the file in order to find the APK.

Note that the original was a release APK since I decided to do a testing period last-minute. This new build will be a unoptimized debug build that is easier for me to identify issues with, so the app will run slower than normal. Do not be concerned by this.

@e-zk @bodayw @KraXen72

Auxio_3.0.0_R2.zip

If you have issues, please remember to attach a stack trace.

bodayw commented 1 year ago

That was quick 👍

And yes I can confirm that I don't write "genre" tags in my music library.

Some logcat lines:

> adb -d logcat | select-string "[DWE] Auxio"

12-30 11:48:03.180 27484  2539 E Auxio.Indexer: Music indexing failed
12-30 11:48:03.185 27484  2539 E Auxio.Indexer: java.lang.NumberFormatException: For input string: ""
12-30 11:48:03.185 27484  2539 E Auxio.Indexer:         at java.lang.Integer.parseInt(Integer.java:627)
12-30 11:48:03.185 27484  2539 E Auxio.Indexer:         at java.lang.Integer.parseInt(Integer.java:650)
12-30 11:48:03.185 27484  2539 E Auxio.Indexer:         at org.oxycblt.auxio.music.extractor.ParsingUtilKt.parseId3v1Genre(ParsingUtil.kt:10)
12-30 11:48:03.185 27484  2539 E Auxio.Indexer:         at org.oxycblt.auxio.music.Song.<init>(Music.kt:1126)
12-30 11:48:03.185 27484  2539 E Auxio.Indexer:         at org.oxycblt.auxio.music.system.Indexer$buildSongs$2.invokeSuspend(Indexer.kt:35)
12-30 11:48:03.185 27484  2539 E Auxio.Indexer:         at org.oxycblt.auxio.music.system.Indexer$buildSongs$2.invoke(Indexer.kt:13)
12-30 11:48:03.185 27484  2539 E Auxio.Indexer:         at org.oxycblt.auxio.music.extractor.MetadataExtractor.parse(MetadataExtractor.kt:270)
12-30 11:48:03.185 27484  2539 E Auxio.Indexer:         at org.oxycblt.auxio.music.extractor.MetadataExtractor$parse$1.invokeSuspend(Unknown Source:12)
12-30 11:48:03.185 27484  2539 E Auxio.Indexer:         at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:9)
12-30 11:48:03.185 27484  2539 E Auxio.Indexer:         at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:107)
12-30 11:48:03.185 27484  2539 E Auxio.Indexer:         at kotlinx.coroutines.internal.LimitedDispatcher.run(LimitedDispatcher.kt:12)
12-30 11:48:03.185 27484  2539 E Auxio.Indexer:         at kotlinx.coroutines.scheduling.TaskImpl.run(Tasks.kt:3)
12-30 11:48:03.185 27484  2539 E Auxio.Indexer:         at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:82)
OxygenCobalt commented 1 year ago

Yep. Same issue. Perhaps some metadata formats or taggers somehow write empty genre names to whitespace or an empty string, even when I specifically attempt to filter those out when parsing. Ugh.

Definitely priority in a future version to properly handle the many ways tags can be "empty" without actually being empty.

e-zk commented 1 year ago

Awesome work! The accuracy+quality of the tags in my music library varies greatly.

The music I get from Bandcamp always has nice tags but I have some old files from years ago that has some pretty shoddy tagging - tagging that I probably did myself manually all those years ago.

bodayw commented 1 year ago

Auxio_3.0.0_R2.zip

The issue no longer appears.

e-zk commented 1 year ago

Confirming as well that the R2 apk doesn't have the issue.

alanorth commented 1 year ago

@OxygenCobalt yes this is a great idea. Anyways, I've been building from dev every few days for the last few months and filing bugs as I see them. I can't think of any issues right now. :+1:

foss- commented 1 year ago

Thanks so much for your work - very excited about v3! Will have to find the time to test. Would it be an option to release pre-releases via F-Droid? That may increase size of test group and make running a pre-release simple while keeping it optional via the Suggested release tag.

OxygenCobalt commented 1 year ago

@e-zk @bodayw Thanks for confirming that it works.

@alanorth Great.

@foss- Perhaps. I don't think it would be on F-Droid though since the process of getting an app update through is really annoying. I could periodically make pre-releases on github however if I change my workflow.

I think this will be good for release now. If there are any more issues, they will be released in a 3.0.1 patch.