# Studio::System::update function call frequency. Sound artefacts

**URL:** https://qa.fmod.com/t/studio-update-function-call-frequency-sound-artefacts/21667
**Category:** FMOD Studio
**Tags:** javascript, html5
**Created:** [May 27, 2024, 5:39pm UTC](https://qa.fmod.com/t/studio-update-function-call-frequency-sound-artefacts/21667 "2024-05-27T17:39:30Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![d.mazur](https://avatars.discourse-cdn.com/v4/letter/d/c68b51/32.png) [@d.mazur](https://qa.fmod.com/u/d.mazur)
#### Post date: [May 27, 2024, 5:39pm UTC](https://qa.fmod.com/t/studio-update-function-call-frequency-sound-artefacts/21667/1 "2024-05-27T17:39:30Z")

</div>

Hello! My company wants to use FMOD for new games. I am developing a PoC and I am interested in how often **Studio::System::update** should be called. I am trying to do this in requestAnimationFrame and then the calls occur approximately every 16.6ms. This works well except when the main browser thread executes some code for a longer time. In this case, when the interval between calls increases to 18-22ms, I hear sound artefacts: crackles, pops, etc.  
So is it really true that a uniform **Studio::System::update** call frequency is very important?  
If so, are there any other ways to make it more uniform in a web application?  
I tried using **setInterval** with a frequency of 50ms. This also works until the interval increases to 55-65ms, at which point I hear the same horrible artifacts.  
I would be very grateful for your help, our company has high hopes for FMOD.

---

<div class="post-metadata">

### Author: ![jeff\_fmod](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/jeff_fmod/32/1766_2.png) [@jeff\_fmod](https://qa.fmod.com/u/jeff_fmod)
#### Post date: [May 28, 2024, 2:17am UTC](https://qa.fmod.com/t/studio-update-function-call-frequency-sound-artefacts/21667/2 "2024-05-28T02:17:15Z")

</div>

It isn’t the call frequency of `Studio::System::update` that would be causing the crackling, rather the cracklng and stalled `update` call are both separate side effects of the slow operation. Calls to `update` are for updating 3D positions, triggering callbacks etc, and the mixer will run independently of calls to `update`, so strictly uniform `update` calls are not necessary.

As for the crackling, HTML5 doesn’t have good support for threads, so the mixer can be blocked by work that would be trivial on any other platform. There are a few things you can do to workaround this performance limitation:

- Increase your [DSP buffer size](https://fmod.com/docs/2.02/api/core-api-system.html#system_setdspbuffersize), which will increase latency, but reduce [stuttering](https://fmod.com/docs/2.02/api/platforms-html5.html#audio-stability-stuttering).
- Enable the `Cross-Origin-Opener-Policy: same-origin` and `Cross-Origin-Embedder-Policy: require-corp` policies in your server header. This will enable a fast code path which uses a [SharedArrayBuffer](https://caniuse.com/#feat=sharedarraybuffer).
- Use https instead of http for your website. This will allow the faster [`FMOD_OUTPUTTYPE_AUDIOWORKLET`](https://fmod.com/docs/2.02/api/core-api-system.html#fmod_outputtype_audioworklet) output type to be used.

Please give those optimizations a go and let me know if you are still getting stuttering when the browser’s workload increases.

---

<div class="post-metadata">

### Author: ![d.mazur](https://avatars.discourse-cdn.com/v4/letter/d/c68b51/32.png) [@d.mazur](https://qa.fmod.com/u/d.mazur)
#### Post date: [May 28, 2024, 1:27pm UTC](https://qa.fmod.com/t/studio-update-function-call-frequency-sound-artefacts/21667/3 "2024-05-28T13:27:03Z")

</div>

Thank you for answer!  
Today I discovered that the issue with stuttering appears only if chrome dev-tools page is opened. Without it all looks pretty smooth. So probably my problem is not really… a problem.
