Plexamp visual crash on windows

Occasionally on track change the plexamp display will crash and just show a grey screen as shown here:
image

I suspect this might be related to the “soundprint” visualization, as I have switched over from “soundprint:” to “freaqy” and haven’t seen a crash like this since switching. “Soundprint” is by far the coolest visualization though, so I’d prefer to switch back :eyes:.

Edit to clarify: Only the display crashes. Audio still plays just fine.

I spoke too soon, just got the same visual crash while running “freaqy”. It did take much longer to hit, though.

Next time you run into this try closing then sharing logs Settings>Advanced>Debugging

I have a Settings>Advanced>Debugging option on mobile, but not in the windows desktop app.
image
It looks like there are some logs in C:\Users\[user]\AppData\Roaming\Plexamp\Local Storage\leveldb\[six-digit number].log… would those have anything that would help?

Had this happen again today for the first time in a while, but I am still not sure how to collect logs for desktop since @Daimyo’s suggestion only appears to work for mobile… I found a few other log files in that Roaming\Plexamp directory, but I can’t figure out what character encoding they are using (or maybe it isn’t supposed to be human-readable?)… I even popped the hex open and didn’t really find anything that looked like real logs… there are also the LOG files (with no extensions) that appear to at least be plaintext, but are just things like

2020/04/29-10:34:47.885 4764 Reusing MANIFEST Session Storage/MANIFEST-000001
2020/04/29-10:34:47.886 4764 Recovering log #3
2020/04/29-10:34:47.887 4764 Reusing old log Session Storage/000003.log 

I know these logs are useless and I know this is going to be super hard to track down without actually useful logs, but I can’t for the life of me figure out where they are being written (if at all)

Just had this happen again on the latest release and there is still no way to get debug logs on the desktop app as far as I can tell.

On top of that, restarting the app doesn’t even seem to be fixing it this time, it just drops me back into the same blank screen I had before… Possibly something is being corrupted in the cache, so the same corrupted data is being reloaded from cache on every start.

Plexamp logs can be found under
C:\Users\<username>\AppData\Local\Plexamp\Plexamp\Logs

What kind of graphics adapter is in your computer?
Have you tried to update its driver software?

Thanks, I actually managed to find the logs now! I swear those weren’t there last time I checked…

This looks pretty suspicious:

May 20, 2020 11:25:04.634 [Javascript] ERROR - Error: [mobx] An invariant failed, however the error is obfuscated because this is an production build.
    at h (C:\Users\x\AppData\Local\Programs\plexamp\resources\app.asar\index.js:16:1100)
    at p (C:\Users\x\AppData\Local\Programs\plexamp\resources\app.asar\index.js:16:1060)
    at ke (C:\Users\x\AppData\Local\Programs\plexamp\resources\app.asar\index.js:16:13840)
    at e.spliceWithArray (C:\Users\x\AppData\Local\Programs\plexamp\resources\app.asar\index.js:16:33929)
    at e.setArrayLength (C:\Users\x\AppData\Local\Programs\plexamp\resources\app.asar\index.js:16:33553)
    at t.set (C:\Users\x\AppData\Local\Programs\plexamp\resources\app.asar\index.js:16:39134)
    at pickBestCircularGradientColors (C:\Users\x\AppData\Local\Programs\plexamp\resources\app.asar\index.js:16:112445)
    at e.get (C:\Users\x\AppData\Local\Programs\plexamp\resources\app.asar\index.js:170:24834)
    at Me (C:\Users\x\AppData\Local\Programs\plexamp\resources\app.asar\index.js:16:14135)
    at e.computeValue (C:\Users\x\AppData\Local\Programs\plexamp\resources\app.asar\index.js:16:12250)
May 20, 2020 11:25:04.635 [Javascript] ERROR - Error: [mobx] An invariant failed, however the error is obfuscated because this is an production build.
    at h (C:\Users\x\AppData\Local\Programs\plexamp\resources\app.asar\index.js:16:1100)
    at p (C:\Users\x\AppData\Local\Programs\plexamp\resources\app.asar\index.js:16:1060)
    at ke (C:\Users\x\AppData\Local\Programs\plexamp\resources\app.asar\index.js:16:13840)
    at e.spliceWithArray (C:\Users\x\AppData\Local\Programs\plexamp\resources\app.asar\index.js:16:33929)
    at e.setArrayLength (C:\Users\x\AppData\Local\Programs\plexamp\resources\app.asar\index.js:16:33553)
    at t.set (C:\Users\x\AppData\Local\Programs\plexamp\resources\app.asar\index.js:16:39134)
    at pickBestCircularGradientColors (C:\Users\x\AppData\Local\Programs\plexamp\resources\app.asar\index.js:16:112445)
    at e.get (C:\Users\x\AppData\Local\Programs\plexamp\resources\app.asar\index.js:170:24834)
    at Me (C:\Users\x\AppData\Local\Programs\plexamp\resources\app.asar\index.js:16:14135)
    at e.computeValue (C:\Users\x\AppData\Local\Programs\plexamp\resources\app.asar\index.js:16:12250)

There are also some warnings about file downloads:

