like the others reporting in this forum, I’ve suffered the error (crash) when calling FMOD::System::release().

It always failed at the same location. With your latest dev build, I’ve been able to trace with more details the location of the problem (thanks to your debug libs):


function FMOD::OutputDSounds::update

in this function, there are a number of calls to (in order):

  • FMOD::SystemI::get3DNumListeners
  • FMOD::SystemI::get3DListenerAttributes
  • FMOD::SystemI::get3DSettings

then a series of tests on variables rooloffscale, distancescale, dopplerscale

then erase the struct dsListenerParams

then a call to a function (virtual function?) that leads to an error message if failed:

"IDirectSoundListener::SetAllParameters returned errcode %08X"

then call FMOD::ChannelPool::getNumChannels
then call FMOD::ChannelPool::getChannel (in a loop)


right after the loop that call getChannel above, there is a call to a function (in the debugger, this+0x244 seems to be a pointer to a class, which seems to have a vTbl and the function calls this vTbl+0x44). The vTbl seems to be pointing to 0! maybe an error (a class without a virtual destructor somewhere)??

So the code fails at this exact location everytime!

with fmodexD.dll, this is happening at 006C8F97 (DLL base listed at 006C0000 in the debugger).

Hope this helps!


  • You must to post comments

thats still a different branch to what we’re talking about, could you try with the development branch

  • You must to post comments

Well, I’ve just checked with v33 and it is still happening. NB: I’m not using NON BLOCKING API at all. I’ve tried the tip in this thread in adding a Sleep(1000) before the call to system->release() and this does not change anything.

It is hard to tell what particular sequence of action when opening the API could lead to this, however, the directions I’ve given to locate the code trying to get a value from memory from a pointer to this memory that is null should be easy to catch? It is always crashing at the same code location…

Hope this helps!

  • You must to post comments

Hi Bret, I’m sure it is something simple. Maybe a set of parameters goes wild in the lib? Neverheless, I’ve removed any call to create sound / create channel, so the application just init the sound library with the code pasted below, and closes it when leaving the application, with a call to update between the two in a thread that just does that: calling FMOD:update()


    FMOD_RESULT result;

    // create the main system

    result = FMOD::System_Create(&SoundSystem);     // Create the main system object.
    if (result != FMOD_OK)
        throw (result);

    // need 32 channels minimum

    result = SoundSystem->setSoftwareChannels(32);
    if (result != FMOD_OK)
        throw (result);

    // setup the software mixer format

    result = SoundSystem->setSoftwareFormat(48000,FMOD_SOUND_FORMAT_PCM16,2,2,FMOD_DSP_RESAMPLER_LINEAR);
    if (result != FMOD_OK)
        throw (result);

    // setup the output speakers with the control panel speaker modes

    int numdrivers;
    result = SoundSystem->getNumDrivers(&numdrivers);
    if (result != FMOD_OK)
        throw (result);
    if (numdrivers == 0)
        throw ("No Sound Card detected on the system");

    // assume primary output driver is always at index 0

    FMOD_CAPS           caps;
    FMOD_SPEAKERMODE    speakermode;
    result = SoundSystem->getDriverCaps(0,&caps,0,0,&speakermode);
    if (result != FMOD_OK)
        throw (result);

    result = SoundSystem->setSpeakerMode(speakermode);
    if (result != FMOD_OK)
        throw (result);

    // ready to start the system

    result = SoundSystem->init(100, FMOD_INIT_NORMAL, 0);    // Initialize FMOD.
    if (result != FMOD_OK)
        throw (result);

    // Create sound Groups

    result = SoundSystem->getMasterChannelGroup( &SoundGroups[Group_Master]);
    if (result != FMOD_OK)
        throw (result);


And here is below the log file:

