Commit Graph

50 Commits

Author SHA1 Message Date
Marc Audy
b2d9e2e11d Copying //UE4/Dev-Framework to //UE4/Main @ 2775446
#lockdown Nick.Penwarden

==========================
MAJOR FEATURES + CHANGES
==========================

Change 2720537 on 2015/10/07 by Aaron.McLeran

	Audio Optimization: Implementing an audio update delta time so audio isn't updated with every engine tick

Change 2746582 on 2015/10/29 by Aaron.McLeran

	Implementing single ray-cast sound occlusion

	- Fixing/Implementing sound occlusion using one ray cast
	- Update rate of the ray cast is conifgurable by the user
	- User can enabled/disable occlusion and set various properties of the occlusion at the audio component level
	- Occlusion ray-casts are made at a slower rate than the audio engine is updated
	- The following properties are supported:
	    * LowPassFilterFrequency (the LPF cutoff frequency of the per-voice filter to apply if a sound is occluded)
	    * OcclusionVolumeAttenuation (the volume attenuation to apply to sounds that are occluded)
	    * OcclusionInterpolationTime (how fast a sound moves from occluded to unoccluded... allows user-defined interpolation times, avoids fast parameter setting for smoother transitions)

	- Fixed how low-pass filter frequency is applied on platforms that support it.
	    * Changed the older HighFrequencyGain parameter to a more understandable and correct LowPassFilterFrequency parameter
	    * Updated the parameter for the various other features that use per-voice LPF (e.g. audio volumes, distance-based filtering)
	    * Added backward-compatibility code to take old HighFrequencyGain params to new LowPassFilterFrequency params.
	    * At the lowest level, there is only one filter which is applied to a sound, but the parameter that has the lowest cutoff frequency is the one used
	    * Fixed how the parameter is applied at the lower-level in XAudio2 and CoreAudio. The old parameter was incorrectly applied.
	    * XAudio2 documentation on the low-pass-fitler frequency cutoff param is confirmed incorrect through testing.

	#rb zak.middleton

Change 2765174 on 2015/11/12 by Aaron.McLeran

	UE-23091 More fixage for NaN audio log spam

	Last checkin for this (CL 2760896) was fixing a legit issue but there was still an issue that I was rarely catching during the FN gate encounter in AITestbed after about 5 min of gate defense.

	To track down, I added a lot more logging and asserts on NaN numbers in the audio code, enabled ENABLE_NAN_DIAGNOSTIC in UnrealMathUtility.h.

	- Was able to trace another cause of the NaNs in audio to 2 uninitialized variables in SoundAttenuationSettings struct: OmniRadius and StereoSpread.
	- Zak M suggested the change of the const ref position vector in ListenerPosition and the usage of GetSafeNormal() in Audio.cpp since the value returned by GetLocation() is a temporary and Normalize() is unsafe.
	- I removed the flag for the XAudio2 call to compute doppler since we don't use that value and it could've been as source of more NaNs in X3DAudioCalculate

	#codereview Zak.Middleton
	#rb Zak.Middleton

Change 2765467 on 2015/11/13 by James.Golding

	- Allow -ms option to work with 'stat dumphitches' for controlling min time logged
	#rb gil.gribb

Change 2765746 on 2015/11/13 by Benn.Gallagher

	Added buckets for update rate shift tags (for staggering anim updates)
	#jira UE-23213
	#rb Bruce.Nesbit

Change 2765747 on 2015/11/13 by Benn.Gallagher

	Fixes for bone length calculation in anim dynamics chains.
	#rb Bruce.Nesbit

Change 2765749 on 2015/11/13 by Benn.Gallagher

	Removed allocations from local CS blends for skeletal controls.
	#rb Bruce.Nesbit

Change 2765752 on 2015/11/13 by Benn.Gallagher

	Lod mapping support for URO customization
	#jira UE-23211
	#rb Bruce.Nesbit

Change 2765965 on 2015/11/13 by Marc.Audy

	Remove outdated code in LoadMap previously used for matching up downloaded packages from servers. These code paths no longer operate, but in the case where a PIE client was connecting to a non-PIE server (not really supported, but possible), it would cause the Editor Level package to be flagged as as PIE package and cause a crash on exit of PIE
	#jira UE-21181
	#rb Josh.Markiewicz

