I’m evaluating FMOD for a indie game project, and I want to use the hardware accelerated posibilities of Creative X-Fi cards. So I made a simple test playing 50 voices in hardware, with and without reverb.

The problem is that if I initialize fmod in default mode (running Windows XP, so defaulting to directsound) I can play the 50 voices with and without reverb, and with and without FMOD_HARDWARE flag, with as little CPU usage as 1-2% (QuadCore @ 3.0Ghz)

But, if I initialize FMOD with OpenAL support [setOutput( FMOD_OUTPUTTYPE_OPENAL )], then playing the sounds with FMOD_HARDWARE consumes 20-25% CPU, with about 5-10% kernel usage. If I use FMOD_SOFTWARE it consumes again 1-2%.

So, what’s wrong with the OpenAL usage? I’ve tried also on Vista x64 with latest X-Fi drivers and OpenAL 2.0.3 and the same CPU average.

Here is the code I used for the test (some checks are removed for easy reading)

unsigned int version;

MY_ASSERT( FMOD::System_Create(&system) );
MY_ASSERT( system->getVersion(&version) );

// Select OpenAL before any other query
if( system->setOutput( FMOD_OUTPUTTYPE_OPENAL ) == FMOD_OK )
    LogG("OpenAL support activated!");
    MY_ASSERT( system->setOutput( FMOD_OUTPUTTYPE_AUTODETECT ) ); // DirectSound for windows XP/Vista

int minFrec, maxFrec;
result = system->getDriverCaps(0, &caps, &minFrec, &maxFrec, &speakermode);

if (caps & FMOD_CAPS_HARDWARE_EMULATED)             /* The user has the 'Acceleration' slider set to off!  This is really bad for latency!. */
{                                                   /* You might want to warn the user about this. */
    result = system->setDSPBufferSize(1024, 10);    /* At 48khz, the latency between issuing an fmod command and hearing it will now be about 213ms. */


MY_ASSERT( system->init(128, FMOD_INIT_NORMAL, 0) ); 

system->setReverbProperties( &rp );

FMOD::Sound *sound;
FMOD_RESULT result = system->createSound("../media/sound.wav",  FMOD_HARDWARE | FMOD_3D, 0, &sound);

FMOD::Channel *channel;
for( int i=0; i<50; ++i )
    result = system->playSound(FMOD_CHANNEL_FREE, sound, false, &channel);


Any ideas?

Thanks a lot in advance.

  • You must to post comments

Uhmm… I’ve just discovered that launching the application without the debugger (VS2005) drops the CPU usage in OpenAL mode.

I’ve tested with 128 voices and Reverb, and get these results

Software Mode 128 3D voices: 2-3%
OpenAL Mode 128 3D voices: 5-7%

These are better results than before, but hardware should be faster than software, isn’t it? Maybe if using more simultaneous EAX effects could I get better results in OpenAL mode than in software? Is the quality of the EAX reverb the same as the software one?

BTW, amazing performance of FMOD software mode 😛

  • You must to post comments

FMOD’s software reverb is about the equivalent of EAX 3, it is very high quality, and the author of fmod’s reverb actually wrote the code for EAX4 implementation. (making sure certain patent issues were avoided of course). EAX 4 and EAX 5 just added some more parameters to tweak it further.

I can’t really explain why the hardware mode is not as fast. FMOD’s mixer is very optimized, and unexplained slowness is usually due to driver overhead. I think I run though a few reasons in the fmod documentation why FMOD’s software mixer is better (mainly more features, cross platform sound, better performance), I would just recommend using FMOD_SOFTWARE.

  • You must to post comments
Showing 2 results
Your Answer

Please first to submit.