chr56 / Phonograph_Plus

A semi-active fork of kabouzeid/Phonograph -- a revived classic material designed music player for Android
GNU General Public License v3.0
389 stars 19 forks source link

[Bug Report] Crash while scrolling albums #28

Closed anaskaejdar closed 2 years ago

anaskaejdar commented 2 years ago

Describe the bug or unexpected behavior By scrolling my library (Albums, Songs, or Genres tabs), the app crashes.

Crash log If app crashed, copy the logs if available.

Crash Report:

Package name:    player.phonograph.plus
App version:     0.3.2 (310)
Git Commit Hash: a219a0464086110fe2c8
Android version: 12 (SDK 31)
Device brand:    samsung  (by samsung)
Device model:    SM-G981U (code: x1q)
Product name:    x1qsqx
Build version:   SP1A.210812.016.G981USQU3FVH1 
                 (G981USQU3FVH1)
Hardware:        qcom
Language:        fa

java.lang.RuntimeException: Canvas: trying to draw too large(127916100bytes) bitmap.
    at android.graphics.RecordingCanvas.throwIfCannotDraw(RecordingCanvas.java:266)
    at android.graphics.BaseRecordingCanvas.drawBitmap(BaseRecordingCanvas.java:97)
    at android.graphics.drawable.BitmapDrawable.draw(BitmapDrawable.java:560)
    at android.widget.ImageView.onDraw(ImageView.java:1462)
    at android.view.View.draw(View.java:23898)
    at android.view.View.updateDisplayListIfDirty(View.java:22767)
    at android.view.View.draw(View.java:23628)
    at android.view.ViewGroup.drawChild(ViewGroup.java:5355)
    at android.view.ViewGroup.dispatchDraw(ViewGroup.java:5112)
    at android.view.View.updateDisplayListIfDirty(View.java:22753)
    at android.view.View.draw(View.java:23628)
    at android.view.ViewGroup.drawChild(ViewGroup.java:5355)
    at android.view.ViewGroup.dispatchDraw(ViewGroup.java:5112)
    at android.view.View.updateDisplayListIfDirty(View.java:22753)
    at android.view.View.draw(View.java:23628)
    at android.view.ViewGroup.drawChild(ViewGroup.java:5355)
    at android.view.ViewGroup.dispatchDraw(ViewGroup.java:5112)
    at android.view.View.draw(View.java:23901)
    at android.view.View.updateDisplayListIfDirty(View.java:22767)
    at android.view.View.draw(View.java:23628)
    at android.view.ViewGroup.drawChild(ViewGroup.java:5355)
    at androidx.recyclerview.widget.RecyclerView.drawChild(Unknown Source:0)
    at android.view.ViewGroup.dispatchDraw(ViewGroup.java:5112)
    at android.view.View.draw(View.java:23901)
    at androidx.recyclerview.widget.RecyclerView.draw(Unknown Source:0)
    at com.simplecityapps.recyclerview_fastscroll.views.FastScrollRecyclerView.draw(Unknown Source:0)
    at android.view.View.updateDisplayListIfDirty(View.java:22767)
    at android.view.View.draw(View.java:23628)
    at android.view.ViewGroup.drawChild(ViewGroup.java:5355)
    at android.view.ViewGroup.dispatchDraw(ViewGroup.java:5112)
    at android.view.View.updateDisplayListIfDirty(View.java:22753)
    at android.view.View.draw(View.java:23628)
    at android.view.ViewGroup.drawChild(ViewGroup.java:5355)
    at androidx.coordinatorlayout.widget.CoordinatorLayout.drawChild(Unknown Source:13)
    at android.view.ViewGroup.dispatchDraw(ViewGroup.java:5112)
    at android.view.View.updateDisplayListIfDirty(View.java:22753)
    at android.view.View.draw(View.java:23628)
    at android.view.ViewGroup.drawChild(ViewGroup.java:5355)
    at android.view.ViewGroup.dispatchDraw(ViewGroup.java:5112)
    at android.view.View.updateDisplayListIfDirty(View.java:22753)
    at android.view.View.draw(View.java:23628)
    at android.view.ViewGroup.drawChild(ViewGroup.java:5355)
    at androidx.recyclerview.widget.RecyclerView.drawChild(Unknown Source:0)
    at android.view.ViewGroup.dispatchDraw(ViewGroup.java:5112)
    at android.view.View.draw(View.java:23901)
    at androidx.recyclerview.widget.RecyclerView.draw(Unknown Source:0)
    at android.view.View.updateDisplayListIfDirty(View.java:22767)
    at android.view.View.draw(View.java:23628)
    at android.view.ViewGroup.drawChild(ViewGroup.java:5355)
    at android.view.ViewGroup.dispatchDraw(ViewGroup.java:5112)
    at android.view.View.updateDisplayListIfDirty(View.java:22753)
    at android.view.View.draw(View.java:23628)
    at android.view.ViewGroup.drawChild(ViewGroup.java:5355)
    at androidx.coordinatorlayout.widget.CoordinatorLayout.drawChild(Unknown Source:13)
    at android.view.ViewGroup.dispatchDraw(ViewGroup.java:5112)
    at android.view.View.updateDisplayListIfDirty(View.java:22753)
    at android.view.View.draw(View.java:23628)
    at android.view.ViewGroup.drawChild(ViewGroup.java:5355)
    at android.view.ViewGroup.dispatchDraw(ViewGroup.java:5112)
    at android.view.View.updateDisplayListIfDirty(View.java:22753)
    at android.view.View.draw(View.java:23628)
    at android.view.ViewGroup.drawChild(ViewGroup.java:5355)
    at android.view.ViewGroup.dispatchDraw(ViewGroup.java:5112)
    at android.view.View.updateDisplayListIfDirty(View.java:22753)
    at android.view.View.draw(View.java:23628)
    at android.view.ViewGroup.drawChild(ViewGroup.java:5355)
    at android.view.ViewGroup.dispatchDraw(ViewGroup.java:5112)
    at android.view.View.updateDisplayListIfDirty(View.java:22753)
    at android.view.View.draw(View.java:23628)
    at android.view.ViewGroup.drawChild(ViewGroup.java:5355)
    at com.sothree.slidinguppanel.SlidingUpPanelLayout.drawChild(Unknown Source:65)
    at android.view.ViewGroup.dispatchDraw(ViewGroup.java:5112)
    at android.view.View.draw(View.java:23901)
    at com.sothree.slidinguppanel.SlidingUpPanelLayout.draw(Unknown Source:0)
    at android.view.View.updateDisplayListIfDirty(View.java:22767)
    at android.view.View.draw(View.java:23628)
    at android.view.ViewGroup.drawChild(ViewGroup.java:5355)
    at android.view.ViewGroup.dispatchDraw(ViewGroup.java:5112)
    at android.view.View.updateDisplayListIfDirty(View.java:22753)
    at android.view.View.draw(View.java:23628)
    at android.view.ViewGroup.drawChild(ViewGroup.java:5355)
    at androidx.drawerlayout.widget.DrawerLayout.drawChild(SourceFile:2)
    at android.view.ViewGroup.dispatchDraw(ViewGroup.java:5112)
    at android.view.View.updateDisplayListIfDirty(View.java:22753)
    at android.view.View.draw(View.java:23628)
    at android.view.ViewGroup.drawChild(ViewGroup.java:5355)
    at android.view.ViewGroup.dispatchDraw(ViewGroup.java:5112)
    at android.view.View.updateDisplayListIfDirty(View.java:22753)
    at android.view.View.draw(View.java:23628)
    at android.view.ViewGroup.drawChild(ViewGroup.java:5355)
    at android.view.ViewGroup.dispatchDraw(ViewGroup.java:5112)
    at android.view.View.updateDisplayListIfDirty(View.java:22753)
    at android.view.View.draw(View.java:23628)
    at android.view.ViewGroup.drawChild(ViewGroup.java:5355)
    at android.view.ViewGroup.dispatchDraw(ViewGroup.java:5112)
    at android.view.View.updateDisplayListIfDirty(View.java:22753)
    at android.view.View.draw(View.java:23628)
    at android.view.ViewGroup.drawChild(ViewGroup.java:5355)
    at android.view.ViewGroup.dispatchDraw(ViewGroup.java:5112)
    at android.view.View.updateDisplayListIfDirty(View.java:22753)
    at android.view.View.draw(View.java:23628)
    at android.view.ViewGroup.drawChild(ViewGroup.java:5355)
    at android.view.ViewGroup.dispatchDraw(ViewGroup.java:5112)
    at android.view.View.draw(View.java:23901)
    at com.android.internal.policy.DecorView.draw(DecorView.java:1378)
    at android.view.View.updateDisplayListIfDirty(View.java:22767)
    at android.view.ThreadedRenderer.updateViewTreeDisplayList(ThreadedRenderer.java:602)
    at android.view.ThreadedRenderer.updateRootDisplayList(ThreadedRenderer.java:608)
    at android.view.ThreadedRenderer.draw(ThreadedRenderer.java:684)
    at android.view.ViewRootImpl.draw(ViewRootImpl.java:5440)
    at android.view.ViewRootImpl.performDraw(ViewRootImpl.java:5148)
    at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:4212)
    at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:2919)
    at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:10491)
    at android.view.Choreographer$CallbackRecord.run(Choreographer.java:1108)
    at android.view.Choreographer.doCallbacks(Choreographer.java:866)
    at android.view.Choreographer.doFrame(Choreographer.java:797)
    at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:1092)
    at android.os.Handler.handleCallback(Handler.java:938)
    at android.os.Handler.dispatchMessage(Handler.java:99)
    at android.os.Looper.loopOnce(Looper.java:226)
    at android.os.Looper.loop(Looper.java:313)
    at android.app.ActivityThread.main(ActivityThread.java:8669)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:571)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1135)