FMOD: OutputDSound::registerDLL : Detected DIRECTX 9
FMOD: FMOD_Output_DSound_EnumProc : Enumerating "Primary Sound Driver"
FMOD: FMOD_Output_DSound_EnumProc : Enumerating "SoundMAX HD Audio"
FMOD: FMOD_Output_DSound_EnumProc : Enumerating "Bluetooth Audio"
FMOD: FMOD_Output_DSound_EnumProc : Enumerating "Bluetooth High Quality Audio"
FMOD: OutputDSound::getDriverCaps : Register DLL
FMOD: OutputDSound::getDriverCaps : Enumerate Drivers
FMOD: OutputDSound::getDriverCaps : CoInitialize
FMOD: OutputDSound::getDriverCaps : DirectSoundCreate8 : id = 0
FMOD: OutputDSound::getDriverCaps : GetCaps
FMOD: OutputDSound::init : Bad Caps or emulated driver. Reverting back to software
FMOD: OutputDSound::close :
FMOD: OutputDSound::close : Free channel pool 2d
FMOD: OutputDSound::close : Free channel pool 3d
FMOD: OutputDSound::close : Release directsound listener
FMOD: OutputDSound::close : Release directsound object
FMOD: OutputDSound::close : FreeLibrary on dsound3d.dll
FMOD: OutputDSound::close : FreeLibrary on dsound.dll
FMOD: OutputDSound::close : Free driver list
FMOD: OutputDSound::close : done
FMOD: SystemI::init : maxchannels = 100, flags = 00000000, extradriverdata = 00000000
FMOD: SystemI::close :
FMOD: SystemI::close : Shut down streamer and FMOD_NONBLOCKING and FileSystem thread.
FMOD: SystemI::close : Remove all user channel groups.
FMOD: SystemI::close : Remove ‘main’ channel group.
FMOD: SystemI::close : Remove miscllaneous DSP stuff.
FMOD: SystemI::close : done.

FMOD: OutputDSound::init : Register DLL
FMOD: OutputDSound::init : Enumerate Drivers
FMOD: FMOD_Output_DSound_EnumProc : Enumerating "Primary Sound Driver"
FMOD: FMOD_Output_DSound_EnumProc : Enumerating "SoundMAX HD Audio"
FMOD: FMOD_Output_DSound_EnumProc : Enumerating "Bluetooth Audio"
FMOD: FMOD_Output_DSound_EnumProc : Enumerating "Bluetooth High Quality Audio"
FMOD: OutputDSound::init : DirectSoundCreate8 : mSelectedDriver = -1
FMOD: OutputDSound::init : SetCooperativeLevel
FMOD: OutputDSound::init : GetCaps
FMOD: OutputDSound::init : Bad Caps or emulated driver. Reverting back to software
FMOD: OutputDSound::init : Create Primary Buffer
FMOD: OutputDSound::init : Set Primary Buffer Format
FMOD: OutputDSound::init : Getting Listener Interface
FMOD: OutputDSound::init : Done
FMOD: SystemI::init : Set up software engine
FMOD: OutputDSound::createSample : length 4096, channels 2, format 2, mode 0000002a
FMOD: OutputDSound::createSample : done
FMOD: Thread::initThread : Initializing FMOD mixer thread. priority 3
FMOD: Thread::initThread : – Stacksize 32768. Stack pointer 00000000 : usesemaphore = 0 : sleeptime = 10
FMOD: Thread::initThread : done.
FMOD: Thread::callback : * FMOD mixer thread started
FMOD: SystemI::init : Set up emulated output
FMOD: SystemI::init : create the channel pool
FMOD: SystemI::init : Set up streamer
FMOD: Thread::initThread : Initializing FMOD stream thread. priority 2
FMOD: Thread::initThread : – Stacksize 32768. Stack pointer 00000000 : usesemaphore = 0 : sleeptime = 10
FMOD: Thread::callback : * FMOD stream thread started
FMOD: Thread::initThread : done.
FMOD: SystemI::init : done

FMOD: SystemI::close :
FMOD: SystemI::recordStop :
FMOD: SystemI::recordStop : done
FMOD: SystemI::close : Stop all sounds

  • You must to post comments

Hi Bret,

it is unfortunate we don’t have new report from Billp who’s experiencing the same issue. It turns out after experimenting for a month with this that the root of the issue is this: when FMOD is used (init/loop/release) from a DLL code, which DLL is used by an application .exe, then, it exhibit this crashing issue.

Now this begs the question to you: What is the correct way to use the fmod sound system from a DLL, that is itself used by a .exe, or by another DLL?

