au.DisableParallelSourceProcessing

au.DisableParallelSourceProcessing

#Overview

name: au.DisableParallelSourceProcessing

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.DisableParallelSourceProcessing is to control whether parallel processing of audio sources is enabled or disabled in the Unreal Engine’s audio mixer system.

This setting variable is primarily used in the Audio Mixer subsystem of Unreal Engine. It’s specifically 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’s initialized with a default value of 1 (disabled) and can be changed at runtime using console commands.

The au.DisableParallelSourceProcessing variable is directly associated with the DisableParallelSourceProcessingCvar variable. They share the same value and are used interchangeably in the code.

Developers must be aware that this variable affects the performance of audio processing. When set to 1 (disabled), it prevents the use of asynchronous tasks for processing audio sources, which could impact performance in audio-heavy scenarios.

Best practices when using this variable include:

  1. Leaving it at the default value (1) unless there’s a specific need for parallel audio source processing.
  2. If enabling parallel processing (setting to 0), ensure that the system has enough cores to handle the additional threads efficiently.
  3. Profile the audio performance with both settings to determine the optimal configuration for your specific game or application.

Regarding the associated variable DisableParallelSourceProcessingCvar:

The purpose of DisableParallelSourceProcessingCvar is to serve as the internal representation of the au.DisableParallelSourceProcessing console variable within the C++ code.

This variable is used directly in the AudioMixer module, specifically in the FMixerSourceManager::GenerateSourceAudio function. It determines whether the audio processing should use multiple worker threads or not.

The value of this variable is set through the FAutoConsoleVariableRef system, which links it to the au.DisableParallelSourceProcessing console variable.

DisableParallelSourceProcessingCvar interacts directly with the logic that decides whether to use source workers for parallel processing. When it’s non-zero, parallel processing is skipped.

Developers should be aware that changes to au.DisableParallelSourceProcessing will directly affect this variable, and vice versa.

Best practices for using DisableParallelSourceProcessingCvar include:

  1. Avoid modifying this variable directly in code. Instead, use the console variable au.DisableParallelSourceProcessing to change its value.
  2. When reading this variable in performance-critical code, consider caching its value to avoid frequent checks of the console variable system.

#References in C++ code

#Callsites

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

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

Scope: file

Source code excerpt:

static int32 DisableParallelSourceProcessingCvar = 1;
FAutoConsoleVariableRef CVarDisableParallelSourceProcessing(
	TEXT("au.DisableParallelSourceProcessing"),
	DisableParallelSourceProcessingCvar,
	TEXT("Disables using async tasks for processing sources.\n")
	TEXT("0: Not Disabled, 1: Disabled"),
	ECVF_Default);

static int32 DisableFilteringCvar = 0;

#Associated Variable and Callsites

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

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

Scope: file

Source code excerpt:

// Link to "Audio" profiling category
CSV_DECLARE_CATEGORY_MODULE_EXTERN(AUDIOMIXERCORE_API, Audio);
static int32 DisableParallelSourceProcessingCvar = 1;
FAutoConsoleVariableRef CVarDisableParallelSourceProcessing(
	TEXT("au.DisableParallelSourceProcessing"),
	DisableParallelSourceProcessingCvar,
	TEXT("Disables using async tasks for processing sources.\n")
	TEXT("0: Not Disabled, 1: Disabled"),
	ECVF_Default);

static int32 DisableFilteringCvar = 0;
FAutoConsoleVariableRef CVarDisableFiltering(

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

Scope (from outer to inner):

file
namespace    Audio
function     void FMixerSourceManager::GenerateSourceAudio

Source code excerpt:

		}

		if (NumSourceWorkers > 0 && !DisableParallelSourceProcessingCvar)
		{
			AUDIO_MIXER_CHECK(SourceWorkers.Num() == NumSourceWorkers);
			for (int32 i = 0; i < SourceWorkers.Num(); ++i)
			{
				FAudioMixerSourceWorker& Worker = SourceWorkers[i]->GetTask();
				Worker.SetGenerateBuses(bGenerateBuses);