au.streamcaching.ReadRequestPriority

au.streamcaching.ReadRequestPriority

#Overview

name: au.streamcaching.ReadRequestPriority

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.ReadRequestPriority is to set the default request priority for audio chunks when Stream Caching is turned on in Unreal Engine’s audio system.

This setting variable is primarily used by the audio streaming subsystem within Unreal Engine. Based on the callsites, it appears to be part of the Engine module, specifically within the audio streaming cache functionality.

The value of this variable is set through a console variable (CVar) system. It’s initialized with a default value of 1, which corresponds to “Normal” priority. The value can be changed at runtime using console commands or through configuration files.

The associated variable ReadRequestPriorityCVar directly interacts with au.streamcaching.ReadRequestPriority. They share the same value, with ReadRequestPriorityCVar being the actual integer storage for the priority level.

Developers must be aware that this variable affects the prioritization of audio chunk loading. It offers five levels of priority: 0: High 1: Normal (default) 2: Below Normal 3: Low 4: Min

When using this variable, developers should consider the following best practices:

  1. Adjust the priority based on the specific needs of their game’s audio system.
  2. Be cautious about setting all audio to high priority, as it may impact overall system performance.
  3. Use lower priorities for less critical audio assets to ensure important audio is loaded first.
  4. Monitor performance and adjust as necessary during development and testing.

Regarding the associated variable ReadRequestPriorityCVar:

The purpose of ReadRequestPriorityCVar is to serve as the actual storage for the priority value set by au.streamcaching.ReadRequestPriority.

This variable is used within the Engine module, specifically in the audio streaming cache system. It’s directly accessed in the GetAsyncPriorityForChunk function to determine the appropriate priority for audio chunk loading.

The value of ReadRequestPriorityCVar is set through the CVar system, mirroring the value of au.streamcaching.ReadRequestPriority.

ReadRequestPriorityCVar interacts directly with au.streamcaching.ReadRequestPriority, essentially serving as its backing store.

Developers should be aware that modifying ReadRequestPriorityCVar directly (if possible) would have the same effect as changing au.streamcaching.ReadRequestPriority. However, it’s best practice to use the CVar system (au.streamcaching.ReadRequestPriority) for changing this value to ensure proper synchronization and maintain consistency with engine conventions.

Best practices for ReadRequestPriorityCVar are the same as those for au.streamcaching.ReadRequestPriority, as they are effectively the same setting from the perspective of the audio system.

#References in C++ code

#Callsites

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

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

Scope: file

Source code excerpt:

static int32 ReadRequestPriorityCVar = 1;
FAutoConsoleVariableRef CVarReadRequestPriority(
	TEXT("au.streamcaching.ReadRequestPriority"),
	ReadRequestPriorityCVar,
	TEXT("This cvar sets the default request priority for audio chunks when Stream Caching is turned on.\n")
	TEXT("0: High, 1: Normal, 2: Below Normal, 3: Low, 4: Min"),
	ECVF_Default);

static int32 PlaybackRequestPriorityCVar = 0;

#Associated Variable and Callsites

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

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

Scope: file

Source code excerpt:

	ECVF_Default);

static int32 ReadRequestPriorityCVar = 1;
FAutoConsoleVariableRef CVarReadRequestPriority(
	TEXT("au.streamcaching.ReadRequestPriority"),
	ReadRequestPriorityCVar,
	TEXT("This cvar sets the default request priority for audio chunks when Stream Caching is turned on.\n")
	TEXT("0: High, 1: Normal, 2: Below Normal, 3: Low, 4: Min"),
	ECVF_Default);

static int32 PlaybackRequestPriorityCVar = 0;
FAutoConsoleVariableRef CVarPlaybackRequestPriority(

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

Scope (from outer to inner):

file
function     EAsyncIOPriorityAndFlags FAudioChunkCache::GetAsyncPriorityForChunk

Source code excerpt:

	else
	{
		switch (ReadRequestPriorityCVar)
		{
		case 4:
		{
			return AIOP_MIN;
		}
		case 3: