15 seconds delay until next track begins playing for local files

Roon Core Machine

<!‐-Include your operating system and machine info (Model, CPU, RAM)-‐>
<!‐-Write below this line-‐>
Mac mini (M1, 2020), 8GB memory, , 265GB SSD, Ventura 13.1

Networking Gear & Setup Details

<!‐-Your network gear (model of routers/switches) and if on WiFi/Ethernet, are you using VPN-‐>
<!‐-Write below this line-‐>
Swisscom Internet Router, wired inhouse network

Connected Audio Devices

<!‐-Specify what devices you’re using and their connection types, like USB/HDMI/Chromecast, etc.)-‐>
<!‐-Write below this line-‐>
RME UC USB DAC

Number of Tracks in Library

<!‐-Tell us how large your music library is, eg. “30,000 tracks”-‐>
<!‐-Write below this line-‐>
61.000

Description of Issue

<!-‐Tell us about the problem you’re having in as much detail as possible. Screenshots are always appreciated!-‐>
<!‐-Write below this line-‐>
For albums in my local library it may take 15 seconds before the next track begins playing after pressing the “next track” icon. Sometimes the next track starts playing without noticeable delay. I don`t see a pattern.
In the example from the logfile entries below i see that after pressing “Next” the “Computed stats” entries are repeated 10 times and only afterwards the playback of the next track begins.
Besides the long time that each computation takes, this looks to me like a shortcoming in the program logic. Why can’t the calculation happen after starting the playback and why is one execution of the same statement not enough?

----------- Logfile ------------

50 top performers, 16 genres
12/23 16:12:16 Debug: [music/profilestats] Computed stats in 1116ms, got 50 top albums, 50 top performers, 16 genres
12/23 16:12:17 Debug: [music/profilestats] Computed stats in 1119ms, got 50 top albums, 50 top performers, 16 genres
12/23 16:12:18 Debug: [music/profilestats] Computed stats in 1111ms, got 50 top albums, 50 top performers, 16 genres
12/23 16:12:19 Debug: [music/profilestats] Computed stats in 1103ms, got 50 top albums, 50 top performers, 16 genres
12/23 16:12:20 Debug: [music/profilestats] Computed stats in 1105ms, got 50 top albums, 50 top performers, 16 genres
12/23 16:12:21 Debug: [music/profilestats] Computed stats in 1104ms, got 50 top albums, 50 top performers, 16 genres
12/23 16:12:22 Debug: [music/profilestats] Computed stats in 1112ms, got 50 top albums, 50 top performers, 16 genres
12/23 16:12:23 Debug: [music/profilestats] Computed stats in 1102ms, got 50 top albums, 50 top performers, 16 genres
12/23 16:12:25 Debug: [music/profilestats] Computed stats in 1092ms, got 50 top albums, 50 top performers, 16 genres
12/23 16:12:26 Debug: [music/profilestats] Computed stats in 1095ms, got 50 top albums, 50 top performers, 16 genres
12/23 16:12:26 Trace: [broker/accounts] [heartbeat] now=23.12.2022 15:12:26 nextauthrefresh=23.12.2022 16:10:12 nextmachineallocate=23.12.2022 16:02:26
12/23 16:12:27 Debug: [music/profilestats] Computed stats in 1090ms, got 50 top albums, 50 top performers, 16 genres
12/23 16:12:28 Debug: [music/profilestats] Computed stats in 1111ms, got 50 top albums, 50 top performers, 16 genres
12/23 16:12:28 Trace: [dbperf] flush 0 bytes, 0 ops in 10 ms (cumulative 28629048 bytes, 15518 ops in 11760 ms)
12/23 16:12:28 Trace: [library] endmutation in 14677ms

@Patrick_Thibor, to receive appropriate help, it would be really helpful if you could complete the template provided below. Please be sure to include details of your core, network, storage location of your media files, and any messages displayed by Roon. Thank you.

Roon Core Machine

<!‐-Include your operating system and machine info (Model, CPU, RAM)-‐>
<!‐-Write below this line-‐>

Networking Gear & Setup Details

<!‐-Your network gear (model of routers/switches) and if on WiFi/Ethernet, are you using VPN-‐>
<!‐-Write below this line-‐>

Connected Audio Devices

<!‐-Specify what devices you’re using and their connection types, like USB/HDMI/Chromecast, etc.)-‐>
<!‐-Write below this line-‐>

Number of Tracks in Library

<!‐-Tell us how large your music library is, eg. “30,000 tracks”-‐>
<!‐-Write below this line-‐>

Description of Issue

<!-‐Tell us about the problem you’re having in as much detail as possible. Screenshots are always appreciated!-‐>
<!‐-Write below this line-‐>

Including these details in your first post helps resolve your issues faster.

I have added the requested information.
Some additional observations from my side: I am testing Roon since a few weeks and tried it with three different setups.

  1. All on one computer: PC, 10 Core, 5 GHz, 64 GB memory
  2. Mac mini late 2014, Output on Mac mini and other computers in my network
  3. Mac mini 2020 as a server, Output on Mac mini and other computers in my network

All three setups share the same issue. The performance for playing the next track is great after a restart of the Roon Core. The performance degrades after a few hours. A restart of the Core is fixing the issue for some hours.

From this i assume that the problem does not originate from my hardware or network. Can this be an issue with the software since the same logfile entry repeats for 10 (plus / minus) times?
Can this be an issue with the database? DB and software are the only components that are the same in all three setups that i have tested

Try Linux. I had exactly those problems and others. Linux was a significant improvement. Not. Perfect, but noticeably better.

I have only ever run my Roon Core on a headless Linux server, and I remember having experienced that same problem last year, but not anymore in recent times. I also thought that stats computing on the Core should not interfere with the music reproduction and I think that at one point I reported this behavior. This seems to be a problem of design or implementation on the server side of Roon, and it is not OS dependent.

That said, this problem went away as soon as Roon Core was ported to .NET on Linux, doing away with the inefficiencies of Mono. When I did experience this behavior, I regularly monitored the RAM usage by the Roon Core, and regularly restarted the Roon Server to be able to use the system without having to wait for 10-15 seconds between tracks. I also at one point deleted my play history, under the assumption that those stats were being computed over this history. But I don’t know for sure that this is so, nor do I know that deleting the history will have an impact. The problem is ugly enough though, that I was prepared to do anything to make it go away.

As at this point Roon is using .NET on all supported platforms, I am at a loss thinking of what may cause this problem on your Mac Mini. I would recommend monitoring RAM usage and restart Roon Server regularly, maybe automating this process to do automatic restarts every morning or at night. There may still be some memory leak on the Mac which would impact this behavior.

Other than this, I would very much like that the good people at Roon had a look into this, and that there were a way that the startup of music reproduction weren’t held up by the computing of statistics on the server.

BTW, I just checked my Core logs, and this is how it behaves at this moment on my installation. This is with a library of about 250.000 tracks and on a server which was restarted 3 days ago:

12/25 21:32:00 Debug: [music/profilestats] Computed stats in 327ms, got 49 top albums, 50 top performers, 4 genres
12/25 21:32:00 Debug: [music/profilestats] Computed stats in 331ms, got 49 top albums, 50 top performers, 4 genres
12/25 21:32:01 Debug: [music/profilestats] Computed stats in 328ms, got 49 top albums, 50 top performers, 4 genres
12/25 21:32:01 Debug: [music/profilestats] Computed stats in 327ms, got 49 top albums, 50 top performers, 4 genres
12/25 21:32:01 Debug: [music/profilestats] Computed stats in 324ms, got 49 top albums, 50 top performers, 4 genres

Hi Andreas,

thank you for sharing your experience with the same issue. This shows that i am not alone.
There seems to be no problem with memory consumption. It is quite stabel between 1.5 and 1.7 GB und 1.5 GB unused memory in the system.
For now i will go with the ugly workaround to restart the server every night. After every restart, the “Computed stats” statement is only happening once for every new track and the execution is around 300 ms.
Its really strange that this problem is only affecting a few users (at least this is what i take out of scanning the community posts).
Since in general Roon seems to be developed by very capable SW developers, i am sure that they will find a solution if they find the time to look into the issue.
Executing the same calculation of statistics several times for for jumping to the next track looks like a bug to me. Waiting for the results of the execution before the next track begins to play looks like poor design.

What DNS servers do you use on your network? If it’s those provided by your ISP, try changing them to 1.1.1.1 and 1.0.0.1.

I changed the DNS servers as suggested.
This did not change the performance and the pattern, that i still see in the logfile. The following entry is explaining the delay after pressing the Next button:

"12/28 10:07:01 Debug: [music/profilestats] Computed stats in 488ms, got 50 top albums, 50 top performers, 23 genres".

After a reboot of the Roon server, this computation is only executed twice after pressing the Next button.
The number of repeated computations is growing up to 10 within the next hours. The execution time for each individual calculation is growing from 200 ms after a restart of the server to over 1000 ms after running for a few hours.
I assume, that looking into these patterns that are nicely recorded in the logfiles would lead to a solution.

That nicely describes my experience last year. It thankfully went away after Roon ported the Linux core to .NET. This of course has nothing to do with DNS lookups. It’s just a myth in Roon’s universe that by changing to Google or Cloudflare DNS every problem will go away…

No, it’s not. It continues to resolve user issues. For example,

Moreover, the OP has the same issue using Windows and macOS.

@Patrick_Thibor, where are your local files stored?

He doesn’t. I experienced this same issue in the past, and it had nothing whatsoever to do with DNS. Look at the profilestats calculations… there’s the issue, and that has nothing to do with DNS.

Please read the thread, and if you don’t have anything to contribute, please defer from replying. Thanks.

Currently my files are on an external HD attached to the Mac Mini (the server for Roon Server).
I had the exact same issues with the files stored on an internal SSD on a high-end audio PC with the Roon Server running on the same server.
As Andreas is pointing out, its most unlikely that the issues are cause by server hardware, file storage of network issues. Somebody who knows how to interprete the logfile entries that i shared should look into this.

1 Like

I have read the thread, have you? And I will contribute with my user experience, having had the same issue in the past. This is not the way to reply to a user, less by a moderator. We are discussing a user issue, and we may disagree about the issue and its cause, but that is no reason to ask me to shut up. You are being rude and it is not the first time I have noticed that.

That’s a completely different issue. The user describes that specifically 192/24 tracks would start to play, and then after some time they would distort and stop.

The issue described in this thread is that a track ends to play, and there will be an ever increasing time for the next track to start playing. This increasing time is correlated with the profilestats calculations done on the Core. A restart will solve the problem temporarily, and after the restart the profilestats calculations will be faster, and there will be less calculations. After some time, the times between the end of the last track being played and the start of the next track will increase again. Restart the server, rinse and repeat…

What I can tell you is that I did not change anything in my network setup, DNS configuration, server hardware or local file location to solve the problem. I lived with frequent Roon Core restarts, until a new version of Roon server on Linux made the issue go away. Or at least I don’t notice it anymore.

To be precise i have no time gap between tracks when one track is played until the end and than the next one begins. This always works perfect.
I experience the delay when i press the “Next” button in the middle of a track. There may also be a similar delay before the first track of an album start playing after pressing “Play now” for a selected album.
I have not unreasonable delays for the same operations when i play Qobuz tracks.

This is something I rarely do and I’ll have to check how this behaves on my system… When I had the problem, it was that the time between the end of one track and the start of the next track would steadily increase. And like you I observed the ever increasing times of the profilestats calculations. This now is not anymore an issue.

Let’s hope that Roon support will look into this and propose a solution.

The problem is still happening on a regular basis. After a restart of the Roon Core everything works perfect for 10-12 hours. Then i get the huge delays when i want to start the playback of the next track in an album or the first track in a new album.
The delay goes up to 24 seconds. The same “Computed stats” entry repeats many times before the playback begins. In the below sample form the logfile it was repeated 17 times.
This looks like a bug to me.
Since i am a new Roon user i don´t know what i can expect from #support.
The ticked was created 17 days ago, but until now there was no reaction from a technical support member. How long do i have to wait until there is a first response from the support team?

12/29 16:15:40 Debug: [music/profilestats] Computed stats in 1412ms, got 50 top albums, 50 top performers, 24 genres
12/29 16:15:42 Debug: [music/profilestats] Computed stats in 1393ms, got 50 top albums, 50 top performers, 24 genres
12/29 16:15:43 Debug: [music/profilestats] Computed stats in 1399ms, got 50 top albums, 50 top performers, 24 genres
12/29 16:15:45 Debug: [music/profilestats] Computed stats in 1392ms, got 50 top albums, 50 top performers, 24 genres
12/29 16:15:46 Debug: [music/profilestats] Computed stats in 1386ms, got 50 top albums, 50 top performers, 24 genres
12/29 16:15:48 Debug: [music/profilestats] Computed stats in 1634ms, got 50 top albums, 50 top performers, 24 genres
12/29 16:15:49 Debug: [music/profilestats] Computed stats in 1386ms, got 50 top albums, 50 top performers, 24 genres
12/29 16:15:50 Debug: [music/profilestats] Computed stats in 1386ms, got 50 top albums, 50 top performers, 24 genres
12/29 16:15:52 Debug: [music/profilestats] Computed stats in 1364ms, got 50 top albums, 50 top performers, 24 genres
12/29 16:15:52 Info: [stats] 405676mb Virtual, 1914mb Physical, 1003mb Managed
12/29 16:15:53 Debug: [music/profilestats] Computed stats in 1387ms, got 50 top albums, 50 top performers, 24 genres
12/29 16:15:54 Debug: [music/profilestats] Computed stats in 1369ms, got 50 top albums, 50 top performers, 24 genres
12/29 16:15:56 Debug: [music/profilestats] Computed stats in 1374ms, got 50 top albums, 50 top performers, 24 genres
12/29 16:15:57 Debug: [music/profilestats] Computed stats in 1370ms, got 50 top albums, 50 top performers, 24 genres
12/29 16:15:59 Debug: [music/profilestats] Computed stats in 1373ms, got 50 top albums, 50 top performers, 24 genres
12/29 16:16:00 Debug: [music/profilestats] Computed stats in 1366ms, got 50 top albums, 50 top performers, 24 genres
12/29 16:16:00 Trace: [XEON] [HighQuality, 16/44 ALAC => 32/44] [100% buf] [LOADING @ 0:00] Sjå, Åmioda (Og ikke en lyd kom mig fra Strupen) - Maja Ratkje
12/29 16:16:01 Debug: [music/profilestats] Computed stats in 1450ms, got 50 top albums, 50 top performers, 24 genres
12/29 16:16:03 Debug: [music/profilestats] Computed stats in 1392ms, got 50 top albums, 50 top performers, 24 genres
12/29 16:16:03 Trace: [dbperf] flush 0 bytes, 0 ops in 17 ms (cumulative 15545643 bytes, 12087 ops in 9879 ms)
12/29 16:16:03 Trace: [library] endmutation in 24351ms

Hi @Patrick_Thibor

I have exactly the same issue with a similar set up (Mac mini M1). Thread here https://community.roonlabs.com/t/please-suggestions-to-solve-time-lag-on-track-and-album-changes/198147

In my case the issue is “time sensitive”: gaps are longer the longer the previous song has played AND the longer the Roon session. Restarting Roon (I do it every day) solves the issue momentarily, but crawls back.
I’ve been suffering from this issue for a long time, interacted with support many times, seems to have gotten better with latest versions of Roon…but still is there

Hi Ricardo,

thank you for sharing your experience. I hope somebody from the technical team looks into the issue. The logfile contains very detailed and hopefully useful information to get to the root of the issue.