au.NeverMuteNonRealtimeAudioDevices

au.NeverMuteNonRealtimeAudioDevices

#Overview

name: au.NeverMuteNonRealtimeAudioDevices

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

It is referenced in 7 C++ source files.

#Summary

#Usage in the C++ source code

The purpose of au.NeverMuteNonRealtimeAudioDevices is to control the muting behavior of non-realtime audio devices in Unreal Engine 5. It is primarily used in the audio system to manage audio playback in different scenarios, such as when a window goes out of focus.

This setting variable is mainly relied upon by the Unreal Engine’s audio subsystem, specifically within the AudioDeviceManager. It’s also used in the MovieRenderPipeline plugin, which is part of the cinematic rendering system.

The value of this variable is set through the console variable system. It can be set programmatically or through the console. By default, it’s initialized to 0.

The associated variable GCVarNeverMuteNonRealtimeAudioDevices interacts directly with au.NeverMuteNonRealtimeAudioDevices. They share the same value, with GCVarNeverMuteNonRealtimeAudioDevices being the actual storage for the setting.

Developers must be aware that:

  1. This variable affects the behavior of non-realtime audio devices, which could impact audio playback in certain scenarios.
  2. It’s particularly important for cinematic rendering, as evidenced by its use in the MovieRenderPipeline plugin.
  3. Changing this value can affect the user experience, especially in situations where the application window loses focus.

Best practices when using this variable include:

  1. Consider the implications on user experience before changing its value.
  2. When using the MovieRenderPipeline, be aware that this setting is automatically managed to ensure consistent audio behavior during rendering.
  3. If you need to change this value for a specific operation, remember to restore it to its previous state afterwards.

Regarding the associated variable GCVarNeverMuteNonRealtimeAudioDevices:

#References in C++ code

#Callsites

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

#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/AudioDeviceManager.cpp:55

Scope: file

Source code excerpt:

static int32 GCVarNeverMuteNonRealtimeAudioDevices = 0;
FAutoConsoleVariableRef CVarNeverMuteNonRealtimeAudioDevices(
	TEXT("au.NeverMuteNonRealtimeAudioDevices"),
	GCVarNeverMuteNonRealtimeAudioDevices,
	TEXT("When set to 1, nonrealtime audio devices will be exempt from normal audio device muting (for example, when a window goes out of focus.\n")
	TEXT("0: Not Disabled, 1: Disabled"),
	ECVF_Default);

static FAutoConsoleCommand GReportAudioDevicesCommand(

#Loc: <Workspace>/Engine/Plugins/MovieScene/MovieRenderPipeline/Source/MovieRenderPipelineCore/Private/Graph/MovieGraphDefaultAudioRenderer.cpp:152

Scope (from outer to inner):

file
function     void UMovieGraphDefaultAudioRenderer::SetupAudioRendering

Source code excerpt:


	// Ensure that the NRT audio doesn't get muted
	if (IConsoleVariable* NeverMuteNRTAudioCvar = IConsoleManager::Get().FindConsoleVariable(TEXT("au.NeverMuteNonRealtimeAudioDevices")))
	{
		AudioState.PrevNeverMuteNRTAudioValue = NeverMuteNRTAudioCvar->GetInt();
		
		NeverMuteNRTAudioCvar->SetWithCurrentPriority(1);
	}
}

#Loc: <Workspace>/Engine/Plugins/MovieScene/MovieRenderPipeline/Source/MovieRenderPipelineCore/Private/Graph/MovieGraphDefaultAudioRenderer.cpp:173

Scope (from outer to inner):

file
function     void UMovieGraphDefaultAudioRenderer::TeardownAudioRendering

Source code excerpt:

	}

	if (IConsoleVariable* NeverMuteNRTAudioCvar = IConsoleManager::Get().FindConsoleVariable(TEXT("au.NeverMuteNonRealtimeAudioDevices")))
	{
		NeverMuteNRTAudioCvar->Set(AudioState.PrevNeverMuteNRTAudioValue, ECVF_SetByConstructor);
	}
}

