au.Quartz.MaxSubscribersToUpdatePerTick

au.Quartz.MaxSubscribersToUpdatePerTick

#Overview

name: au.Quartz.MaxSubscribersToUpdatePerTick

This variable is created as a Console Variable (cvar).

It is referenced in 4 C++ source files.

#Summary

#Usage in the C++ source code

The purpose of au.Quartz.MaxSubscribersToUpdatePerTick is to limit the number of Quartz subscribers that can be updated per tick in the audio system of Unreal Engine 5. This setting is part of the audio subsystem, specifically related to the Quartz timing framework.

This setting variable is primarily used in the AudioMixer module, particularly within the Quartz subsystem. It’s referenced in the QuartzSubsystem.cpp file, which suggests it’s an integral part of the Quartz timing system used for audio synchronization and scheduling.

The value of this variable is set through a console variable (CVar) system. It’s initialized with a default value of -1 and can be changed at runtime through console commands or configuration files.

The associated variable MaxQuartzSubscribersToUpdatePerTickCvar directly interacts with au.Quartz.MaxSubscribersToUpdatePerTick. They share the same value, with MaxQuartzSubscribersToUpdatePerTickCvar being the actual int32 variable used in the code logic.

Developers must be aware that:

  1. A value <= 0 means no limit on the number of subscribers updated per tick.
  2. A value >= 1 will limit the number of subscribers updated each tick to that specific value.

Best practices when using this variable include:

  1. Use it to optimize performance by limiting the number of Quartz subscribers updated each frame if needed.
  2. Monitor its impact on audio timing and synchronization when setting a limit.
  3. Consider the trade-off between performance and timing accuracy when adjusting this value.

Regarding the associated variable MaxQuartzSubscribersToUpdatePerTickCvar:

#References in C++ code

#Callsites

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

#Loc: <Workspace>/Engine/Source/Runtime/AudioMixer/Private/Quartz/QuartzSubsystem.cpp:18

Scope: file

Source code excerpt:

static int32 MaxQuartzSubscribersToUpdatePerTickCvar = -1;
FAutoConsoleVariableRef CVarMaxQuartzSubscribersToUpdatePerTick(
	TEXT("au.Quartz.MaxSubscribersToUpdatePerTick"),
	MaxQuartzSubscribersToUpdatePerTickCvar,
	TEXT("Limits the number of Quartz subscribers to update per Tick.\n")
	TEXT("<= 0: No Limit, >= 1: Limit"),
	ECVF_Default);

static int32 SimulateNoAudioDeviceCvar = 0;

#Associated Variable and Callsites

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

#Loc: <Workspace>/Engine/Source/Runtime/AudioMixer/Private/Quartz/QuartzSubsystem.cpp:16

Scope: file

Source code excerpt:

#include UE_INLINE_GENERATED_CPP_BY_NAME(QuartzSubsystem)

static int32 MaxQuartzSubscribersToUpdatePerTickCvar = -1;
FAutoConsoleVariableRef CVarMaxQuartzSubscribersToUpdatePerTick(
	TEXT("au.Quartz.MaxSubscribersToUpdatePerTick"),
	MaxQuartzSubscribersToUpdatePerTickCvar,
	TEXT("Limits the number of Quartz subscribers to update per Tick.\n")
	TEXT("<= 0: No Limit, >= 1: Limit"),
	ECVF_Default);

static int32 SimulateNoAudioDeviceCvar = 0;
FAutoConsoleVariableRef CVarSimulateNoAudioDevice(

#Loc: <Workspace>/Engine/Source/Runtime/AudioMixer/Private/Quartz/QuartzSubsystem.cpp:103

Scope (from outer to inner):

file
function     void FQuartzTickableObjectsManager::Tick

Source code excerpt:

{
	const int32 NumSubscribers = QuartzTickSubscribers.Num();
	if (MaxQuartzSubscribersToUpdatePerTickCvar <= 0 || NumSubscribers <= MaxQuartzSubscribersToUpdatePerTickCvar)
	{
		TArray<FQuartzTickableObject*> SubscribersCopy = QuartzTickSubscribers;

		// we can afford to update ALL subscribers
		for (FQuartzTickableObject* Entry : SubscribersCopy)
		{

#Loc: <Workspace>/Engine/Source/Runtime/AudioMixer/Private/Quartz/QuartzSubsystem.cpp:121

Scope (from outer to inner):

file
function     void FQuartzTickableObjectsManager::Tick

Source code excerpt:

	{
		// only update up to our limit
		for (int i = 0; i < MaxQuartzSubscribersToUpdatePerTickCvar; ++i)
		{
			FQuartzTickableObject* CurrentSubscriber = QuartzTickSubscribers[UpdateIndex];
			if (!ensure(CurrentSubscriber))
			{
				continue;
			}