I was wondering if it was possible to get information about what the size in memory will be if I load up a complete fsb file. I need this kind of information to show in our tools what impact the audio projects have.
The problem gets bigger as most project have multiple fsb files and we want to know the impact of them separately.
Any ideas or info I might have overlooked?
- Rein asked 9 years ago
You can use EventSystem::getInfo. Passing in a FMOD_EVENT_SYSTEMINFO struct containing an array of FMOD_EVENT_WAVEBANKINFO structs. That should give you all the information you need.
That wavebank info struct contains memory information as well so rather than loading the soundbank manually you could just iterate through all the event groups and call ‘loadEventData’ to make sure it’s completely loaded then just use the memory information in that struct. Keep in mind these are worst case scenario numbers, FMOD will generally only load sounds from the bank as they are requested.
You can do exactly that with the FMOD Event Player. Double-click on your FEV file (or, if your file associations aren’t set up properly, run fmod_eventplayer.exe in your FMOD Designer install project).
Once the program loads, you can right-click on each EventGroup and select "Load Data". The memory usage for each FSB will be displayed on the right.
- Adiss answered 9 years ago
I wrote a little script to parse the output of the fmod_designer_cl (command line tool) and output a spreadsheet of each source file’s encoded size in its FSB.
The FMod Event player solution doesn’t work for console based hardware codecs, like GCADPCM.
- mattconnolly answered 9 years ago
Matt, that’s a nice trick. Might have to do something like that here
Something everyone should keep in mind with audio budgeting from FMOD Designer is to factor in the overhead of the non-wav data (event defs, strings, fsb registries, etc). If you don’t, it’s easy to underestimate your total audio footprint (like we did!)
Wav data is by far the largest, but all of that other data can add up to quite a bit, especially if you have a lot of events or route voice through FMOD designer. In our last game, with all projects loaded but no samples loaded, the baseline was about 4 MB. A lot of this data is dependent on the size of runtime structures and is hard to gather offline, but it might be worth including some sort of estimate based on number of events or somesuch.
Yeah that’s true, we can actually see how much fmod allocates for the wave data and because we recurse all the event groups and retrieve each event as soon as we load an fev we get the event allocations upfront. What we find difficult to predict is how much is then going to be used during the game by other stuff.
We seem to notice that for example an event allocates working memory based on its Max Instances. So if that is set to 3, it’s only after we’ve played that event 3 times that we get the max memory allocation for the event. Same like reverb, its only on the first call to ::setReverbProperties() that it seems to initialise the SFX reverb unit and allocate the memory it needs, and then filters for events and custom created filters, etc.
Calling getMemoryInfo() seems to only retrieve the amount of memory each thing is already using and not the total that it can actually use (like calling it before and after playing Max Instances of an event gives different results).
Sorry if that sounded a bit confusing. Does anybody have an idea of how to predict these things? It would be really useful to have a estimate of the total memory Fmod will use.
- pcorvo answered 9 years ago
pcorvo, you might check out loadEventData which can be used to pre-allocate all of the event instance memory associated with an EventGroup (and also streams and sample memory). It’s a good way to ensure that you’re always allocating at the worst case.
As for reverbs and whatnot, it’s a good question. We don’t have a really solid strategy other than reserving a buffer in our budget for "system" allocations.
Please login first to submit.