Do you have a typical code fragement of how and where to place the init, the loop, and the release code blocks?

This is critical it is used from a DLL.

Thanks in advance.


  • You must to post comments

My problem may be different from CptLucky’s of course, but I’m still getting the same problem with v35 i.e. crashes if I don’t do the sleep before calling release. It seems to be only when I’ve triggered music for my jukebox that does it though, and they come from Stream From Disk wave banks (can have a maximum of 2 loaded at any time, but only 1 playing).

When I used the debug output the last time to see if that helped, the last entries just say

FMOD: SystemI::close : Free software output.
FMOD: SystemI::close : Free emulated output.
FMOD: SystemI::close : Free channel pool.
FMOD: SystemI::close : Remove miscllaneous DSP stuff.
FMOD: SystemI::close : done.

FMOD: EventSystemI::release : released.

So no real help there (for me anyway).

  • You must to post comments

I’ve futher made a test: I’ve disabled any call to FMOD::update. The application now crashes in another code point when calling ->release(). The call stack is the same as the other message I’ve posted above (well, on page 1 of the thread). It now crashes a little earlier but always in the same function of your code. Here is the disassembly, the EIP is stopped at 0x00708EF1 mov ecx, dword ptr [eax] with eax = 0x02C97640 (which ressemble a memory allocated in the heap).

