Synthesia crashes and lag when loading music

Trouble with Synthesia, your keyboard, or adapter? Think you found a bug?
When describing problems, always mention your OS and game version (shown at the bottom of the title screen).

If your keyboard has USB or MIDI ports, there is a tremendously high chance (>99%) it will work with Synthesia. See what you'll need on the keyboards page.
Post Reply
lucalucky
Posts: 9

Post by lucalucky »

Hello, I have this problem with the latest versions of Synthesia (now 10.6.5425), for this I have been using version 10.2 for several years.
The problem occurs when I open Synthesia and the program starts loading the music. It does this slowly, with lagging and often freezes; so it is impossible to navigate between titles, also when loading is completed and listen to music easily.
It must be said that I have a midi collection of about 8000 files, but I don't think this is the problem because the old versions have always worked well and I also imagine that many have much more midi files than me.
I don't think it's even due to the PC which is new and features an AMD Ryzen 5 3500U with Vega 8 graphics. My OS is Windows 10, latest version with upgrades. There is a solution to the problem, that has been going on for years and does not allow me to make full use of the Synthesia I have purchased. Many thanks. :)

Best Regards
LP
Luca P.
Nicholas
Posts: 13135

Post by Nicholas »

Hmm, that's strange. There shouldn't be much of anything that could cause Synthesia to freeze.

Sorry for the trouble.

Just to rule out the large song library, if you temporarily disable those folders in Synthesia's search, does the problem still happen? (Are any of your songs those huge, >100MB in size, "Black MIDI" files?)
lucalucky
Posts: 9

Post by lucalucky »

Thank you for the reply.
No, actually there are only small files of few kb, max 100kb. The only thing I can say is that my midi file "collection" is stored in many folder and subfolder, it could be a problem?
Even disabling the other folders and only loading default the Synthesia music is a bit stiff/sloppy during the process, but it not freeze 'cause it load in one moment.
Strong freezing and also the system becomes unresponsive during the multiple song loading process. For example the program load 500 songs then freeze, then load other 1000 songs and freeze again and it gets worse and worse until the last song is loaded.

I know, it is strange, also to explain but it is so.
Best regards
Luca P.
Nicholas
Posts: 13135

Post by Nicholas »

lucalucky wrote: 12-18-20 1:34 pmEven disabling the other folders and only loading default the Synthesia music is a bit stiff/sloppy during the process, but it not freeze 'cause it load in one moment.
This is even more curious because the built-in songs go through a shorter version of the process that should be very fast. Out of curiosity, do you know whether your computer is reading the MIDI files from an SSD or HDD?

In any event, in about 350 task list lines the plan is to finally address this embarrassment. Hopefully those changes will smooth this out considerably (along with loading larger song collections in less than 1/100th the time it takes today).
lucalucky
Posts: 9

Post by lucalucky »

Nicholas wrote: 12-18-20 6:34 pm This is even more curious because the built-in songs go through a shorter version of the process that should be very fast. Out of curiosity, do you know whether your computer is reading the MIDI files from an SSD or HDD?

In any event, in about 350 task list lines the plan is to finally address this embarrassment. Hopefully those changes will smooth this out considerably (along with loading larger song collections in less than 1/100th the time it takes today).
The computer loads my MIDI files from an SSD.

The strange thing is that even with my old computer the same thing happened, and I attributed this to the old age of the PC. I was expecting a decent increase in performance with the new PC.
Even the old pc was equipped with AMD components, could it be a problem with AMD and compatibility?
For now I continue to use vers. 10.2.3742 without much problems, it loads songs quite smoothly and runs well.

Hope the issue will be solved in future updates, thank you for the support.

Best regards.
LP
Luca P.
Nicholas
Posts: 13135

Post by Nicholas »

There shouldn't be any compatibility problems with AMD hardware. (Until recently all my dev hardware was Intel-only, but about a year ago I switched my main dev machine over to AMD's new Zen stuff and haven't looked back.)

That it's crashing while loading songs may actually be a clue to a relatively new (to the >1 year old 10.6 version, anyway) crash that I've been hunting unsuccessfully for a while now. The crash is right on the transition to the song setup screen (the one just before the song plays) and smells like a multi-threading bug. But I haven't been able to reproduce it myself, so I'm not sure. If it's because the song scanning thread is doing something unexpected, that would be interesting.
lucalucky
Posts: 9

Post by lucalucky »

Hello, I go back to the problem that has plagued me for years...
Sorry but I have to quote myself, with minor corrections, to sum up the problem which is always the same, even for later and current versions (10.7).
lucalucky wrote: 12-15-20 2:59 pm Hello, I have this problem with the latest versions of Synthesia (now 10.6.5425), for this I still have to use version 10.2.
The problem occurs when I open Synthesia and the program starts loading the music. It does this slowly, with lagging and often freezes; so it is impossible to navigate between titles and also when loading is completed it lags during the listening.
It must be said that I have a midi collection of about 8000 files, but I don't think this is the problem because the old versions have always worked well and I also imagine that many have much more midi files than me.
I don't think it's even due to the PC which is new and features an AMD Ryzen 5 3500U with Vega 8 graphics. My OS is Windows 10, latest version with upgrades. There is a solution to the problem, that has been going on for years and does not allow me to make full use of the Synthesia I have purchased. Many thanks. :)

Best Regards
LP
I've done a video to show and explain better the problem, making a comparison between the two version (10.2 and 10.7). PS: it is recorded with an external cam in order to not affect the performance and capture what I really see on the screen, Synthesia audio is not recorded, just to point it out. :D
https://youtu.be/_PoNQ5_Hd08

In the video I show firstly the older version. It is very fast, you can search and navigate thru the songs easily still when the loading is not finished yet, and searching for songs is immediate and clean. (I've used "Jingle Bells" and "Jazz" as keywords to show the searching)
Then I move on to show the latest version of the program, which is much slower, full of lag during the loading and even when the loading itself is finished is still annoying to search for music because many times the program crashes for many seconds.
Finally in the last part of the video I show both version during the process of "playing" a song. Version 10.2 has a normal behaviour, smooth video and fast response, though vers. 10.7 lag too much for my tastes.
Also the way the song counter increments is eloquent in the explanation, to show the differences between the two versions throughout the video.

My PC is still an HP laptop fitted with an AMD Ryzen 5 3500U with Vega 8 graphics and Windows 10 uptaded to the latest upgrades. The PC is fitted with an SSD. This problem appears also on older AMD PC with the same symptoms. Older version work smoothly and fine, latest version not. So the problem is not the "slowness" of the hardware.
I hope this could be helpful in order to find a solution, I would really like to try newer version with ease.
Thank you so much.

Best Regards
LP
Luca P.
Nicholas
Posts: 13135

Post by Nicholas »

Thanks for the video. If a picture is worth a thousand words, a video is worth more!

I knew the song list was bad now, but I didn't realize it was better in the past. I just tracked down the speed/responsiveness regression you demonstrated to a simple, routine upgrade of the version of the SQLite library we use internally that I made on 2016-04-25 to SQLite 3.12.2.

Using the latest Synthesia code, I rolled back only SQLite to the version we were using before (3.7.17) and the song list is fast again! That's quite a performance regression on their part! Out of curiosity, I also tried the very latest version of SQLite (3.36.0, released last week) and it's still slow. I'll have to comb through their changelog to see what might have changed between 3.7 and 3.12 to make such a big impact. I know Synthesia uses the library in nearly the least-efficient way possible (hence the embarrassment), but it doesn't seem like it should have gotten so much worse.

Until I reach the library optimization task (now on line 309 of the task list) and get a chance to investigate exactly how/why the performance changed, I suppose for now I'll just temporarily revert SQLite back to the older version.

What's more alarming to me is that strange, lurching, wave-like playback jitter that you're seeing on the play screen. I was also able to reproduce it in older builds, but I'm having trouble finding it in the current debug build. (Does it still happen to you in the latest build from this Monday?) The number of songs that Synthesia knows about should have zero impact on the play screen, so something unexpected is going on there.
lucalucky
Posts: 9

Post by lucalucky »

Thanks for the reply.
Yes, I have the same problems, including the jittery playback also with the latest version, I've just downloaded and tried it.
I hope that this issue with SQLite can be addressed in the future.
But the point, that make me think is that, I'm the only one in trouble with those problems? Since vers. 10.2 is passed a lot of time, and no one has reported these problems here. Is that possible?

Could be a Direct X problem? Just assuming... (I'm not an expert on this field) I don't know, since it's the same on other PCs that I have.
Luca P.
Nicholas
Posts: 13135

Post by Nicholas »

lucalucky wrote: 06-30-21 4:46 pmSince vers. 10.2 is passed a lot of time, and no one has reported these problems here. Is that possible?
I think it's related to having such a large song list, which also explains why I haven't heard any reports in 5 years. More than 1k songs is rare. More than 10k songs is very rare.

Does the same jittery behavior happen (in the newest version, etc.) when you have very few songs in the list? (Again, there really shouldn't be any dependence on the song count during play, but the working hypothesis is that I missed something.) :?
lucalucky
Posts: 9

Post by lucalucky »

Nicholas wrote: 06-30-21 5:38 pmDoes the same jittery behavior happen (in the newest version, etc.) when you have very few songs in the list? (Again, there really shouldn't be any dependence on the song count during play, but the working hypothesis is that I missed something.) :?
Yes, it happens also with only the "default" songs loaded. I think It depends only by the version used.
Luca P.
Bavi_H
Posts: 116

Post by Bavi_H »

About the jittery motion:

I also noticed this problem on the Synthesia on my Windows 8.1 computer earlier this year. When I tested right now, I was able to re-create the issue in Synthesia 10.6.5425, 10.7.5567, and preview-10.7.5619.

For me, the problem only happens when the "Music Output" page for "Built-in MIDI Synthesizer" has the first setting "Send output to this device" switched off. When it is off, the motion of the falling bars is stuttery. When it is on, the motion of the falling bars is smooth.

As a workaround, when I want to turn off the "Built-in MIDI Synthesizer", I leave the first setting "Send output to this device" turned on, and then I turn off all the settings under "Use this device for", so it is effectively silent. When I do this, the motion of the falling bars remains smooth.

I didn't report this issue at the time because I was afraid it might be an issue only on my computer. Now I know someone else has this issue, I wanted to share what worked for me.
lucalucky
Posts: 9

Post by lucalucky »

Thank you so much, I just tried right now!
It works keeping on ON position the built-in Synthesizer. I've switched ON the main setting and turned off all the other switches (note, metronome, percussions etc...) since I prefer to use Virtual Midi Synth as an output for SF2/SFZ.
Probably is not a Synthesia's correct behaviour, I really don't know, but at least it works very well, no jittery playback at all and it run normally smooth as in vers.10.2!
Many thanks Bavi_H.

The problem with the song list loading is still there, I mean, there is no correlation between the two problems.
Luca P.
Nicholas
Posts: 13135

Post by Nicholas »

Bavi_H wrote: 07-01-21 3:38 amFor me, the problem only happens when the "Music Output" page for "Built-in MIDI Synthesizer" has the first setting "Send output to this device" switched off.
This is insane, but I was just able to reproduce it exactly. Good detective work! I'm kind of afraid of trying to track down what might be happening (usually turning something off speeds the rest of the code up!) but now I at least have a lead.

Assuming I'm able to find the root cause for the uneven update speed, both of these should be fixed in the next dev preview. Thanks again!
Nicholas
Posts: 13135

Post by Nicholas »

Both problems should be fixed in the latest development preview! :D

Detailed explanations for the curious:

SQLite: After an hour of going through their old versions, narrowing down where the bad behavior started (and tracking down and back-porting a separate crash fix in their code), I found it. SQLite 3.8.0 introduced their "Next Generation Query Parser" which is apparently 100x slower in Synthesia's case. I found the magic, one-line incantation I needed to make it fast again.

Slow-down without built-in synth: This one was even more interesting! The slow-down isn't fixed by using Microsoft's synth. But (if you happen to have it installed), it is fixed "permanently" by enabling VirtualMIDISynth, even if you disable it afterward. That seemed extra strange to me, and I noticed that if you closed the little system tray icon that it launches, then it would slow back down.

But now we've got a situation that doesn't even involve Synthesia that is changing its performance! As a test, I tore out 100% of Synthesia's MIDI device code (so the device lists appear completely empty) and it was still slow! Then, separately, from the Start Menu, I launched VirtualMIDISynth and Synthesia sped up! :o

Of course it ended up being an undocumented, breaking change made by Microsoft in Windows 10 version 2004. Our built-in synth (based on the lovely BASS and BASSMIDI libraries) happened to be requesting a faster timer on Synthesia's behalf. When the built-in synth is disabled, no such request was being made anymore. In the past this never mattered because something in the system had always requested the fastest timer. Since Windows 10 2004 we have to do it ourselves.

Technically this has always been my fault for not calling timeBeginPeriod when the app starts.

In any event, thanks for the detailed bug reports and work-arounds!
lucalucky
Posts: 9

Post by lucalucky »

Nice! "I'm curious" and I have read the report.
I'm going to try the new dev. preview as soon as possibile.

Many thanks for your effort. :)

Best regards
LP
Luca P.
lucalucky
Posts: 9

Post by lucalucky »

I've been using the new version for a couple of days. Of course it works great.
I finally managed to replace the old version and try some new features, like the live recording!
Luca P.
Nicholas
Posts: 13135

Post by Nicholas »

That's great news, thanks for the follow-up!
Post Reply