au.AudioGameplayVolumes.AudioThreadCmdRollback
au.AudioGameplayVolumes.AudioThreadCmdRollback
#Overview
name: au.AudioGameplayVolumes.AudioThreadCmdRollback
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
When non-zero, uses old code to rollback late thread command change.
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of au.AudioGameplayVolumes.AudioThreadCmdRollback is to control the behavior of audio thread command rollback in the Audio Gameplay Volume system. It acts as a flag to determine whether to use old code for rolling back late thread command changes.
This setting variable is primarily used in the Audio Gameplay Volume plugin, which is part of Unreal Engine’s audio system. Specifically, it’s utilized within the AudioGameplayVolumeSubsystem.
The value of this variable is set through the Unreal Engine console variable system. It’s defined as an FAutoConsoleVariableRef, which means it can be modified at runtime through console commands or configuration files.
The associated variable bAudioThreadCmdRollback directly interacts with au.AudioGameplayVolumes.AudioThreadCmdRollback. They share the same value, with bAudioThreadCmdRollback being the actual int32 variable used in the code logic.
Developers must be aware that when this variable is set to a non-zero value, it triggers the use of old code for rolling back late thread command changes. This could potentially affect the behavior and performance of the Audio Gameplay Volume system.
Best practices when using this variable include:
- Understanding the implications of enabling the old rollback code.
- Using it primarily for debugging or compatibility purposes.
- Testing thoroughly when changing its value, as it may impact audio behavior.
Regarding the associated variable bAudioThreadCmdRollback:
The purpose of bAudioThreadCmdRollback is to serve as the actual flag checked in the code to determine whether to use the old rollback code.
It’s used within the AudioGameplayVolumeSubsystem, specifically in the RemoveVolumeComponent function. When bAudioThreadCmdRollback is true (non-zero), it triggers a specific code path for removing volume representations from the audio thread.
The value of bAudioThreadCmdRollback is set through the console variable system, mirroring au.AudioGameplayVolumes.AudioThreadCmdRollback.
Developers should be aware that this variable directly affects the behavior of the RemoveVolumeComponent function and potentially other areas of the Audio Gameplay Volume system.
Best practices include:
- Using this variable in conjunction with au.AudioGameplayVolumes.AudioThreadCmdRollback.
- Being cautious when modifying its value, as it can change core audio behavior.
- Documenting any changes made to this variable for other team members.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Plugins/AudioGameplayVolume/Source/AudioGameplayVolume/Private/AudioGameplayVolumeSubsystem.cpp:46
Scope (from outer to inner):
file
namespace AudioGameplayVolumeConsoleVariables
Source code excerpt:
int32 bAudioThreadCmdRollback = 0;
FAutoConsoleVariableRef CVarAudioThreadCmdRollback(
TEXT("au.AudioGameplayVolumes.AudioThreadCmdRollback"),
bAudioThreadCmdRollback,
TEXT("When non-zero, uses old code to rollback late thread command change."),
ECVF_Default);
} // namespace AudioGameplayVolumeConsoleVariables
#Associated Variable and Callsites
This variable is associated with another variable named bAudioThreadCmdRollback
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Plugins/AudioGameplayVolume/Source/AudioGameplayVolume/Private/AudioGameplayVolumeSubsystem.cpp:44
Scope (from outer to inner):
file
namespace AudioGameplayVolumeConsoleVariables
Source code excerpt:
ECVF_Default);
int32 bAudioThreadCmdRollback = 0;
FAutoConsoleVariableRef CVarAudioThreadCmdRollback(
TEXT("au.AudioGameplayVolumes.AudioThreadCmdRollback"),
bAudioThreadCmdRollback,
TEXT("When non-zero, uses old code to rollback late thread command change."),
ECVF_Default);
} // namespace AudioGameplayVolumeConsoleVariables
void FAudioGameplayActiveSoundInfo::Update(double ListenerInteriorStartTime)
#Loc: <Workspace>/Engine/Plugins/AudioGameplayVolume/Source/AudioGameplayVolume/Private/AudioGameplayVolumeSubsystem.cpp:398
Scope (from outer to inner):
file
function void UAudioGameplayVolumeSubsystem::RemoveVolumeComponent
Source code excerpt:
// Remove representation of volume from audio thread
if (AudioGameplayVolumeConsoleVariables::bAudioThreadCmdRollback)
{
TWeakObjectPtr<UAudioGameplayVolumeSubsystem> WeakThis(this);
FAudioThread::RunCommandOnAudioThread([WeakThis, ComponentID]()
{
if (WeakThis.IsValid())
{