May 20, 2020 11:25:13.136 [Javascript] WARNING - IMAGE: No palette to be extracted as there is no thumb.
May 20, 2020 11:25:13.290 [Javascript] WARNING - Download of https://192-168-1-100.5a4dda5e45c5488f9a381eb8fc26c998.plex.direct:32400/photo/:/transcode?width=300&height=300&upscale=1&url=undefined&X-Plex-Token=<token> failed: Request failed with status code 404.
May 20, 2020 11:25:13.290 [Javascript] WARNING - Error downloading https://192-168-1-100.5a4dda5e45c5488f9a381eb8fc26c998.plex.direct:32400/photo/:/transcode?width=300&height=300&upscale=1&url=undefined&X-Plex-Token=<token>
May 20, 2020 11:25:13.290 [Javascript] INFO - Download of https://192-168-1-100.5a4dda5e45c5488f9a381eb8fc26c998.plex.direct:32400/photo/:/transcode?width=300&height=300&upscale=1&url=undefined&X-Plex-Token=<token> failed with ???.

I can upload the full logs as well as long as you’re cool with me pruning my username out of them like in the above snippet.

My graphics adapter is GTX 1080 with the latest drivers.

Yeah, that’s fine.

Here ya go
Plexamp.log (81.1 KB)

This ended up as a much bigger post than I intended, but I think I am at least close to a root cause here. Sorry for the long read!

I extracted index.js from the app.asar file, deminified it, and put it back in place so I could better follow the traceback.

It seems like it is trying to compute the value of something that is set to be “observable”, and due to the later call to pickBestCircularGradientColors and the info message just before the stack trace saying that it is Setting new palette and loudness data, I strongly suspect that what is being computed is the gradient for the background that is based on the color palette in the album art. I also see WARNING - IMAGE: No palette to be extracted as there is no thumb. which could be related, but it’s hard to say.

The summary of what I have found so far is that computeValue calls Me, passing it an object this. I can’t manage to attach a debugger to the app, so I can’t figure out what this is when I hit this failure.

Me(this, this.derivation, this.scope);

Me then does some checks and then tries to run t.call

            if (((Re.trackingDerivation = e), !0 === Re.disableErrorBoundaries)) r = t.call(n);
            else
                try {
                    r = t.call(n); // We are hitting this
                } catch (e) {
                    r = new we(e);
                }

which eventually gets to this function:

                                    key: "gradientColors",
                                    get: function () {
                                        var e = this.metadata && this.palette ? (0, k.pickBestCircularGradientColors)(this.palette) : ["#222", "#222", "#222", "#222"];

The first part of that ternary is evaluating to something truthy, because the traceback mentions this as the part that is failing:

(this.palette)

That, again, appears to make it pretty far through the call stack before getting to pickBestCircularGradientColors:

            pickBestCircularGradientColors: function (e) {
                if (!e) return null;
                if (e.length < 20) {
                    var t = e.length;
                    (e.length = 20), e.fill("#ddd", t, 20);
                }

The stack trace here indicates that this is failing at the = in e.length = 20, which seems pretty odd to me, but I’m not a js developer. Apparently this assignment somehow eventually calls down to the set function defined for the prototype object here:

            Object.defineProperty(mn.prototype, "length", {
                enumerable: !1,
                configurable: !0,
                get: function () {
                    return this.$mobx.getArrayLength();
                },
                set: function (e) {
                    this.$mobx.setArrayLength(e); // We are failing here
                },

That setArrayLength function then calls down to spliceWithArray

                    (e.prototype.setArrayLength = function (e) {
                        if ("number" != typeof e || e < 0) throw new Error("[mobx.array] Out of range: " + e);
                        var t = this.values.length;
                        if (e !== t)
                            if (e > t) {
                                for (var n = new Array(e - t), r = 0; r < e - t; r++) n[r] = void 0;
                                this.spliceWithArray(t, 0, n); // Hitting this one
                            } else this.spliceWithArray(e, t - e);
                    }),

which in turn calls ke(this.atom)

                    (e.prototype.spliceWithArray = function (e, t, n) {
                        var r = this;
                        ke(this.atom);

ke is a pretty short function but seems to be failing at the first call to p(!1):

        function ke(e) {
            var t = e.observers.length > 0;
            Re.computationDepth > 0 && t && p(!1), Re.allowStateChanges || (!t && "strict" !== Re.enforceActions) || p(!1);
        }

p is also a pretty small function:

        function p(e) {
            throw (h(!1, e), "X");
        }

which finally brings us to the top of the call stack at h:

        function h(e, t) {
            if (!e) throw new Error("[mobx] " + (t || u));
        }

It appears that in my case, h is being called with h(!1, !1) which should always return whatever u is, in this case it appears to be

An invariant failed, however the error is obfuscated because this is an production build.

I assume t would not be !1 in a dev build and that is how you get real debugging internally. p and h appear to just be methods used to raise exceptions, so they can probably be ignored, so my best guess is an issue with how the computationDepth is being computed in ke.

The album art for the album that is trying to play (and seems to be causing this issue, because it is happening on app startup right now) doesn’t exist. Realizing that it may be related to the specific album prompted me to try this in the mobile version of the app, where I was just able to replicate the issue.

Manually looking up and fetching the album art, adding it to the directory with the music, getting plex to update it’s info to show the album art, force closing the plexamp mobile app, and then re-launching it seems to have fixed the black/grey-screen hang. Dumping the cache directory and PlayQueue.json from the AppData\Local\Plexamp\Plexamp directory and then relaunching seems to have fixed it on the windows side.

The root cause seems to be an error in generating the color palette based on the album art in the case where the album art doesn’t exist. It looks like there are a bunch of places where this should be caught and other colors should be substituted, so it isn’t clear to me why sometimes it generates a greyscale gradient and other times I get this issue.

1 Like

Your analysis really impressed me.

1 Like

Update: This seems to be fixed in 3.1! I have been unable to replicate it on windows or android since updating.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.