How to reproduce Steps to reproduce the bugs or unexpected behaviors:

Scroll through aforementioned tabs

Screenshots (Optional) (if available)

Other information …version 1.3.2

chr56 commented 2 years ago

Have you added new songs to your device recently?

anaskaejdar commented 2 years ago

Yes, I have. Whether new songs or podcast episodes, I am often having audio added, moved, and deleted.

chr56 commented 2 years ago

It seems that one of those songs has a very large of cover image, so system refuses to display it, I will try to resize it before displaying.

chr56 commented 2 years ago

preview.zip

Try this one. @maemunman

anaskaejdar commented 2 years ago

This build still crashes in the album tab, unfortunately, as does the most recent release

anaskaejdar commented 2 years ago

I will try to figure out which file has the giant cover art

chr56 commented 2 years ago

PhonographPlus_0.3.3-common-debug.apk.zip try this: This build would notify you oversized song as Error and toast messages about pictures's resolution

anaskaejdar commented 2 years ago

Interesting. It complained about the cover of an album I had it my library for a long time already with no issue. Album title is Ancient Hues by the group Rastak. I could send you one of the tracks to test with, but I'm worried about breaking copyright.

Cover sizes that don't cause a problem ![Screenshot_۲۰۲۲۰۹۲۲-۱۰۵۹۴۹_Phonograph Plus_1](https://user-images.githubusercontent.com/32847759/191819489-2213c9ca-336e-4f08-a336-64ba102bf93c.jpg) ![Screenshot_۲۰۲۲۰۹۲۲-۱۰۵۹۴۳_Phonograph Plus_1](https://user-images.githubusercontent.com/32847759/191819492-3a3c355c-bed9-4a96-8300-eb0a35b27a8b.jpg) ![Screenshot_۲۰۲۲۰۹۲۲-۱۰۵۹۳۸_Phonograph Plus_1](https://user-images.githubusercontent.com/32847759/191819494-f7918751-f030-4f1a-b4ad-852388e4be2a.jpg) Around half a megabyte
The problem cover ![Screenshot_۲۰۲۲۰۹۲۲-۱۱۰۰۲۸_Phonograph Plus](https://user-images.githubusercontent.com/32847759/191819811-e0546df5-0f03-4f31-8177-a3fa9e4df0a2.jpg) Just under 32MB
anaskaejdar commented 2 years ago

This part is interesting. There is no file in the album's directory that is over 29MB, and neither is there is any standalone cover.png or similar

Screenshot_۲۰۲۲۰۹۲۲-۱۱۰۸۰۹_Amaze

chr56 commented 2 years ago

😂, actually, the number presents "area" of image (width * height), not the image size.

Now you can try this build: 9d8f6d94

This one resizes the oversized image from the very beginning.

anaskaejdar commented 2 years ago

Oh lol

The new build crashed with this log:

``` Crash Report: Package name: player.phonograph.plus.preview App version: 0.3.3 (311) Git Commit Hash: 9d8f6d94d2809e733065 Android version: 12 (SDK 31) Device brand: samsung (by samsung) Device model: SM-G981U (code: x1q) Product name: x1qsqx Build version: SP1A.210812.016.G981USQU3FVH1 (G981USQU3FVH1) Hardware: qcom Language: fa java.lang.RuntimeException: Canvas: trying to draw too large(127916100bytes) bitmap. at android.graphics.RecordingCanvas.throwIfCannotDraw(RecordingCanvas.java:266) at android.graphics.BaseRecordingCanvas.drawBitmap(BaseRecordingCanvas.java:97) at android.graphics.drawable.BitmapDrawable.draw(BitmapDrawable.java:560) at android.widget.ImageView.onDraw(ImageView.java:1462) at android.view.View.draw(View.java:23898) at android.view.View.updateDisplayListIfDirty(View.java:22767) at android.view.View.draw(View.java:23628) at android.view.ViewGroup.drawChild(ViewGroup.java:5355) at android.view.ViewGroup.dispatchDraw(ViewGroup.java:5112) at android.view.View.updateDisplayListIfDirty(View.java:22753) at android.view.View.draw(View.java:23628) at android.view.ViewGroup.drawChild(ViewGroup.java:5355) at android.view.ViewGroup.dispatchDraw(ViewGroup.java:5112) at android.view.View.updateDisplayListIfDirty(View.java:22753) at android.view.View.draw(View.java:23628) at android.view.ViewGroup.drawChild(ViewGroup.java:5355) at android.view.ViewGroup.dispatchDraw(ViewGroup.java:5112) at android.view.View.draw(View.java:23901) at android.view.View.updateDisplayListIfDirty(View.java:22767) at android.view.View.draw(View.java:23628) at android.view.ViewGroup.drawChild(ViewGroup.java:5355) at androidx.recyclerview.widget.RecyclerView.drawChild(Unknown Source:0) at android.view.ViewGroup.dispatchDraw(ViewGroup.java:5112) at android.view.View.draw(View.java:23901) at androidx.recyclerview.widget.RecyclerView.draw(Unknown Source:0) at com.simplecityapps.recyclerview_fastscroll.views.FastScrollRecyclerView.draw(Unknown Source:0) at android.view.View.updateDisplayListIfDirty(View.java:22767) at android.view.View.draw(View.java:23628) at android.view.ViewGroup.drawChild(ViewGroup.java:5355) at android.view.ViewGroup.dispatchDraw(ViewGroup.java:5112) at android.view.View.updateDisplayListIfDirty(View.java:22753) at android.view.View.draw(View.java:23628) at android.view.ViewGroup.drawChild(ViewGroup.java:5355) at androidx.coordinatorlayout.widget.CoordinatorLayout.drawChild(Unknown Source:13) at android.view.ViewGroup.dispatchDraw(ViewGroup.java:5112) at android.view.View.updateDisplayListIfDirty(View.java:22753) at android.view.View.draw(View.java:23628) at android.view.ViewGroup.drawChild(ViewGroup.java:5355) at android.view.ViewGroup.dispatchDraw(ViewGroup.java:5112) at android.view.View.updateDisplayListIfDirty(View.java:22753) at android.view.View.draw(View.java:23628) at android.view.ViewGroup.drawChild(ViewGroup.java:5355) at androidx.recyclerview.widget.RecyclerView.drawChild(Unknown Source:0) at android.view.ViewGroup.dispatchDraw(ViewGroup.java:5112) at android.view.View.draw(View.java:23901) at androidx.recyclerview.widget.RecyclerView.draw(Unknown Source:0) at android.view.View.updateDisplayListIfDirty(View.java:22767) at android.view.View.draw(View.java:23628) at android.view.ViewGroup.drawChild(ViewGroup.java:5355) at android.view.ViewGroup.dispatchDraw(ViewGroup.java:5112) at android.view.View.updateDisplayListIfDirty(View.java:22753) at android.view.View.draw(View.java:23628) at android.view.ViewGroup.drawChild(ViewGroup.java:5355) at androidx.coordinatorlayout.widget.CoordinatorLayout.drawChild(Unknown Source:13) at android.view.ViewGroup.dispatchDraw(ViewGroup.java:5112) at android.view.View.updateDisplayListIfDirty(View.java:22753) at android.view.View.draw(View.java:23628) at android.view.ViewGroup.drawChild(ViewGroup.java:5355) at android.view.ViewGroup.dispatchDraw(ViewGroup.java:5112) at android.view.View.updateDisplayListIfDirty(View.java:22753) at android.view.View.draw(View.java:23628) at android.view.ViewGroup.drawChild(ViewGroup.java:5355) at android.view.ViewGroup.dispatchDraw(ViewGroup.java:5112) at android.view.View.updateDisplayListIfDirty(View.java:22753) at android.view.View.draw(View.java:23628) at android.view.ViewGroup.drawChild(ViewGroup.java:5355) at android.view.ViewGroup.dispatchDraw(ViewGroup.java:5112) at android.view.View.updateDisplayListIfDirty(View.java:22753) at android.view.View.draw(View.java:23628) at android.view.ViewGroup.drawChild(ViewGroup.java:5355) at com.sothree.slidinguppanel.SlidingUpPanelLayout.drawChild(Unknown Source:65) at android.view.ViewGroup.dispatchDraw(ViewGroup.java:5112) at android.view.View.draw(View.java:23901) at com.sothree.slidinguppanel.SlidingUpPanelLayout.draw(Unknown Source:0) at android.view.View.updateDisplayListIfDirty(View.java:22767) at android.view.View.draw(View.java:23628) at android.view.ViewGroup.drawChild(ViewGroup.java:5355) at android.view.ViewGroup.dispatchDraw(ViewGroup.java:5112) at android.view.View.updateDisplayListIfDirty(View.java:22753) at android.view.View.draw(View.java:23628) at android.view.ViewGroup.drawChild(ViewGroup.java:5355) at androidx.drawerlayout.widget.DrawerLayout.drawChild(SourceFile:2) at android.view.ViewGroup.dispatchDraw(ViewGroup.java:5112) at android.view.View.updateDisplayListIfDirty(View.java:22753) at android.view.View.draw(View.java:23628) at android.view.ViewGroup.drawChild(ViewGroup.java:5355) at android.view.ViewGroup.dispatchDraw(ViewGroup.java:5112) at android.view.View.updateDisplayListIfDirty(View.java:22753) at android.view.View.draw(View.java:23628) at android.view.ViewGroup.drawChild(ViewGroup.java:5355) at android.view.ViewGroup.dispatchDraw(ViewGroup.java:5112) at android.view.View.updateDisplayListIfDirty(View.java:22753) at android.view.View.draw(View.java:23628) at android.view.ViewGroup.drawChild(ViewGroup.java:5355) at android.view.ViewGroup.dispatchDraw(ViewGroup.java:5112) at android.view.View.updateDisplayListIfDirty(View.java:22753) at android.view.View.draw(View.java:23628) at android.view.ViewGroup.drawChild(ViewGroup.java:5355) at android.view.ViewGroup.dispatchDraw(ViewGroup.java:5112) at android.view.View.updateDisplayListIfDirty(View.java:22753) at android.view.View.draw(View.java:23628) at android.view.ViewGroup.drawChild(ViewGroup.java:5355) at android.view.ViewGroup.dispatchDraw(ViewGroup.java:5112) at android.view.View.draw(View.java:23901) at com.android.internal.policy.DecorView.draw(DecorView.java:1378) at android.view.View.updateDisplayListIfDirty(View.java:22767) at android.view.ThreadedRenderer.updateViewTreeDisplayList(ThreadedRenderer.java:602) at android.view.ThreadedRenderer.updateRootDisplayList(ThreadedRenderer.java:608) at android.view.ThreadedRenderer.draw(ThreadedRenderer.java:684) at android.view.ViewRootImpl.draw(ViewRootImpl.java:5440) at android.view.ViewRootImpl.performDraw(ViewRootImpl.java:5148) at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:4212) at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:2919) at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:10491) at android.view.Choreographer$CallbackRecord.run(Choreographer.java:1108) at android.view.Choreographer.doCallbacks(Choreographer.java:866) at android.view.Choreographer.doFrame(Choreographer.java:797) at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:1092) at android.os.Handler.handleCallback(Handler.java:938) at android.os.Handler.dispatchMessage(Handler.java:99) at android.os.Looper.loopOnce(Looper.java:226) at android.os.Looper.loop(Looper.java:313) at android.app.ActivityThread.main(ActivityThread.java:8669) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:571) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1135) ```
chr56 commented 2 years ago

Phonograph Plus_0.3.3_2d92cd7f.zip

New resize-image logics. My Test is fine (test for a 4MB 6000x4000 image).

If it crashed again: 1) possibly some of your file is damaged/corrupted (or is there really a "HUGE" image inside? How crazy?); 2) possibly the problem is not image-size. After all I can not reproduce this crash with same crash log, and the stack trace of log is very helpless (only one line tells where the bug MIGHT be, I am more and more suspicions about it); 3) I can not help you.

anaskaejdar commented 2 years ago

It did crash again. I guess it can't be helped. I could somehow send you the album privately for testing if you'd like, but outside of that I don't have any ideas.

chr56 commented 2 years ago

Preview-06758fe6.zip

Again, no words to say.

anaskaejdar commented 2 years ago

No crash! even when staring directly at the problem album:

Screenshot_۲۰۲۲۱۰۰۷-۰۸۱۱۲۶_Phonograph Plus Preview

chr56 commented 2 years ago

Brilliant, so this bug should be fixed.

And the issue would close after new version releases.

chr56 commented 2 years ago

Close, fixed in v0.3.5.1-LTS