Crash (Assert) when opening, saving or modifying a metasound

Hello

We just updated our engine to 5.6.1, and since that update I’m getting editor crashes when working with specific metasound assets. Before the update, I didn’t experience any crashes of this sort.

I am not using any custom nodes in the graphs - only metasound patches and other metasound sources.

Crash report:

Assertion failed: Reason == Metasound::Frontend::EInvalidEdgeReason::None [File:C:\Repos\Perforce\Engine\Engine\Plugins\Runtime\Metasound\Source\MetasoundFrontend\Private\MetasoundFrontendDocumentBuilder.cpp] [Line: 831]

Attempted call to AddEdge in MetaSound Builder where edge is invalid: Mismatched Access Type.

UnrealEditor_Core!FDebug::CheckVerifyFailedImpl2() [C:\Repos\Perforce\Engine\Engine\Source\Runtime\Core\Private\Misc\AssertionMacros.cpp:728]

UnrealEditor_MetasoundFrontend!FMetaSoundFrontendDocumentBuilder::AddEdge() [C:\Repos\Perforce\Engine\Engine\Plugins\Runtime\Metasound\Source\MetasoundFrontend\Private\MetasoundFrontendDocumentBuilder.cpp:831]

UnrealEditor_MetasoundFrontend!Metasound::Frontend::ReroutePrivate::FRerouteNodeTemplateTransform::Transform() [C:\Repos\Perforce\Engine\Engine\Plugins\Runtime\Metasound\Source\MetasoundFrontend\Private\NodeTemplates\MetasoundFrontendNodeTemplateReroute.cpp:77]

The crash occurs when:

  • Opening specific metasound sources or patches.
    • Some of them always trigger the assert, and others only do it when I’m opening the metasound the first time during that editor session.
  • Opening a metasound preset that uses a crashing metasound source.
  • Modifying the settings of an input.
  • Saving the metasound.
  • Undoing a change in the graph.

Additional observations:

  • The assert fails ~9-18 times before being able to resume the program from the IDE.
  • The PageID seems to be NULL in FMetaSoundFrontendDocumentBuilder::AddEdge.
  • The asset settings (like Volume, Pitch, etc.) do not cause a crash - unless undoing the change.

Output Log after resuming the program:

When trying to open a metasound source or patch:

LogAssetEditorSubsystem: Opening Asset editor for MetaSoundPatch /Game/Audio/MetaSoundUtility/Patches/MSP_InterpSineOut.MSP_InterpSineOut

LogOutputDevice: Warning: Script Stack (0 frames) :

LogOutputDevice: Warning: Script Stack (0 frames) :

LogOutputDevice: Warning: Script Stack (0 frames) :

LogOutputDevice: Warning: Script Stack (0 frames) :

LogOutputDevice: Warning: Script Stack (0 frames) :

LogOutputDevice: Warning: Script Stack (0 frames) :

LogOutputDevice: Warning: Script Stack (0 frames) :

LogOutputDevice: Warning: Script Stack (0 frames) :

LogOutputDevice: Warning: Script Stack (0 frames) :

LogSlate: The tab “MetasoundEditor_Pages” attempted to spawn in layout ‘Standalone_MetasoundEditor_Layout_v15’ but failed for some reason. It will not be displayed.

LogSlate: The tab “MetasoundEditor_UserPresetWidget” attempted to spawn in layout ‘Standalone_MetasoundEditor_Layout_v15’ but failed for some reason. It will not be displayed.

LogSlate: The tab “MetasoundEditor_UserPresetWidget” attempted to spawn in layout ‘Standalone_MetasoundEditor_Layout_v15’ but failed for some reason. It will not be displayed.

When trying to undo a property setting change:

LogEditorTransaction: Undo Edit Default

LogOutputDevice: Warning: Script Stack (0 frames) :

LogOutputDevice: Warning: Script Stack (0 frames) :

LogOutputDevice: Warning: Script Stack (0 frames) :

LogOutputDevice: Warning: Script Stack (0 frames) :

LogOutputDevice: Warning: Script Stack (0 frames) :

LogOutputDevice: Warning: Script Stack (0 frames) :

LogOutputDevice: Warning: Script Stack (0 frames) :

LogOutputDevice: Warning: Script Stack (0 frames) :

LogOutputDevice: Warning: Script Stack (0 frames) :

LogOutputDevice: Warning: Script Stack (0 frames) :

LogOutputDevice: Warning: Script Stack (0 frames) :

LogOutputDevice: Warning: Script Stack (0 frames) :

LogOutputDevice: Warning: Script Stack (0 frames) :

