Files
UnrealEngineUWP/Engine/Source/Runtime/Mac
Aaron McLeran 15b333032e BLOCKING ISSUE UE-17563 Fixing core audio crash
- QAGame's Test map TM-MultipleSounds allowed me to finally repro the issue after a few minutes. Reducing the number of voices in CoreAudio caused the issue to happen immediately.
- Crash was due to an invalid audio unit index (-1) when the number of active audio units exceeds total number of available audio units
- Fixed by properly failing to play a sound if no audio unit/voice indices are available rather than trying to construct an AUGraph with the invalid index.
- Added more asserts to make sure things are what they should be.
- Changed the MAX_AUDIOCHANNELS #define used in Mac-code so it can be different than other platforms. Other platforms use this as an upper limit but don'''t allocate resources according to it, Mac however, allocates resources and allows voices to play up to the max number. Rather than fix that right now, we''ll hard-code that upper limit on mac to be on-par with PC
- Went ahead and reduced the number of max voices on Mac since PC only uses 32 and this was set to be 64 (for mono/stereo files) and 16 for multichannel files for a total of 80 max voices. Mac is already perf-heavy on the main thread, this will help to decrease perf due to audio and will be more in-line with PC audio.

#codereview Michael.Trepka Marc.Audy
#lockdown Nick.Penwarden

[CL 2623909 by Aaron McLeran in Main branch]
2015-07-16 21:46:19 -04:00
..