0708D2D mov eax,dword ptr [esp+4]
00708D31 test eax,eax
00708D33 jne FMOD::OutputDSound::getHandle+0Dh (708D3Ah)
00708D35 push 24h
00708D37 pop eax
00708D38 jmp FMOD::OutputDSound::getHandle+17h (708D44h)
00708D3A mov ecx,dword ptr [ecx+240h]
00708D40 mov dword ptr [eax],ecx
00708D42 xor eax,eax
00708D44 ret 4
00708D47 push ebp
00708D48 mov ebp,esp
00708D4A sub esp,8Ch
00708D50 fldz
00708D52 push ebx
00708D53 push esi
00708D54 fstp dword ptr [ebp-44h]
00708D57 fldz
00708D59 mov esi,ecx
00708D5B xor ebx,ebx
00708D5D fstp dword ptr [ebp-40h]
00708D60 fldz
00708D62 cmp dword ptr [esi+244h],ebx
00708D68 push edi
00708D69 fstp dword ptr [ebp-3Ch]
00708D6C fldz
00708D6E fstp dword ptr [vel]
00708D71 fldz
00708D73 fstp dword ptr [ebp-34h]
00708D76 fldz
00708D78 fstp dword ptr [ebp-30h]
00708D7B fldz
00708D7D fstp dword ptr [front]
00708D80 fldz
00708D82 fstp dword ptr [ebp-1Ch]
00708D85 fld1
00708D87 fstp dword ptr [ebp-18h]
00708D8A fldz
00708D8C fstp dword ptr [top]
00708D8F fld1
00708D91 fstp dword ptr [ebp-28h]
00708D94 fldz
00708D96 fstp dword ptr [ebp-24h]
00708D99 je FMOD::OutputDSound::update+276h (708FBDh)
00708D9F mov ecx,dword ptr [esi+34h]
00708DA2 lea eax,[numlisteners]
00708DA5 push eax
00708DA6 call FMOD::SystemI::get3DNumListeners (766C89h)
00708DAB cmp eax,ebx
00708DAD jne FMOD::OutputDSound::update+278h (708FBFh)
00708DB3 cmp dword ptr [numlisteners],1
00708DB7 jne FMOD::OutputDSound::update+93h (708DDAh)
00708DB9 lea eax,[top]
00708DBC mov ecx,dword ptr [esi+34h]
00708DBF push eax
00708DC0 lea eax,[front]
00708DC3 push eax
00708DC4 lea eax,[vel]
00708DC7 push eax
00708DC8 lea eax,[pos]
00708DCB push eax
00708DCC push ebx
00708DCD call FMOD::SystemI::get3DListenerAttributes (766F05h)
00708DD2 cmp eax,ebx
00708DD4 jne FMOD::OutputDSound::update+278h (708FBFh)
00708DDA lea eax,[rolloffscale]
00708DDD mov ecx,dword ptr [esi+34h]
00708DE0 push eax
00708DE1 lea eax,[distancescale]
00708DE4 push eax
00708DE5 lea eax,[dopplerscale]
00708DE8 push eax
00708DE9 call FMOD::SystemI::get3DSettings (766C36h)
00708DEE cmp eax,ebx
00708DF0 jne FMOD::OutputDSound::update+278h (708FBFh)
00708DF6 fld dword ptr [dopplerscale]
00708DF9 fcomp dword ptr [esi+27Ch]
00708DFF fnstsw ax
00708E01 test ah,44h
00708E04 jp FMOD::OutputDSound::update+0F6h (708E3Dh)
00708E06 fld dword ptr [distancescale]
00708E09 fcomp dword ptr [esi+280h]
00708E0F fnstsw ax
00708E11 test ah,44h
00708E14 jp FMOD::OutputDSound::update+0F6h (708E3Dh)
00708E16 fld dword ptr [rolloffscale]
00708E19 fcomp dword ptr [esi+284h]
00708E1F fnstsw ax
00708E21 test ah,44h
00708E24 jp FMOD::OutputDSound::update+0F6h (708E3Dh)
00708E26 mov eax,dword ptr [esi+34h]
00708E29 cmp byte ptr [eax+9E8h],bl
00708E2F jne FMOD::OutputDSound::update+0F6h (708E3Dh)
00708E31 cmp byte ptr [eax+9E9h],bl
00708E37 je FMOD::OutputDSound::update+23Ch (708F83h)
00708E3D push 40h
00708E3F lea eax,[dsListenerParams]
00708E45 pop edi
00708E46 push edi
00708E47 push ebx
00708E48 push eax
00708E49 call memset (782A5Ch)
00708E4E mov eax,dword ptr [dopplerscale]
00708E51 add esp,0Ch
00708E54 fld1
00708E56 mov dword ptr [ebp-50h],eax
00708E59 mov eax,dword ptr [rolloffscale]
00708E5C fdiv dword ptr [distancescale]
00708E5F mov dword ptr [ebp-54h],eax
00708E62 mov eax,dword ptr [front]
00708E65 mov dword ptr [ebp-70h],eax
00708E68 mov eax,dword ptr [ebp-1Ch]
00708E6B mov dword ptr [ebp-6Ch],eax
00708E6E mov eax,dword ptr [ebp-18h]
00708E71 mov dword ptr [ebp-68h],eax
00708E74 mov eax,dword ptr [top]
00708E77 mov dword ptr [ebp-64h],eax
00708E7A mov eax,dword ptr [ebp-28h]
00708E7D mov dword ptr [ebp-60h],eax
00708E80 mov eax,dword ptr [ebp-24h]
00708E83 mov dword ptr [ebp-5Ch],eax
00708E86 mov eax,dword ptr [pos]
00708E89 mov dword ptr [ebp-88h],eax
00708E8F mov eax,dword ptr [ebp-40h]
00708E92 mov dword ptr [ebp-84h],eax
00708E98 mov eax,dword ptr [ebp-3Ch]
00708E9B mov dword ptr [ebp-80h],eax
00708E9E mov eax,dword ptr [vel]
00708EA1 mov dword ptr [ebp-7Ch],eax
00708EA4 mov eax,dword ptr [ebp-34h]
00708EA7 mov dword ptr [ebp-78h],eax
00708EAA mov eax,dword ptr [ebp-30h]
00708EAD mov dword ptr [ebp-74h],eax
00708EB0 mov eax,dword ptr [esi+34h]
00708EB3 mov dword ptr [dsListenerParams],edi
00708EB9 fstp dword ptr [ebp-58h]
00708EBC test byte ptr [eax+1Ch],2
00708EC0 je FMOD::OutputDSound::update+19Bh (708EE2h)
00708EC2 fld dword ptr [ebp-18h]
00708EC5 fchs
00708EC7 fstp dword ptr [ebp-68h]
00708ECA fld dword ptr [ebp-24h]
00708ECD fchs
00708ECF fstp dword ptr [ebp-5Ch]
00708ED2 fld dword ptr [ebp-3Ch]
00708ED5 fchs
00708ED7 fstp dword ptr [ebp-80h]
00708EDA fld dword ptr [ebp-30h]
00708EDD fchs
00708EDF fstp dword ptr [ebp-74h]
00708EE2 mov eax,dword ptr [esi+244h]
00708EE8 lea edx,[dsListenerParams]
00708EEE push 1
00708EF0 push edx
00708EF1 mov ecx,dword ptr [eax] ***** <—- CRASHES HERE *****
00708EF3 push eax
00708EF4 call dword ptr [ecx+28h]
00708EF7 cmp eax,ebx
00708EF9 mov dword ptr [hr],eax
00708EFC je FMOD::OutputDSound::update+1CCh (708F13h)
00708EFE push eax
00708EFF push offset string "IDirectSoundListener::SetAllPara"... (790F2Ch)
00708F04 push offset string "OutputDSound::update" (790F14h)
00708F09 push 592h
00708F0E jmp FMOD::OutputDSound::update+25Eh (708FA5h)

  • You must to post comments

