au.UseCachedDeviceInfoCache
au.UseCachedDeviceInfoCache
#Overview
name: au.UseCachedDeviceInfoCache
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
Uses a Cache of the DeviceCache instead of asking the OS0 off, 1 on
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of au.UseCachedDeviceInfoCache is to control whether the audio system should use a cached version of device information instead of querying the operating system directly.
This setting variable is primarily used in the audio mixer system of Unreal Engine. It is referenced in the AudioMixerCore module, specifically in the AudioMixer.cpp file.
The value of this variable is set using a console variable (CVar) system. It is initialized to 1 (enabled) by default but can be changed at runtime through the console or configuration files.
The au.UseCachedDeviceInfoCache variable interacts directly with the bUseAudioDeviceInfoCacheCVar variable. They share the same value, with bUseAudioDeviceInfoCacheCVar being the actual variable used in the code logic.
Developers must be aware that this setting is platform-specific. The code shows that it’s only effective on the Windows platform. On other platforms, the caching behavior is always disabled.
Best practices when using this variable include:
- Consider the trade-offs between performance and up-to-date information. Caching can improve performance but might not reflect real-time changes in audio devices.
- Test thoroughly on Windows platforms to ensure desired behavior.
- Be aware that changing this setting at runtime may affect audio device detection and handling.
Regarding the associated variable bUseAudioDeviceInfoCacheCVar:
The purpose of bUseAudioDeviceInfoCacheCVar is to serve as the actual boolean flag used in the code to determine whether to use the device info cache.
This variable is used in the IAudioMixer::ShouldUseDeviceInfoCache() function, which is likely called by various parts of the audio system to determine whether to use cached device information.
The value of bUseAudioDeviceInfoCacheCVar is set by the au.UseCachedDeviceInfoCache console variable. It’s initialized to 1 (true) by default.
Developers should be aware that this variable directly affects the behavior of the audio mixer system on Windows platforms. Changes to au.UseCachedDeviceInfoCache will be reflected in bUseAudioDeviceInfoCacheCVar.
Best practices include:
- Use the console variable au.UseCachedDeviceInfoCache to modify this setting, rather than trying to change bUseAudioDeviceInfoCacheCVar directly.
- When debugging audio device issues on Windows, consider the value of this variable and its impact on device detection and information retrieval.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Runtime/AudioMixerCore/Private/AudioMixer.cpp:90
Scope: file
Source code excerpt:
static int32 bUseAudioDeviceInfoCacheCVar = 1;
FAutoConsoleVariableRef CVarUseAudioDeviceInfoCache(
TEXT("au.UseCachedDeviceInfoCache"),
bUseAudioDeviceInfoCacheCVar,
TEXT("Uses a Cache of the DeviceCache instead of asking the OS")
TEXT("0 off, 1 on"),
ECVF_Default);
static int32 bRecycleThreadsCVar = 1;
#Associated Variable and Callsites
This variable is associated with another variable named bUseAudioDeviceInfoCacheCVar
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/AudioMixerCore/Private/AudioMixer.cpp:88
Scope: file
Source code excerpt:
ECVF_Default);
static int32 bUseAudioDeviceInfoCacheCVar = 1;
FAutoConsoleVariableRef CVarUseAudioDeviceInfoCache(
TEXT("au.UseCachedDeviceInfoCache"),
bUseAudioDeviceInfoCacheCVar,
TEXT("Uses a Cache of the DeviceCache instead of asking the OS")
TEXT("0 off, 1 on"),
ECVF_Default);
static int32 bRecycleThreadsCVar = 1;
FAutoConsoleVariableRef CVarRecycleThreads(
#Loc: <Workspace>/Engine/Source/Runtime/AudioMixerCore/Private/AudioMixer.cpp:907
Scope (from outer to inner):
file
namespace Audio
function bool IAudioMixer::ShouldUseDeviceInfoCache
Source code excerpt:
{
#if PLATFORM_WINDOWS
return bUseAudioDeviceInfoCacheCVar != 0;
#else //PLATFORM_WINDOWS
return false;
#endif //PLATFORM_WINDOWS
}
bool IAudioMixer::ShouldRecycleThreads()