# Assertion: 'connectionsRemaining == 0' failed

**URL:** https://qa.fmod.com/t/assertion-connectionsremaining-0-failed/19412
**Category:** Unity
**Tags:** unity
**Created:** [October 18, 2022, 6:28am UTC](https://qa.fmod.com/t/assertion-connectionsremaining-0-failed/19412 "2022-10-18T06:28:44Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![simingtu](https://avatars.discourse-cdn.com/v4/letter/s/9e8a1a/32.png) [@simingtu](https://qa.fmod.com/u/simingtu)
#### Post date: [October 18, 2022, 6:28am UTC](https://qa.fmod.com/t/assertion-connectionsremaining-0-failed/19412/1 "2022-10-18T06:28:44Z")

</div>

[FMOD] assert : assertion: ‘connectionsRemaining == 0’ failed  
[FMOD] assert : assertion: ‘connectionsRemaining == 0’ failed  
0  
UnityEngine.Debug:LogError(Object)  
1  
FMODUnity.RuntimeManager:DEBUG\_CALLBACK(DEBUG\_FLAGS, IntPtr, Int32, IntPtr, IntPtr)

can you tell me what does this logerror means?

i tick liveupdate in fmod settings for editor, but the default settings for android is close.  
i run the game in android mobile phone, this log error is uploaded.  
i can publish the release packge, but i want to known the reason.

---

<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: [October 19, 2022, 12:50am UTC](https://qa.fmod.com/t/assertion-connectionsremaining-0-failed/19412/2 "2022-10-19T00:50:29Z")

</div>

Hi,

This error means that not all DSP connections were released correctly when closing. Are you using the function `FMODUnity.RuntimeManger.close()` anywhere in your project?

---

<div class="post-metadata">

### Author: ![simingtu](https://avatars.discourse-cdn.com/v4/letter/s/9e8a1a/32.png) [@simingtu](https://qa.fmod.com/u/simingtu)
#### Post date: [October 19, 2022, 4:12am UTC](https://qa.fmod.com/t/assertion-connectionsremaining-0-failed/19412/3 "2022-10-19T04:12:08Z")

</div>

first, there is no FMODUnity.RuntimeManger.close() function in FMODUnity.RuntimeManger.cs file. our fmod version is 2.01.11:

another question is, i destroy dsp on monobehaviour OnDestroy method:

```auto
    private void AddDSP()
    {
        RuntimeManager.CoreSystem.getMasterChannelGroup(out m_masterGroup);
        var result = m_masterGroup.addDSP(-1, m_faderAllDsp);

        result = m_toneEmpty.getChannelGroup(out FMOD.ChannelGroup g1);
        result = g1.getParentGroup(out FMOD.ChannelGroup parentGroup);
        result = parentGroup.getParentGroup(out FMOD.ChannelGroup parentGroup2);
        m_toneGroup = parentGroup2;
        result = m_toneGroup.addDSP(-1, m_faderDsp);
        result = m_toneGroup.addDSP(-2, m_fftDsp);
    }

    public void OnDestroy()
    {
        ReleaseFmodDSP();
    }

    private void ReleaseFmodDSP()
    {
        var result = m_toneGroup.removeDSP(m_faderDsp);
        result = m_toneGroup.removeDSP(m_fftDsp);
        result = m_masterGroup.removeDSP(m_faderAllDsp);

        result = m_fftDsp.release();
        result = m_faderDsp.release();
        result = m_faderAllDsp.release();
    }

```

but the error still happened. i have three questions:  
is there any method i can call to release all dsp i created to avoid this error logs.  
and is there any method to check which dsp is not released.  
and is there any method to check how many dsps are used in the project.

---

<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: [October 21, 2022, 4:12am UTC](https://qa.fmod.com/t/assertion-connectionsremaining-0-failed/19412/4 "2022-10-21T04:12:43Z")

</div>

Apologies, the function is `FMODUnity.RuntimeManager.CoreSystem.close()`.

When checking FMOD.RESULTS a good function to use is:

```auto
/// <summary>
/// Error checking for FMOD Functions
/// if the fucntions doesn't exit with FMOD.RESULT.OK, it will print a message and the result
/// </summary>
private void ERRCHECK(FMOD.RESULT result, string failMsg)
{
    if (result != FMOD.RESULT.OK)
	{
                Debug.Log(failMsg + " with result: " + result);
	}
}

```

And use it like this  
`ERRCHECK(m_masterGroup.addDSP(-1, m_faderDsp), "Failed to add faderDsp to masterGroup");`  
This way if the function fails it will log it in the console.

Could I please get a code snippet of how you are creating the DSP you are showing?

> [@simingtu](#):
>
> is there any method i can call to release all dsp i created to avoid this error logs.

You could recursively search for all the DSP in the mixer and remove them.

> [@simingtu](#):
>
> and is there any method to check which dsp is not released.

Checking the result when releasing a DSP will be the best way to check if a certain DSP has not been release correctly.

> [@simingtu](#):
>
> and is there any method to check how many dsps are used in the project.

Unfortunately not