[quote:yoyquus8]it is unfortunate we don’t have new report from Billp who’s experiencing the same issue[/quote:yoyquus8]

Apologies… I tried to update to a newer version, it didn’t "just work" so there was a delay, which was just enough time for a "high priority interrupt" to drag me to another project 😡

Side note for one second… The "didn’t just work" was that Eventsystem::getGroup returns an "Invalid Parameter" with the newer versions, and it used to just work. Now that I’m back into this, I found that EventSystem::load has changed and has a 3rd argument, the EventProject pointer.

If I use Event[b:yoyquus8]Project[/b:yoyquus8]::getGroup, my code is back to operational.

OK, let me first admit that I haven’t looked through the forum for an answer, but let me just ask: Does EventProject now [i:yoyquus8]supercede [/i:yoyquus8] EventSystem::getGroup()? Or should BOTH still work?

I am now using 4.04.51

Back to the DLL issue…
[quote:yoyquus8]It turns out after experimenting for a month with this that the root of the issue is this: when FMOD is used (init/loop/release) from a DLL code, which DLL is used by an application .exe, then, it exhibit this crashing issue. [/quote:yoyquus8]

I am just now back to getting my code working under 4.04.51, but I noted that the very first run of this code as a DLL failed in the same place… Sound::release().

I am using VC++ Express, FWIW. The non-DLL version of the code runs fine (basically my previous report, all over again), and the DLL version runs FINE, but just is not happy with release().

I will experiment some more and report any findings.



  • You must to post comments

does anyone have a simple project that reproduces this issue? When we do this with our tests there are no crashes, so there is something you guys are doing different to us, though i’m trying everything.

edit: i may have reproduced it i’ll keep you posted.

  • You must to post comments

Additional report:

now if I call again FMOD::update(), it still crash of course, but back at the same location as initialy posted, right before the call to direct sound CommitDeferredSettings

I’ve forgotten to add: the windows message I get is:

Unhandled exception at 0x00708f8a (fmodex.dll) in myapplication.exe: 0xC0000005: Access violation reading location 0x02b37640.

I’ve no doubt all is fine for everyone, but it seems I’ve found a code path for at least any FMOD DLL for the past 2 months to lead to a crash ALWAYS at the SAME LOCATION, right before the call to CommitDeferredSettings.

I hope all this information will help you track it down. It seems I use pretty much standard init code?!?

Hope this helps!

  • You must to post comments

On your side note, with the addition of EventProject, EventSystem::getGroup paths now need to include their EventProject name as well e.g.




Same goes for EventSystem::getEventGroup.

  • You must to post comments

Ok i have reproduced a release crash especially to do with streams, and put a new intermediate version at ftp://ftp.fmod.org l:upload p:upload in the development directory.

It is 4.04.37, let me know how you go with it.

  • You must to post comments


our error reportting system shows a crash like this, too. I haven’t been able to locate where fmod crashes in these situations and we are not able to reproduce it on our developing and testing machines as well. It’s just some sheldom effect that occours on systems of our users. The only thing I know is that we got no such reports from Linux and Mac users only on Windows.


  • You must to post comments

Yeah, Brett that appears to have fixed the problem I was having. I had a way I could reproduce the crash, and it didn’t happen once in the 10 times I tried it with v37.

