au.BusReaderPatchWaitTimeout

au.BusReaderPatchWaitTimeout

#Overview

name: au.BusReaderPatchWaitTimeout

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.BusReaderPatchWaitTimeout is to set the maximum amount of time the audio bus reader node will wait for its patch output to receive samples in the Metasound system of Unreal Engine 5.

This setting variable is primarily used in the Metasound plugin, which is part of Unreal Engine’s audio system. Specifically, it’s utilized in the MetasoundEngine module, as evident from the file path.

The value of this variable is set using an FAutoConsoleVariableRef, which means it can be adjusted at runtime through console commands. Its default value is 3 seconds.

The associated variable AudioBusReaderNodePatchWaitTimeout directly interacts with au.BusReaderPatchWaitTimeout. They share the same value, with AudioBusReaderNodePatchWaitTimeout being the actual variable used in the code logic.

Developers must be aware that this variable affects the behavior of the audio bus reader node in the Metasound system. It determines how long the node will wait for samples to become available before potentially timing out.

Best practices when using this variable include:

  1. Adjusting the value based on the specific needs of your audio system. A longer timeout might be necessary for more complex audio setups, while a shorter one could improve responsiveness in simpler scenarios.
  2. Monitoring the audio performance to ensure the chosen timeout value doesn’t cause unwanted delays or audio glitches.
  3. Using the console variable for debugging and testing different timeout values without recompiling the code.

Regarding the associated variable AudioBusReaderNodePatchWaitTimeout:

#References in C++ code

#Callsites

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

#Loc: <Workspace>/Engine/Plugins/Runtime/Metasound/Source/MetasoundEngine/Private/MetasoundAudioBusReaderNode.cpp:18

Scope: file

Source code excerpt:

static int32 AudioBusReaderNodePatchWaitTimeout = 3;
FAutoConsoleVariableRef CVarAudioBusReaderNodePatchWaitTimeout(
	TEXT("au.BusReaderPatchWaitTimeout"),
	AudioBusReaderNodePatchWaitTimeout,
	TEXT("The maximum amount of time the audio bus reader node will wait for its patch output to receive samples."),
	ECVF_Default);

namespace Metasound
{

#Associated Variable and Callsites

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

#Loc: <Workspace>/Engine/Plugins/Runtime/Metasound/Source/MetasoundEngine/Private/MetasoundAudioBusReaderNode.cpp:16

Scope: file

Source code excerpt:

#define LOCTEXT_NAMESPACE "MetasoundAudioBusNode"

static int32 AudioBusReaderNodePatchWaitTimeout = 3;
FAutoConsoleVariableRef CVarAudioBusReaderNodePatchWaitTimeout(
	TEXT("au.BusReaderPatchWaitTimeout"),
	AudioBusReaderNodePatchWaitTimeout,
	TEXT("The maximum amount of time the audio bus reader node will wait for its patch output to receive samples."),
	ECVF_Default);

namespace Metasound
{
	namespace AudioBusReaderNode

#Loc: <Workspace>/Engine/Plugins/Runtime/Metasound/Source/MetasoundEngine/Private/MetasoundAudioBusReaderNode.cpp:192

Scope (from outer to inner):

file
namespace    Metasound
class        class TAudioBusReaderOperator : public TExecutableOperator<TAudioBusReaderOperator<NumChannels>>
function     void Execute

Source code excerpt:

			{
				// Give input patch samples some time to arrive.
				if (AudioBusPatchOutput->WaitUntilNumSamplesAvailable(NumSamplesToPop, uint32(AudioBusReaderNodePatchWaitTimeout)))
				{
					bPerformPop = true;
				}
			}

			if (bPerformPop)