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


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?


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.

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?


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.

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!