Look into your system’s temp folder.
You will find one or several folders in there with “sonic” in their folder name.
in them, there are WAV files.
If you find a WAV file of a suspiciously small file size, it can be a good hint at which file is the culprit. You should be able to identify the album, just by listening to the wav files.
Another method is to enable server debug logs.
Then look at the Plex Media Server.log It should at least tell you which albums were last committed to the analyzer.
On Windows, get Sysinternals Process Monitor Process Monitor - Windows Sysinternals | Microsoft Docs
Then filter for instances of the Plex Transcoder. You should be able to find out which audio file is opened by the “hung” transcoder process.
@blackzwe To add some more confusion to the conversation.
This only applies when you run the NVidia Shield as a media server and not a player.
I went and checked on my shield and it has sonic analysis on it. (the media server is in another room).
I have almost 5000 flac albums and I am going on week 3 of sonic analysis lol. I have a 6 core processor but Plex is only using 3 cores, and each is only at about 20% capacity. I don’t know how to increase it or tell Plex to use more cores.
That’s interesting and much slower than I would expect. I did over 7000 mp3 albums in 5-6 days in an i3-7100, which is 2 cores/4 threads. And I had not changed LongRunningJobThreads like @asidie mentioned. (but I’m about to, great tip.)
Yea… its an intel Celeron Processor J3455. Clearly not the fastest at all… pretty slow actually. With running all 4 threads it can only process around 28 albums an hour. Still looking at 25 days right now. I thought about copying my database/metadata to my Gaming PC. I assume my AMD 1800X would be able to handle this a bit quicker but not going to mess with it.
I know most people do not have this many albums but it would be cool if you could just use like your plex clients to handle some of the load. I just load a client on this PC and it just starts cranking away.
I also think it would be cool to be able to set a number of albums to process and it completes the scan so I can start using this feature. I set it to 1000 albums and it processes and then allows to to use that Sonic Analysis data for those albums and keeps adding too it every 1000 chunk. Waiting around for 25 days is pretty lame right now.
folks should be careful using the long running jobs advanced preference, you should really consider leaving at least 1 or 2 cpu free for OTHER applications/system processes.
if you allocate all cpu threads to sonic, other things will have a difficult time running/completing their own processing.
If you’ve already updated to PMS 1.24.3 you can do this:
Create a new advanced server preference, named LongRunningJobThreads
It can contain the number of threads which PMS shall use concurrently for sonic analysis.
Careful not to exceed the number of your physical CPU cores (hyper-threading doesn’t count).
A sane strategy would be to leave 1 core as spare.
I turned mine back on to running 24/7 about 10 days or at 3800 albums. today I got 938 albums to go so it should hopefully finish over the weekend into early next week. The last 1000 or so seemed to go faster than the first couple thousand. It’s would have been running for about a month and a bit at this point, but 22 days it was as an task over night, not 24/7.
I’m a little worried about adding music once it’s done. I have a LOT of albums to add to this library.
I just wanted to jump in here and pick some peoples brains on this feature. Currently I am running this on all cores to try to get this done and I still have 25 days. I don’t want to be cranking away for 5 weeks plus just to find out this is doing nothing. What I am looking for is back end indications that this is actually working. Some of the questions I have.
While this is scanning, where is it keeping track of what has been scanned? Is this in the database somewhere, a new database, should I have a Music Analysis X folder under my database folder?
While this is scanning, should I not get [MusicAnalysis] in the logs for every item it scans or only the items it is having problems with? I checked the main log and only have a couple items in there and not the amount I would have thought. I can process about 28 albums an hour so I would think I would see hundreds of items in there.
Any tid bits about how this whole thing works in the back end would be nice for people in the future who are having problems.
you won’t be able to see what has been scanned until all files have been processed
except if you monitor the Plex Media Server.log files. If you look for the keyword sonic, you will find the relevant lines quickly. (‘debug’ logging needs to be activated)
Mainly you will find the transcoder command line calls to create a temporary WAV version of each track of an album. These WAV files will go into a subfolder per album, inside the system’s temp folder – not inside the Plex data folder. So make sure to link the /tmp folder of your server VM/Docker to a sufficiently large disk volume.
If there is something stuck, you may find that it is usually the transcoder getting choked by an invalid audio file. These tracks usually appear in your library with an insanely long play time.
If your server is crashing or losing its power right while it is creating the final database for the analysis results, this database can be left in a damaged state.
If this is the case, shut down the server, go into the Plex data folder/Plug-in Support/Databases. If there is a folder inside, named like \Music Analysis n, empty this \Music Analysis n folder. Afterwards restart the server.
I found that the best way to monitor it was to monitor the main server log for completion percentage. The line looks like this:
Aug 18, 2021 02:04:35.501 [32460] DEBUG - [MusicAnalysis] Activity: updated activity 551ea721-1f31-4fb1-a2c3-64867e253588 - completed 17.3% - Sonic Analysis
Caveats:
This is only on of a few steps needed for a complete Sonic Analysis. It also has to build artist and track indexes… whatever that means. But AFAIK this completion % is the album count, the lengthiest step, the thing you most want to track.
Plex will roll the logs over when they get big and if you are doing tail -f your monitoring process will stop when that happens.
If the server has other stuff to do it seems like Sonic Analysis might go on hold for a while so a delay in updating the completion value is not necessarily a bad sign.
After my main run was complete, if I added a few more albums, this completion percentage might get up to 80% and stop… even though the activity indicator showed all albums were analyzed. In other words, for small runs I think this percentage display misbehaves.
With all that said I am not sure that monitoring the log is substantially better than watching the album countdown in the web app.
I’m not sure if the devs are monitoring this thread, but I managed to figure out what was hanging my Sonic Analysis. I had one .mp3 file that had a “?” in the metadata for the song title and album title. Once I replaced the file on my server with one that did not have that character in the metadata I was able to kill the offending ffmpeg decode process and now the sonic analysis is proceeding as expected.