# Only one channel is playing at time when adding DSP in group

**URL:** <https://qa.fmod.com/t/only-one-channel-is-playing-at-time-when-adding-dsp-in-group/16323>\
**Category:** FMOD Engine\
**Tags:** cpp\
**Created:** [October 19, 2020, 6:43pm UTC](https://qa.fmod.com/t/only-one-channel-is-playing-at-time-when-adding-dsp-in-group/16323 "2020-10-19T18:43:51Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![rafagan](https://avatars.discourse-cdn.com/v4/letter/r/7ba0ec/32.png) [@rafagan](https://qa.fmod.com/u/rafagan)\
**Post date:** [October 19, 2020, 6:43pm UTC](https://qa.fmod.com/t/only-one-channel-is-playing-at-time-when-adding-dsp-in-group/16323/1 "2020-10-19T18:43:51Z")

</div>

When I add a plugin to group, setting a read callback in FMOD\_DSP\_DESCRIPTION make the channels not playing simultaneously. Per example, If I play the sound1 and sound2 just after, both sounds play together, but adding the DSP with read callback, when I play sound1 and after sound2, the sound1 stops.

Any help?

---

<div class="post-metadata">

**Author:** ![cameron-fmod](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/cameron-fmod/32/261_2.png) [@cameron-fmod](https://qa.fmod.com/u/cameron-fmod)\
**Post date:** [October 28, 2020, 1:21am UTC](https://qa.fmod.com/t/only-one-channel-is-playing-at-time-when-adding-dsp-in-group/16323/2 "2020-10-28T01:21:35Z")

</div>

What version of FMOD are you using?  
Are you seeing any errors or warnings in the console?

---

<div class="post-metadata">

**Author:** ![rafagan](https://avatars.discourse-cdn.com/v4/letter/r/7ba0ec/32.png) [@rafagan](https://qa.fmod.com/u/rafagan)\
**Post date:** [October 28, 2020, 4:06pm UTC](https://qa.fmod.com/t/only-one-channel-is-playing-at-time-when-adding-dsp-in-group/16323/3 "2020-10-28T16:06:53Z")

</div>

The problem is that I’ve recorded sound input buffer in disk but don’t passed it ahead through outputbuffer. My final working code for the read callback follows:

```
auto recordCallback = [](
        FMOD_DSP_STATE* dspState,
        float* inBuffer,
        float* outBuffer,
        unsigned int length,
        int inChannelCount,
        int* outChannelCount
) -> FMOD_RESULT F_CALLBACK {
    void* ptr;
    dspState->functions->getuserdata(dspState, &ptr);
    auto* r = reinterpret_cast<Recorder*>(ptr);

    r->enqueue(inBuffer, length * inChannelCount);

    for (auto sample = 0U; sample < length; sample++) {
        for (auto channel = 0; channel < inChannelCount; channel++) {
            auto index = (sample * inChannelCount) + channel;
            outBuffer[index] = r->recordSilenced() ? 0 : inBuffer[index];
        }
    }

    return FMOD_OK;
};
```

---

<div class="post-metadata">

**Author:** ![mathew](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/mathew/32/431_2.png) [@mathew](https://qa.fmod.com/u/mathew)\
**Post date:** [November 1, 2020, 9:27pm UTC](https://qa.fmod.com/t/only-one-channel-is-playing-at-time-when-adding-dsp-in-group/16323/4 "2020-11-01T21:27:55Z")

</div>

Yes, that’s makes sense, when writing a capture DSP it is important to pass the input buffer data through to the output buffer, otherwise the signal will go silent.
