surge-synthesizer / surge

Synthesizer plug-in (previously released as Vember Audio Surge)
https://surge-synthesizer.github.io/
GNU General Public License v3.0
3.1k stars 395 forks source link

Loading of a specific Surge configuration results in pathological system instability #7641

Closed EmeliaK closed 3 days ago

EmeliaK commented 4 months ago

Bug Description: Attempting to load a project module containing a Surge XT (TNMG Andromeda preset) instance is liable to hang the loading process. The plugin server process responsible for this Surge instance climbs to and maintains an unusual threshold of CPU usage. If the plugin server process is not manually terminated, the system is liable to either fully hard-crash or lose video signal (busy idle?), in either case resulting in a necessary power cycle.

Surge XT Version

Reproduction Steps: Steps to reproduce the behavior:

  1. Open a module containing a Surge XT (TNMG Andromeda preset) instance as an instrument. (This may immediately reproduce.)
  2. Start playback of this module. (This may immediately reproduce.)
  3. Close this module by opening a different module or quitting.
  4. Reopen this module. (If module seems to eventually open, attempting playback may incur issue. If this does not reproduce, repeat steps 3 and 4 as necessary.)

Expected Behavior: This module loads, and is playable, as normal.

Screenshots: Video of the issue occurring. (Problem module attached below. Load at 0:05 hangs, then issue repeatedly fails to reproduce, then load at 3:30 hangs. Note the process's CPU usage climbing to around 10~11% on either hang. If these processes are not terminated, the system will eventually crash - harder to record that.)

Computer Information (please complete the following!):

Additional Information: Extremely bizarre, but very fatal issue. Can't tell if it's plain semi-random, or if there are actually consistent conditions to reproduce this every load that are just too subtle for me to catch. I only discovered (after getting hit with it again today) that a specific plugin server process seemed to be the precursor. Unsure if it's even a Surge-side thing or if this is something bad with how Renoise cleans up(?). This issue was also present on Surge XT 1.0.1 back on January 28th 2023, in the module where I initially encoutered this issue. I believed at first it was a corruption of the Renoise module from attempting to duplicate a Surge XT (TNMG Andromeda) instance, and reported it on the Renoise forums, but I now realise the duplication would have incurred a load of Surge XT (TNMG Andromeda) and thus been the same issue as what I'm currently reporting. The TNMG Andromeda preset is the only one I've encountered this issue on; I don't know if it occurs on others, and I can't be confident in suggesting the preset bears any blame (I've used other TNMG presets fine), but it's one of the few consistent factors in this issue's reproduction.

Filesize-trimmed version of problem module shown in video. Issue is confirmed to still reproduce identically in this. Nagisa ni Hisame_20240506.zip

baconpaul commented 4 months ago

We found a problem in Surge very recently where some windows systems, with some patches, can generate very very high CPU usages. We fixed this and plan to sweep the fix into our 1.3.2 release, this week.

I don't have your system setup available to me, but I am wondering if you would be willing to let us know whether it is reproducible in our nightly installer https://surge-synthesizer.github.io/nightly_XT

the patch in question has many of the characteristics which would tickle this particular bug. I'm curious if we resolved it with the change in question.

Thank you!

EmeliaK commented 4 months ago

@baconpaul Thanks for the prompt response, and your amazing work!

Testing NIGHTLY-2024-05-06-c9c696c - results initially seemed promising, but unfortunately managed to reproduce twice attempting to load the old module from last year (attached below for posterity), as well as attempting to load the current module (Nagisa ni Hisame). To clarify, it never occurs mid-playback, always when trying to load a "fresh" instance.

In the old module's case (Renoise v3.3.x at the time), the pathological plugin server process is associated with one of either of its two TNMG Andromeda patches; I reproduced first getting the one in slot 05 acting up, then on a later attempt the one in slot 02. Doesn't seem to happen to both at once? Midenrura, Parched Light Fields.zip

