Editor.AsyncSoundWaveCompilationMaxConcurrency

Editor.AsyncSoundWaveCompilationMaxConcurrency

#Overview

name: Editor.AsyncSoundWaveCompilationMaxConcurrency

This variable is created as a Console Variable (cvar).

It is referenced in 4 C++ source files.

#Summary

#Usage in the C++ source code

The purpose of Editor.AsyncSoundWaveCompilationMaxConcurrency is to control the maximum number of concurrent sound wave compilations in Unreal Engine’s editor. This setting is part of the engine’s audio compilation system.

This setting variable is primarily used in the Engine module, specifically within the SoundWaveCompiler subsystem. It’s utilized to manage the asynchronous compilation of sound waves, which can improve performance during asset import and map loading.

The value of this variable is set through the AsyncCompilationHelpers::EnsureInitializedCVars function, which is called in the FSoundWaveCompilingManager constructor. This function initializes the console variable (CVar) for controlling the maximum concurrency of async sound wave compilation.

This variable interacts closely with the bEnableAsyncSoundWaveCompilation variable, which is defined in the UEditorExperimentalSettings class. The bEnableAsyncSoundWaveCompilation variable determines whether async sound wave compilation is enabled or not.

Developers should be aware that this setting affects the performance and resource utilization of the sound compilation process. Setting it too high might consume too many system resources, while setting it too low might slow down the compilation process.

Best practices when using this variable include:

  1. Adjusting it based on the available system resources and the project’s needs.
  2. Monitoring performance impact when changing this value.
  3. Considering it in conjunction with the bEnableAsyncSoundWaveCompilation setting.

Regarding the associated variable bEnableAsyncSoundWaveCompilation:

The purpose of bEnableAsyncSoundWaveCompilation is to enable or disable asynchronous sound wave compilation in the Unreal Engine editor.

This variable is part of the UEditorExperimentalSettings class in the UnrealEd module. It’s used to control whether the engine should use asynchronous compilation for sound waves, which can improve import and map load time performance.

The value of this variable is set in the UEditorExperimentalSettings constructor, where it’s initially set to false. It can be modified through the editor’s project settings.

This variable directly affects the behavior controlled by Editor.AsyncSoundWaveCompilationMaxConcurrency. If bEnableAsyncSoundWaveCompilation is false, the max concurrency setting won’t have any effect.

Developers should be aware that enabling this feature might impact stability, as it’s part of the experimental settings. It should be tested thoroughly before use in production.

Best practices for using this variable include:

  1. Enabling it when improved sound compilation performance is needed.
  2. Testing the impact on stability and overall performance before enabling in production.
  3. Using it in conjunction with Editor.AsyncSoundWaveCompilationMaxConcurrency for optimal results.

#References in C++ code

#Callsites

This variable is referenced in the following C++ source code:

#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/SoundWaveCompiler.cpp:49

Scope (from outer to inner):

file
namespace    SoundWaveCompilingManagerImpl
function     static void EnsureInitializedCVars

Source code excerpt:


			AsyncCompilationHelpers::EnsureInitializedCVars(
				TEXT("SoundWave"),
				CVarAsyncSoundWaveStandard.AsyncCompilation,
				CVarAsyncSoundWaveStandard.AsyncCompilationMaxConcurrency,
				GET_MEMBER_NAME_CHECKED(UEditorExperimentalSettings, bEnableAsyncSoundWaveCompilation));
		}
	}
}

#Associated Variable and Callsites

This variable is associated with another variable named bEnableAsyncSoundWaveCompilation. They share the same value. See the following C++ source code.

#Loc: <Workspace>/Engine/Source/Editor/UnrealEd/Classes/Settings/EditorExperimentalSettings.h:27

Scope (from outer to inner):

file
class        class UEditorExperimentalSettings : public UObject

Source code excerpt:

	UPROPERTY(EditAnywhere, config, Category = Performance, meta = (DisplayName = "Enable async static mesh compilation and loading"))
	bool bEnableAsyncStaticMeshCompilation;

	/** Enable async skeletal mesh compilation to improve import and map load time performance when compilation is required */
	UE_DEPRECATED(5.1, "Deprecated & replaced by bEnableAsyncSkinnedAssetCompilation.")
	UPROPERTY(/*EditAnywhere - deprecated & replaced by bEnableAsyncSkinnedAssetCompilation, */config/*, Category = Performance, meta = (DisplayName = "Enable async skeletal mesh compilation and loading")*/)
	bool bEnableAsyncSkeletalMeshCompilation;

	/** Enable async skinned asset compilation to improve import and map load time performance when compilation is required */
	UPROPERTY(EditAnywhere, config, Category = Performance, meta = (DisplayName = "Enable async skinned asset compilation and loading"))
	bool bEnableAsyncSkinnedAssetCompilation;

	/** Enable async sound compilation to improve import and map load time performance when compilation is required */
	UPROPERTY(EditAnywhere, config, Category = Performance, meta = (DisplayName = "Enable async sound compilation and loading"))
	bool bEnableAsyncSoundWaveCompilation;

	/** Allows the editor to run on HDR monitors on Windows 10 */
	UPROPERTY(EditAnywhere, config, Category = HDR, meta = (ConfigRestartRequired = true, DisplayName = "Enable Editor Support for HDR Monitors"))
	bool bHDREditor;

	/** The brightness of the slate UI on HDR monitors */
	UPROPERTY(EditAnywhere, config, Category = HDR, meta = (ClampMin = "100.0", ClampMax = "300.0", UIMin = "100.0", UIMax = "300.0"))
	float HDREditorNITLevel;

	/** Allows usage of the procedural foliage system */
	UPROPERTY(EditAnywhere, config, Category = Foliage, meta = (DisplayName = "Procedural Foliage"))
	bool bProceduralFoliage;

	/** Allows usage of the Translation Picker */
	UPROPERTY(EditAnywhere, config, Category = Tools, meta = (DisplayName = "Translation Picker"))
	bool bEnableTranslationPicker;

	/** Specify which console-specific nomenclature to use for gamepad label text */
	UPROPERTY(EditAnywhere, config, Category=UserInterface, meta=(DisplayName="Console for Gamepad Labels"))
	TEnumAsByte<EConsoleForGamepadLabels::Type> ConsoleForGamepadLabels;

	/** Allows for customization of toolbars and menus throughout the editor */
	UPROPERTY(config)
	bool bToolbarCustomization;

	/** Break on Exceptions allows you to trap Access Nones and other exceptional events in Blueprints. */

