{"id":3741,"date":"2022-06-16T15:01:10","date_gmt":"2022-06-16T06:01:10","guid":{"rendered":"https:\/\/blog.criware.com\/?p=3741"},"modified":"2024-05-21T10:01:16","modified_gmt":"2024-05-21T01:01:16","slug":"introducing-sonicsync-for-ultra-low-latency","status":"publish","type":"post","link":"https:\/\/blog.criware.com\/index.php\/2022\/06\/16\/introducing-sonicsync-for-ultra-low-latency\/","title":{"rendered":"Introducing SonicSYNC for ultra-low latency"},"content":{"rendered":"<p>Managing audio latency is crucial in game development, as an interruption or a delay in the sound is much more noticeable than a dropped video frame. The sense of immersion will immediately be broken if the visuals and the sounds are not accurately synchronized.<\/p>\n<p>Furthermore, many gameplays rely on tight synchronization. This is the case for instance for rhythm games, puzzle games, FPS or any games in which sound is played in response to the player\u2019s input or as a situation indicator: if you hear an enemy sneaking up on you with a 200 ms delay, it may already be too late to react!<\/p>\n<p>Thankfully, the new <strong>SonicSYNC<\/strong> feature of ADX makes it possible to reduce playback latency by up to 50%, thus enhancing the experience and the responsiveness of a game.<\/p>\n<h2 style=\"font-size: 150%; font-weight: bold; margin-top: 40px;\">Introduction<\/h2>\n<p>SonicSYNC minimizes the latency introduced by sound buffering to zero on iOS, Android and Nintendo Switch. This is more efficient than the regular low-latency playback feature provided by ADX until now, especially on Android.<\/p>\n<p>In a normal playback situation, sounds are buffered to give time for the data to be decompressed, and effects and processing to be applied. This is where the largest delays are introduced. With SonicSYNC, these delays are eliminated by generating audio signals immediately, in direct synchronization with the sound driver. Eventually, only the delays caused by the hardware tap recognition and the output processing are still relevant, and the overall audio playback responsiveness is greatly improved.<\/p>\n<p style=\"text-align: center;\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-3746\" src=\"https:\/\/blog.criware.com\/wp-content\/uploads\/2022\/06\/sonicsync-explainer.png\" alt=\"sonicsync explainer\" width=\"600\" height=\"394\" srcset=\"https:\/\/blog.criware.com\/wp-content\/uploads\/2022\/06\/sonicsync-explainer.png 600w, https:\/\/blog.criware.com\/wp-content\/uploads\/2022\/06\/sonicsync-explainer-300x197.png 300w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><\/p>\n<p>Here is some data collected on iOS devices showing the improvements brought by the use of SonicSYNC.<\/p>\n<p style=\"text-align: center;\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-3747\" src=\"https:\/\/blog.criware.com\/wp-content\/uploads\/2022\/06\/ios-latency.png\" alt=\"ios latency\" width=\"881\" height=\"403\" srcset=\"https:\/\/blog.criware.com\/wp-content\/uploads\/2022\/06\/ios-latency.png 881w, https:\/\/blog.criware.com\/wp-content\/uploads\/2022\/06\/ios-latency-300x137.png 300w, https:\/\/blog.criware.com\/wp-content\/uploads\/2022\/06\/ios-latency-768x351.png 768w\" sizes=\"auto, (max-width: 881px) 100vw, 881px\" \/><\/p>\n<p>And here are the numbers for Android devices:<\/p>\n<p style=\"text-align: center;\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-3748\" src=\"https:\/\/blog.criware.com\/wp-content\/uploads\/2022\/06\/android-latency.png\" alt=\"android latency\" width=\"881\" height=\"403\" srcset=\"https:\/\/blog.criware.com\/wp-content\/uploads\/2022\/06\/android-latency.png 881w, https:\/\/blog.criware.com\/wp-content\/uploads\/2022\/06\/android-latency-300x137.png 300w, https:\/\/blog.criware.com\/wp-content\/uploads\/2022\/06\/android-latency-768x351.png 768w\" sizes=\"auto, (max-width: 881px) 100vw, 881px\" \/><\/p>\n<p><em>These graphs show the results obtained from 20 latency measurements, from the triggering to the actual audio playback with the different methods available in ADX.<\/em><\/p>\n<p>Since audio latency is so much reduced with SonicSYNC, the use of Bluetooth headphones and speakers, which add their own latency, becomes more reliable for gaming.<\/p>\n<h2 style=\"font-size: 150%; font-weight: bold; margin-top: 40px;\">Usage<\/h2>\n<p>Enabling SonicSYNC will allow ADX to play the sound without using any extra buffering. Because of this sound stuttering may occur when using Bus effects with a high CPU load such as <strong>PitchShifter, Reverb, I3DL2 Reverb and Headphone virtual surround<\/strong>. Usually, using a single one of these effects (other than the PitchShifter) should not be an issue. However, it is recommended to be careful when combining several effects.<\/p>\n<p>Some processes can also trigger sound interruptions if they take too long: creating \/ discarding a Voice Pool, creating \/ discarding a Mana Player, loading \/ releasing ACB and AWB files, attaching \/ detaching DSP Bus settings, or locking with <strong>criAtom_Lock<\/strong>. To avoid potential issues, it is recommended to perform these operations when the game is silent.<\/p>\n<p>Finally, since SonicSYNC playback offers a lower latency, the regular low latency playback function must be disabled.<\/p>\n<p>With that in mind, using SonicSYNC in your game is really simple (students and indie game developers will be happy to know that it is also included in <strong>ADX LE<\/strong>).\u00a0 Here are the steps to activate SonicSYNC depending of your game engine.<br \/>\n&nbsp;<br \/>\n<strong><u>Native:<\/u><\/strong><br \/>\nTo use SonicSYNC with the native version of ADX, the threading model must be set to <strong>CRIATOMEX_THREAD_MODEL_MULTI_WITH_SONICSYNC<\/strong> in <strong>CriAtomExConfig<\/strong> when initializing the Atom library.<\/p>\n<p>Note that since the processing of the library will be distributed across multiple threads, it will be necessary to call both <strong>criAtomEx_GetPerformanceInfo<\/strong> and <strong>criAtomExAsrRack_GetPerformanceInfo<\/strong> to get accurate measurements of the total processing load.<br \/>\n&nbsp;<br \/>\n<strong><u>Unity:<\/u><\/strong><br \/>\nWhen using Unity, SonicSYNC has to be enabled for each platform in the <strong>CriWareLibraryInitializer<\/strong>. Additionally, for Android it is highly recommended to also enable <strong>Uses Android Fast Mixer<\/strong>. This device-specific property is used for a better synchronization with the sound buffer of the device, and the latency may be higher if it is disabled.<\/p>\n<p style=\"text-align: center;\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-3749\" src=\"https:\/\/blog.criware.com\/wp-content\/uploads\/2022\/06\/Unity.png\" alt=\"Unity\" width=\"628\" height=\"339\" srcset=\"https:\/\/blog.criware.com\/wp-content\/uploads\/2022\/06\/Unity.png 628w, https:\/\/blog.criware.com\/wp-content\/uploads\/2022\/06\/Unity-300x162.png 300w\" sizes=\"auto, (max-width: 628px) 100vw, 628px\" \/><\/p>\n<p>&nbsp;<br \/>\n<strong><u>Unreal Engine:<\/u><\/strong><br \/>\nIn Unreal, simply go to <em>Project Settings &gt; CriWare &gt; Atom<\/em> and enable the <strong>SmartPhone Use SonicSYNC<\/strong> property.<\/p>\n<p style=\"text-align: center;\">\n<img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-3752\" src=\"https:\/\/blog.criware.com\/wp-content\/uploads\/2022\/06\/Unreal.png\" alt=\"Unreal\" width=\"688\" height=\"181\" srcset=\"https:\/\/blog.criware.com\/wp-content\/uploads\/2022\/06\/Unreal.png 688w, https:\/\/blog.criware.com\/wp-content\/uploads\/2022\/06\/Unreal-300x79.png 300w\" sizes=\"auto, (max-width: 688px) 100vw, 688px\" \/>\n<\/p>\n<h2 style=\"font-size: 150%; font-weight: bold; margin-top: 40px;\">See it in action<\/h2>\n<p><strong>SonicSYNC Gallery<\/strong> is a collection of mini-games showcasing the benefits of using SonicSYNC in various scenarii, from Rhythm to Shooting games. In order to experience audio latency in game and compare it directly with SonicSYNC, each game can be played with different latency profiles that can add up to 200ms of delay.<\/p>\n<p style=\"text-align: center;\">\n<img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-3753\" src=\"https:\/\/blog.criware.com\/wp-content\/uploads\/2022\/06\/sonicsyncapp.png\" alt=\"sonicsyncapp\" width=\"6265\" height=\"877\" srcset=\"https:\/\/blog.criware.com\/wp-content\/uploads\/2022\/06\/sonicsyncapp.png 6265w, https:\/\/blog.criware.com\/wp-content\/uploads\/2022\/06\/sonicsyncapp-300x42.png 300w, https:\/\/blog.criware.com\/wp-content\/uploads\/2022\/06\/sonicsyncapp-768x108.png 768w, https:\/\/blog.criware.com\/wp-content\/uploads\/2022\/06\/sonicsyncapp-1024x143.png 1024w\" sizes=\"auto, (max-width: 6265px) 100vw, 6265px\" \/>\n<\/p>\n<p>&nbsp;<br \/>\nYou can download SonicSYNC Gallery on <a href=\"https:\/\/play.google.com\/store\/apps\/details?id=com.criware.sonicsyncgallery&amp;gl=US\">Google Play Store<\/a> or <a href=\"https:\/\/apps.apple.com\/us\/app\/sonicsync-gallery\/id1576495789\">Apple App Store<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Managing audio latency is crucial in game development, as an interruption or a delay in the sound is much more<\/p>\n","protected":false},"author":2,"featured_media":5490,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"colormag_page_container_layout":"default_layout","colormag_page_sidebar_layout":"default_layout","footnotes":""},"categories":[5,7],"tags":[],"class_list":["post-3741","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-adx","category-tutorials"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/blog.criware.com\/index.php\/wp-json\/wp\/v2\/posts\/3741","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.criware.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.criware.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.criware.com\/index.php\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.criware.com\/index.php\/wp-json\/wp\/v2\/comments?post=3741"}],"version-history":[{"count":13,"href":"https:\/\/blog.criware.com\/index.php\/wp-json\/wp\/v2\/posts\/3741\/revisions"}],"predecessor-version":[{"id":3757,"href":"https:\/\/blog.criware.com\/index.php\/wp-json\/wp\/v2\/posts\/3741\/revisions\/3757"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/blog.criware.com\/index.php\/wp-json\/wp\/v2\/media\/5490"}],"wp:attachment":[{"href":"https:\/\/blog.criware.com\/index.php\/wp-json\/wp\/v2\/media?parent=3741"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.criware.com\/index.php\/wp-json\/wp\/v2\/categories?post=3741"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.criware.com\/index.php\/wp-json\/wp\/v2\/tags?post=3741"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}