This commit is contained in:
Crizomb 2025-06-10 17:40:16 +02:00
commit f698a38c7e
585 changed files with 118338 additions and 0 deletions

View file

@ -0,0 +1,136 @@
<html>
<head>
<title>Platform Details | Mac</title>
<link rel="stylesheet" href="style/docs.css">
<link rel="stylesheet" href="style/code_highlight.css">
<script type="text/javascript" src="scripts/language-selector.js"></script></head>
<body>
<div class="docs-body">
<div class="manual-toc">
<p>FMOD Engine User Manual 2.03</p>
<ul>
<li><a href="welcome.html">Welcome to the FMOD Engine</a></li>
<li><a href="studio-guide.html">Studio API Guide</a></li>
<li><a href="core-guide.html">Core API Guide</a></li>
<li class="manual-current-chapter manual-inactive-chapter"><a href="platforms.html">Platform Details</a><ul class="subchapters"><li><a href="platforms-win.html">Windows</a></li><li class="manual-current-chapter manual-active-chapter"><a href="platforms-mac.html">Mac</a></li><li><a href="platforms-linux.html">Linux</a></li><li><a href="platforms-ios.html">iOS</a></li><li><a href="platforms-android.html">Android</a></li><li><a href="platforms-openharmony.html">Open Harmony</a></li><li><a href="platforms-uwp.html">Universal Windows Platform</a></li><li><a href="platforms-html5.html">HTML5</a></li></ul></li>
<li><a href="white-papers.html">White Papers</a></li>
<li><a href="studio-api.html">Studio API Reference</a></li>
<li><a href="core-api.html">Core API Reference</a></li>
<li><a href="fsbank-api.html">FSBank API Reference</a></li>
<li><a href="plugin-api.html">Plug-in API Reference</a></li>
<li><a href="effects-reference.html">Effects Reference</a></li>
<li><a href="troubleshooting.html">Troubleshooting</a></li>
<li><a href="glossary.html">Glossary</a></li>
</ul>
</div>
<div class="manual-content api">
<h1>4. Platform Details | Mac</h1>
<div class="toc">
<ul>
<li><a href="#macos-specific-starter-guide">macOS Specific Starter Guide</a><ul>
<li><a href="#sdk-version">SDK Version</a></li>
<li><a href="#compatibility">Compatibility</a></li>
<li><a href="#libraries">Libraries</a></li>
<li><a href="#latency">Latency</a></li>
<li><a href="#suspend-in-background">Suspend in Background</a></li>
<li><a href="#thread-affinity">Thread Affinity</a></li>
<li><a href="#thread-priority">Thread Priority</a></li>
</ul>
</li>
<li><a href="#performance-reference">Performance Reference</a><ul>
<li><a href="#format-choice">Format Choice</a></li>
<li><a href="#channel-count">Channel Count</a><ul>
<li><a href="#settings">Settings</a></li>
<li><a href="#test-device">Test Device</a></li>
<li><a href="#results">Results</a></li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
<h2 id="macos-specific-starter-guide"><a href="#macos-specific-starter-guide">macOS Specific Starter Guide</a></h2>
<h3 id="sdk-version"><a href="#sdk-version">SDK Version</a></h3>
<p>FMOD is compiled using the following tools.</p>
<ul>
<li><strong>Xcode</strong> - version 15.0.1 targeting macOS 14.0.</li>
</ul>
<h3 id="compatibility"><a href="#compatibility">Compatibility</a></h3>
<p>FMOD supports x86_64 and arm64 back to macOS 10.13. Please note that both x86 and PPC are not accepted for submission to the Mac App Store and thus are no longer supported by FMOD.</p>
<h3 id="libraries"><a href="#libraries">Libraries</a></h3>
<p>Core API library</p>
<ul>
<li><strong>/api/core/lib/libfmod.dylib</strong> - Release binary for production code.</li>
<li><strong>/api/core/lib/libfmodL.dylib</strong> - Release binary with logging enabled for development.</li>
</ul>
<p>Studio API library (used in conjunction with the Core API library)</p>
<ul>
<li><strong>/api/studio/lib/libfmodstudio.dylib</strong> - Release binary for production code.</li>
<li><strong>/api/studio/lib/libfmodstudioL.dylib</strong> - Release binary with logging enabled for development.</li>
</ul>
<h3 id="latency"><a href="#latency">Latency</a></h3>
<p>The default latency introduced by FMOD for this platform is 4 blocks of 512 samples at a sample rate of 48 kHz, which equates to approximately 43 ms. You are free to change this using two APIs, <a class="apilink" href="core-api-system.html#system_setdspbuffersize">System::setDSPBufferSize</a> and <a class="apilink" href="core-api-system.html#system_setsoftwareformat">System::setSoftwareFormat</a> but there are some important considerations.</p>
<p>All audio devices have a number of samples they prefer to operate in, on Mac this is almost always 512, which makes our default a natural fit. If you use <a class="apilink" href="core-api-system.html#system_setdspbuffersize">System::setDSPBufferSize</a> to reduce FMODs granularity (to 256 samples for instance), be aware the audio device will still operate at its native block of 512 samples. If you would like to reduce the block size of the audio device (to 256 samples), after you have set the FMOD granularity and initialized the System object use the following code:</p>
<div class="highlight language-cpp"><pre><span></span><span class="n">AudioUnit</span> <span class="n">audioUnit</span><span class="p">;</span>
<span class="n">gSystem</span><span class="o">-&gt;</span><span class="n">getOutputHandle</span><span class="p">((</span><span class="kt">void</span> <span class="o">**</span><span class="p">)</span><span class="o">&amp;</span><span class="n">audioUnit</span><span class="p">);</span>
<span class="n">AudioDeviceID</span> <span class="n">audioDeviceID</span><span class="p">;</span>
<span class="n">UInt32</span> <span class="n">audioDeviceIDSize</span> <span class="o">=</span> <span class="k">sizeof</span><span class="p">(</span><span class="n">audioDeviceID</span><span class="p">);</span>
<span class="n">AudioUnitGetProperty</span><span class="p">(</span><span class="n">audioUnit</span><span class="p">,</span> <span class="n">kAudioOutputUnitProperty_CurrentDevice</span><span class="p">,</span> <span class="n">kAudioUnitScope_Global</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="o">&amp;</span><span class="n">audioDeviceID</span><span class="p">,</span> <span class="o">&amp;</span><span class="n">audioDeviceIDSize</span><span class="p">);</span>
<span class="n">UInt32</span> <span class="n">bufferFrameSize</span> <span class="o">=</span> <span class="mi">256</span><span class="p">;</span>
<span class="n">AudioDeviceSetProperty</span><span class="p">(</span><span class="n">audioDeviceID</span><span class="p">,</span> <span class="nb">NULL</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="n">FALSE</span><span class="p">,</span> <span class="n">kAudioDevicePropertyBufferFrameSize</span><span class="p">,</span> <span class="k">sizeof</span><span class="p">(</span><span class="n">bufferFrameSize</span><span class="p">),</span> <span class="o">&amp;</span><span class="n">bufferFrameSize</span><span class="p">);</span>
</pre></div>
<h3 id="suspend-in-background"><a href="#suspend-in-background">Suspend in Background</a></h3>
<p>FMOD native threads will continue running when your application transitions to the background, this will continue to use resources. To completely stop FMOD without losing your current setup you can call <a class="apilink" href="core-api-system.html#system_mixersuspend">System::mixerSuspend</a> as part of your backgrounding process. When you return to the foreground, use <a class="apilink" href="core-api-system.html#system_mixerresume">System::mixerResume</a> to reactivate FMOD. It is extremely important to ensure no FMOD APIs are called in-between suspend and resume as they run the risk of causing a deadlock. You must also call suspend and resume pairs on the same thread.</p>
<h3 id="thread-affinity"><a href="#thread-affinity">Thread Affinity</a></h3>
<p>All threads will default to <a class="apilink" href="core-api-common.html#fmod_thread_affinity_core_all">FMOD_THREAD_AFFINITY_CORE_ALL</a>, it is not currently possible to override this with <a class="apilink" href="core-api-common.html#thread_setattributes">Thread_SetAttributes</a>.</p>
<h3 id="thread-priority"><a href="#thread-priority">Thread Priority</a></h3>
<p>The relationship between FMOD platform agnostic thread priority and the platform specific values is as follows:</p>
<ul>
<li><a class="apilink" href="core-api-common.html#fmod_thread_priority_low">FMOD_THREAD_PRIORITY_LOW</a> ~ 83</li>
<li><a class="apilink" href="core-api-common.html#fmod_thread_priority_medium">FMOD_THREAD_PRIORITY_MEDIUM</a> ~ 87</li>
<li><a class="apilink" href="core-api-common.html#fmod_thread_priority_high">FMOD_THREAD_PRIORITY_HIGH</a> ~ 90</li>
<li><a class="apilink" href="core-api-common.html#fmod_thread_priority_very_high">FMOD_THREAD_PRIORITY_VERY_HIGH</a> ~ 94</li>
<li><a class="apilink" href="core-api-common.html#fmod_thread_priority_extreme">FMOD_THREAD_PRIORITY_EXTREME</a> ~ 97</li>
<li><a class="apilink" href="core-api-common.html#fmod_thread_priority_critical">FMOD_THREAD_PRIORITY_CRITICAL</a> ~ 99</li>
</ul>
<h2 id="performance-reference"><a href="#performance-reference">Performance Reference</a></h2>
<p>This section is a companion for the <a href="white-papers-cpu-performance.html">CPU Performance</a> white paper and serves as a quick reference of facts targeting this platform.</p>
<h3 id="format-choice"><a href="#format-choice">Format Choice</a></h3>
<p>Each compression format provided in FMOD has a reason for being included, the below list will detail our recommendations for this platform. Formats listed as primary are considering the best choice, secondary formats should only be considered if the primary doesn't satisfy your requirements.</p>
<ul>
<li><strong>Vorbis</strong>: Primary format for all sounds.</li>
<li><strong>FADPCM</strong>: Secondary format if Vorbis CPU usage is too high for low spec machines.</li>
<li><strong>PCM</strong>: Not recommended.</li>
<li><strong>XMA</strong>: Unavailable.</li>
<li><strong>AT9</strong>: Unavailable.</li>
</ul>
<h3 id="channel-count"><a href="#channel-count">Channel Count</a></h3>
<p>To give developers an idea about the costs of a particular format we provide synthetic benchmark results. These results are based on simple usage of the Studio API using recommended configuration settings.</p>
<h4 id="settings"><a href="#settings">Settings</a></h4>
<ul>
<li><strong>Real channel count:</strong> 64</li>
<li><strong>Sample rate:</strong> 48 kHz</li>
<li><strong>Speaker mode:</strong> Stereo</li>
<li><strong>DSP block size:</strong> 512 samples</li>
</ul>
<h4 id="test-device"><a href="#test-device">Test Device</a></h4>
<ul>
<li><strong>CPU:</strong> Intel(R) Core(TM) i5-4278U CPU @ 2.60GHz</li>
<li><strong>OS:</strong> macOS 10.15.7 (19H2)</li>
</ul>
<h4 id="results"><a href="#results">Results</a></h4>
<ul>
<li><strong>DSP with Vorbis:</strong> 7.78% (+/- 0.95%)</li>
<li><strong>DSP with FADPCM:</strong> 4.90% (+/- 0.61%)</li>
<li><strong>DSP with PCM:</strong> 2.93% (+/- 0.58%)</li>
<li><strong>Update at 60 FPS:</strong> 1.81% (+/- 0.35%)</li>
</ul></div>
<p class="manual-footer">FMOD Engine User Manual 2.03.07 (2025-04-02). &copy; 2025 Firelight Technologies Pty Ltd.</p>
</body>
</html>
</div>