# Do I have to call FMOD\_Channel\_RemoveDSP()?

**URL:** https://qa.fmod.com/t/do-i-have-to-call-fmod-channel-removedsp/16797
**Category:** FMOD Engine
**Tags:** cpp
**Created:** [February 22, 2021, 2:25pm UTC](https://qa.fmod.com/t/do-i-have-to-call-fmod-channel-removedsp/16797 "2021-02-22T14:25:18Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![jiyongman](https://avatars.discourse-cdn.com/v4/letter/j/ebca7d/32.png) [@jiyongman](https://qa.fmod.com/u/jiyongman)
#### Post date: [February 22, 2021, 2:25pm UTC](https://qa.fmod.com/t/do-i-have-to-call-fmod-channel-removedsp/16797/1 "2021-02-22T14:25:18Z")

</div>

Do I have to call **FMOD\_Channel\_RemoveDSP()** and remove a DSP added to a channel with **FMOD\_Channel\_AddDSP()** after the sound stops?

I’m confused because **FMOD\_Channel\_Stop()** releases resources and invalidates the **FMOD\_CHANNEL** handle.  
That means **FMOD\_Channel\_RemoveDSP()** won’t work with my stale handle.

But as for **FMOD\_DSP\_Release()**, the document says :  
“If DSP is not removed from the network with ChannelControl::removeDSP after being added with ChannelControl::addDSP, it will not release and will instead return FMOD\_ERR\_DSP\_INUSE.”

I’m confused.  
Also, if I really have to remove the channel DSP, it’s a little bit annoying because I need to write extra code for that (like callbacks or checking logic if the sound stopped naturally or manually.).

So far, I mostly used global DSPs added to channel groups, but this time I need to add many different DSPs individually.

---

<div class="post-metadata">

### Author: ![joseph](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/joseph/32/264_2.png) [@joseph](https://qa.fmod.com/u/joseph)
#### Post date: [February 23, 2021, 2:16am UTC](https://qa.fmod.com/t/do-i-have-to-call-fmod-channel-removedsp/16797/2 "2021-02-23T02:16:44Z")

</div>

As part of stopping the channel, `ChannelControl::stop` automatically calls `ChannelControl::removeDSP` to remove all DSPs in the channel’s chain. You then need to call `DSP::release` on each of the DSPs to release them.

So, you do not have to call `ChannelControl::removeDSP` if you are stopping the channel with `ChannelControl::stop`, but you do need to call `DSP::release` for each DSP that you have created and added to the channel.

---

<div class="post-metadata">

### Author: ![jiyongman](https://avatars.discourse-cdn.com/v4/letter/j/ebca7d/32.png) [@jiyongman](https://qa.fmod.com/u/jiyongman)
#### Post date: [February 23, 2021, 7:50am UTC](https://qa.fmod.com/t/do-i-have-to-call-fmod-channel-removedsp/16797/3 "2021-02-23T07:50:08Z")

</div>

Thanks!

I’m assuming it also applies when the channel sound ends itself, right?

---

<div class="post-metadata">

### Author: ![jiyongman](https://avatars.discourse-cdn.com/v4/letter/j/ebca7d/32.png) [@jiyongman](https://qa.fmod.com/u/jiyongman)
#### Post date: [February 23, 2021, 8:05am UTC](https://qa.fmod.com/t/do-i-have-to-call-fmod-channel-removedsp/16797/4 "2021-02-23T08:05:29Z")

</div>

Ah, one more question.

You can call me lazy, but is it safe just to call **FMOD\_Channel\_RemoveDSP()** on the stale channel handle regardless of the FMOD\_RESULT error code returned by it, not thinking much about the state of the channel sound?

---

<div class="post-metadata">

### Author: ![joseph](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/joseph/32/264_2.png) [@joseph](https://qa.fmod.com/u/joseph)
#### Post date: [February 25, 2021, 12:55am UTC](https://qa.fmod.com/t/do-i-have-to-call-fmod-channel-removedsp/16797/5 "2021-02-25T00:55:52Z")

</div>

> [@jiyongman](#):
>
> I’m assuming it also applies when the channel sound ends itself, right?

Yes, when a channel ends naturally, all DSPs in its chain are removed, as if you had called `ChannelControl::stop`.

> [@jiyongman](#):
>
> You can call me lazy, but is it safe just to call **FMOD\_Channel\_RemoveDSP()** on the stale channel handle regardless of the FMOD\_RESULT error code returned by it, not thinking much about the state of the channel sound?

The error code simply indicates that the channel handle is no longer valid, and that any operation on the associated channel will not do anything meaningful. Generating this error message won’t otherwise interfere with the running of your game - though of course, if your game’s intended behavior produces “false positive” error messages, anyone debugging your game will have to sort the meaningful error messages form the meaningless ones, and anyone reading those error messages without the context of this thread may assume that they represent unintended or buggy behavior in your game.

---

<div class="post-metadata">

### Author: ![jiyongman](https://avatars.discourse-cdn.com/v4/letter/j/ebca7d/32.png) [@jiyongman](https://qa.fmod.com/u/jiyongman)
#### Post date: [February 25, 2021, 3:24am UTC](https://qa.fmod.com/t/do-i-have-to-call-fmod-channel-removedsp/16797/6 "2021-02-25T03:24:45Z")

</div>

Love it!  
Thanks!
