au.ExtraAudioMixerDeviceLogging
au.ExtraAudioMixerDeviceLogging
#Overview
name: au.ExtraAudioMixerDeviceLogging
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
Enables extra logging for audio mixer device running \n0: no logging, 1: logging every 500 callbacks \n
It is referenced in 4
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of au.ExtraAudioMixerDeviceLogging is to enable extra logging for the audio mixer device running in Unreal Engine 5. This setting variable is specifically designed for debugging and monitoring the audio mixer system.
This setting variable is primarily used within the AudioMixerCore module of Unreal Engine 5. It’s referenced in the AudioMixer.cpp file, which is part of the core audio mixing functionality.
The value of this variable is set through a console variable (CVar) system. It’s initialized to 0 by default, but can be changed at runtime using console commands or through configuration files.
The au.ExtraAudioMixerDeviceLogging variable interacts directly with ExtraAudioMixerDeviceLoggingCVar. They share the same value, with ExtraAudioMixerDeviceLoggingCVar being the actual integer storage for the logging setting.
Developers should be aware that this variable controls additional logging, which can impact performance if enabled. It’s designed to log every 500 callbacks when set to 1, providing periodic updates on the audio mixer’s activity.
Best practices for using this variable include:
- Keep it disabled (0) in production builds to avoid unnecessary logging overhead.
- Use it judiciously during development and debugging phases.
- Be prepared for increased log output when enabled, which may require additional log management.
Regarding the associated variable ExtraAudioMixerDeviceLoggingCVar:
The purpose of ExtraAudioMixerDeviceLoggingCVar is to store the actual integer value that controls the extra logging behavior for the audio mixer device.
This variable is used within the AudioMixerCore module, specifically in the Audio namespace and within functions like FOutputBuffer::MixNextBuffer and IAudioMixerPlatformInterface::ApplyAttenuationInternal.
The value of ExtraAudioMixerDeviceLoggingCVar is set through the au.ExtraAudioMixerDeviceLogging console variable. It’s initialized to 0 and can be changed at runtime.
ExtraAudioMixerDeviceLoggingCVar interacts directly with au.ExtraAudioMixerDeviceLogging, serving as its backing storage.
Developers should be aware that this variable is checked in performance-sensitive audio processing code. Setting it to a non-zero value will introduce additional branching and potential logging calls in the audio processing path.
Best practices for using ExtraAudioMixerDeviceLoggingCVar include:
- Avoid modifying it directly; instead, use the au.ExtraAudioMixerDeviceLogging console variable to change its value.
- Be mindful of its impact on audio processing performance when enabled.
- Use it in conjunction with other audio debugging tools and logs for comprehensive audio system analysis.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Runtime/AudioMixerCore/Private/AudioMixer.cpp:135
Scope: file
Source code excerpt:
static int32 ExtraAudioMixerDeviceLoggingCVar = 0;
FAutoConsoleVariableRef ExtraAudioMixerDeviceLogging(
TEXT("au.ExtraAudioMixerDeviceLogging"),
ExtraAudioMixerDeviceLoggingCVar,
TEXT("Enables extra logging for audio mixer device running \n")
TEXT("0: no logging, 1: logging every 500 callbacks \n"),
ECVF_Default);
// Stat definitions for profiling audio mixer
#Associated Variable and Callsites
This variable is associated with another variable named ExtraAudioMixerDeviceLoggingCVar
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/AudioMixerCore/Private/AudioMixer.cpp:133
Scope: file
Source code excerpt:
ECVF_Default);
static int32 ExtraAudioMixerDeviceLoggingCVar = 0;
FAutoConsoleVariableRef ExtraAudioMixerDeviceLogging(
TEXT("au.ExtraAudioMixerDeviceLogging"),
ExtraAudioMixerDeviceLoggingCVar,
TEXT("Enables extra logging for audio mixer device running \n")
TEXT("0: no logging, 1: logging every 500 callbacks \n"),
ECVF_Default);
// Stat definitions for profiling audio mixer
DEFINE_STAT(STAT_AudioMixerRenderAudio);
#Loc: <Workspace>/Engine/Source/Runtime/AudioMixerCore/Private/AudioMixer.cpp:285
Scope (from outer to inner):
file
namespace Audio
function bool FOutputBuffer::MixNextBuffer
Source code excerpt:
static const int32 HeartBeatRate = 500;
if ((ExtraAudioMixerDeviceLoggingCVar > 0) && (++CallCounterMixNextBuffer > HeartBeatRate))
{
UE_LOG(LogAudioMixer, Display, TEXT("FOutputBuffer::MixNextBuffer() called %i times"), HeartBeatRate);
CallCounterMixNextBuffer = 0;
}
return true;
#Loc: <Workspace>/Engine/Source/Runtime/AudioMixerCore/Private/AudioMixer.cpp:431
Scope (from outer to inner):
file
namespace Audio
function void IAudioMixerPlatformInterface::ApplyAttenuationInternal
Source code excerpt:
{
static const int32 HeartBeatRate = 500;
const bool bLog = (ExtraAudioMixerDeviceLoggingCVar > 0) && (++CallCounterApplyAttenuationInternal > HeartBeatRate);
if (bLog)
{
UE_LOG(LogAudioMixer, Display, TEXT("IAudioMixerPlatformInterface::ApplyAttenuationInternal() called %i times"), HeartBeatRate);
CallCounterApplyAttenuationInternal = 0;
}