LogOutputDevice: Warning: Script Stack (0 frames) :

LogOutputDevice: Warning: Script Stack (0 frames) :

LogOutputDevice: Warning: Script Stack (0 frames) :

LogOutputDevice: Warning: Script Stack (0 frames) :

LogOutputDevice: Warning: Script Stack (0 frames) :

LogMetasoundEditor: Warning: Failed to synchronize Frontend Node ‘Trigger Compare (Int32)’ Connection: Pin ‘Compare’

LogMetasoundEditor: Warning: Failed to synchronize Frontend Node ‘Num (WaveAsset:Array)’ Connection: Pin ‘Array’

LogMetasoundEditor: Warning: Failed to synchronize Frontend Node ‘Get Wave Info’ Connection: Pin ‘Wave’

LogMetasoundEditor: Warning: Failed to synchronize Frontend Node ‘Trigger Compare (Float)’ Connection: Pin ‘Compare’

Apologies for the delay! There are a couple issues in the log. The one regarding the missing spawned tab in the layout can be disregarded. The invalid edge issue seems to be related with the upgrade path and, if I recall correctly, was addressed in a follow up change. I will try to pin that down and respond before end of day today!

Its hard to say for certain without some test content to attempt to repro the upgrade, but my guess is there was a bug with how reroute nodes may have been versioned when connected to inputs. Is there a pattern that you can diagnose with the offending MetaSound assets? Look for reroute nodes may be directly off input nodes. If they seem to be implementing that, we can try a couple options to get you up and running.

  1. In the older version of the engine, remove any reroutes connected to input nodes. Then attempt to version them again to 5.6.1
  2. Changelist 44249333 has some updates that hardened a bit of the code with reroutes. You could potentially pull that change and try reopening the offending content.

Let me know if that helps!

Hi Rob. Thanks for the reply.

I looked through the offending MetaSound assets, and it doesn’t seem like reroute nodes are the issue, as some of the graphs don’t have any. Even quite simple metasound graphs are causing crashes, for example this one:

[Image Removed]MSP_InterpSineOut

I tried pulling Changelist 44249333 into our project, but it seems like it depends on a lot of changes in previous changelists, as I got a lot of errors. I managed to run the engine with about half of the changes in the changelist, but no luck - the editor still crashes in the same metasounds as before.

Until we’ve found a solution, I’ve commented out the following assert in MetaSoundFrontendDocumentBuilder, which at least lets me work without the crashing. I’m not sure if this is causing other issues, but until now I’ve not encountered any.

checkf(Reason == Metasound::Frontend::EInvalidEdgeReason::None, TEXT("Attempted call to AddEdge in MetaSound Builder where edge is invalid: %s."), *LexToString(Reason));

Is there anything else I can do or provide you with to help in diagnosing the issue?

I just tried creating a new metasound patch with the exact same graph and inputs/outputs as MSP_InterpSineOut, and there are no failed asserts/crashes. So it seems to me that it is not caused by any particular setup of the graph itself, but perhaps rather that it is some sort of asset corruption issue, or the asset itself not properly updating to a 5.6.1 version of the same asset. Or something like that?

Not sure if it helps, but I thought I’d throw it in here.

We updated from 5.5.3, so no major version skips. And it was also at that engine version I created the above asset. I have attached the old version (from 5.5.3) of that asset.

I tried the new resave feature on all metasound in the project, but no luck. The same metasound assets still cause a crash. And for some reason after the resave, the failed assert/crash has started to happen even when playing the metasound in PIE. It is the exact same assert in the code, and the same assets that crash on opening/modifying/saving.

I tried looking for the document version, but I couldn’t find any logging for it apart from this:

LogMetaSound: Display: Resave recommended: Asset ‘MR_MDW_GeneralFlipbook_Loop’ at ‘/Game/Maps/MDW/Blueprints/TEMP/GeneralFlipbook/MR_MDW_GeneralFlipbook_Loop.MR_MDW_GeneralFlipbook_Loop’ successfully migrated editor data in target document version ‘v1.12’.

I had a lot of these before I used the new resave functionality from the content browser, and I didn’t see any other version numbers than 1.12.

Thanks so much for the updates! I’m wondering if there was some edit chain that put the asset in an invalid/unexpected state that the document migration path is not accounting for. Would it be possible for you to upload the unversioned uasset example above from your unversioned project (prior to 5.6.1)? Assuming there’s no other asset references therein, I can try and import the asset locally to see if I can reproduce the issue.

