How can I select specific output channels?

Thanks to your help, I was able to make my application work with ASIO.
But there’s one problem. I have an audio interface with multiple output channels which include 8 analog outs 8 digital outs.
There’s no such thing like a stereo output here.
I can choose whichever I prefer as my default output channels in Windows, and my current output is analog 3-4 out with a stereo configuration.
But FMOD uses analog 1-2 out, and because my analog 1-2 out is currently broken, it’s really hard for me to test my application properly.
Also, I think it would be super cool if I can provide options for users to choose their preferable channels themselves like in professional music applications.

Is this possible?

So far I tried FMOD_System_SetSoftwareFormat() with different FMOD_SPEAKERMODE constants but failed.

PS. When using FMOD_OUTPUTTYPE_WASAPI, analog 3-4 out is used as expected.

Hi Jiyongman,

For ASIO, you will want to make use of FMOD_ADVANCEDSETTINGS, specifically the fields ASIONumChannels, ASIOChannelList and ASIOSpeakerList. You can use ASIOSpeakerList to remap which asio channels map to which speakers.

1 Like

Thanks, I tried below code :

FMOD_System_SetSoftwareChannels(g_System, 128);

FMOD_System_SetOutput(g_System, FMOD_OUTPUTTYPE_ASIO);
FMOD_System_SetDSPBufferSize(g_System, 256, 2);

FMOD_System_SetSoftwareFormat(g_System, 44100, FMOD_SPEAKERMODE_STEREO, 0);

FMOD_System_Init(g_System, 1024, FMOD_INIT_NORMAL, NULL);


FMOD_ADVANCEDSETTINGS myAsioSettings = {0};

myAsioSettings.cbSize = sizeof(FMOD_ADVANCEDSETTINGS);
myAsioSettings.ASIONumChannels = 2;

FMOD_System_GetAdvancedSettings(g_System, &myAsioSettings);


FMOD_SPEAKER mySpeakerList[] = { (FMOD_SPEAKER)0, (FMOD_SPEAKER)1 };
// FMOD_SPEAKER mySpeakerList[] = { FMOD_SPEAKER_FRONT_LEFT, FMOD_SPEAKER_FRONT_RIGHT };
myAsioSettings.ASIOSpeakerList = mySpeakerList;

FMOD_System_SetAdvancedSettings(g_System, &myAsioSettings);

I can’t specify any other speakers other than (FMOD_SPEAKER)0 and (FMOD_SPEAKER)1.

With above code, FMOD plays with Analog 1-2 OUT only.
Like I said earlier, I have an audio interface which has 8 analog output channels and 8 digital output channels.
What I want now is stereo mix with Analog 3-4 OUT or Analaog 7-8 OUT.
So I thought { (FMOD_SPEAKER)2, (FMOD_SPEAKER)3 } or { (FMOD_SPEAKER)6, (FMOD_SPEAKER)7 } would do the trick, but only to fail.
I tried all other values too, but no success.
As you can see, I’m setting ASIONumChannels to 2, but I already tried setting it to 16 with 16 speakers, and 8 with 8 speakers as well.

What am I doing wrong here?

Also, I wonder if there’s any known ASIO related issue with a global Reverb effect.

If I create an FMOD_DSP_TYPE_SFXREVERB and add it to a specific channel, then everything is ok, but if I add it to a “global group” using FMOD_ChannelGroup_AddDSP() or just simply create a global reverb using FMOD_System_SetReverbProperties(), then I see a problem.

Just playing one single sound is okay, but when I play two or more sounds at the same time with the global reverb on, suddenly I hear some artifacts hard to explain while FMOD plays those sounds via multi channel outputs other than just Analog 1-2 OUT.

This doesn’t happen when:
a. the speaker mode is forced to FMOD_SPEAKERMODE_STEREO or FMOD_SPEAKERMODE_RAW with 2 numrawspeakers.
(Not setting the speaker mode at all or setting any other speaker mode including FMOD_SPEAKERMODE_DEFAULT causes the issue)

b. the global reverb is disabled using FMOD_DSP_SetBypass() or FMOD_PRESET_OFF.

I don’t have this kind of issue when using WASAPI.
I also tried LOWPASS, HIGHPASS, ECHO, and FLANGE, but only REVERB has the problem.

Do you have any clue?

The speaker list maps the opposite way. You won’t be able to do this with stereo at the moment, as the size of the speakerList array should match the number of speakers defined by the FMOD_SPEAKERMODE. You should have more luck changing your example to the following:
FMOD_System_SetSoftwareFormat(g_System, 44100, FMOD_SPEAKERMODE_QUAD, 0);
FMOD_SPEAKER mySpeakerList[] = { FMOD_SPEAKER_MAX, FMOD_SPEAKER_MAX, (FMOD_SPEAKER)0, (FMOD_SPEAKER)1 };
This, however, will change how the audio is spacialised to suit whichever speakmode is chosen, so this may not be an ideal solution, particularly if you are utilizing FMOD Studio features. We will look to address this in a future version.

1 Like

YES!
Even though it’s not that ideal as you said and not sure if this will always work,
but along with your kind answer, below code works too:
FMOD_System_SetSoftwareFormat(g_System, 44100, FMOD_SPEAKERMODE_RAW, 8);
mySpeakerList[] = { FMOD_SPEAKER_MAX, FMOD_SPEAKER_MAX, FMOD_SPEAKER_MAX, FMOD_SPEAKER_MAX, FMOD_SPEAKER_MAX, FMOD_SPEAKER_MAX, (FMOD_SPEAKER)0, (FMOD_SPEAKER)1};

Or:
FMOD_System_SetSoftwareFormat(g_System, 44100, FMOD_SPEAKERMODE_RAW, 6);
mySpeakerList[] = { FMOD_SPEAKER_MAX, FMOD_SPEAKER_MAX, FMOD_SPEAKER_MAX, FMOD_SPEAKER_MAX, (FMOD_SPEAKER)0, (FMOD_SPEAKER)1};

Thank you!