Sorry I couldn’t have been more help with an example project, but it would have been very difficult to extract something meaningful for you for this one.

Thanks again Brett, much appreciated, and great work!

  • You must to post comments

so you’re calling fmod functions from different threads? If so, that’s your problem. We repeatedly say not to do that, in fact the latest version spams a warning if you do and i’ve made it bigger and bolder in the documentation.

  • You must to post comments

Hi Bret,

it is still crashing with .37 and it looks like it is the same error. It will be hard to provide a "sample/test" project though as our soundmanager class is tied up with many other things in our project.

Is there any "trace enabled" "debug" version I could try for you? from the "trace" I’ve done in the debugger, it should be quite "locatable" in your code: either your code is calling a virtual function for class, which pointer to its vtable in the other class is 0, or, you are calling a pointer that has been set to 0 before. For the later, a simple test of the pointer before calling the function should help trap the issue, in the former I suspect a destructor called too soon somewhere like this:

delete m_ptr_to_my_class;

m_ptr_to_my_class = 0; <—- missing line leaving something not expected.

Hope this helps!

  • You must to post comments

Hi Bret,

no, not from a different thread, the same thread. I was mentioning "thread" as the update loop of the application is in a thread. BUT, when I don’t call FMOD:Update() at all, so just starting it, and when the application quits closing it with the C++ code above, it crashes as well, in the same function, just at a different location (right in the code block before the other one).

This is all taking place in a code of yours that call "direct sound update" when it closes.

Let me explain the software architecture as it is implemented right now in order to make sure all is correct thread wise for you:

1) application.exe binds to an application.dll
2) application.dll contains the code to create 1 instance of our main class
3) the main class uses 1 instance of our soundclass
4) our sound class init the FMOD (code above) in a function "init" called by our main class when the main class is called to init from the DLL which is called to init from the .exe
5) the sound class play sounds, and closes FMOD in its destructor
6) the application tells the DLL to create a thread, and this thread will call an "update" in our main class, that will also call the sound class update which call the FMOD::update(). NB: EVEN WITHOUT calling FMOD update() at all, it crashes on system->release() BUT at a different location
7) instead of asking the DLL to create an update thread, the application can call an update() function in the DLL that directly calls update of the main class that will call update of the sound class that will call update of FMOD. Usually done from a windows timer in the .exe. In this case, FMOD ALSO CRASHES (no additional thread involved)
8 ) the exe can tell the DLL to close, and then the DLL closes the main class which call the sound class to close which call system->release()

I think it is safe to say there is no thread pbm in this architecture, but you certainly have more experience in the matter.

Obviously, again, cannot you add a simple "if (my_variable !=0) before calling the function of your class? because it looks like it is the issue. I don’t have YOUR source code, but does it makes sense when I read the information I have that I assume there is a realchannel class in your code, with virtual functions? it looks like the vfptr table is pointing to "non valid" memory for the code somewhere.

I’m quite stuck. However, maybe I don’t need to call ->release() at all? question: when the .exe call the .DLL to tell it to close, it delete the instance of our main class, and the DLL unloads and the .exe exits. At this stage, I would assume FMOD DLL also unloads from memory and your destructors properly delete all allocated memory? so if I don’t call ->release() at all, there shouldn’t be any memory anyhow nor locked ressources isn’t it?

Just let me know how the best I could help.

  • You must to post comments

Thanks John, I’ll check that out.

  • You must to post comments

you can use fmodexd.dll and fmodexd.pdb, if you rename both to fmodex.dll and fmodex.pdb you can get debug info.
It also outputs logging info to the debug window.

  • You must to post comments

The best way you could help is to find out what it is you are doing that makes that crash happen. It sounds like you can reproduce it easily, so there is something inbetween the init and release causing it.
Putting some if statement around a realchannel pointer is -not- a solution when 99% of the time it works. You make it sound like it always does this by simply calling init and release after each other, but this is not the case. So what in between causes it? You should be able to comment out your whole application inbetween the init and release until you find the cause.

  • You must to post comments


it is still causing the error with the latest 4.04.31


  • You must to post comments
Showing 1 - 20 of 30 results
Your Answer

Please first to submit.