Slow FLAC Library Import on RoonServer [Ticket in]

What’s happening?

· Other

How can we help?

· I'm having trouble adding music to my library

Other options

· Other

Describe the issue

I have a library of ~130k FLAC tracks. If I try to import that library, it is _extremely_ slow -- currently at 108 added, 108 identified after running for 18 hours. This happens regardless of whether the tracks are on a local drive or SMB share. This happens regardless of whether I run RoonServer on Linux, MacOS, or Windows.

I took the same library, used ffmpeg to convert it to MP3, and it imported in less than eight hours.

Describe your network setup

Verizon FiOS router. Everything is currently wired to the router.

(...not that it matters since the same problem happens importing from a local disk.)

Hi @Neil_Carpenter ,

If you navigate to Roon Sever Settings → Library → Background/On-Demand Audio Analysis speed and set this to Fast once you finish your listening session, does it help with the import speed?

What’s happening?

· Other

How can we help?

· I'm having trouble adding music to my library

Other options

· Other

Describe the issue

I have a library of ~130k files, almost entirely FLAC. If I try to import this library into Roon, it is ridiculously slow (currently: 108 added, 108 identified after running for about 18 hours). This happens whether the library is on an SMB share or on a local disk. It happens with RoonServer running on Linux, Window or MacOS (where it is currently -- M2 Max with 32GB RAM).

But, if I convert the entire library to MP3 using ffmpeg, it imports completely in less than eight hours.

Describe your network setup

Verizon FiOS using their router. Everything involved is hardwired (and, as previously mentioned, it occurs even in a local-only scenario).

I should also note that I’ve completely disabled background analysis for now for simplicity’s sake.

There is no listening session – at this point, less than 1% of my library is imported.

But, no, changing background audio analysis from disabled to fast (4 cores) makes absolutely no difference.

Once again, this works just fine with the same library, same metadata, but MP3. With my FLAC library, the throughput is abominal.

How awful? fgrep storage RoonServer_Log.txt (to filter out noise unrelated to the import):

RoonServer_log.txt:06/16 13:53:48 Debug: [music/storage] importing file 67:0:10cc/Before, During, After/26 Confessions.flac from \music
RoonServer_log.txt:06/16 13:53:48 Debug: [music/storage] importing file 67:0:10cc/Before, During, After/27 Expecting a Message.flac from \music
RoonServer_log.txt:06/16 13:53:48 Debug: [library] imported 30 tracks from storage backend b7febf83-f171-4ce2-9ca0-a378e3048a32 (\music)
RoonServer_log.txt:06/16 15:33:11 Trace: [storage] [directory] extracting /Users/rando/Library/RoonMounts/RoonStorage_39c5de40fea863010953fc3daaae727775da8263/music/10cc/Before, During, After/28 Man on the Moon.flac
RoonServer_log.txt:06/16 15:33:16 Trace: [tidal/storage] sync force=False, isplaylistonly=False
RoonServer_log.txt:06/16 15:33:16 Trace: [tidal/storage] scan 9: starting
RoonServer_log.txt:06/16 15:34:11 Trace: [tidal/storage] got timestamps
RoonServer_log.txt:06/16 15:34:11 Trace: [tidal/storage]     will scan favorite playlists
RoonServer_log.txt:06/16 15:34:21 Trace: [tidal/storage]     will scan playlists
RoonServer_log.txt:06/16 16:02:19 Trace: [storage] [directory] force rescan requested for /Users/rando/Library/RoonMounts/RoonStorage_39c5de40fea863010953fc3daaae727775da8263/music
RoonServer_log.txt:06/16 16:26:56 Debug: [music/storage] importing file 67:0:10cc/Before, During, After/28 Man on the Moon.flac from \music
RoonServer_log.txt:06/16 16:26:59 Debug: [library] imported 1 tracks from storage backend b7febf83-f171-4ce2-9ca0-a378e3048a32 (\music)

We can see that a group of 30 tracks finished importing and…nothing for 100 minutes. Then it begins extracting a single track and…takes almost an hour to import that single track.

Two more days have passed and it’s imported about 400 tracks.

Two more days have passed with only a few hundred more tracks having been processed.

What are the next steps here?

I’ve preemptively uploaded logs from RoonServer as it’s been a week with no response from support. The problem, as described, continues unabated, rendering Roon unusable (high memory consumption and frequent hangs in any client).

Hey @Neil_Carpenter,

Thanks for the additional info! We’re seeing some interesting errors in a fresh server diagnostic, and would be curious to see how things function with a complete server database refresh. What machine is your usual Roon Server?