Change 2766071 on 2015/11/13 by Mieszko.Zielinski

	Fixed dumb mistake in AEQSTestingPawn::PostLoad #UE4

	the 'bTickDuringGame == bTickDuringGame' thing

	#rb John.Abercrombie

Change 2766086 on 2015/11/13 by Mieszko.Zielinski

	Exposing NavModifierComponent to ENGINE_API #UE4

	#codereview Lukasz.Furman

Change 2766345 on 2015/11/13 by Mieszko.Zielinski

	No longer compiling AISystem's creation out from client builds #UE4

	Instead AISystem's instantiation on clients is configurable via UAISystemBase::bInstantiateAISystemOnClient config variable

Change 2766346 on 2015/11/13 by Mieszko.Zielinski

	Improvements to EQS test scoring function preview #UE4

	#rb Lukasz.Furman

Change 2766528 on 2015/11/13 by Stan.Melax

	multiple materials/chunks on a single cloth sim mesh

	This supposedly used to work in 4.7 but broke for 4.8
	It looks like previous change 2493547  may have introduced the condition statement that makes multiple materials not include all of there verts.

	Changing this to instead check for the bounds on the skinningmap instead of the NumRealSimVerts which doesn't look like it takes the offset into consideration.

	jira:
	#UE-23300

	https://jira.ol.epicgames.net/browse/UE-23300

	https://answers.unrealengine.com/questions/287833/apex-not-working-on-multiple-materials-since-48.html

	Double tested code change with test asset from https://jira.ol.epicgames.net/browse/UE-10674

	#rb  Benn.Gallagher

Change 2766546 on 2015/11/13 by Marc.Audy

	Throw warning for orphaned looping sounds caused by a looping sound node
	Don't do somewhat expensive (due to weak pointer) orphaned sound checks in test or shipping
	#rb Aaron.McLeran

Change 2766917 on 2015/11/14 by Jurre.deBaare

	Fix UE4-23349 Simplygon doens't support sub 64 pixel textures

Change 2767742 on 2015/11/16 by Marc.Audy

	Restructure SignificanceManager to store significance manager references in a FGCObject Module class instead of using a singleton.
	Improve performance by eliminating StaticFindObjectFast calls in ::Get and force inlining Get calls
	#rb Zak.Middleton, Rob.Manuszewski

Change 2767827 on 2015/11/16 by Zak.Middleton

	#ue4 - Perf: avoid SmoothClientPosition() calls once the target mesh offset has been reached.

	- New flag bNetworkSmoothingComplete indicates whether smoothing has reached the destination. This is set to false when a new network position is received.
	- Also fixes trying to smooth rotation towards identity rotation before receiving network updates.
	- Deprecated FNetworkPredictionData_Client_Character::CurrentSmoothTime in favor of saving last update time, to prevent needing to update time every tick (since we skip updates now).

	#rb Dan.Youhon

Change 2768070 on 2015/11/16 by Marc.Audy

	Change StaticDuplicateObject and DuplicateObject to take FName instead of char* (existing usages can automatically convert to FName so no backwards compatibility issues)
	Fixup usages to avoid unnecessary string -> char* -> name conversions
	Change AActor::CreateComponentFromTemplate to take an FName instead of FString, deprecated FString version
	#rb Gil.Gribb

Change 2768121 on 2015/11/16 by Marc.Audy

	Forceinline GetFName

Change 2768161 on 2015/11/16 by Aaron.McLeran

	Checking occlusion back in

	- Bug was due to improper interpolation of LPFFrequency values in audio volumes.

Change 2769428 on 2015/11/17 by Thomas.Sarkanen

	Fixed backwards-compatibility issues with FExposedValueCopyRecord

	Added PostSerialize function to patch up older data to the new format (copies properties->property FNames).
	Made sure to zero FExposedValueCopyRecord in its constructor, prevents uninitialized variable issues when generating CRCs. This is necessary despite these members being UPROPERTYs because they are simply built on the stack then stuffed into the new CDO during compilation.

	UE-23268 - EDITOR CRASH: Assertion failed: ((UObject*)ContainerPtr)->IsA((UClass*)GetOuter())

	#rb James.Golding
	#codereview Mike.Beach,Bob.Tellez

