au.DisableSourceEffects

au.DisableSourceEffects

#Overview

name: au.DisableSourceEffects

The value of this variable can be defined or overridden in .ini config files. 2 .ini config files referencing this setting variable.

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

It is referenced in 3 C++ source files.

#Summary

#Usage in the C++ source code

The purpose of au.DisableSourceEffects is to control the usage of source effects in the audio mixer system of Unreal Engine 5. It acts as a global switch to enable or disable all source effects.

This setting variable is primarily used in the audio mixer subsystem of Unreal Engine 5. It is referenced in the AudioMixerSourceManager.cpp file, which is part of the AudioMixer module.

The value of this variable is set through a console variable (CVar) system. It is initialized to 0 (not disabled) and can be changed at runtime using console commands or through code.

The au.DisableSourceEffects variable interacts directly with the DisableSourceEffectsCvar variable. They share the same value, with DisableSourceEffectsCvar being the actual integer variable used in the code logic.

Developers must be aware that setting this variable to 1 will disable all source effects globally, which could significantly impact the audio quality and behavior of the game. It’s important to use this variable judiciously, typically for debugging or performance optimization purposes.

Best practices when using this variable include:

  1. Use it temporarily for debugging audio issues or performance problems related to source effects.
  2. Always revert to the default value (0) after testing unless there’s a specific reason to keep source effects disabled.
  3. Document any permanent changes to this variable in the project settings or documentation.

Regarding the associated variable DisableSourceEffectsCvar:

The purpose of DisableSourceEffectsCvar is to serve as the actual integer variable that controls the behavior of source effect processing in the audio mixer.

This variable is used directly in the audio processing logic, specifically in the ComputePostSourceEffectBufferForIdRange function of the FMixerSourceManager class.

The value of DisableSourceEffectsCvar is set through the au.DisableSourceEffects console variable.

It interacts with the source effect processing logic, determining whether the effect chain for each audio source should be processed or skipped.

Developers should be aware that this variable is used in performance-critical audio processing code, so changing its value could have immediate effects on audio performance and quality.

Best practices for DisableSourceEffectsCvar include:

  1. Avoid directly modifying this variable in code; instead, use the au.DisableSourceEffects console variable to change its value.
  2. When debugging audio issues, check the value of this variable to ensure it’s not unexpectedly disabling source effects.
  3. Consider adding logging or telemetry around changes to this variable in a development build to track when and why source effects are being disabled.

#Setting Variables

#References In INI files

Location: <Workspace>/Projects/Lyra/Config/Android/AndroidEngine.ini:13, section: [ConsoleVariables]

Location: <Workspace>/Projects/Lyra/Config/IOS/IOSEngine.ini:8, section: [ConsoleVariables]

#References in C++ code

#Callsites

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

#Loc: <Workspace>/Engine/Source/Runtime/AudioMixer/Private/AudioMixerSourceManager.cpp:63

Scope: file

Source code excerpt:

static int32 DisableSourceEffectsCvar = 0;
FAutoConsoleVariableRef CVarDisableSourceEffects(
	TEXT("au.DisableSourceEffects"),
	DisableSourceEffectsCvar,
	TEXT("Disables using any source effects.\n")
	TEXT("0: Not Disabled, 1: Disabled"),
	ECVF_Default);

static int32 DisableDistanceAttenuationCvar = 0;

#Associated Variable and Callsites

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

#Loc: <Workspace>/Engine/Source/Runtime/AudioMixer/Private/AudioMixerSourceManager.cpp:61

Scope: file

Source code excerpt:

	ECVF_Default);

static int32 DisableSourceEffectsCvar = 0;
FAutoConsoleVariableRef CVarDisableSourceEffects(
	TEXT("au.DisableSourceEffects"),
	DisableSourceEffectsCvar,
	TEXT("Disables using any source effects.\n")
	TEXT("0: Not Disabled, 1: Disabled"),
	ECVF_Default);

static int32 DisableDistanceAttenuationCvar = 0;
FAutoConsoleVariableRef CVarDisableDistanceAttenuation(

#Loc: <Workspace>/Engine/Source/Runtime/AudioMixer/Private/AudioMixerSourceManager.cpp:2773

Scope (from outer to inner):

file
namespace    Audio
function     void FMixerSourceManager::ComputePostSourceEffectBufferForIdRange

Source code excerpt:


			// Now process the effect chain if it exists
			if (!DisableSourceEffectsCvar && SourceInfo.SourceEffects.Num() > 0)
			{
				// Prepare this source's effect chain input data
				SourceInfo.SourceEffectInputData.CurrentVolume = SourceInfo.VolumeSourceDestination;

				const float Pitch = Audio::GetFrequencyMultiplier(SourceInfo.PitchModulation.GetValue());
				SourceInfo.SourceEffectInputData.CurrentPitch = SourceInfo.PitchSourceParam.GetValue() * Pitch;