#Loc: <Workspace>/Engine/Plugins/MovieScene/MovieRenderPipeline/Source/MovieRenderPipelineCore/Private/MoviePipelineGameOverrideSetting.cpp:114

Scope (from outer to inner):

file
function     void UMoviePipelineGameOverrideSetting::ApplyCVarSettings

Source code excerpt:

	}

	MOVIEPIPELINE_STORE_AND_OVERRIDE_CVAR_INT(PreviousNeverMuteNonRealtimeAudio, TEXT("au.NeverMuteNonRealtimeAudioDevices"), 1, bOverrideValues);

	// To make sure that the skylight is always valid and consistent accross capture sessions, we enforce a full capture each frame, accepting a small GPU cost.
	MOVIEPIPELINE_STORE_AND_OVERRIDE_CVAR_INT(PreviousSkyLightRealTimeReflectionCaptureTimeSlice, TEXT("r.SkyLight.RealTimeReflectionCapture.TimeSlice"), 0, bOverrideValues);

	// Cloud are rendered using high quality volumetric render target mode 3: per pixel tracing and composition on screen, while supporting cloud on translucent.
	MOVIEPIPELINE_STORE_AND_OVERRIDE_CVAR_INT(PreviousVolumetricRenderTarget, TEXT("r.VolumetricRenderTarget"), 1, bOverrideValues);

#Loc: <Workspace>/Engine/Plugins/MovieScene/MovieRenderPipeline/Source/MovieRenderPipelineCore/Private/MoviePipelineGameOverrideSetting.cpp:236

Scope (from outer to inner):

file
function     void UMoviePipelineGameOverrideSetting::BuildNewProcessCommandLineArgsImpl

Source code excerpt:

	}

	InOutDeviceProfileCvars.Add(FString::Printf(TEXT("au.NeverMuteNonRealtimeAudioDevices=%d"), 1));
	InOutDeviceProfileCvars.Add(FString::Printf(TEXT("r.SkyLight.RealTimeReflectionCapture.TimeSlice=%d"), 0));
	InOutDeviceProfileCvars.Add(FString::Printf(TEXT("r.VolumetricRenderTarget=%d"), 1));
	InOutDeviceProfileCvars.Add(FString::Printf(TEXT("r.VolumetricRenderTarget.Mode=%d"), 3));
	InOutDeviceProfileCvars.Add(FString::Printf(TEXT("wp.Runtime.BlockOnSlowStreaming=%d"), 0));
	InOutDeviceProfileCvars.Add(FString::Printf(TEXT("p.Chaos.ImmPhys.MinStepTime=%d"), 0));
	InOutDeviceProfileCvars.Add(FString::Printf(TEXT("r.SkipRedundantTransformUpdate=%d"), 0));

#Associated Variable and Callsites

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

#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/AudioDeviceManager.cpp:53

Scope: file

Source code excerpt:

	ECVF_Default);

static int32 GCVarNeverMuteNonRealtimeAudioDevices = 0;
FAutoConsoleVariableRef CVarNeverMuteNonRealtimeAudioDevices(
	TEXT("au.NeverMuteNonRealtimeAudioDevices"),
	GCVarNeverMuteNonRealtimeAudioDevices,
	TEXT("When set to 1, nonrealtime audio devices will be exempt from normal audio device muting (for example, when a window goes out of focus.\n")
	TEXT("0: Not Disabled, 1: Disabled"),
	ECVF_Default);

static FAutoConsoleCommand GReportAudioDevicesCommand(
	TEXT("au.ReportAudioDevices"),

#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/AudioDeviceManager.cpp:1129

Scope (from outer to inner):

file
function     bool FAudioDeviceManager::IsAlwaysPlayNonRealtimeDeviceAudio

Source code excerpt:

bool FAudioDeviceManager::IsAlwaysPlayNonRealtimeDeviceAudio() const
{
	return GCVarNeverMuteNonRealtimeAudioDevices != 0;
}

bool FAudioDeviceManager::IsVisualizeDebug3dEnabled() const
{
#if ENABLE_AUDIO_DEBUG
	return GetDebugger().IsVisualizeDebug3dEnabled() || CVarIsVisualizeEnabled;