Change 2769488 on 2015/11/17 by Benn.Gallagher

	DrawCanvas and debug string support for skeletal controls - accessed using "Skeletal Controls" option in Show->Display Info in Persona
	#rb Martin.Wilson

Change 2769545 on 2015/11/17 by Benn.Gallagher

	Added space conversion options to copy bone node.
	#jira OR-9430
	#rb Martin.Wilson

Change 2770228 on 2015/11/17 by Marc.Audy

	Fix cause of assert firing when detaching if AttachTo(AttachParent) returns false
	#rb Ori.Cohen
	#jira UE-23366

Change 2770489 on 2015/11/17 by Marc.Audy

	Make ::Serialize WITH_EDITORONLY_DATA since it did nothing otherwise

Change 2770761 on 2015/11/17 by Aaron.McLeran

	Removing optimization disablement

	- Forgot to remove these lines before checking in/testing.

Change 2771375 on 2015/11/18 by Thomas.Sarkanen

	Added initialzation of internal state machine desc ptrs to (finally) remove random crashes when using sub-state machines

	#rb Benn.Gallagher

Change 2771697 on 2015/11/18 by Jeff.Farris

	Sensible defaults for APlayerController::ClientPlayCameraAnim and ClientPlayCameraShake
	 #rb marc.audy

Change 2771755 on 2015/11/18 by Marc.Audy

	Put back in the recursion block for destroy actor
	#rb James.Golding

Change 2772217 on 2015/11/18 by Marc.Audy

	Update axis inversion to work the same way as sensitivity instead of old problematic way
	Also change to use Reset instead of Empty(Array.Num())
	#rb Jeff.Farris

Change 2772686 on 2015/11/18 by Aaron.McLeran

	Fixing HRTF spatialization coordinate bug.

	Don't need to convert to xaudio2 coordinates for HRTF spatialization

	#rb chad.taylor

Change 2772766 on 2015/11/18 by Aaron.McLeran

	Fixing HRTF spatialization with xaudio2 voice pools

	- Issue was caused by 2 issues:
	- effect chains weren't properly clearing their state between uses (SetEffectChain(nullptr) releases the effect for use with other voices)
	- Not re-setting MaxEffectChainChannels = 0 in CreateSource() was causing re-used SoundSources to release their XAudio2 voices to the wrong pool.

	#rb chad.taylor

Change 2773027 on 2015/11/19 by Thomas.Sarkanen

	PR #1765: Git Plugin can find the git.exe binary installed on the Local AppData user directory (Contributed by SRombauts)

	#rb Thomas.Sarkanen

Change 2773142 on 2015/11/19 by Benn.Gallagher

	Optimized SafeSetCSBoneTransforms, no longer doing 2 iterations over the whole pose.
	    - Only iterating beyond the index of the first bone transform, cutting off all bones before
	    - No longer using a bone mask the size of the skeleton, just an array of interesting nodes
	    - No longer attempting to convert a transform if it isn't necessary (which was happening a lot)
	#rb Laurent.Delayen

Change 2773212 on 2015/11/19 by Richard.Hinckley

	#jira UEDOC-2685

	Removing ugly comment. Not going to remove the node itself for backward compatibility.

Change 2773351 on 2015/11/19 by Zak.Middleton

	#orion - Make sure we don't skip a final visual update when character mesh interpolation tries to stop smoothing once it reaches its destination. We keep setting bNetworkSmoothingComplete to false until the first visual update, at which point if it remains true we will stop getting updates.

	#rb Dan.Youhon

Change 2773599 on 2015/11/19 by Marc.Audy

	Fix shadow variable, initialization order, and incorrect placement of ENGINE_API that fails compiles on clang
	#codereview Aaron.McLeran

Change 2773661 on 2015/11/19 by Richard.Hinckley

	#jira UEDOC-2685

	Following up by deprecating the CastToPlayerController function for 4.11.