For the Mac currently running Roon Server, follow the steps below:

  • Create a Backup of your current database (or if you have a recent backup available to use you can skip this step)
  • Exit out of Roon + RoonServer (from taskbar area)
  • Navigate to your Roon Database Location
  • Find the folder that says “Roon Server” and “Roon”
  • Rename the “RoonServer” folder to “RoonServer_old” and “Roon” to “Roon_old”
  • Reinstall the Roon App from our Downloads Page to generate a new Roon folder
  • Verify if the issue persists on a fresh database before restoring the backup

Here is the process outlined from a macOS machine:
roonoldmac

I’d also temporarily simplify your network setup and only host a single subnet across your devices if possible. We’ll be on standby for your reply! :raised_hands:

What constitutes an ‘interesting error’?

This feels like you’re ignoring the history here – I’ve had the same symptoms on fresh installs on Linux (both a VM and a bare-metal server with 128GB RAM), Windows, and MacOS (on three different ARM64 Macs). The current install is on an Apple Mini M2 Pro with 32GB RAM and was installed a little over a week ago.

But, fine, we can start fresh again. The import problem appears to remain – it flew through a relatively small number of tracks, now it’s been hung for 20+ minutes with no additional tracks imported.

I’m using local storage for the tracks so there are no network dependencies there.

You are quite right this is ridiculously slow

Wild guess , have you tried changing the DNS provider.

You have probably done it by now but have you tried a “cold start”, turn everything off (modem router server the lot) and start each component in turn after the previous one has started

How are the music files stored , have you tried changing cables etc dodgy USB is not unknown

I can’t imagine any reason to do so – this is the sort of thing that becomes a support answer without actual, technical explanation. I would bet that, occasionally, somebody changes their DNS servers and reboots…and, while the reboot (at least temporarily) fixes an issue, the person sees the correlation as causation.

I’m using Control-D for DNS. They’re excellent and I’ve had no problems with them but I also have access to all the logs from my clients.

But, as I said, I have a lot of skepticism that a DNS issue could cause these observed symptoms. DNS query timeouts are fairly short and responses are cached so DNS failures tend to be either complete (error returned) or to cause very short delays (<4 seconds) before being cached locally & reused for the TTL. (And, if there are any name resolution issues, Roon doesn’t seem to be logging them, making it much more difficult to troubleshoot.)

No. I have no reason to believe there’s a network issue here and I’m not about to generate inconvenience for other systems/operations. Once again, if there is some sort of issue, Roon should log and alert on it so that I’m not stuck spending days troubleshooting it…but there’s no other indication of a problem.

I’ve seen the same symptoms regardless of whether my music was stored on an internal SATA drive, external USB, or an SMB-connected SAN.

The one thing that has made a difference is converting them from FLAC to MP3.

@benjamin what are the next steps? I noticed that the RoonAppliance process has also been restarting occasionally, as recently as 13:08 EDT today. In the two hours since then, Roon has processed fourteen (14) tracks out of the tens of thousands remaining.

How were the flac files derived? (eg cd rip, downloaded, transcoded from something else?)

How did you achieve the transcode from flac to mp3?

Hello @Neil_Carpenter,

Thank you for your patience.

It appears that most of your tracks could not be found on our analysis server. Here’s an example from the logs:

1. 2Pac feat. K-Ci & JoJo - How Do U Want It - Hit 'em Up

[cite_start]06/25 06:44:26 Debug: [easyhttp] [6081] GET to https://api.roonlabs.net/audioanalysis/1/analysis/696bb99fdd6d5cebb04c12457b329347178a3681?format=json&getSpectrogram=False&hexContentHash=True& returned after 93 ms, status code: 404 [cite: 12045]
06/25 06:44:26 Trace: [analysis] Track 2Pac feat. [cite_start]K‐Ci & JoJo - How Do U Want It - Hit 'em Up was not found in AudioAnalysis Service, continuing with analysis... [cite: 12045]
06/25 06:44:26 Trace: [analysis] analyzing trackid=6168114 url=/Volumes/slow/music/2Pac feat. [cite_start]K‐Ci & JoJo/How Do U Want It/04 Hit 'em Up.flac [cite: 12045]

2. Blank & Jones - Blank & Jones Present So80s (SoEighties) 5 - The Look of Love, Parts One & Two

[cite_start]06/25 06:06:55 Debug: [easyhttp] [12329] GET to https://api.roonlabs.net/audioanalysis/1/analysis/32177f3cabc720bef7f7e95ce83cb970ec1b6b1f?format=json&getSpectrogram=False&hexContentHash=True& returned after 142 ms, status code: 404 [cite: 8016]
[cite_start]06/25 06:06:55 Trace: [analysis] Track Blank & Jones - Blank & Jones Present So80s (SoEighties) 5 - The Look of Love, Parts One & Two was not found in AudioAnalysis Service, continuing with analysis... [cite: 8016]
[cite_start]06/25 06:06:55 Trace: [analysis] analyzing trackid=7685938 url=/Volumes/slow/music/Blank & Jones/Blank & Jones Present So80s (SoEighties) 5/11 The Look of Love, Parts One & Two.flac [cite: 8016]