#Loc: <Workspace>/Engine/Source/Editor/UnrealEd/Private/Settings/SettingsClasses.cpp:175

Scope (from outer to inner):

file
function     UEditorExperimentalSettings::UEditorExperimentalSettings

Source code excerpt:

	ECVF_Default);

static TAutoConsoleVariable<float> CVarEditorHDRNITLevel(
	TEXT("Editor.HDRNITLevel"),
	160.0f,
	TEXT("Sets The desired NIT level of the editor when running on HDR"),
	ECVF_Default);

UEditorExperimentalSettings::UEditorExperimentalSettings( const FObjectInitializer& ObjectInitializer )
	: Super(ObjectInitializer)
	, bEnableAsyncTextureCompilation(false)
	, bEnableAsyncStaticMeshCompilation(false)
	, bEnableAsyncSkeletalMeshCompilation(true)	// This was false and set to True in /Engine/Config/BaseEditorPerProjectUserSettings.ini. The setting is removed from .ini so change it to default True.
	, bEnableAsyncSkinnedAssetCompilation(false)
	, bEnableAsyncSoundWaveCompilation(false)
	, bHDREditor(false)
	, HDREditorNITLevel(160.0f)
	, bUseOpenCLForConvexHullDecomp(false)
	, bAllowPotentiallyUnsafePropertyEditing(false)
	, bPackedLevelActor(true)
	, bLevelInstance(true)
{
}

void UEditorExperimentalSettings::PostInitProperties()
{
	PRAGMA_DISABLE_DEPRECATION_WARNINGS
	// bEnableAsyncSkeletalMeshCompilation's default to True (see comment in constructor above).
	// To be backwards compatible, if a user project overrides it to False, pass on the value to bEnableAsyncSkinnedAssetCompilation.
	if (!bEnableAsyncSkeletalMeshCompilation)
	{
		UE_LOG(LogSettingsClasses, Warning, TEXT("bEnableAsyncSkeletalMeshCompilation is deprecated and replaced with bEnableAsyncSkinnedAssetCompilation. Please update the config. Setting bEnableAsyncSkinnedAssetCompilation to False."));
		bEnableAsyncSkinnedAssetCompilation = false;
	}
	PRAGMA_ENABLE_DEPRECATION_WARNINGS

	CVarEditorHDRSupport->Set(bHDREditor ? 1 : 0, ECVF_SetByProjectSetting);
	CVarEditorHDRNITLevel->Set(HDREditorNITLevel, ECVF_SetByProjectSetting);
	Super::PostInitProperties();
}

#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/SoundWaveCompiler.cpp:40

Scope (from outer to inner):

file
namespace    SoundWaveCompilingManagerImpl
function     static void EnsureInitializedCVars

Source code excerpt:

	}

	static void EnsureInitializedCVars()
	{
		static bool bIsInitialized = false;

		if (!bIsInitialized)
		{
			bIsInitialized = true;

			AsyncCompilationHelpers::EnsureInitializedCVars(
				TEXT("SoundWave"),
				CVarAsyncSoundWaveStandard.AsyncCompilation,
				CVarAsyncSoundWaveStandard.AsyncCompilationMaxConcurrency,
				GET_MEMBER_NAME_CHECKED(UEditorExperimentalSettings, bEnableAsyncSoundWaveCompilation));
		}
	}
}

FSoundWaveCompilingManager::FSoundWaveCompilingManager()
	: Notification(MakeUnique<FAsyncCompilationNotification>(GetAssetNameFormat()))
{
	SoundWaveCompilingManagerImpl::EnsureInitializedCVars();
}

FName FSoundWaveCompilingManager::GetStaticAssetTypeName()
{
	return TEXT("UE-SoundWave");
}

FName FSoundWaveCompilingManager::GetAssetTypeName() const
{
	return GetStaticAssetTypeName();
}

TArrayView<FName> FSoundWaveCompilingManager::GetDependentTypeNames() const
{
	return TArrayView<FName>{ };
}

FTextFormat FSoundWaveCompilingManager::GetAssetNameFormat() const