Change 2774707 on 2015/11/19 by Stan.Melax

	FCollisionQueryParams constructor API pitfall
	Deprecating something that will call the unintended constructor if the programmer provides a string literal instead of explicitly creating an FName.

	So this line of code:
	 FCollisionQueryParams Param(FName(TEXT("DragDropTrace")));
	will invoke:
	 FCollisionQueryParams::FCollisionQueryParams(FName,bool=false,...)

	But this line of code:
	 FCollisionQueryParams Param(TEXT("DragDropTrace"));
	invokes:
	 FCollisionQueryParams::FCollisionQueryParams(bool)

	Yes that actually happens, the string literal (the TEXT("whatever")) ends up specifies a bool parameter instead of a FName parameter.  So the name is lost and a flag (that is usually set to false) is now set to true (since the string literal address is non-NULL).  Yeah, that's could potentially be not what the programmer had intended.

	It looks like this interface was introduced in CL 1792949
	back in august 2013. Since its been a couple of years, we'll phase it out using the deprecation approach.
	Making an API change would break things for existing projects.
	If it had been a more recent change we could have probably just gone down to a single constructor right away.

	Figured out that going one step further and removing bool param's default and adding a default constructor would minimize the number of places that will be hit with this deprecation.  So, yes this is *increasing* the number of construtors temporarily, but this solution has minimal impact on the community.  Later after other to-be-deprecated constructor gets removed, the two remaining can be combined into one with defaults for all parameters.

	see also
	https://udn.unrealengine.com/questions/269512/dangerous-fcollisionqueryparams-overloads.html

	#codereview ori.cohen

[CL 2775460 by Marc Audy in Main branch]
2015-11-20 11:02:37 -05:00
Aaron McLeran
b60d86b400 UE-18992 Fixing inconsistent volume on android
- Cached previous volume value needed to be reset on play so it has a chance of getting set in the API call for sound source instances which are recycled but playing the same wave instance.

#codereview chris.babcock

[CL 2633076 by Aaron McLeran in Main branch]
2015-07-24 19:31:40 -04:00
Aaron McLeran
418b93bbb4 UE-14954 Fix for android volume
* Fix uses proper linear->dB volume calculation

[CL 2618862 by Aaron McLeran in Main branch]
2015-07-13 16:50:26 -04:00
Robert Jones
7757982c38 UE-17300 Strategy Game crashes during game play on Android device
- Added initial nulling of pointer which was causing the crash

[CL 2593176 by Robert Jones in Main branch]
2015-06-19 03:58:19 -04:00
Marc Audy
1f3af26fb1 Use a triple buffer XAudio/Core for realtime audio decompression to ensure that if async task is getting starved audio does not hitch; if final buffer is active then ensure completion on the main thread of the pending async task so starvation will not occur.
Properly initialize audio resource when playing a native sound with a specified start time.
#codereview Aaron.McLeran

[CL 2588686 by Marc Audy in Main branch]
2015-06-16 11:13:47 -04:00
Marc Audy
60228ea69e Asynchronous realtime audio decompression/procedural generation (XAudio2, Mac, Android)
[CL 2578892 by Marc Audy in Main branch]
2015-06-05 16:09:35 -04:00
Aaron McLeran
2c12cc600f UE-16362 Sound attenuation has no discernible falloff on Android
- Issue was variable shadowing on the Volume parameter introduced by CL 2477046

[CL 2571755 by Aaron McLeran in Main branch]
2015-05-30 15:05:31 -04:00
Aaron McLeran
7afc6d8748 Rollback //depot/UE4/Engine/Source/Runtime/Android/AndroidAudio/Private/AndroidAudioSource.cpp to revision 12
Rolling back recent changes to file to before 4.8 changes

[CL 2570916 by Aaron McLeran in Main branch]
2015-05-29 15:01:29 -04:00
Aaron McLeran
6dcc4df096 UE-14954 Making sure we actually set a min dB volume if the volume of a sound is 0.0
[CL 2553341 by Aaron McLeran in Main branch]
2015-05-15 14:34:51 -04:00
Aaron McLeran
7746ecfc97 UE-14954 Changing code to not call the SetVolumeLevel API function unless the volume has changed.
[CL 2553189 by Aaron McLeran in Main branch]
2015-05-15 13:52:29 -04:00
Aaron McLeran
ee5da6ccf1 UE-14954 only doing the log10 calculation if the volume changes from previous update
[CL 2536653 by Aaron McLeran in Main branch]
2015-05-04 18:35:35 -04:00
Aaron McLeran
4b0ea51076 UE-14954 Making the min volume a static const value
[CL 2536522 by Aaron McLeran in Main branch]
2015-05-04 17:39:10 -04:00
Aaron McLeran
ba6dbe8b79 UE-14954 Changing the implementation to convert the linear volume to mdB and clamping within the device range.
This will result in a more platform consistent and accurate volume.
 of the sound source

