0
0

I have been trying to use fmod to control a Focusrite Scarlett 18i20 (from a Windows 7 pc using USB) connected to 2 amplifiers having 4 speakers each hooked up to them. I would like to control what each speaker plays independently. This is the code I am trying to start from:

[code:6xmjqllx] FMOD::System *system;
FMOD_RESULT result;
unsigned int version;
int numdrivers;
int freq;
FMOD_SPEAKERMODE speakermode;
FMOD_CAPS caps;
char name[256];

result = FMOD::System_Create(&system);
std::cout << result << std::endl;

result = system->getDriverCaps(0, &caps, &freq, &speakermode);
std::cout << result << ‘ ‘ << caps << ‘ ‘ << freq << ‘ ‘ << speakermode << std::endl;

std::cout << ‘[’ << (caps & FMOD_CAPS_HARDWARE ? ‘X’ : ‘ ‘) << "] Hardware" << std::endl;
std::cout << ‘[’ << (caps & FMOD_CAPS_HARDWARE_EMULATED ? ‘X’ : ‘ ‘) << "] Hardware emulated" << std::endl;
std::cout << ‘[’ << (caps & FMOD_CAPS_OUTPUT_MULTICHANNEL ? ‘X’ : ‘ ‘) << "] Multichannel" << std::endl;
std::cout << ‘[’ << (caps & FMOD_CAPS_OUTPUT_FORMAT_PCM8 ? ‘X’ : ‘ ‘) << "] PCM 8" << std::endl;
std::cout << ‘[’ << (caps & FMOD_CAPS_OUTPUT_FORMAT_PCM16 ? ‘X’ : ‘ ‘) << "] PCM 16" << std::endl;
std::cout << ‘[’ << (caps & FMOD_CAPS_OUTPUT_FORMAT_PCM24 ? ‘X’ : ‘ ‘) << "] PCM 24" << std::endl;
std::cout << ‘[’ << (caps & FMOD_CAPS_OUTPUT_FORMAT_PCM32 ? ‘X’ : ‘ ‘) << "] PCM 32" << std::endl;
std::cout << ‘[’ << (caps & FMOD_CAPS_OUTPUT_FORMAT_PCMFLOAT ? ‘X’ : ‘ ‘) << "] PCM float" << std::endl;
std::cout << ‘[’ << (caps & FMOD_CAPS_REVERB_LIMITED ? ‘X’ : ‘ ‘) << "] Reverb limited" << std::endl;
std::cout << ‘[’ << (caps & FMOD_CAPS_LOOPBACK ? ‘X’ : ‘ ‘) << "] Loopback" << std::endl;

result = system->getDriverInfo(0, name, 256, 0);
std::cout << result << ‘ ‘ << name << std::endl;

result = system->setSoftwareFormat(48000, FMOD_SOUND_FORMAT_PCMFLOAT, 8, 0, FMOD_DSP_RESAMPLER_LINEAR);
std::cout << "setSoftwareFormat: " << result << std::endl;

result = system->init(100, FMOD_INIT_NORMAL, 0);
std::cout << result << std::endl;

char c;
std::cin >> c;

result = system->release();
std::cout << result << std::endl;
[/code:6xmjqllx]

This is the output:

[code:6xmjqllx]0
0 248 44100 2
[ ] Hardware
[ ] Hardware emulated
[ ] Multichannel
[X] PCM 8
[X] PCM 16
[X] PCM 24
[X] PCM 32
[X] PCM float
[ ] Reverb limited
[ ] Loopback
0 Line Out (Scarlett 18i20 USB)
setSoftwareFormat: 0
0[/code:6xmjqllx]

It looks like the multichannel capabilities of the audio interface are not recognized.

Also, and I suspect this might be related, whenever the number of output channels is set to anything greater than 2 in setSoftwareFormat (set to 8 in the example above), the program crashes during system->release() (otherwise, it doesn’t).

Am I doing something wrong? Any help or hint would be appreciated!

  • You must to post comments
0
0

You probably need to set your windows speaker mode to something other than stereo.

It looks like in directsound output mode, that flag is set if directx >= 9, and wasapi just sets it if the device is set to something above stereo.
WASAPI will always output to the speaker mode you set in your control panel. In FMOD Studio you can set the speaker mode for the software mixer to any speaker mode you want, and the output module will downmix or upmix to the operatign system’s preferred speaker mode.
In FMOD Ex it forces you to use that format (the one set by the control panel).

For non standard speaker modes, you could try ASIO output.

  • You must to post comments
0
0

Thank you very much, Brett.

So, I installed ASIO4ALL because as far as I can tell, there was no way for me to change the speaker mode from the control panel (other than mono or stereo with a few choices of sampling rate for each). I was able to test ASIO4ALL with Ableton Live 9 Lite to make sure that it worked.

Now, integrating the ASIO SDK and FMOD together in my app hasn’t been that easy, however. If anyone can point me to an example using both together, I would be very grateful.

  • You must to post comments
0
0

You dont use the ‘asio sdk’, have you trued System::setOutput and FMOD_OUTPUTTYPE_ASIO ?

  • You must to post comments
0
0

[quote="brett":d1ercqq4]You dont use the ‘asio sdk’,[/quote:d1ercqq4]
Ok, I ditched it!

[quote="brett":d1ercqq4] have you trued System::setOutput and FMOD_OUTPUTTYPE_ASIO ?[/quote:d1ercqq4]
I hadn’t, but now I have, and it works!

Thank you very much, Brett! 😀

  • You must to post comments
Showing 4 results
Your Answer

Please first to submit.