I have a very large music library, and was actually pretty pleased with how quickly Sonic analysis had been coming along. I had 4 processes at about 99% CPU core usage each, but there was no slowdown to Plex or my media server at all. The computer in question is an M1 Mac mini with 8 GB of RAM (which is unbelievably faster than the 16 GB RAM Intel Mac it replaced, and the Sonic analysis seems to work fine via Rosetta 2–unless that is the case of the current issue).
I assume I have some sort of weird file or giant album that is crashing the scanner. How can I figure out the culprit?
On my system, SA also pooped out. I tried it twice, recreating the library in between, and it stopped with the same number of albums left each time, which certainly suggests a problem with a file.
PMS is loading up this temp directory with files… over 700 WAVs.
C:\Users\ACCOUNT_NAME\AppData\Local\Temp
If I look at the SA log and temporary directory I can see that some temp files were made about the time SA last showed a sign of life.
Aug 18, 2021 02:04:35.501 [32460] DEBUG - [MusicAnalysis] Activity: updated activity 551ea721-1f31-4fb1-a2c3-64867e253588 - completed 17.3% - Sonic Analysis
So, I assume that one of those is the culprit… if a bad file/album is the root cause of the stoppage. It could be something else. There is a lot going on in there… it looks like Plex scans everything, makes a to-do list, and then goes down the list making temporary WAV files and analyzing them.
Unfortunately the temp WAV files have no metadata so if you want to backtrack to the source file… you will have to listen to all the suspect WAVs!
I’ve spent a while watching and babysitting SA and I am about ready to give up and wait for updates.
Ok, I’ve had just 10 albums remaining for more than a day now. Previously, when the scanner had gotten stuck, I noticed that the actual music analysis processes had stopped, and that a single transcoder process was pegged at 100%. Some combo of killing that transcoder process and restarting Plex server jump-started the sonic analysis again.
This technique no longer works. I am attaching my logs in case anyone can figure out exactly which album or, better yet, file is giving the transcoder a stomach ache.
By searching across all my recent logs for “MusicAnalysis: Analyzing album” I do get just ten results which I assume must be the 10 albums that never complete. However looking through the logs for references to those albums doesn’t actually help me figure out what is going wrong.
What I saw is that killing the stuck transcoder would let you continue… but Plex knows it didn’t finish the file that choked the transcoder, so it goes back to it later. In other words the first and second stopping points you had are the same problem.
Here is what I found and how I solved the problem. (It’s not a great solution, though.)
Slight update: It looked like the sonic analysis was stuck on ten different albums, but it’s really just one. If I add 9 of them back, everything works. If I add the one back, the sonic analysis gets stuck with some number or other of albums remaining, like 17 or something. So at least I can try to figure out the bad file or files and transcode them–I never like transcoding but one album out of a 2 TB music collection ain’t bad,
Having a similar issue, my server (Ubuntu 18.04) is getting stuck saying “Processing 385 albums”, but I’ve looked through the logs and can’t see where it’s even getting stuck.
Any help with this would be greatly appreciated, as it seems it’s my most recent ~385 albums that don’t have the sonic analysis processed, so I haven’t even been able to try it out yet.
Check top or whatever your process monitor is. It should list the command line used to invoke the processes, right? Look for a Plex transcoder process that is stuck on one file.
If you kill the transcoder process, that should unstick your analysis. However, Plex knows it didn’t finish that file, and it will come back to it later and get stuck again.
I had to re-create a couple of MP3s that the transcoder hated.
My experience was also that killing the transcoder process got Plex to skip the problem file(s) until the very end. I do know that “analyzing X albums” doesn’t mean that X are bad; it could just be that one is bad.
I’d also trying just restarting Plex entirely. Also, make sure you have scheduled tasks set to run always (just create a 24 hour window) since there’s no way to manually start the sonic analysis.
If you can examine the logs–sorry other threads have the info on what exact string to look for–just try moving all the albums out of your music folder, then put groups of them back to see if it gets stuck again. Of course, you have hundreds so that will be a pain; I ended up with just 10, where only one was actually had an invalid file or whatever.
So I saw mine getting stuck at 687 albums. On the command line, I typed “ps aux | grep plex” and saw what song it was stuck on. From there I tried the following:
Loaded up the program “EZ CD Audio Converter Free” which you can get off the Microsoft app store. I added that album to that program and pulled down its metadata then saved the metadata. This rewrites the file data for that album. This should also repair any possible problems with the music file metadata.
Plex was getting stuck on the 4th track of that album.
So after saving the metadata I restarted PMS then went back and forced it to scan my music library. It was then able to scan that album and finish. It’s now down to 642 albums remaining.
Fairly obvious by now this feature is not ready for Prime Time. I’ve turned mine off until they figure out how to fix it… Or it just disappears like a bunch of other features did.
That’s interesting. When I had a stuck mp3 file, it did not seem to be the metadata at fault, but the stream data itself. Interestingly, each of the files had a nonsensical duration listed in Plex… like 25 hours. But multiple mp3 health checking tools said the files were fine, and they played fine in any other app.
I run all my mp3s through mp3tag, but only 2 of many thousands made Sonic Analysis barf. I ended up replacing the files, and tagging them in my usual way, and this got Sonic Analysis unstuck.
Since you found a problem that does seem to be metadata related it may be that there is more than one issue that can trip up the analysis.
Always possible but I consider it unlikely. I have run lots of files through mp3tag and into Plex, and I had just two files that gave Sonic Analysis a problem. I checked those two files with other utilities and they came up clean. I bet the mp3tag commonality is a red herring.