au.LogSubmixAutoDisable

au.LogSubmixAutoDisable

#Overview

name: au.LogSubmixAutoDisable

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 au.LogSubmixAutoDisable is to control the logging of submix disable and enable states in the Unreal Engine audio mixer system. It is primarily used for debugging and monitoring the performance of audio submixes.

This setting variable is part of the Audio Mixer subsystem in Unreal Engine 5. It is specifically used within the AudioMixer module, as evident from its location in the AudioMixerSubmix.cpp file.

The value of this variable is set through the engine’s console variable system. It is declared as an FAutoConsoleVariableRef, which allows it to be modified at runtime through console commands or configuration files.

The au.LogSubmixAutoDisable variable interacts directly with the LogSubmixEnablementCVar variable. They share the same value, with LogSubmixEnablementCVar being the actual integer variable used in the code to check the logging state.

Developers should be aware that this variable is primarily used for debugging purposes. When enabled (set to 1), it will log information about submix disabling and re-enabling, which can be useful for diagnosing audio performance issues or understanding the behavior of the submix system.

Best practices for using this variable include:

  1. Enabling it only when necessary for debugging, as excessive logging can impact performance.
  2. Using it in conjunction with other audio debugging tools to get a comprehensive view of the audio system’s behavior.
  3. Disabling it in production builds to avoid unnecessary logging overhead.

Regarding the associated variable LogSubmixEnablementCVar:

The purpose of LogSubmixEnablementCVar is to serve as the actual integer variable that stores the state of the logging feature. It is used internally within the code to check whether logging should be performed.

This variable is part of the same Audio Mixer subsystem and is used in conjunction with au.LogSubmixAutoDisable.

The value of LogSubmixEnablementCVar is set indirectly through the au.LogSubmixAutoDisable console variable. They are linked through the FAutoConsoleVariableRef declaration.

LogSubmixEnablementCVar interacts directly with the UE_CLOG macro, which conditionally logs information based on the variable’s value.

Developers should be aware that modifying LogSubmixEnablementCVar directly is not the intended way to control this feature. Instead, they should use the au.LogSubmixAutoDisable console variable.

Best practices for LogSubmixEnablementCVar include:

  1. Treating it as a read-only variable within the code.
  2. Using it for conditional logging in performance-sensitive areas of the audio processing code.
  3. Ensuring that any new code that needs to check the logging state uses this variable consistently with existing code.

#References in C++ code

#Callsites

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

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

Scope: file

Source code excerpt:

static int32 LogSubmixEnablementCVar = 0;
FAutoConsoleVariableRef CVarLogSubmixEnablement(
	TEXT("au.LogSubmixAutoDisable"),
	LogSubmixEnablementCVar,
	TEXT("Enables logging of submix disable and enable state.\n")
	TEXT("1: Submix enablement logging is on. 0: Submix enablement/disablement logging is off."),
	ECVF_Default);

// Define profiling categories for submixes. 

#Associated Variable and Callsites

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

#Loc: <Workspace>/Engine/Source/Runtime/AudioMixer/Private/AudioMixerSubmix.cpp:38

Scope: file

Source code excerpt:

	ECVF_Default);

static int32 LogSubmixEnablementCVar = 0;
FAutoConsoleVariableRef CVarLogSubmixEnablement(
	TEXT("au.LogSubmixAutoDisable"),
	LogSubmixEnablementCVar,
	TEXT("Enables logging of submix disable and enable state.\n")
	TEXT("1: Submix enablement logging is on. 0: Submix enablement/disablement logging is off."),
	ECVF_Default);

// Define profiling categories for submixes. 
DEFINE_STAT(STAT_AudioMixerEndpointSubmixes);

#Loc: <Workspace>/Engine/Source/Runtime/AudioMixer/Private/AudioMixerSubmix.cpp:1260

Scope (from outer to inner):

file
namespace    Audio
function     void FMixerSubmix::ProcessAudio

Source code excerpt:

				bIsCurrentlyDisabled = true;

				UE_CLOG(LogSubmixEnablementCVar == 1, LogAudioMixer, Display,
					TEXT("Submix Disabled. Num Sources: %d, Time Silent: %.2f, Disablement Threshold: %.2f, Submix Name: %s"), 
					MixerSourceVoices.Num(),
					(float)(MixerDevice->GetAudioClock() - SilenceTimeStartSeconds),
					AutoDisableTime,
					*SubmixName);
			}

#Loc: <Workspace>/Engine/Source/Runtime/AudioMixer/Private/AudioMixerSubmix.cpp:1277

Scope (from outer to inner):

file
namespace    Audio
function     void FMixerSubmix::ProcessAudio

Source code excerpt:

		{
			bIsCurrentlyDisabled = false;
			UE_CLOG(LogSubmixEnablementCVar == 1, LogAudioMixer, Display, TEXT("Submix Re-Enabled: %s"), *SubmixName);
		}

		// Mix all submix audio into this submix's input scratch buffer
		{
			CSV_SCOPED_TIMING_STAT(Audio, SubmixChildren);
			CONDITIONAL_SCOPE_CYCLE_COUNTER(STAT_AudioMixerSubmixChildren, (ChildSubmixes.Num() > 0));