getNumdrivers failed return FMOD_ERR_INVALID_PARAM

Using : FMOD Engine Core Api 2.02.09
OS : Windows 10

It only occurs on a specific user’s PC.
Unfortunately, the audio device information was not confirmed.

FMOD Init proceeded in order.

  1. FMOD::System_Create(&m_system);
  • success
  1. m_system->getVersion(&version);
  • success
  1. m_system->getNumDrivers(&numdrivers);
  • failed, FMOD_ERR_INVALID_PARAM

Why does this happen?

When error situation, i use setOutput NOSOUND.
m_system->setOutput(FMOD_OUTPUTTYPE_NOSOUND);

Is there a better way?

Hi,

The FMOD_ERR_INVALID_PARAM could be thrown for a couple of reasons, would it be possible to get a full code snippet? Some causes could be, if the *int passed into the function is null or the m_system fails a validation test in the getNumDrivers() function. Initializing the debug system will also help resolve the issue, further explained under FMOD API | Common. To use the debug system you will have to link the fmodL logging dll in your project preferences. Then before calling System_Create call Debug_Initialize(FMOD_DEBUG_LEVEL_LOG). This will print out FMOD logs to the output console of your IDE.
The FMOD_OUTPUTTYPE will impact the number of drivers used by the system, in reference to calling getNumDrivers(). Using NOSOUND and logging the errors from FMOD is the best way for now.

Thanks for answer.

This is full code snippet.
fmod api called only 3 times when failure occurs.

FMOD_RESULT result = FMOD_OK;
unsigned int version = 0;
int numdrivers = 0;

result = FMOD::System_Create(&m_system);
// success
result = m_system->getVersion(&version);
// success
result = m_system->getNumDrivers(&numdrivers);
// result failed, FMOD_ERR_INVALID_PARAM

I’m hard to understand that an error occurred FMOD_ERR_INVALID_PARAM when simply calling the getNumDrivers api.
Is there anything that could be a problem?

It seems that the parameter data types are not different.

FMOD_RESULT F_API getNumDrivers           (int *numdrivers);

Hi,

No worries and thank you for the code snippet.
Is it possible to get the Debug system initialized to get some more information from the FMOD system? Also, could you run Dxdiag on the user’s computer to provide us with more information about their PC? This can be done by pressing the Windows key and searching “dxdiag”. After accepting the first prompt, select “Save All Information”, save the .txt file on your pc then Upload it to your FMOD profile.

It seems difficult to collect FMOD debug information or dxdiag information because the problem occurred on an unidentified customer(a.k.a. end user)'s PC.
I will check the contact to user, but we have not any detailed information, so it will take a much time.
try to contact as soon as possible.

Thank you.

How often is the crash occurring?
Thank you for all the information you have provided so far. Any more information would be great. Thank you

Hi.
I reproduce the problem situation in my computer.
It’s not exactly the same, getNumDrivers returns FMOD_ERR_OUTPUT_INIT.
It happens every time in that situation.

I tested it following this way. (OS : Windows 11)
Computer has multiple audio devices. (NVIDIA High Definition Auido, Headset, USB Audio etc)
I removed directly the headset earphone audio device from windows device manager.
But In Setting → System → Sound → Output, still remains that removed device.
Device detailed information looks like invalid dummy device. but It is not automatically erased.
It would be strange, removed headset earphone device is a DualShock 4. (3 - wireless controller)

FMOD_RESULT result = FMOD_OK;
unsigned int version = 0;
int numdrivers = 0;

result = FMOD::Debug_Initialize(FMOD_DEBUG_LEVEL_LOG, FMOD_DEBUG_MODE_FILE, nullptr, "fmod.log");
// success
result = FMOD::System_Create(&m_system);
// success
result = m_system->getVersion(&version);
// success
result = m_system->getNumDrivers(&numdrivers);
// result failed, FMOD_ERR_OUTPUT_INIT

same as before.
But getNumDrivers returns FMOD_ERR_OUTPUT_INIT.
numdrivers is 0.

In this situation, USB Audio device is working normaly so i can listen some audio using it. (music player, video player etc)

FMOD error log (getNumDrivers)
[ERR] OutputWASAPI::storeDeviceInfo : IPropertyStore::GetValue returned 0xE000020B.

Dxdiag also throws an error.
DxDiag error
Error: A problem was detected while obtaining additional sound information.

I upload fmod log and dixdiag information my FMOD profile.
I’m sorry, I cannot change windows language setting. so dxdiag infomation has include korean.

Hi,

Thank you for all the information.
Unfortunately, I was not able to reproduce the issue. I have passed on the bug to our development team to look into it further.