Since this is the only patch I've experienced this with, I've gone through other patches I've used before (i.e. these ones are likely not associated with whatever I'm experiencing), since you mention shared characteristics between certain patches can trip the bug you recently squashed. Maybe this list lines up?

Associated with issue:

Not associated, seems fine:

(As you can tell, I've been a big fan of Surge - thank you once again for all the team's amazing work!)

mkruselj commented 4 months ago

I am curious if you make a version of the Andromeda patch with all FX removed if it reproduces. Or at least all Airwindows effects. Perhaps even go removing them one by one and see. My spidey sense is tingling that it might be Airwindows... I can't explain why, it's just a hunch.

EmeliaK commented 4 months ago

@mkruselj Sadly reproduced with all four of Andromeda's Airwindows effects removed, and then again with its FX chains cleared entirely.

Also reproduced twice (almost terminated too late the second time!) with a completely empty module containing nothing but the Andromeda patch, and then again with its FX chains cleared too.

If you've successfully attempted playback without incurring the issue, that seems to make it more liable to reproduce on following loads? Intuitively feels that way, but unsure. Have also had it reproduce by (as far as I can tell) leaving it alone for a while before the next load attempt.

mkruselj commented 4 months ago

Let's try some other things. For example, try setting each filter to Off one by one then all of them across both scenes. Try different filter configurations for each scene. Try setting each oscillator type back to Classic. Yes, sound will change, but we're trying to nail which part of Surge is misbehaving here.

Thanks!

EmeliaK commented 4 months ago

@mkruselj

Reproduced with the stacking changes:

But interestingly...

Would it make sense that ST+FP could cause snags like this? Will add a further comment as I test ST and FP modes individually to see if it can be narrowed down to either one (or if I end up disproving this hunch).

Something else I'm observing is that when it does occur, it has a good chance of reproducing again on the very next attempt, though not always. Unsure if it's tied to how soon the repeat attempt was made... Doesn't seem likely to trigger three times in a row - only had that happen once, where on the third reproduce its CPU usage leapt from the usual "bugged" 10-11% up to 13%.

EmeliaK commented 4 months ago

Update:

I've noticed that even if the module loads and playback works, loading the Surge instance's GUI and attempting to interact with it (I've been switching between scenes - don't know if it's exclusive to that or not, haven't been able to isolate) often characteristically hangs the process too - some or any kind of GUI interaction might be another form of "trigger" for the issue? I've managed to get multiple GUI-triggered hangs as well as a load hang.

So while plain Mono and Mono FP have constantly managed to load and even playback fine, it turns out GUI interaction can still bite afterwards. Getting more unsure of the nature of this issue now - I'll take a break and maybe try switching scenes in the GUIs of other patches.

Attaching the goat file I've been using for reference - SceneA Mono ST, SceneB Mono. andromeda_goat.zip

mkruselj commented 4 months ago

So weird. At this point this might be a weird interaction between Renoise and Surge. I'm assuming you cannot reproduce this in another DAW?

EmeliaK commented 4 months ago

I'm getting worried that it is; VST3 support in Renoise is still fairly immature as far as I'm aware, and its plugin hosting in general can tend to just work strangely. The issue doesn't seem to be reproducing in REAPER on load/play/GUI interaction.

In any case, the Renoise module can be reloaded (if the plugin server process hangs and requires manual termination) until it actually succeeds, so I'm not blocked from working per se - just have to get Renoise to behave first (and timebomb my computer if I don't!).

baconpaul commented 4 months ago

Yeah I just found a bug and a separate maybe bug in renoise vst3 on the airwindows project but at least now I have renoise in my Mac so I suppose I can try this!

mkruselj commented 3 months ago

So... shall we mark this one as "issue is on host end, nothing we can do about it" and close it, or...? @baconpaul

baconpaul commented 3 months ago

lets leave this one open for now even though i think your analysis is almost definitely correct.

mkruselj commented 3 days ago

I'm closing it after all. No new info or further activity, if the issue still happens we'll either reopen or get another ticket, it's fine.