Also, if you have information regarding what document version was being upgraded from (should be in the log when you upgrade and comment out that check), that’d be useful too! Change 42779832 was an attempted fix at corrupt connection data when migrating from MetaSounds older than version 1.12. In addition, I was assuming that the asset had been resaved in the prior version of the engine (would be good to know what you’re upgrading from), but that’d be good to verify (i.e. you aren’t trying to skip a major version and resaved your assets in 5.5, 5.4 if it was authored before, etc. etc.).

Minor PSA for what its worth. Introduced in 5.6, we added a feature to right-click a content folder in the browser and version/resave MetaSounds specifically.

I was able to open the asset you linked in both the most recent version of UE in Main & 5.6.1 and load doesn’t seem to be triggering document versioning. Do you have the original, crashing version to provide?

Apologies, it does look to be updating from 1.14 (confirming that the version you provided was successfully updated, likely after you added the code to circumvent the crash)! The log line we’re wanting is listed as a verbose log line (was relatively recently changed to avoid spamming especially in build scripts). To enable it, you need to run ‘log logmetasound verbose’ in the commandline before loading the offending content in the MetaSound Editor (before double-clicking from the Content Browser). We’re looking for a line like the following:

LogMetaSound: Verbose: MetaSound at ‘<GameContentDirectory>MSP_InterpSineOut.MSP_InterpSineOut’ Document Versioned: ‘v1.14’ --> ‘v1.16’

Sorry, too many threads. See above for why we’re not seeing the versioning log line :slight_smile:

Here’s the output log when I get the earliest revision of MSP_InterpSineOut (via p4v), boot up the editor (without the code to circumvent the crash), change logging to verbose and open the asset.

The lines “LogOutputDevice: Warning: Script Stack (0 frames) :” are not there when the assert is commented out. And the logging is the same, when I’m running with the newest revision of the asset. So maybe the asset is still somehow at the new document version, even after getting its older revision.

But as you can see there are few log lines for some other assets that I haven’t resaved yet, which say v1.11. So I’m guessing v1.11 was the version for all our metasound assets before the update to 5.6.1 and resave - including the offending assets.

[0063.96][257]LogAssetEditorSubsystem: Opening Asset editor for MetaSoundPatch /Game/Audio/MetaSoundUtility/Patches/MSP_InterpSineOut.MSP_InterpSineOut

[0063.99][257]LogMetaSound: Verbose: MetaSound tags require updating: MetaSoundAssetManager aync loading asset ‘/Game/Maps/MDW/Blueprints/TEMP/GeneralFlipbook/MR_MDW_GeneralFlipbook_Loop.MR_MDW_GeneralFlipbook_Loop’ to access tags/update entry…

[0063.99][257]LogMetaSound: Verbose: MetaSound tags require updating: MetaSoundAssetManager aync loading asset ‘/Game/Maps/GVT/Audio/Seagull/MS_Seagull_Flap.MS_Seagull_Flap’ to access tags/update entry…

[0063.99][257]LogMetaSound: Verbose: MetaSound tags require updating: MetaSoundAssetManager aync loading asset ‘/Game/Maps/MDW/Blueprints/Crater/MS_Single_OutputEnvelope_Mono_Preset.MS_Single_OutputEnvelope_Mono_Preset’ to access tags/update entry…

[0064.00][257]LogMetaSound: Verbose: MetaSound tags require updating: MetaSoundAssetManager aync loading asset ‘/Metasound/DefaultAssets/Sources/MSS_PlayRandom_Loop.MSS_PlayRandom_Loop’ to access tags/update entry…

[0064.00][257]LogMetaSound: Verbose: MetaSound tags require updating: MetaSoundAssetManager aync loading asset ‘/Metasound/DefaultAssets/Sources/MSS_PlayRandom_Oneshot.MSS_PlayRandom_Oneshot’ to access tags/update entry…

[0064.10][257]LogOutputDevice: Warning: Script Stack (0 frames) :

[0067.19][257]LogOutputDevice: Warning: Script Stack (0 frames) :

[0067.66][257]LogOutputDevice: Warning: Script Stack (0 frames) :

[0068.17][257]LogOutputDevice: Warning: Script Stack (0 frames) :

[0068.70][257]LogOutputDevice: Warning: Script Stack (0 frames) :

[0069.17][257]LogOutputDevice: Warning: Script Stack (0 frames) :

[0069.55][257]LogOutputDevice: Warning: Script Stack (0 frames) :

[0069.97][257]LogOutputDevice: Warning: Script Stack (0 frames) :

[0070.38][257]LogOutputDevice: Warning: Script Stack (0 frames) :

[0070.80][257]LogOutputDevice: Warning: Script Stack (0 frames) :

[0071.22][257]LogOutputDevice: Warning: Script Stack (0 frames) :

