How to close auto downmix of MasterChannelGroup effected by studio bank

Hi. I have a requirement which used FMODCoreAPI and FMODStudioAPI:GlobalMasterGroup has 16 channels output.It works well when i just play one sound has 8 channels output.But once i load a bank which MasterGroupBus output mode is set as 5.1channels, my sound will downmix automaticly to 5.1 mode.

FMOD::Studio::System::create(&system);
system->getCoreSystem(&core_system);
core_system->setSoftwareFormat(48000, FMOD_SPEAKERMODE_RAW, 16);
system->initialize(1024, FMOD_STUDIO_INIT_NORMAL, FMOD_INIT_PROFILE_ENABLE | FMOD_INIT_PROFILE_METER_ALL, NULL);

core_system->createChannelGroup(“test”, &channelgroup);
core_system->createSound(“D:/project/FMod_Test/Debug/8channelstest.wav”, FMOD_LOOP_NORMAL, NULL, &sound);
core_system->playSound(sound, channelgroup, false, &channel);
system->update();
till now works well:

FMOD::Studio::Bank *bank;
system->loadBankFile(“D:/project/FMod_Test/Debug/wavebanks/Master.bank”, FMOD_STUDIO_LOAD_BANK_NORMAL, &bank);
system->loadBankFile(“D:/project/FMod_Test/Debug/wavebanks/Master.strings.bank”, FMOD_STUDIO_LOAD_BANK_NORMAL, &bank);
system->update();
auto downmix occurred:

I tried many methods but it didn’t work.
by setMixMatrix():

core_system->getMasterChannelGroup(&mastergroup);
float matrix[16][16] = { 0 };
for (int i = 0; i < 16; i++) matrix[i][i] = 1;
mastergroup->setMixMatrix(matrix[0], 16, 16);

or add a dsp in MasterChannelgroup with readDSP callback:

strcpy(dspdesc.name, “test_dsp”);
dspdesc.version = FMOD_PLUGIN_SDK_VERSION;
dspdesc.numinputbuffers = 16;
dspdesc.numoutputbuffers = 16;
dspdesc.read = readDSP;
core_system->createDSP(&dspdesc, &dsp);
mastergroup->addDSP(1, dsp);
FMOD_RESULT F_CALLBACK readDSP(FMOD_DSP_STATE *dsp_state, float *inbuffer, float *outbuffer, unsigned int length, int inchannels, int *outchannels)
{
memcpy(outbuffer, inbuffer, length * sizeof(float) * inchannels);
return FMOD_OK;
}
still not working:

I can reset studio MasterGroupBus output mode to make it work correctly, but is there any other way to config channel.

Thanks.

Hi,

Unfortunately, this isn’t currently supported in FMOD Studio. However, there is a task for this feature and I have noted your interest.

There was an alternative option posted in another forum here: Automatic Downmix of multichannel streams. Bug? - #16 by mathew which may be a solution.

Hope this helps!

Thanks.
As he mentioned, I used CoreAPI to solve problem.
It seems automaticly downmix occured when studio mastergroupbus speakermode were different from core masterchannelgroup’s.So when load banks and it changes the masterchannelgroup speakermode to 5.1, it indeed worked by set it back to FMOD_SPEAKERMODE_RAW.
However, it didn’t mention about this in WhitePaper or APIReference.So maybe it’s the only way to achieve this effect befor new feature actual installation.

1 Like

I see, thank you for looking into this. I will make a note to add this to the documentation.