au.streamcaching.ChunkSlotNumScalar
au.streamcaching.ChunkSlotNumScalar
#Overview
name: au.streamcaching.ChunkSlotNumScalar
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
This allows scaling the number of chunk slots pre-allocated.\n1.0: is the lower limit
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of au.streamcaching.ChunkSlotNumScalar is to allow scaling of the number of chunk slots pre-allocated in the audio streaming system of Unreal Engine 5. This setting variable is primarily used for fine-tuning the audio streaming cache behavior.
This setting variable is utilized by the audio streaming subsystem within the Engine module of Unreal Engine 5. Specifically, it’s used in the audio compression settings and caching system.
The value of this variable is set through the Unreal Engine console variable system. It’s declared as an FAutoConsoleVariableRef, which means it can be adjusted at runtime through console commands or configuration files.
The associated variable ChunkSlotNumScalarCvar interacts directly with au.streamcaching.ChunkSlotNumScalar. They share the same value, with ChunkSlotNumScalarCvar being the actual float variable used in the code.
Developers must be aware that this variable has a lower limit of 1.0. Values below 1.0 will be clamped to 1.0 when used in calculations, as seen in the code: FMath::Max(ChunkSlotNumScalarCvar, 1.0f).
Best practices when using this variable include:
- Only adjust it if you have a specific need to modify the audio streaming cache behavior.
- Monitor performance impacts when changing this value, as it directly affects memory allocation for audio streaming.
- Consider platform-specific requirements when adjusting this value, as audio streaming needs may vary across different devices.
Regarding the associated variable ChunkSlotNumScalarCvar:
The purpose of ChunkSlotNumScalarCvar is to store the actual float value that represents the scaling factor for chunk slots in the audio streaming system.
It’s used directly in the Engine module, specifically in the audio compression and streaming management systems.
The value of ChunkSlotNumScalarCvar is set initially to 1.0f and can be modified through the console variable system using the au.streamcaching.ChunkSlotNumScalar command.
This variable interacts directly with calculations in the FCachedAudioStreamingManagerParams::BuildCachedStreamingManagerParams function, where it’s used to determine the number of elements in the audio streaming cache.
Developers should be aware that this variable directly impacts memory allocation for audio streaming. Increasing its value will result in more pre-allocated chunk slots, which could improve streaming performance but increase memory usage.
Best practices for ChunkSlotNumScalarCvar include:
- Monitor its impact on both audio streaming performance and memory usage when adjusting.
- Consider platform limitations, especially on memory-constrained devices.
- Use in conjunction with other audio streaming settings for optimal performance tuning.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/AudioCompressionSettingsUtils.cpp:45
Scope: file
Source code excerpt:
static float ChunkSlotNumScalarCvar = 1.0f;
FAutoConsoleVariableRef CVarChunkSlotNumScalar(
TEXT("au.streamcaching.ChunkSlotNumScalar"),
ChunkSlotNumScalarCvar,
TEXT("This allows scaling the number of chunk slots pre-allocated.\n")
TEXT("1.0: is the lower limit"),
ECVF_Default);
const FPlatformRuntimeAudioCompressionOverrides* FPlatformCompressionUtilities::GetRuntimeCompressionOverridesForCurrentPlatform()
#Associated Variable and Callsites
This variable is associated with another variable named ChunkSlotNumScalarCvar
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/AudioCompressionSettingsUtils.cpp:43
Scope: file
Source code excerpt:
ECVF_Default);
static float ChunkSlotNumScalarCvar = 1.0f;
FAutoConsoleVariableRef CVarChunkSlotNumScalar(
TEXT("au.streamcaching.ChunkSlotNumScalar"),
ChunkSlotNumScalarCvar,
TEXT("This allows scaling the number of chunk slots pre-allocated.\n")
TEXT("1.0: is the lower limit"),
ECVF_Default);
const FPlatformRuntimeAudioCompressionOverrides* FPlatformCompressionUtilities::GetRuntimeCompressionOverridesForCurrentPlatform()
{
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/AudioCompressionSettingsUtils.cpp:351
Scope (from outer to inner):
file
function FCachedAudioStreamingManagerParams FPlatformCompressionUtilities::BuildCachedStreamingManagerParams
Source code excerpt:
int32 MinChunkSize = (1.0f - MinimumCacheUsage) * MaxChunkSize;
uint64 TempNumElements = ((CacheSettings.CacheSizeKB * 1024) / MinChunkSize) * FMath::Max(ChunkSlotNumScalarCvar, 1.0f);
int32 NumElements = FMath::Min(TempNumElements, static_cast<uint64>(TNumericLimits< int32 >::Max()));
FCachedAudioStreamingManagerParams Params;
FCachedAudioStreamingManagerParams::FCacheDimensions CacheDimensions;
// Primary cache defined here: