Skip to content

Commit 55e1517

Browse files
committed
Merge from Perforce 2023-12-15 14:13:58.026562
1 parent b0320c5 commit 55e1517

File tree

87 files changed

+2154
-385
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

87 files changed

+2154
-385
lines changed

README.md

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,17 @@
1-
% Steam Audio 4.4.1
2-
% Valve Corporation
1+
# Steam Audio 4.5.0
32

4-
Supported Platforms
5-
-------------------
3+
Valve Corporation
4+
5+
## Supported Platforms
66

77
Steam Audio supports Windows (32 bit and 64 bit), Linux (32 bit and 64 bit), macOS, and Android (armv7, arm64, x86, x64) platforms.
88

9-
Supported Integrations
10-
----------------------
9+
## Supported Integrations
1110

1211
Steam Audio supports Unity 2017.3+, Unreal Engine 4.27+, and FMOD Studio 2.0+.
1312

14-
Additional Links
15-
----------------
13+
## Additional Links
14+
1615
- [Steam Audio Homepage](https://valvesoftware.github.io/steam-audio)
1716
- [Downloads & Documentation](https://valvesoftware.github.io/steam-audio/downloads.html)
1817
- [Community Forum](http://steamcommunity.com/app/596420/discussions/)

fmod/CMakeLists.txt

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
cmake_minimum_required(VERSION 3.17)
55

6-
project(Phonon VERSION 4.4.1)
6+
project(Phonon VERSION 4.5.0)
77

88
set(CMAKE_CXX_STANDARD 14)
99
set(CMAKE_MODULE_PATH "${CMAKE_HOME_DIRECTORY}/build")
@@ -22,6 +22,8 @@ elseif (APPLE AND CMAKE_SYSTEM_NAME STREQUAL "Darwin")
2222
set(IPL_OS_MACOS TRUE)
2323
elseif (ANDROID)
2424
set(IPL_OS_ANDROID TRUE)
25+
elseif (APPLE AND CMAKE_SYSTEM_NAME STREQUAL "iOS")
26+
set(IPL_OS_IOS TRUE)
2527
endif()
2628

2729
# CPU architecture detection
@@ -42,6 +44,8 @@ elseif (IPL_OS_ANDROID)
4244
elseif (CMAKE_ANDROID_ARCH STREQUAL "x86_64")
4345
set(IPL_CPU_X64 TRUE)
4446
endif()
47+
elseif (IPL_OS_IOS)
48+
set(IPL_CPU_ARMV8 TRUE)
4549
endif()
4650

4751

@@ -77,6 +81,9 @@ endif()
7781
if (IPL_OS_ANDROID)
7882
add_definitions(-DIPL_OS_ANDROID)
7983
endif()
84+
if (IPL_OS_IOS)
85+
add_definitions(-DIPL_OS_IOS)
86+
endif()
8087

8188
if (IPL_CPU_X86)
8289
add_definitions(-DIPL_CPU_X86)
@@ -132,6 +139,7 @@ endif()
132139
# macOS flags
133140
if (IPL_OS_MACOS)
134141
set(CMAKE_OSX_ARCHITECTURES "x86_64;arm64")
142+
set(CMAKE_OSX_DEPLOYMENT_TARGET "10.13")
135143
endif()
136144

137145
# Android flags
@@ -140,6 +148,9 @@ if (IPL_OS_ANDROID)
140148
add_link_options(-static-libstdc++)
141149
endif()
142150

151+
# iOS flags
152+
# todo
153+
143154

144155
#
145156
# DEPENDENCIES

fmod/build/SteamAudioHelpers.cmake

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ function (get_local_lib_path LIB_PATH)
2626
elseif (IPL_CPU_X64)
2727
set(${LIB_PATH} ${CMAKE_HOME_DIRECTORY}/lib/android-x64 PARENT_SCOPE)
2828
endif()
29+
elseif (IPL_OS_IOS)
30+
set(${LIB_PATH} ${CMAKE_HOME_DIRECTORY}/lib/ios PARENT_SCOPE)
2931
endif()
3032
endfunction()
3133

@@ -54,6 +56,8 @@ function (get_bin_subdir BIN_SUBDIR)
5456
elseif (IPL_CPU_X64)
5557
set(${BIN_SUBDIR} android-x64 PARENT_SCOPE)
5658
endif()
59+
elseif (IPL_OS_IOS)
60+
set(${BIN_SUBDIR} ios PARENT_SCOPE)
5761
endif()
5862
endfunction()
5963

@@ -103,6 +107,11 @@ function (add_executable_or_apk name)
103107
endif()
104108
else()
105109
add_executable(${name} ${ARGN})
110+
if (IPL_OS_IOS)
111+
set_target_properties(${name} PROPERTIES MACOSX_BUNDLE_GUI_IDENTIFIER com.valve.${name})
112+
set_target_properties(${name} PROPERTIES MACOSX_BUNDLE_BUNDLE_VERSION 1.0.0)
113+
set_target_properties(${name} PROPERTIES MACOSX_BUNDLE_SHORT_VERSION_STRING 1.0.0)
114+
endif()
106115
endif()
107116
endfunction()
108117

@@ -118,6 +127,8 @@ function (install_executable_or_apk name dir)
118127
set(arch x64)
119128
endif()
120129
install(FILES ${CMAKE_HOME_DIRECTORY}/build/android/${name}/build/outputs/apk/${name}-${arch}-debug.apk DESTINATION ${dir} RENAME ${name}.apk)
130+
elseif (IPL_OS_IOS)
131+
install(TARGETS ${name} BUNDLE DESTINATION ${dir})
121132
else()
122133
install(TARGETS ${name} RUNTIME DESTINATION ${dir})
123134
endif()

fmod/build/build.py

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ def detect_host_system():
2222
# Parses the command line.
2323
def parse_command_line(host_system):
2424
parser = argparse.ArgumentParser()
25-
parser.add_argument('-p', '--platform', help = "Target operating system.", choices = ['windows', 'osx', 'linux', 'android'], type = str.lower, default = host_system)
25+
parser.add_argument('-p', '--platform', help = "Target operating system.", choices = ['windows', 'osx', 'linux', 'android', 'ios'], type = str.lower, default = host_system)
2626
parser.add_argument('-t', '--toolchain', help = "Compiler toolchain. (Windows only)", choices = ['vs2013', 'vs2015', 'vs2017', 'vs2019', 'vs2022'], type = str.lower, default = 'vs2019')
2727
parser.add_argument('-a', '--architecture', help = "CPU architecture.", choices = ['x86', 'x64', 'armv7', 'arm64'], type = str.lower, default = 'x64')
2828
parser.add_argument('-c', '--configuration', help = "Build configuration.", choices = ['debug', 'release'], type = str.lower, default = 'release')
@@ -34,7 +34,7 @@ def parse_command_line(host_system):
3434
def build_subdir(args):
3535
if args.platform == 'windows':
3636
return "-".join([args.platform, args.toolchain, args.architecture])
37-
elif args.platform == 'osx':
37+
elif args.platform in ['osx', 'ios']:
3838
return args.platform
3939
elif args.platform in ['linux', 'android']:
4040
return "-".join([args.platform, args.architecture, args.configuration])
@@ -43,7 +43,7 @@ def build_subdir(args):
4343
def bin_subdir(args):
4444
if args.platform in ['windows', 'linux', 'android']:
4545
return "-".join([args.platform, args.architecture])
46-
elif args.platform == 'osx':
46+
elif args.platform in ['osx', 'ios']:
4747
return "-".join([args.platform])
4848

4949
# Returns the root directory of the repository.
@@ -68,7 +68,7 @@ def generator_name(args):
6868
elif args.toolchain == 'vs2022':
6969
generator = 'Visual Studio 17 2022'
7070
return generator + suffix
71-
elif args.platform == 'osx':
71+
elif args.platform in ['osx', 'ios']:
7272
return 'Xcode'
7373
elif args.platform in ['linux', 'android']:
7474
return 'Unix Makefiles'
@@ -114,6 +114,10 @@ def cmake_generate(args):
114114
cmake_args += ['-DCMAKE_ANDROID_NDK=' + os.environ.get('ANDROID_NDK')]
115115
cmake_args += ['-DCMAKE_MAKE_PROGRAM=' + os.environ.get('ANDROID_NDK') + '/prebuilt/windows-x86_64/bin/make.exe']
116116

117+
# On iOS, specify the toolchain file.
118+
if args.platform in ['ios']:
119+
cmake_args += ['-DCMAKE_TOOLCHAIN_FILE=' + root_dir() + '/build/toolchain_ios.cmake']
120+
117121
# On Linux and Android, specify the build configuration at generate-time.
118122
if args.platform in ['linux', 'android']:
119123
cmake_args += ['-DCMAKE_BUILD_TYPE=' + config_name(args)]
@@ -146,7 +150,7 @@ def cmake_generate(args):
146150
def cmake_build(args):
147151
cmake_args = ['--build', '.']
148152

149-
if args.platform in ['windows', 'osx']:
153+
if args.platform in ['windows', 'osx', 'ios']:
150154
cmake_args += ['--config', config_name(args)]
151155

152156
run_cmake('cmake', cmake_args)
@@ -155,7 +159,7 @@ def cmake_build(args):
155159
def cmake_install(args):
156160
cmake_args = ['--install', '.']
157161

158-
if args.platform in ['windows', 'osx']:
162+
if args.platform in ['windows', 'osx', 'ios']:
159163
cmake_args += ['--config', config_name(args)]
160164

161165
run_cmake('cmake', cmake_args)
@@ -164,7 +168,7 @@ def cmake_install(args):
164168
def cmake_package(args):
165169
cmake_args = ['-G', 'ZIP']
166170

167-
if args.platform in ['windows', 'osx']:
171+
if args.platform in ['windows', 'osx', 'ios']:
168172
cmake_args += ['-C', config_name(args)]
169173

170174
run_cmake('cpack', cmake_args)

fmod/build/toolchain_ios.cmake

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#
2+
# Copyright (c) Valve Corporation. All rights reserved.
3+
#
4+
5+
set(CMAKE_SYSTEM_NAME iOS)
6+
set(CMAKE_OSX_ARCHITECTURES arm64)
7+
set(CMAKE_OSX_DEPLOYMENT_TARGET 11.0)
8+
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE BOTH)
9+
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY BOTH)
10+
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM BOTH)
11+
set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE BOTH)

fmod/doc/build-instructions.rst

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,10 @@ To build the Android plugin, you will need:
5858
- Android SDK for platform 25 (Android 7.1 Nougat) or later (https://developer.android.com/studio)
5959
- Android NDK (install using the Android SDK Manager)
6060

61+
To build the iOS plugin, you will need:
62+
63+
- Xcode 14.0 or later (install from the Mac App Store)
64+
6165
To build the documentation, you will need:
6266

6367
- Sphinx (https://www.sphinx-doc.org)
@@ -94,18 +98,20 @@ On macOS, this will generate an Xcode project (``build/osx/Phonon.xcodeproj``) a
9498

9599
On Android, this will generate a Makefile for 32-bit ARM (``build/android-armv7-release/Makefile``) and build it.
96100

101+
On iOS, this will generate an Xcode project (``build/ios/Phonon.xcodeproj``) and build it in the Release configuration.
102+
97103
If CMake cannot generate the build system due to missing dependencies, you can run CMake directly and adjust settings that control where CMake looks for dependencies, and which targets it builds.
98104

99105
The Steam Audio build script (``build.py``) lets you specify the following command line parameters to control its behavior:
100106

101107
-p, --platform NAME
102-
Specifies the target platform. Valid options are ``windows``, ``linux``, ``osx``, and ``android``. Default is the current host platform.
108+
Specifies the target platform. Valid options are ``windows``, ``linux``, ``osx``, ``android``, and ``ios``. Default is the current host platform.
103109

104110
-t, --toolchain NAME
105111
Specifies the compiler version (on Windows only). Valid options are ``vs2013``, ``vs2015``, ``vs2017``, ``vs2019``. Default is ``vs2015``.
106112

107113
-a, --architecture NAME
108-
Specifies the CPU architecture to build for. Valid options are ``x86`` (32-bit Intel, available on Windows, Linux, and Android), ``x64`` (64-bit Intel, available on Windows, Linux, macOS, and Android), ``armv7`` (32-bit ARM, available on Android), and ``arm64`` (64-bit ARM, available on Android). Default is ``x64`` for Windows, Linux, and macOS; and ``armv7`` for Android.
114+
Specifies the CPU architecture to build for. Valid options are ``x86`` (32-bit Intel, available on Windows, Linux, and Android), ``x64`` (64-bit Intel, available on Windows, Linux, macOS, and Android), ``armv7`` (32-bit ARM, available on Android), and ``arm64`` (64-bit ARM, available on Android and iOS). Default is ``x64`` for Windows, Linux, and macOS; ``armv7`` for Android; and ``arm64`` for iOS.
109115

110116
-c, --configuration NAME
111117
Specifies the build configuration. Valid options are ``debug`` and ``release``. Default is ``release``.
@@ -140,6 +146,14 @@ Toolchain File Platform
140146
``build/toolchain_android_x64.cmake`` 64-bit Intel
141147
======================================= ============
142148

149+
When building for iOS, Steam Audio provides the following toolchain files that you can use:
150+
151+
======================================= ============
152+
Toolchain File Platform
153+
======================================= ============
154+
``build/toolchain_ios.cmake`` 64-bit ARM
155+
======================================= ============
156+
143157
Below are some of the CMake options you may want to configure:
144158

145159
============================== ======================================================================

fmod/doc/getting-started.rst

Lines changed: 62 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
Getting Started
22
===============
33

4+
.. highlight:: c++
5+
46
Requirements
57
------------
68

@@ -12,6 +14,7 @@ The Steam Audio FMOD Studio integration supports the following platforms:
1214
- Linux (32-bit and 64-bit, tested with Ubuntu 18.04 LTS)
1315
- macOS 10.7 or later (64-bit Intel)
1416
- Android 5.0 or later (32-bit ARM, 64-bit ARM, 32-bit Intel)
17+
- iOS 11.0 or later (64-bit ARM)
1518

1619

1720
Add Steam Audio to your FMOD Studio project
@@ -65,6 +68,18 @@ If you are using Unity as your game engine, see the Unity tab below. If you are
6568

6669
.. image:: media/unity_fmodsettings.png
6770

71+
If you are building for iOS, do the following instead:
72+
73+
1. In Unity's main menu, click **FMOD** > **Edit Settings**.
74+
2. Under **Static Plugins**, click **Add Plugin**.
75+
3. In the text box that appears, enter ``FMOD_SteamAudio_Spatialize_GetDSPDescription``.
76+
4. Click **Add Plugin** again.
77+
5. In the text box that appears, enter ``FMOD_SteamAudio_MixerReturn_GetDSPDescription``.
78+
6. Click **Add Plugin** again.
79+
7. In the text box that appears, enter ``FMOD_SteamAudio_Reverb_GetDSPDescription``.
80+
81+
You can configure these static plugins as a platform-specific override for iOS, while using the ``phonon_fmod`` dynamic plugin on other platforms. For more information on how to do this, refer to the documentation for the FMOD Studio Unity integration.
82+
6883
.. rubric:: Configure the Steam Audio Unity integration to use FMOD Studio
6984

7085
1. In Unity's main menu, click **Steam Audio** > **Settings**.
@@ -91,6 +106,29 @@ If you are using Unity as your game engine, see the Unity tab below. If you are
91106

92107
.. image:: media/unreal_fmodsettings.png
93108

109+
If you are building for iOS, the version of the FMOD Studio Unreal Engine plugin you are using may not correctly initialize static DSP plugins, leading to errors at runtime. As a workaround, you can modify the ``Source/FMODStudio/Private/FMODStudioModule.cpp`` file in the FMOD Studio plugin's root directory:
110+
111+
1. Near the top of the file, after all the ``#include`` directives, add::
112+
113+
#if PLATFORM_IOS
114+
extern "C" {
115+
FMOD_DSP_DESCRIPTION* F_CALL FMOD_SteamAudio_Spatialize_GetDSPDescription();
116+
FMOD_DSP_DESCRIPTION* F_CALL FMOD_SteamAudio_MixerReturn_GetDSPDescription();
117+
FMOD_DSP_DESCRIPTION* F_CALL FMOD_SteamAudio_Reverb_GetDSPDescription();
118+
}
119+
#endif
120+
121+
2. Next, in the ``FFMODStudioModule::CreateStudioSystem`` function, add the following lines after the code for loading dynamic plugins::
122+
123+
#if PLATFORM_IOS
124+
unsigned int Handle = 0;
125+
lowLevelSystem->registerDSP(FMOD_SteamAudio_Spatialize_GetDSPDescription(), &Handle);
126+
lowLevelSystem->registerDSP(FMOD_SteamAudio_MixerReturn_GetDSPDescription(), &Handle);
127+
lowLevelSystem->registerDSP(FMOD_SteamAudio_Reverb_GetDSPDescription(), &Handle);
128+
#endif
129+
130+
This issue may be fixed in a newer version of FMOD Studio.
131+
94132
.. rubric:: Configure the Steam Audio Unreal Engine plugin to use FMOD Studio
95133

96134
1. In Unreal's main menu, click **Edit** > **Project Settings**.
@@ -104,16 +142,31 @@ If you are using Unity as your game engine, see the Unity tab below. If you are
104142

105143
.. rubric:: Load the Steam Audio FMOD Studio integration
106144

107-
1. When initializing FMOD Studio in your game engine, call ``FMOD::System::loadPlugin`` to load the Steam Audio FMOD Studio integration. The plugin files can be found in the ``steamaudio_fmod.zip`` file you downloaded earlier. The file name of the plugin depends on the platform:
145+
When initializing FMOD Studio in your game engine, call ``FMOD::System::loadPlugin`` to load the Steam Audio FMOD Studio integration. The plugin files can be found in the ``steamaudio_fmod.zip`` file you downloaded earlier. The file name of the plugin depends on the platform:
146+
147+
- Windows 32-bit: ``lib/windows-x86/phonon_fmod.dll``
148+
- Windows 64-bit: ``lib/windows-x64/phonon_fmod.dll``
149+
- Linux 32-bit: ``lib/linux-x86/libphonon_fmod.so``
150+
- Linux 64-bit: ``lib/linux-x64/libphonon_fmod.so``
151+
- macOS: ``lib/osx/libphonon_fmod.dylib``
152+
- Android ARMv7 (32-bit): ``lib/android-armv7/libphonon_fmod.so``
153+
- Android ARMv8/AArch64 (64-bit): ``lib/android-armv8/libphonon_fmod.so``
154+
- Android x86 (32-bit): ``lib/android-x86/libphonon_fmod.so``
155+
156+
On iOS, instead of calling ``FMOD::System::loadPlugin``, you will have to statically link to ``lib/ios/libphonon_fmod.a`` and use ``FMOD::System::registerDSP`` to register each of the Steam Audio DSP plugins. For example::
157+
158+
extern "C" {
159+
FMOD_DSP_DESCRIPTION* F_CALL FMOD_SteamAudio_Spatialize_GetDSPDescription();
160+
FMOD_DSP_DESCRIPTION* F_CALL FMOD_SteamAudio_MixerReturn_GetDSPDescription();
161+
FMOD_DSP_DESCRIPTION* F_CALL FMOD_SteamAudio_Reverb_GetDSPDescription();
162+
}
163+
164+
FMOD::System* system = ...; // initialized elsewhere
108165

109-
- Windows 32-bit: ``lib/windows-x86/phonon_fmod.dll``
110-
- Windows 64-bit: ``lib/windows-x64/phonon_fmod.dll``
111-
- Linux 32-bit: ``lib/linux-x86/libphonon_fmod.so``
112-
- Linux 64-bit: ``lib/linux-x64/libphonon_fmod.so``
113-
- macOS: ``lib/osx/libphonon_fmod.dylib``
114-
- Android ARMv7 (32-bit): ``lib/android-armv7/libphonon_fmod.so``
115-
- Android ARMv8/AArch64 (64-bit): ``lib/android-armv8/libphonon_fmod.so``
116-
- Android x86 (32-bit): ``lib/android-x86/libphonon_fmod.so``
166+
unsigned int handle = 0;
167+
system->registerDSP(FMOD_SteamAudio_Spatialize_GetDSPDescription(), &handle);
168+
system->registerDSP(FMOD_SteamAudio_MixerReturn_GetDSPDescription(), &handle);
169+
system->registerDSP(FMOD_SteamAudio_Reverb_GetDSPDescription(), &handle);
117170

118171
.. rubric:: Initialize the Steam Audio FMOD Studio integration
119172

fmod/include/phonon/phonon.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,12 @@ typedef enum {
108108
IPL_SIMDLEVEL_NEON = IPL_SIMDLEVEL_SSE2, /**< ARM NEON. Up to 4 simultaneous floating-point operations. */
109109
} IPLSIMDLevel;
110110

111+
/** Additional flags for modifying the behavior of a Steam Audio context. */
112+
typedef enum {
113+
IPL_CONTEXTFLAGS_VALIDATION, /**< All API functions perform extra validation checks. NOTE: This imposes a significant performance penalty. */
114+
IPL_CONTEXTFLAGS_FORCE_32BIT = 0x7fffffff, /**< Force this enum to be 32 bits in size. */
115+
} IPLContextFlags;
116+
111117
/** Prototype of a callback that logs a message generated by Steam Audio. This may be implemented in any suitable way,
112118
such as appending to a log file, displaying a dialog box, etc. The default behavior is to print to \c stdout.
113119
@@ -157,6 +163,9 @@ typedef struct {
157163
in lower performance than expected. If you observe this in your application, set this
158164
parameter to `IPL_SIMDLEVEL_AVX2` or lower. */
159165
IPLSIMDLevel simdLevel;
166+
167+
/** Additional flags for modifying the behavior of the created context. */
168+
IPLContextFlags flags;
160169
} IPLContextSettings;
161170

162171
/** Creates a context object. A context must be created before creating any other API objects.

fmod/include/phonon/phonon_interfaces.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ class IContext
4545

4646
virtual void release() = 0;
4747

48-
virtual void setTelemetryAPI(void* telemetryAPI) = 0;
48+
virtual void setProfilerContext(void* profilerContext) = 0;
4949

5050
virtual IPLVector3 calculateRelativeDirection(IPLVector3 sourcePosition,
5151
IPLVector3 listenerPosition,

0 commit comments

Comments
 (0)