[0071.64][257]LogOutputDevice: Warning: Script Stack (0 frames) :

[0072.05][257]LogOutputDevice: Warning: Script Stack (0 frames) :

[0072.45][257]LogOutputDevice: Warning: Script Stack (0 frames) :

[0072.83][257]LogOutputDevice: Warning: Script Stack (0 frames) :

[0073.24][257]LogOutputDevice: Warning: Script Stack (0 frames) :

[0073.64][257]LogOutputDevice: Warning: Script Stack (0 frames) :

[0074.04][257]LogOutputDevice: Warning: Script Stack (0 frames) :

[0074.66][257]LogOutputDevice: Warning: Script Stack (0 frames) :

[0074.88][257]LogOutputDevice: Warning: Script Stack (0 frames) :

[0075.31][257]LogOutputDevice: Warning: Script Stack (0 frames) :

[0075.69][257]LogOutputDevice: Warning: Script Stack (0 frames) :

[0076.08][257]LogOutputDevice: Warning: Script Stack (0 frames) :

[0076.55][257]LogOutputDevice: Warning: Script Stack (0 frames) :

[0076.99][257]LogOutputDevice: Warning: Script Stack (0 frames) :

[0077.31][257]LogOutputDevice: Warning: Script Stack (0 frames) :

[0077.83][257]LogSlate: The tab “MetasoundEditor_Pages” attempted to spawn in layout ‘Standalone_MetasoundEditor_Layout_v15’ but failed for some reason. It will not be displayed.

[0077.83][257]LogSlate: The tab “MetasoundEditor_UserPresetWidget” attempted to spawn in layout ‘Standalone_MetasoundEditor_Layout_v15’ but failed for some reason. It will not be displayed.

[0077.83][257]LogSlate: The tab “MetasoundEditor_UserPresetWidget” attempted to spawn in layout ‘Standalone_MetasoundEditor_Layout_v15’ but failed for some reason. It will not be displayed.

[0077.86][257]LogFileManager: Warning: DeleteFile was unable to delete ‘../../../Vokabulantis/Saved/Config/WindowsEditor/EditorPerProjectUserSettings.ini’, retrying in .5s…

[0077.94][257]LogSourceControl: Attempting ‘p4 client -o esbengravesen_DESKTOP-JE6O8B1_Game_Engine’

[0078.36][257]LogFileManager: Warning: DeleteFile recovered during retry!

[0080.19][257]LogSlate: Took 0.000189 seconds to synchronously load lazily loaded font ‘../../../Engine/Content/Slate/Fonts/Roboto-BoldCondensed.ttf’ (158K)

[0080.25][257]LogEOSSDK: Warning: LogEOSRTC: TickTracker Tick is delayed. TimePeriod=[25.626263s] TickIntervalThreshold=[0.100000s] MaxTickInterval=[16.292077s] MaxExecutionTime=[0.000194s] TicksCount=[836] ExpectedTicksCount=[2562]

[0080.49][259]LogMetaSound: Display: Resave recommended: Asset ‘MR_MDW_GeneralFlipbook_Loop’ at ‘/Game/Maps/MDW/Blueprints/TEMP/GeneralFlipbook/MR_MDW_GeneralFlipbook_Loop.MR_MDW_GeneralFlipbook_Loop’ successfully migrated editor data in target document version ‘v1.12’.

[0080.49][259]LogMetaSound: Verbose: MetaSound at ‘/Game/Maps/MDW/Blueprints/TEMP/GeneralFlipbook/MR_MDW_GeneralFlipbook_Loop.MR_MDW_GeneralFlipbook_Loop’ Document Versioned: ‘v1.11’ --> ‘v1.14’

[0080.60][260]LogMetaSound: Display: Resave recommended: Asset ‘MS_Single_OutputEnvelope_Mono_Preset’ at ‘/Game/Maps/MDW/Blueprints/Crater/MS_Single_OutputEnvelope_Mono_Preset.MS_Single_OutputEnvelope_Mono_Preset’ successfully migrated editor data in target document version ‘v1.12’.

[0080.60][260]LogMetaSound: Verbose: MetaSound at ‘/Game/Maps/MDW/Blueprints/Crater/MS_Single_OutputEnvelope_Mono_Preset.MS_Single_OutputEnvelope_Mono_Preset’ Document Versioned: ‘v1.11’ --> ‘v1.14’

[0080.62][261]LogMetaSound: Display: Async MetaSound Load/Asset Tag Prime Complete

Looks like we’re upgrading from 1.11 to 1.14. I’ll give that a whirl and let our QA know to attempt to repro, thanks!