0
0

I’ve did some memory allocation tracking with FMOD, and it looks like it’s waisting memory when using FMOD_CREATECOMPRESSEDSAMPLE.

Basically FMOD_CREATECOMPRESSEDSAMPLE would do allocation with the size of the decompressed raw pcm file, instead of doing that by chunks and playing, decoding them.

This means that If I have 1MB uncompressed, 120kb compressed non-streaming MPEG2 resident file, it will first decompressed it, then play it.

Could that be done in a buffering fashion, rather than one big decode, play?

It’s a waste of memory I think.

Or could we do streaming files but from memory (that should be easy to implement with the current FMOD state)?

  • You must to post comments
0
0

I think you have some misunderstanding there, fmod does not ‘allocate memory to decompress the sound into’, otherwise there would be no point to it. That is already what FMOD_CREATESAMPLE does. (same as ‘decompress into memory’ in fmod designer).

What you’re probably seeing is the initial codec overhead for the number of codecs that are needed to play 16 or 32 simultaneous mp3s (see FMOD_ADVANCEDSETTINGS). It obviously doesnt allocate these for every format at the start of System::init, so it only does it the first time a file of that type is opened.

Try opening a second file.

  • You must to post comments
0
0

[quote="brett":1m76dv1l]I think you have some misunderstanding there, fmod does not ‘allocate memory to decompress the sound into’, otherwise there would be no point to it. That is already what FMOD_CREATESAMPLE does. (same as ‘decompress into memory’ in fmod designer).

What you’re probably seeing is the initial codec overhead for the number of codecs that are needed to play 16 or 32 simultaneous mp3s (see FMOD_ADVANCEDSETTINGS). It obviously doesnt allocate these for every format at the start of System::init, so it only does it the first time a file of that type is opened.

Try opening a second file.[/quote:1m76dv1l]

I hope, I’m mistaken then. I’ll check that again tomorrow, and would send some malloc, realloc, free() stats.

  • You must to post comments
0
0

We know exactly what is happening with the allocs, we dont allocated wasted memory that has anything to do with the decompressed length of the sound. It is most likely what I said.

  • You must to post comments
Showing 3 results
Your Answer

Please first to submit.