3. Blank & Jones - Blank & Jones Present So80s (SoEighties) 7: Ibiza - Voyage Voyage (Euro remix remix)

[cite_start]06/24 06:05:34 Debug: [easyhttp] [12296] GET to https://api.roonlabs.net/audioanalysis/1/analysis/f989348ea37bd3d190a4cb34a2b18c54f7151d27?format=json&getSpectrogram=False&hexContentHash=True& returned after 142 ms, status code: 404 [cite: 3999]
[cite_start]06/24 06:05:34 Trace: [analysis] Track Blank & Jones - Blank & Jones Present So80s (SoEighties) 7: Ibiza - Voyage Voyage (Euro remix remix) was not found in AudioAnalysis Service, continuing with analysis... [cite: 3999]
[cite_start]06/24 06:05:34 Trace: [analysis] analyzing trackid=7644978 url=/Volumes/slow/music/Blank & Jones/Blank & Jones Present So80s (SoEighties) 7_ Ibiza/12 Voyage Voyage (Euro remix remix).flac [cite: 3999]

4. Blank & Jones - Milchbar: Seaside Season 8 - Snappiness [Sunset Mix]

[cite_start]06/23 19:28:18 Debug: [easyhttp] [3065] GET to https://api.roonlabs.net/audioanalysis/1/analysis/84f03e0b51b4c7e65c584b6b064fcc2ed01a431e?format=json&getSpectrogram=False&hexContentHash=True& returned after 83 ms, status code: 404 [cite: 8025]
[cite_start]06/23 19:28:18 Trace: [analysis] Track Blank & Jones - Milchbar: Seaside Season 8 - Snappiness [Sunset Mix] was not found in AudioAnalysis Service, continuing with analysis... [cite: 8025]
[cite_start]06/23 19:28:18 Trace: [analysis] analyzing trackid=7655218 url=/Volumes/slow/music/Blank & Jones/Milchbar __ Seaside Season 8/06 Snappiness (Sunset mix).flac [cite: 8025]

5. Blank & Jones - Milchbar: Seaside Season 8 - You’re the One

[cite_start]06/23 19:28:18 Debug: [easyhttp] [3065] GET to https://api.roonlabs.net/audioanalysis/1/analysis/74ff4c146293c414c7af56ef871cec1026bbe0c2?format=json&getSpectrogram=False&hexContentHash=True& returned after 85 ms, status code: 404 [cite: 4016]
[cite_start]06/23 19:28:18 Trace: [analysis] Track Blank & Jones - Milchbar: Seaside Season 8 - You're the One was not found in AudioAnalysis Service, continuing with analysis... [cite: 4016]
[cite_start]06/23 19:28:18 Trace: [analysis] analyzing trackid=7655474 url=/Volumes/slow/music/Blank & Jones/Milchbar __ Seaside Season 8/12 You’re the One.flac [cite: 4018]

To help us investigate further, could you please zip the problematic files and upload them using the following link:
:link: Upload Link

Additionally, could you let us know how the metadata for these tracks was defined? For example, were they manually tagged, auto-generated, or sourced from a specific tool?

We’ll take a closer look once we receive the files.

Largely, my metadata has been set by beets (so, MusicBrainz should be the primary source if my memory serves).

Those logs show less than a second taken for each of these transactions – why would this cause delays of hours between tracks? Why would this impact the tracks as FLAC but not as MP3s (given that both collections have the same metadata)?

Those files have been uploaded.

Hello @Neil_Carpenter,

I was able to import your 4 attached tracks, and it took about a minute. In comparison, importing my own 4 FLAC tracks took less than a second.

I’m currently discussing this issue internally with our R&D and Product teams and will follow up with you as soon as I have more information.

In the meantime, could you please share a screenshot of the current analysis status?

Thank you!


This is only a portion of the library as it’s currently split between two folders locally as part of earlier troubleshooting. The RoonAppliance process restarted again at 1222 EDT today. It’s processed thirteen (13) files in the two hours since.

It’s also frequently flashing the message indicating it’s waiting on the Roon server.

What’s the ETA for that?

Thanks @Neil_Carpenter!

Do you have any tracks not used with beets? If so, can you segment them out and test import speed on these tracks alone?

We don’t have a timeline to share just yet, but conversations around this are still ongoing. :+1: