Sonic Analysis

Hello, Im running PMS on Linux in Docker with the Beta image. I followed most of the guides and I got Sonic Analysis to run for a few hours and scan my music library. It seems to have finished, however I dont see any mood tags generated or anything in PlexAmp indicating that it was run. I attached so logs after rebooting the container and running the scheduled tasks. I can see Sonic Analysis run but no errors, so im not sure the issue. Any assistance is appreciated.

Archive.zip (2.1 MB)

Server Version#: Version 1.40.2.8312
Player Version#: Version 4.125.1

Even with a top-of-the-line CPU, you can expect several days of processing, if your music collection is fairly big.
It can be weeks on a relatively slow mini computer.

Another thing that can lead to the analysis being aborted is a CPU that is too slow. As a safeguard, there is a timeout in the code, which aborts the operation if an album is taking too long.

Yet another thing is this: If your container hasn’t the /tmp folder mapped to a real hard drive folder, it will use RAM. In preparation for the analysis, all tracks of an album are converted to WAV format. If you have a particularly big album (e.g. a box set or a custom Frankenstein-album) this RAM can be simply too small for all the WAV files. Causing the analysis to fail.

Thank you for the response. So yeah, CPU is i9 13th Gen, 64GB Ram, no limits from Docker put in place, transcodes are set to a 4gb ram disk but can be altered if needed. After the initial few hours of it running, it seemed to stop and I didn’t see any plex processes running in the background so I thought it “ran”. I didn’t see any errors in the log indicating an issues. My scheduled tasks are set to run between 1AM and 12 Am to allow it to run all day if needed. Any thoughts on an issue or how I can force it going again.

Inspect your server log files after the next server maintenance period has passed.
(activate “debug” logging, but not “verbose” logging)

I edited some metadata to trigger a new scan, I attached the logs with the debug output, a lot of WARN - [MusicAnalysis] Analysis had wrong number of dimensions (1) for track 733755, skipping. But im not sure if theres anything else stopping it.

I will also note that I just recently deleted, fixed metadata and re uploaded my music library. Not sure if there’s anything old needing cleaning or rebuilding before it will work again

Archive.zip (1.1 MB)

That doesn’t trigger a new scan. Triggering a scan does trigger a scan. https://support.plex.tv/articles/200289306-scanning-vs-refreshing-a-library/
But a scan doesn’t necessarily trigger a sonic analysis.

Find out which is track number 733755:
Use the plex web app to call up the Plex media info XML of a track within the same library.
Look at the address bar.
https://xxx-xxx-xxx-xxx.xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.plex.direct:32400/library/metadata/994200?checkFiles=1&includeAllConcerts=1&includeBandwidths=1&includeChapters=1&includeChildren=1&includeConcerts=1&includeExtras=1&includeFields=1&includeGeolocation=1&includeLoudnessRamps=1&includeMarkers=1&includeOnDeck=1&includePopularLeaves=1&includePreferences=1&includeRelated=1&includeRelatedCount=1&includeReviews=1&includeStations=1&X-Plex-Token=xxxxxxxxxxxx

Notice the number immediately after /library/metadata/?
replace it with 733755
and press Enter.
The resulting XML should tell you which audio file is producing the error.

Take a closer look at it.
Does it only contain silence?
Is it a valid audio file at all?
Do you hear glitches when listening to it closely with a regular desktop media player?
If it is an mp3, analyse and repair it using https://mp3diags.sourceforge.net/

If you can, re-rip the CD and replace the album/song.

Yeah, those tracks it has an issue with can be ignored, they’re just audio tones for tuning sound equipment. So I ran analyze, refresh metadata and scan library files, maintainace tasks are scheduled to run between 1 AM and 12 AM, so no limit. Still the same output like before, seems like its running, or there is nothing stopping it, i dont see any errors, but still not seeing anything updating.

Archive.zip (3.6 MB)

[MusicAnalysis] Activity: registered new activity 6ad190fe-29a8-4bee-87d7-4b01656465c0 - "Sonic Analysis"
[MusicAnalysis] Analyzing 0 albums in section 18.
[MusicAnalysis] Activity: updated activity 6ad190fe-29a8-4bee-87d7-4b01656465c0 - completed 0.0% - Sonic Analysis
[MusicAnalysis] Fetching all analysis data from tracks from section 18.
[MusicAnalysis] Activity: updated activity 6ad190fe-29a8-4bee-87d7-4b01656465c0 - completed 20.0% - Sonic Analysis
[MusicAnalysis] Activity: updated activity 6ad190fe-29a8-4bee-87d7-4b01656465c0 - completed 40.0% - Sonic Analysis
[MusicAnalysis] Building album index with 578 albums.
[MusicAnalysis] Activity: updated activity 6ad190fe-29a8-4bee-87d7-4b01656465c0 - completed 60.0% - Sonic Analysis
[MusicAnalysis] Building tree.
[MusicAnalysis] Building artist index with 114 artists.
[MusicAnalysis] Activity: updated activity 6ad190fe-29a8-4bee-87d7-4b01656465c0 - completed 80.0% - Sonic Analysis
[MusicAnalysis] Building tree.
[MusicAnalysis] Activity: Ended activity 6ad190fe-29a8-4bee-87d7-4b01656465c0.
[MusicAnalysis] Indexes completed.

Screenshot 2024-04-08 at 12.33.26 PM

With ~550 albums and that beast CPU analysis would be fast.

OP if you look at the Artist page in Plex for web, do you see “Sonically Similar Artists?”

image

(I thought “mood” info came from metadata lookups?)

I assume you mean the artist filter, but i haven’t seen it there or the recommended tab


To make sure we are looking at the same thing, I mean

  • In Plex Web, click on your Music library
  • Click the Recommended tab at the top if it is not already selected
  • Click any Artist name in the Recommended page
  • See if “Sonically Similar Artists” is visible on that Artist page

I do see those populated now on the web UI. I thought it assisted with adding mood tags, because the wiki I read said plex didn’t read mood tags populated by MusicBrainz so I did not include them in my metadata, i may have been mistaken though.

The mood thing is confusing now since I thought the opposite. AFAIK if you see “Sonically Similar Artists” the Sonic Analysis is working.

Maybe someone can explain moods to us.

Moods are completely unrelated to Sonic Analysis. They’re provided by one of our music metadata sources (Tivo/AllMusic).

Sonic Analysis is used for finding relationships between items in your library.

1 Like

Hi, thanks for the feedback. So just to verify, the sonic analysis is only going to populate the composed playlists/similar songs etc. Is there anyway to verify sonic analysis was completed aside from noticing the “sonically similar” sections. If plex doesn’t use embedded mood/style tags, and if your strictly using embedded/local metadata, how do you populate mood and style tags aside from manually one by one?

Sonic Analysis is used for a lot of Plexamp’s features, like Radios, DJs, and populating the “similar/recommended” hubs on many of the pages.

It sounds like your analysis has run just fine and is completed.

How have you accomplished this? My understanding is that if you’ve enabled the “prefer local metadata” preference, we still pull all of the same cloud metadata, but treat embedded values as the source of truth. Effectively, your local tags override the cloud ones. What have you changed to disable cloud data entirely?

1 Like

This I don’t know, but I can tell you that with your CPU and ~500 albums Sonic Analysis should take less than, oh, two hours or so. Maybe half that? I have a gen 10 and even on my system SA pretty fast.

It’s the people with Celerons who only run maintenance tasks overnight on giant libraries that see it drag out for days and weeks.

I followed this post and the plex recommendations for local metadata, I didnt disable anything that im aware of

https://support.plex.tv/articles/200265296-adding-music-media-from-folders/

Thanks! And to be absolutely clear, you are using the correct Agent and Scanner, as shown below, right?

The other options in those drop downs are largely kept around for legacy support, and should absolutely not be used unless you’re prepared for a bad time :sweat_smile:


Edit

I just went and created a new music library on my server with three of the artists I can see you have in your library (Band of Horses, Coldplay, and Daft Punk), and changed the settings to match Beckfield’s recommendations.

As you can see below, the moods and styles came through as expected:

In addition, from your screenshots it looks like your record labels are missing. This is working fine on my new test library.

If you can confirm you’re using the correct agent, then something else is going wrong. Are you sure your artists/albums are matched correctly? What’s your process for tagging the files before adding them to Plex?

Ok, so I had it set to Personal Media Artists, I thought it was set to plex music so my bad. So both are set to plex music, I rebooted the container, refreshed metadata and scanned. The logs show the new scanner working through the albums, but doesn’t look like its updating anything (server maintenance is set to 1am to 12am. Metadata, I kept it to just what the posts said plex read and the Musicbrainz Id’s

Scanning Music using en-US(Plex Music) with 11153 current media items and 1 section locations in the database.
Performing a scan with 'Plex Music' (language: en-US virtual: 0).
Scanning /MusicMedia
Scanner [Plex Music]: Idle and left with 11153 media items.

Archive.zip (1007.5 KB)

I went ahead and just deleted the library, cleaned/purge, reboot the image and add the library again. Its still processing but with the correct agent from the get go it seems like all the tags are populating this time. Appreciate all the insight, I learned some new things!

1 Like