# Profiling in FMOD and GrowBuffer Confusion

**URL:** <https://qa.fmod.com/t/profiling-in-fmod-and-growbuffer-confusion/20308>\
**Category:** Unity\
**Tags:** unity\
**Created:** [June 12, 2023, 11:12pm UTC](https://qa.fmod.com/t/profiling-in-fmod-and-growbuffer-confusion/20308 "2023-06-12T23:12:11Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![JohnGreska](https://avatars.discourse-cdn.com/v4/letter/j/f05b48/32.png) [@JohnGreska](https://qa.fmod.com/u/JohnGreska)\
**Post date:** [June 12, 2023, 11:12pm UTC](https://qa.fmod.com/t/profiling-in-fmod-and-growbuffer-confusion/20308/1 "2023-06-12T23:12:11Z")

</div>

Hello!

So I have been receiving the  
" [FMOD] AsyncCommandBuffer::growBuffer : Growing command buffer to 65536 bytes." warning,  
and thought it was a little strange. I’m currently in a scene where many sounds play, but not _that_ many sounds play, so I was wondering why it changed that. I looked at other posts concerning this and it said to lower the max instances, but right now i have all my instances for each object playing between 1-3, so I’m not sure why it does that.

So I tried profiling:

 ![image](https://canada1.discourse-cdn.com/flex036/uploads/fmod/original/2X/a/a1e1bd8de3dc9cd51e1f8c3c2968c2a72a0eeb92.png)

I became confused as I don’t believe the amount of active and playing sounds are that much.

I also noticed a few other things, for example:

I have 8 drying machines with a max instance of 3. It says here they are playing and active, but I am not even near any of them at the moment.

Is there a way to not have the sound play at all if I’m not near?

Also, I am using a series of bubbles to create audio ambience at a lake, and using a transmitter:

![image](https://canada1.discourse-cdn.com/flex036/uploads/fmod/original/2X/1/1a8efbfb62993316137ea4f118b61d120222fb00.png)

However, even with setting a max instance of 4, it still is technically playing all 23 instances? I think?

The memory usage throughout is always kept under 16k KB, so it’s not using a _lot_ of memory.  
 ![image](https://canada1.discourse-cdn.com/flex036/uploads/fmod/original/2X/0/0ca5af859e1bb9855915b1f589823f670786b231.png)

If I had to TLDR, my questions are:

1. Why am I receiving the growBuffer warning when I am not using that many sounds? Is it a big deal that it does this?

2. Why are ambient sounds like the drying machine are playing even when I am not in audible distance? Is there any way to prevent this to save space?

3. Are the sounds at the lake using transmission not set up correctly if, even though only 4 are active, all of them are playing? Is that a problem for memory?

Thanks, I hope this was enough detail. Let me know if there’s any more info I can give you.  
Best,  
John

---

<div class="post-metadata">

**Author:** ![Connor\_FMOD](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/connor_fmod/32/3685_2.png) [@Connor\_FMOD](https://qa.fmod.com/u/Connor_FMOD)\
**Post date:** [June 14, 2023, 1:37am UTC](https://qa.fmod.com/t/profiling-in-fmod-and-growbuffer-confusion/20308/2 "2023-06-14T01:37:49Z")

</div>

Hi,

Thank you for all the information.

> [@JohnGreska](#):
>
> Why am I receiving the growBuffer warning when I am not using that many sounds? Is it a big deal that it does this?

- This warning is telling you that the studio system is receiving more commands than it can currently keep track of. As a result, it is having to expand the command buffer to keep track of everything. That is the `growBuffer` warning.
- While 53 total events is not a large amount they all could be calling into the Studio system which could be a cause of the warning.
- In the profiler, I would suggest having a look at the `API Calls View` ([FMOD Studio | Profiling - API Calls View](https://fmod.com/docs/2.02/studio/profiling.html#api-calls-view)) which you can use to check how many Studio calls are being made each frame.

> [@JohnGreska](#):
>
> Why are ambient sounds like the drying machine are playing even when I am not in audible distance? Is there any way to prevent this to save space?

- An option is the `Stop Events Outside Max Distance` option in the FMOD Integration settings  
 ![image](https://canada1.discourse-cdn.com/flex036/uploads/fmod/original/2X/1/1eb9d5047d5abc68cb2c635c8a979f243b4cdce0.png)  
This will stop sounds once they are out of their maximum distance, keep in mind they will have to be restarted if you want them to be heard again.
- An alternative option is setting the `Max Instances` on the `Master Bus` and setting `Stealing` to `Furthest`. This will limit the maximum instances that can be played in total but does solve the issue of having to replay events once coming back into range.

> [@JohnGreska](#):
>
> Are the sounds at the lake using transmission not set up correctly if, even though only 4 are active, all of them are playing? Is that a problem for memory?

- When you mention “However, even with setting a max instance of 4” is this on the `Transiciver` event or on the `Reciever` event? If there is only one `Transceiver` event with the limitation and lots of `Reciever` events that limit will never be hit.

Hope this helps!

---

<div class="post-metadata">

**Author:** ![JohnGreska](https://avatars.discourse-cdn.com/v4/letter/j/f05b48/32.png) [@JohnGreska](https://qa.fmod.com/u/JohnGreska)\
**Post date:** [June 14, 2023, 6:31pm UTC](https://qa.fmod.com/t/profiling-in-fmod-and-growbuffer-confusion/20308/3 "2023-06-14T18:31:16Z")

</div>

Hi Connor, thanks for your reply, I’m looking at the API log, does this mean that each of these lines is a separate sound being called in the game? I don’t even have these many sounds made for it yet haha. That’s worrying?

 ![image](https://canada1.discourse-cdn.com/flex036/uploads/fmod/original/2X/6/6fb8278612ddbe9cff776b9c638650fd88d53147.png)

* * *

For the dryer and stopping sounds, will performance take a huge hit from having those sounds playing in the background?  
There are currently 4 dryer sounds with this result in performance:

 ![image](https://canada1.discourse-cdn.com/flex036/uploads/fmod/original/2X/d/dbc075dce4a103c80107429a6992f1409f1306e5.png)

Probably would like to have 7 in total, scattered around the level.  
And this same process would be for all _background_ devices, like washing machine, fridge hum, microwave whir, etc, looping in the background.

I can do the restart of it is better in the long-run though, if you think?

* * *

Here’s how I set up the transceiver:

TRANSCEIVER

 ![image](https://canada1.discourse-cdn.com/flex036/uploads/fmod/original/2X/0/0d7f042c9acb5f3c7e4a2227566292158738d6e1.png)

RECEIVER

 ![image](https://canada1.discourse-cdn.com/flex036/uploads/fmod/original/2X/a/a6ce26e92d4ca16a60d9e1e5ba4b8b35b47c9a92.png)

Thank you for all your help so far!!

---

<div class="post-metadata">

**Author:** ![Connor\_FMOD](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/connor_fmod/32/3685_2.png) [@Connor\_FMOD](https://qa.fmod.com/u/Connor_FMOD)\
**Post date:** [June 15, 2023, 4:52am UTC](https://qa.fmod.com/t/profiling-in-fmod-and-growbuffer-confusion/20308/4 "2023-06-15T04:52:26Z")

</div>

> [@JohnGreska](#):
>
> each of these lines is a separate sound being called in the game? I don’t even have these many sounds made for it yet haha. That’s worrying?

No, this is just the list of commands being sent to the FMOD system in a single frame. This may indicate that some code is not behaving as expected. Looking at the calls it seems that a lot of events are being moved in the scene, is that correct?

> [@JohnGreska](#):
>
> For the dryer and stopping sounds, will performance take a huge hit from having those sounds playing in the background?  
> There are currently 4 dryer sounds with this result in performance:

That will depend on some factors if there are only 4 it shouldn’t be too expensive. However, since they are out of earshot we should be trying to virtualize them or stop them to save on resources. As things expand like so:

> [@JohnGreska](#):
>
> Probably would like to have 7 in total, scattered around the level.  
> And this same process would be for all _background_ devices, like washing machine, fridge hum, microwave whir, etc, looping in the background.

This is when things will start to get more expensive. So getting these optimizations going early is a good idea.

In regards to your `Transciever` if there is only one in the scene it shouldn’t need the max instances set, and I would suggest setting its priority to `Highest` to make sure that it does not get virtualized ever, priorities are further explained  
under [FMOD Studio | Event Macros Drawer Reference - Priority](https://fmod.com/docs/2.02/studio/event-macro-controls-reference.html#priority). The `Receiver` also seems to be set correctly and in your profiler session, you can see that only `4` events are `Active` which is what you’d expect to see.

---

<div class="post-metadata">

**Author:** ![JohnGreska](https://avatars.discourse-cdn.com/v4/letter/j/f05b48/32.png) [@JohnGreska](https://qa.fmod.com/u/JohnGreska)\
**Post date:** [June 15, 2023, 3:25pm UTC](https://qa.fmod.com/t/profiling-in-fmod-and-growbuffer-confusion/20308/5 "2023-06-15T15:25:06Z")

</div>

> Blockquote  
> No, this is just the list of commands being sent to the FMOD system in a single frame. This may indicate that some code is not behaving as expected. Looking at the calls it seems that a lot of events are being moved in the scene, is that correct?

Yes, there are a lot of moving, physics-based items with sounds or sound scripts attached to them. So this amount of commands being sent is normal?

Is this what is causing the growbuffer warning?

> Blockquote  
> This is when things will start to get more expensive. So getting these optimizations going early is a good idea.

So I will set these to low or lowest priority then, I imagine?

> Blockquote  
> In regards to your `Transciever` if there is only one in the scene it shouldn’t need the max instances set, and I would suggest setting its priority to `Highest` to make sure that it does not get virtualized ever, priorities are further explained

Okay, I will try setting the transceiver to highest.

Thanks.

---

<div class="post-metadata">

**Author:** ![Connor\_FMOD](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/connor_fmod/32/3685_2.png) [@Connor\_FMOD](https://qa.fmod.com/u/Connor_FMOD)\
**Post date:** [June 16, 2023, 8:19am UTC](https://qa.fmod.com/t/profiling-in-fmod-and-growbuffer-confusion/20308/6 "2023-06-16T08:19:39Z")

</div>

Hi,

> [@JohnGreska](#):
>
> Yes, there are a lot of moving, physics-based items with sounds or sound scripts attached to them. So this amount of commands being sent is normal?
> 
> Is this what is causing the growbuffer warning?

The warning tells us that maybe there are some events/behavior that may not be behaving as expected. Would it be possible to get the Unity project [uploaded](https://fmod.com/profile#uploads) to your profile so I can check it on my side? You will have to [register a project](https://fmod.com/profile#projects) with us to be able to upload the project.

> [@JohnGreska](#):
>
> So I will set these to low or lowest priority then, I imagine?

Not necessarily, but more looking into limiting the event instances or limiting the instance that are allowed in the group bus.

 ![image](https://canada1.discourse-cdn.com/flex036/uploads/fmod/original/2X/4/42fde592f1d62be844b16e50318ed8db214347c3.png)

---

<div class="post-metadata">

**Author:** ![JohnGreska](https://avatars.discourse-cdn.com/v4/letter/j/f05b48/32.png) [@JohnGreska](https://qa.fmod.com/u/JohnGreska)\
**Post date:** [June 16, 2023, 3:20pm UTC](https://qa.fmod.com/t/profiling-in-fmod-and-growbuffer-confusion/20308/7 "2023-06-16T15:20:31Z")

</div>

It is currently pending approval and then I will upload the project.

I am not very familiar with the group bus system, what is the difference between using max instances in the group or max instances on the individual event? If I have one column for all SFX, isn’t there the chance that it will cut off a sound I need because there’s no specification?

---

<div class="post-metadata">

**Author:** ![Connor\_FMOD](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/connor_fmod/32/3685_2.png) [@Connor\_FMOD](https://qa.fmod.com/u/Connor_FMOD)\
**Post date:** [June 19, 2023, 1:40am UTC](https://qa.fmod.com/t/profiling-in-fmod-and-growbuffer-confusion/20308/8 "2023-06-19T01:40:11Z")

</div>

Hi,

I will link to our Group Bus documentation, [FMOD Studio | Mixing - Group Buses and Routing](https://fmod.com/docs/2.02/studio/mixing.html#group-buses-and-routing), which goes into further detail about how to use the bus instances limiting, [FMOD Studio | Mixing - Bus Instance Limiting](https://fmod.com/docs/2.02/studio/mixing.html#bus-instance-limiting). In summary, it allows control over large groups of events that can be broken down into categories e.g. SFX, Music, and UI which can then be further broken down to allow for finer control. I would suggest creating overreaching group buses that do not have limits but then creating smaller buses in which you will then place the limits e.g. House appliances.

Hope this helps!

---

<div class="post-metadata">

**Author:** ![JohnGreska](https://avatars.discourse-cdn.com/v4/letter/j/f05b48/32.png) [@JohnGreska](https://qa.fmod.com/u/JohnGreska)\
**Post date:** [June 19, 2023, 4:20pm UTC](https://qa.fmod.com/t/profiling-in-fmod-and-growbuffer-confusion/20308/9 "2023-06-19T16:20:39Z")

</div>

Hello, thank you very much! I will take a look over these resources.

Also, you mentioned you wanted to look over the project files. It is now completely uploaded, so you should be able to take a look at it.

---

<div class="post-metadata">

**Author:** ![Connor\_FMOD](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/connor_fmod/32/3685_2.png) [@Connor\_FMOD](https://qa.fmod.com/u/Connor_FMOD)\
**Post date:** [June 21, 2023, 1:43am UTC](https://qa.fmod.com/t/profiling-in-fmod-and-growbuffer-confusion/20308/10 "2023-06-21T01:43:32Z")

</div>

Hi,

Thank you for sharing the project, it looks very cool!

I was not able to reproduce the issue. Were there actions that you did to trigger the warning consistently?

---

<div class="post-metadata">

**Author:** ![JohnGreska](https://avatars.discourse-cdn.com/v4/letter/j/f05b48/32.png) [@JohnGreska](https://qa.fmod.com/u/JohnGreska)\
**Post date:** [June 21, 2023, 6:25pm UTC](https://qa.fmod.com/t/profiling-in-fmod-and-growbuffer-confusion/20308/11 "2023-06-21T18:25:45Z")

</div>

I would pick up and throw items (with right click) and continue this action repeatedly while walking towards the lake. For me that usually produced the action consistently.

---

<div class="post-metadata">

**Author:** ![Connor\_FMOD](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/connor_fmod/32/3685_2.png) [@Connor\_FMOD](https://qa.fmod.com/u/Connor_FMOD)\
**Post date:** [June 22, 2023, 1:09am UTC](https://qa.fmod.com/t/profiling-in-fmod-and-growbuffer-confusion/20308/12 "2023-06-22T01:09:47Z")

</div>

Hi,

Unfortunately, I was still unable to reproduce the issue.

Could I get you to run DxDiag: [Open and run DxDiag.exe - Microsoft Support](https://support.microsoft.com/en-us/windows/open-and-run-dxdiag-exe-dad7792c-2ad5-f6cd-5a37-bf92228dfd85#:~:text=This%20tool%20is%20used%20to,search%20box%20on%20the%20taskbar). There may be some differences in our machines which is causing the differences in behavior. Please upload the results to your profile.

An option may be manually expanding the size of the `command buffer`. This will increase the initial memory that FMOD uses but should stop the expand command from being called. This can be done in the `RuntimeManger.cs` on line `326`. More information about the `Advanced Settings` can be found here: [FMOD API | Studio API Reference - FMOD\_STUDIO\_ADVACNED\_SETTINGS](https://fmod.com/docs/2.02/api/studio-api-system.html#fmod_studio_advancedsettings).

Another warning I was encountering was `Loading delay exceeded, sound may play at incorrect time` which I was able to solve by enabling the `Load Bank Sample Data` option in the FMOD Integration settings: [Unity Integration | Settings - Load Bank Sample Data](https://fmod.com/docs/2.02/unity/settings.html#load-bank-sample-data).

Let me know if this helps!

---

<div class="post-metadata">

**Author:** ![JohnGreska](https://avatars.discourse-cdn.com/v4/letter/j/f05b48/32.png) [@JohnGreska](https://qa.fmod.com/u/JohnGreska)\
**Post date:** [June 22, 2023, 3:42pm UTC](https://qa.fmod.com/t/profiling-in-fmod-and-growbuffer-confusion/20308/13 "2023-06-22T15:42:34Z")

</div>

Hello,

I uploaded my dxdiag to my profile so you can check it out now.

I ticked the load bank sample data.

For the part in the middle, I tried changing both commandqueuesize:

 ![image](https://canada1.discourse-cdn.com/flex036/uploads/fmod/original/2X/b/b28bdcc562d58d66b6a3b610af237ad695542d93.png)

and cbsize:

 ![image](https://canada1.discourse-cdn.com/flex036/uploads/fmod/original/2X/d/d83f10e46a242856062f9868eeb9416b9f17c453.png)

and I still get the issue with both changes.

In terms of not reproducing the issue, are you picking up and throwing items as you walk along? By the time I throw about 10 items (and a lot of boulders) AND have walked past the fountain AND have walked past the lake (that sounds like a lot but it’s about 20 seconds) then the warning pops up.

---

<div class="post-metadata">

**Author:** ![Connor\_FMOD](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/connor_fmod/32/3685_2.png) [@Connor\_FMOD](https://qa.fmod.com/u/Connor_FMOD)\
**Post date:** [June 26, 2023, 2:23am UTC](https://qa.fmod.com/t/profiling-in-fmod-and-growbuffer-confusion/20308/14 "2023-06-26T02:23:24Z")

</div>

Hi,

The first change was the correct one to make, apologies, I was not clearer. You can keep increasing the initial buffer size till you are no longer seeing the error.

I followed the detailed steps and let the game fun for 20 mins and I still did not see the error.

I hope this helps!

---

<div class="post-metadata">

**Author:** ![JohnGreska](https://avatars.discourse-cdn.com/v4/letter/j/f05b48/32.png) [@JohnGreska](https://qa.fmod.com/u/JohnGreska)\
**Post date:** [June 26, 2023, 3:38pm UTC](https://qa.fmod.com/t/profiling-in-fmod-and-growbuffer-confusion/20308/15 "2023-06-26T15:38:11Z")

</div>

Hi Connor,

Sorry for all this mess, I hope this isn’t taking up too much time.

I set the commandqueue to 120,000 and, while it did pop up later, it still popped up, that it was growing the command buffer to 65536. Is this just something that I need to let happen? Will it affect the game on building?

---

<div class="post-metadata">

**Author:** ![Connor\_FMOD](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/connor_fmod/32/3685_2.png) [@Connor\_FMOD](https://qa.fmod.com/u/Connor_FMOD)\
**Post date:** [June 27, 2023, 3:34am UTC](https://qa.fmod.com/t/profiling-in-fmod-and-growbuffer-confusion/20308/16 "2023-06-27T03:34:54Z")

</div>

Hi,

No need to apologize, it is what I am here for 🙂

It is just a warning letting you know that the command buffer is growing thus taking up more memory. It should not affect the game in any noticeable way.

Could you please try the size to `131,072` rather than `120,000` as this isn’t a value that the `ADVANCEDSETTINGS` can use. This is shown as the buffer was ‘expanded’ to a smaller value than you set.

---

<div class="post-metadata">

**Author:** ![JohnGreska](https://avatars.discourse-cdn.com/v4/letter/j/f05b48/32.png) [@JohnGreska](https://qa.fmod.com/u/JohnGreska)\
**Post date:** [June 27, 2023, 7:55pm UTC](https://qa.fmod.com/t/profiling-in-fmod-and-growbuffer-confusion/20308/17 "2023-06-27T19:55:36Z")

</div>

I set it to that value, but the growing command buffer warning ro 65536 still appears.

---

<div class="post-metadata">

**Author:** ![Connor\_FMOD](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/connor_fmod/32/3685_2.png) [@Connor\_FMOD](https://qa.fmod.com/u/Connor_FMOD)\
**Post date:** [June 28, 2023, 1:53am UTC](https://qa.fmod.com/t/profiling-in-fmod-and-growbuffer-confusion/20308/18 "2023-06-28T01:53:26Z")

</div>

Apologies, I also missed the `if` statement. Could you please comment out lines: `347` `348` `353`.

---

<div class="post-metadata">

**Author:** ![JohnGreska](https://avatars.discourse-cdn.com/v4/letter/j/f05b48/32.png) [@JohnGreska](https://qa.fmod.com/u/JohnGreska)\
**Post date:** [June 28, 2023, 3:56pm UTC](https://qa.fmod.com/t/profiling-in-fmod-and-growbuffer-confusion/20308/19 "2023-06-28T15:56:30Z")

</div>

Just confirming these are the ones you want commented out:

 ![image](https://canada1.discourse-cdn.com/flex036/uploads/fmod/original/2X/7/73e77d09a2efac49c4699c75fced70773065396a.png)

I added 1 to each of the numbers you gave me as my script has the extra line from adding the changed buffer size. When these three lines are commented out, I get this:

 ![image](https://canada1.discourse-cdn.com/flex036/uploads/fmod/original/2X/c/c950a2995997a015d1eb0bffd6fd50a5e0ae4af1.png)

That being said, I did try commenting out regular 347, 348, 353:

 ![image](https://canada1.discourse-cdn.com/flex036/uploads/fmod/original/2X/d/d866ec9f4ea9b43ea448b86963547930363b1671.png)

The game will crash immediately after hitting play.

---

<div class="post-metadata">

**Author:** ![Connor\_FMOD](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/connor_fmod/32/3685_2.png) [@Connor\_FMOD](https://qa.fmod.com/u/Connor_FMOD)\
**Post date:** [June 28, 2023, 11:53pm UTC](https://qa.fmod.com/t/profiling-in-fmod-and-growbuffer-confusion/20308/20 "2023-06-28T23:53:44Z")

</div>

Apologies, it seems your lines do not line up with mine. Looking at your previous posts, you will have to comment out `324` `325` and `330`. Hopefully, this will solve it. Again, apologies for all the confusion.

[Next page](https://qa.fmod.com/t/profiling-in-fmod-and-growbuffer-confusion/20308.md?page=2)