[CL 2536511 by Aaron McLeran in Main branch]
2015-05-04 17:36:45 -04:00
Aaron McLeran
9afd77318e UE-14954 Making android audio inaudible when linear volume of a sound is 0.0
[CL 2536447 by Aaron McLeran in Main branch]
2015-05-04 17:03:17 -04:00
Aaron McLeran
d2729ee628 Supporting multiple audio devices for multiple PIE and other potential use-cases.
- Created audio device manager which manages weak ref handles to audio devices
- Audio device handles are created with WorldContexts and accessed through UWorld objects
- All access to audio devices are now through audio device handles
- There is a main/default audio device for GEngine for use with the Editor and single worldcontext games

#codereview marc.audy, matthew.griffin

[CL 2477046 by Aaron McLeran in Main branch]
2015-03-12 12:59:33 -04:00
Robert Jones
f8e3ad2d57 Changes to Android audio startup to resolve a crash bug a licensee was having.
Error reporting for creation failure changed from Fatal to Warning as we don't really need to stop there.

[CL 2412197 by Robert Jones in Main branch]
2015-01-20 10:09:11 -05:00
Ben Marsh
149375b14b Update copyright notices to 2015.
[CL 2379638 by Ben Marsh in Main branch]
2014-12-07 19:09:38 -05:00
Matthew Griffin
e529148280 Added config setting for audio volume when app is unfocused
Removed GVolumeMultiplier and added an equivalent to FApp to contain the code to load the unfocused volume multiplier from config.

UE-4449 - Allow users to choose whether audio can be heard when focus is lost

#codereview Robert.Manuszewski

[CL 2341022 by Matthew Griffin in Main branch]
2014-10-27 08:15:41 -04:00
Robert Jones
5800659c7e Android audio fixes
- Fixes looping issue with ADPCM samples
- Fixes Android not looping sound cues correctly
- Fixes one shot sound ADPCM problems where sound would get cut early
- Removed Android Audio Device update function - was never called and did nothing anyway so this will improve clarity

Changed ADPCM decompressor so that it uses the same code to decompress a full file as it does when streaming - old code was correct it was just silly have it duplicated.

[CL 2339877 by Robert Jones in Main branch]
2014-10-24 10:55:50 -04:00
Robert Jones
c8aa685ef4 #ttp 338505 MobileMVP: Audio: Procedural Sound not supported on Android
Updated android audio device/buffers/souce to support creation of procedural data from a sound source. Tested with MOD replay in QA test level.

#codereview daniel.lamb, chris.babcock, dmitry.rekman

[CL 2276233 by Robert Jones in Main branch]
2014-08-28 11:18:51 -04:00
Robert Jones
566d29dd25 #ttp 334858 Android : Support ADPCM
Added support for ADPCM decoding.
Added 'sound type' information to USoundWave
- Android uses this to detect which type of asset it needs to deal with
Added support for selected encoding type via project settings

#codereview Daniel.Lamb, Chris.Babcock

[CL 2260750 by Robert Jones in Main branch]
2014-08-18 09:13:38 -04:00
Ben Marsh
89668b5397 [INTEGRATE] Everything from 4.2 branch back into main.
[CL 2088526 by Ben Marsh in Main branch]
2014-05-29 17:45:17 -04:00
Rene Rivera
9b8305f4ad Fix assertion on volume setting for Android SLES. Vaolume needed to be capped to device specific capability.
[CL 2083495 by Rene Rivera in Main branch]
2014-05-29 16:53:56 -04:00
Rene Rivera
adf47caa6b Fix audio playback cutting in and out, especially for ambient sounds. Volume was being cut artificially cut to zero below a certain threshold. This removes that cut to bring it on-par with the other platforms. And also syncs the audio source update to mirror other platforms more closely (for example adds missing global volume attenuation).
#ttp 334725
#codereview daniel.lamb

[CL 2082403 by Rene Rivera in Main branch]
2014-05-22 17:20:22 -04:00
Tim Sweeney
324683ce78 Engine source (Main branch up to CL 2026164) 2014-03-14 14:13:41 -04:00