au.DisableFiltering

au.DisableFiltering

#Overview

name: au.DisableFiltering

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.DisableFiltering is to control the usage of per-source lowpass and highpass filters in the audio mixer system of Unreal Engine 5.

This setting variable is used in the Audio Mixer subsystem of Unreal Engine 5, specifically within the Source Manager component. It’s part of the audio processing pipeline and affects how individual audio sources are filtered.

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

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

Developers must be aware that this variable affects both lowpass and highpass filtering for all audio sources. When set to 1 (disabled), it bypasses these filters, which can significantly change the audio quality and characteristics of the game.

Best practices when using this variable include:

  1. Using it for debugging or performance testing purposes.
  2. Being cautious about disabling filtering in a production environment, as it can affect the intended audio design.
  3. Considering the impact on game performance and audio quality before changing its value.

Regarding the associated variable DisableFilteringCvar:

The purpose of DisableFilteringCvar is to serve as the actual integer variable that stores the state of the au.DisableFiltering setting.

It’s used directly in the audio processing logic within the FMixerSourceManager::ComputePostSourceEffectBufferForIdRange function to determine whether to bypass lowpass and highpass filters.

The value of DisableFilteringCvar is set by the CVar system when au.DisableFiltering is modified.

DisableFilteringCvar interacts with another variable, DisableHPFilteringCvar, in the filter bypass logic. While DisableFilteringCvar affects both lowpass and highpass filters, DisableHPFilteringCvar only affects the highpass filter.

Developers should be aware that changing DisableFilteringCvar directly (instead of through au.DisableFiltering) might lead to inconsistencies in the engine’s state.

Best practices include:

  1. Always modifying au.DisableFiltering instead of DisableFilteringCvar directly.
  2. Using DisableFilteringCvar for read-only purposes in custom code that needs to check the filtering state.
  3. Considering the performance implications of frequently checking this variable in performance-critical audio processing loops.

#Setting Variables

#References In INI files

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

Location: <Workspace>/Projects/Lyra/Config/IOS/IOSEngine.ini:6, 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:39

Scope: file

Source code excerpt:

static int32 DisableFilteringCvar = 0;
FAutoConsoleVariableRef CVarDisableFiltering(
	TEXT("au.DisableFiltering"),
	DisableFilteringCvar,
	TEXT("Disables using the per-source lowpass and highpass filter.\n")
	TEXT("0: Not Disabled, 1: Disabled"),
	ECVF_Default);

static int32 DisableHPFilteringCvar = 0;

#Associated Variable and Callsites

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

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

Scope: file

Source code excerpt:

	ECVF_Default);

static int32 DisableFilteringCvar = 0;
FAutoConsoleVariableRef CVarDisableFiltering(
	TEXT("au.DisableFiltering"),
	DisableFilteringCvar,
	TEXT("Disables using the per-source lowpass and highpass filter.\n")
	TEXT("0: Not Disabled, 1: Disabled"),
	ECVF_Default);

static int32 DisableHPFilteringCvar = 0;
FAutoConsoleVariableRef CVarDisableHPFiltering(

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

Scope (from outer to inner):

file
namespace    Audio
function     void FMixerSourceManager::ComputePostSourceEffectBufferForIdRange

Source code excerpt:

				}

				const bool bBypassLPF = DisableFilteringCvar || (SourceInfo.LowPassFilter.GetCutoffFrequency() >= (MAX_FILTER_FREQUENCY - KINDA_SMALL_NUMBER));
				const bool bBypassHPF = DisableFilteringCvar || DisableHPFilteringCvar || (SourceInfo.HighPassFilter.GetCutoffFrequency() <= (MIN_FILTER_FREQUENCY + KINDA_SMALL_NUMBER));

				float* SourceBuffer = SourceInfo.SourceBuffer.GetData();
				float* HpfInputBuffer = PreDistanceAttenBufferPtr; // assume bypassing LPF (HPF uses input buffer as input)

				if (!bBypassLPF)
				{