# An invalid parameter was passed to this function: effectHandle-\>getOutputChannelLayout(

**URL:** <https://qa.fmod.com/t/an-invalid-parameter-was-passed-to-this-function-effecthandle-getoutputchannellayout/17661>\
**Category:** FMOD Studio\
**Created:** [September 10, 2021, 10:26pm UTC](https://qa.fmod.com/t/an-invalid-parameter-was-passed-to-this-function-effecthandle-getoutputchannellayout/17661 "2021-09-10T22:26:49Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![microsoft\_hemi](https://avatars.discourse-cdn.com/v4/letter/m/4af34b/32.png) [@microsoft\_hemi](https://qa.fmod.com/u/microsoft_hemi)\
**Post date:** [September 10, 2021, 10:26pm UTC](https://qa.fmod.com/t/an-invalid-parameter-was-passed-to-this-function-effecthandle-getoutputchannellayout/17661/1 "2021-09-10T22:26:49Z")

</div>

Hello,

I am writing a DSP plugin using FMOD Studio 2.01.11 but I have run in to an issue when attempting to add it in FMOD Studio. The plugin successfully completes its initialization, but then never receives any buffers. The logs show that there is an issue

13:39:41 Macro: Add Effect  
13:39:41 “FMOD\_ERROR (31): An invalid parameter was passed to this function.”  
13:39:41 “FMOD\_ERROR e:\jk\workspace\build\_\_2.1\_\_studio\_win\studio\src\model\modelbuilder.cpp(307): effectHandle-\>getOutputChannelLayout(soundSystem-\>system(), soundSystem-\>speakerModeForChannelFormat(inputFormat), &outputChannelLayout)”  
13:39:41 fmod\_bank\_loader.cpp(129), Manager::readBank(): fileversion = 135, compatVersion = 132 (oldest = 44, newest = 135)  
13:39:41 fmod\_playback\_effect.cpp(1065), EffectInstanceFactory::createInternal(): Failed to create DSP for plugin ‘SamplePlugin’  
13:39:41 fmod\_repository.h(213), assert(): assertion: ‘cont’ failed

At this point, FMOD Studio spams this log until the plugin is removed and the program shut down:  
“FMOD\_ERROR (1): Tried to call a function on a data type that does not allow this type of functionality (ie calling Sound::lock on a streaming sound).”  
“FMOD\_ERROR e:\jk\workspace\build\_\_2.1\_\_studio\_win\studio\src\soundsystem.cpp(415): mSystem-\>update()”

I don’t see a way to define channel counts outside of an actual read/process event, so I’m not sure why my plugin would be causing this. Any ideas?

Thanks!

---

<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:** [September 12, 2021, 10:44pm UTC](https://qa.fmod.com/t/an-invalid-parameter-was-passed-to-this-function-effecthandle-getoutputchannellayout/17661/2 "2021-09-12T22:44:43Z")

</div>

It looks like Studio is trying to determine the output channel count of the DSP. If you take a look at the API installer, we have some Core API plugin examples, specifically fmod\_gain.cpp has some good info for how to specify channel information, check the function FMOD\_Gain\_dspprocess.

Also I should mention I am working on a much improved DSP plugin API at the moment, so if you have any concerns or ideas about the current architecture, please let me know. Currently the only way to communicate output channel count is via Process, this is something I hope to correct.

---

<div class="post-metadata">

**Author:** ![microsoft\_hemi](https://avatars.discourse-cdn.com/v4/letter/m/4af34b/32.png) [@microsoft\_hemi](https://qa.fmod.com/u/microsoft_hemi)\
**Post date:** [September 13, 2021, 5:16pm UTC](https://qa.fmod.com/t/an-invalid-parameter-was-passed-to-this-function-effecthandle-getoutputchannellayout/17661/3 "2021-09-13T17:16:35Z")

</div>

Hi Mathew,

I am actually using the read method for this plugin rather than process and my implementation matches the example. Using a debugger, I am never seeing the read ever getting hit. Is there a place I can define the output channel count prior to processing buffers?

Thanks!

---

<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:** [September 13, 2021, 11:00pm UTC](https://qa.fmod.com/t/an-invalid-parameter-was-passed-to-this-function-effecthandle-getoutputchannellayout/17661/4 "2021-09-13T23:00:38Z")

</div>

Studio requires the plugin to implement process if it needs to change the channel count, “read” only supports output == input channel count. With process, it is invoked with FMOD\_DSP\_PROCESS\_QUERY, a mode used for determining channels (among other things).

If you only desire in == out you should be able to use “read”, check all your set parameter calls, perhaps they are returning an error? Studio will set everything to defaults as part of it’s initialization tests.

---

<div class="post-metadata">

**Author:** ![microsoft\_hemi](https://avatars.discourse-cdn.com/v4/letter/m/4af34b/32.png) [@microsoft\_hemi](https://qa.fmod.com/u/microsoft_hemi)\
**Post date:** [September 14, 2021, 5:26pm UTC](https://qa.fmod.com/t/an-invalid-parameter-was-passed-to-this-function-effecthandle-getoutputchannellayout/17661/5 "2021-09-14T17:26:26Z")

</div>

Ah, there it is. I found a situation where the set param call could return an error during creation. Now everything is working as expected. Thank you!
