au.streamcaching.MaxCachesToDisplay

au.streamcaching.MaxCachesToDisplay

#Overview

name: au.streamcaching.MaxCachesToDisplay

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.streamcaching.MaxCachesToDisplay is to control the maximum number of audio stream chunks that can be displayed on screen for debugging purposes.

This setting variable is primarily used in the audio streaming system of Unreal Engine. It is referenced in the Engine module, specifically in the AudioStreamingCache.cpp file, which is part of the audio streaming subsystem.

The value of this variable is set through a console variable (CVar) using the FAutoConsoleVariableRef mechanism. It is initialized with a default value of 128.

The associated variable DebugMaxElementsDisplayCVar directly interacts with au.streamcaching.MaxCachesToDisplay. They share the same value, with DebugMaxElementsDisplayCVar being the actual integer variable used in the code to limit the number of displayed elements.

Developers should be aware that this variable is primarily for debugging purposes. It affects the visual output of audio streaming cache information and does not directly impact the runtime performance or behavior of the audio system.

Best practices when using this variable include:

  1. Adjusting the value as needed during debugging sessions to get a comprehensive view of the audio streaming cache without overwhelming the display.
  2. Setting it to a lower value if performance is impacted when displaying a large number of cache elements.
  3. Remembering to reset it to the default value (128) or disable debug display altogether in production builds.

Regarding the associated variable DebugMaxElementsDisplayCVar:

#References in C++ code

#Callsites

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

#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/AudioStreamingCache.cpp:18

Scope: file

Source code excerpt:

static int32 DebugMaxElementsDisplayCVar = 128;
FAutoConsoleVariableRef CVarDebugDisplayCaches(
	TEXT("au.streamcaching.MaxCachesToDisplay"),
	DebugMaxElementsDisplayCVar,
	TEXT("Sets the max amount of stream chunks to display on screen.\n")
	TEXT("n: Number of elements to display on screen."),
	ECVF_Default);

static int32 KeepCacheMissBufferOnFlushCVar = 1;

#Associated Variable and Callsites

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

#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/AudioStreamingCache.cpp:16

Scope: file

Source code excerpt:

DEFINE_LOG_CATEGORY(LogAudioStreamCaching);

static int32 DebugMaxElementsDisplayCVar = 128;
FAutoConsoleVariableRef CVarDebugDisplayCaches(
	TEXT("au.streamcaching.MaxCachesToDisplay"),
	DebugMaxElementsDisplayCVar,
	TEXT("Sets the max amount of stream chunks to display on screen.\n")
	TEXT("n: Number of elements to display on screen."),
	ECVF_Default);

static int32 KeepCacheMissBufferOnFlushCVar = 1;
FAutoConsoleVariableRef CVarKeepCacheMissBufferOnFlush(

#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/AudioStreamingCache.cpp:2166

Scope (from outer to inner):

file
function     TPair<int, int> FAudioChunkCache::DebugDisplayLegacy

Source code excerpt:

	{
		// We use a CVar to clamp the max amount of chunks we display.
		if (Index > DebugMaxElementsDisplayCVar)
		{
			break;
		}

		int32 NumTotalChunks = -1;
		int32 NumTimesTouched = -1;