au.streamcaching.AlwaysLogCacheMisses
au.streamcaching.AlwaysLogCacheMisses
#Overview
name: au.streamcaching.AlwaysLogCacheMisses
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
When set to a nonzero value, all cache misses will be added to the audiomemreport.\n0: Don\'t log cache misses until au.streamcaching.StartProfiling is called. 1: Always log cache misses.
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of au.streamcaching.AlwaysLogCacheMisses is to control the logging behavior of cache misses in the audio streaming system. This setting variable is part of the audio streaming cache subsystem in Unreal Engine 5.
The Unreal Engine subsystem that relies on this setting variable is the audio streaming cache, which is part of the Engine module. This can be inferred from the file location (Engine/Source/Runtime/Engine/Private/AudioStreamingCache.cpp) where the variable is defined and used.
The value of this variable is set through the Unreal Engine console variable system. It is declared as an FAutoConsoleVariableRef, which means it can be modified at runtime through console commands or configuration files.
This variable interacts with another variable named AlwaysLogCacheMissesCVar. They share the same value, with AlwaysLogCacheMissesCVar being the actual integer storage for the console variable.
Developers must be aware that when this variable is set to a non-zero value, all cache misses in the audio streaming system will be logged and added to the audio memory report. This can be useful for debugging and profiling purposes, but may impact performance if left enabled in a production build.
Best practices when using this variable include:
- Use it primarily for debugging and profiling purposes.
- Disable it (set to 0) in production builds to avoid unnecessary logging overhead.
- Use in conjunction with other audio profiling tools to get a comprehensive view of the audio streaming system’s performance.
Regarding the associated variable AlwaysLogCacheMissesCVar:
The purpose of AlwaysLogCacheMissesCVar is to store the actual integer value of the au.streamcaching.AlwaysLogCacheMisses console variable. It is used internally by the audio streaming cache system to determine whether to log cache misses.
This variable is part of the audio streaming cache subsystem in the Engine module.
The value of AlwaysLogCacheMissesCVar is set indirectly through the au.streamcaching.AlwaysLogCacheMisses console variable. When the console variable is modified, this associated variable’s value is updated automatically.
AlwaysLogCacheMissesCVar interacts directly with the au.streamcaching.AlwaysLogCacheMisses console variable and is used in the code to determine logging behavior.
Developers should be aware that this variable is internal to the audio streaming cache system and should not be modified directly. Instead, they should use the au.streamcaching.AlwaysLogCacheMisses console variable to control the logging behavior.
Best practices for AlwaysLogCacheMissesCVar include:
- Do not modify this variable directly in code.
- Use the au.streamcaching.AlwaysLogCacheMisses console variable to control its value.
- When reading this variable in code, be aware that its value can change at runtime if the console variable is modified.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/AudioStreamingCache.cpp:48
Scope: file
Source code excerpt:
static int32 AlwaysLogCacheMissesCVar = 0;
FAutoConsoleVariableRef CVarAlwaysLogCacheMisses(
TEXT("au.streamcaching.AlwaysLogCacheMisses"),
AlwaysLogCacheMissesCVar,
TEXT("When set to a nonzero value, all cache misses will be added to the audiomemreport.\n")
TEXT("0: Don't log cache misses until au.streamcaching.StartProfiling is called. 1: Always log cache misses."),
ECVF_Default);
static int32 ReadRequestPriorityCVar = 1;
#Associated Variable and Callsites
This variable is associated with another variable named AlwaysLogCacheMissesCVar
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/AudioStreamingCache.cpp:46
Scope: file
Source code excerpt:
ECVF_Default);
static int32 AlwaysLogCacheMissesCVar = 0;
FAutoConsoleVariableRef CVarAlwaysLogCacheMisses(
TEXT("au.streamcaching.AlwaysLogCacheMisses"),
AlwaysLogCacheMissesCVar,
TEXT("When set to a nonzero value, all cache misses will be added to the audiomemreport.\n")
TEXT("0: Don't log cache misses until au.streamcaching.StartProfiling is called. 1: Always log cache misses."),
ECVF_Default);
static int32 ReadRequestPriorityCVar = 1;
FAutoConsoleVariableRef CVarReadRequestPriority(
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/AudioStreamingCache.cpp:841
Scope (from outer to inner):
file
function uint64 FAudioChunkCache::AddOrTouchChunk
Source code excerpt:
KickOffAsyncLoad(CacheElement, InKey, OnLoadCompleted, CallbackThread, bNeededForPlayback);
if (bNeededForPlayback && (bLogCacheMisses || AlwaysLogCacheMissesCVar))
{
// We missed
const uint32 TotalNumChunksInWave = CacheElement->GetNumChunks();
FCacheMissInfo CacheMissInfo = { InKey.SoundWaveName, InKey.ChunkIndex, TotalNumChunksInWave, false };
CacheMissQueue.Enqueue(MoveTemp(CacheMissInfo));