# A Crash occured when using abnormal record driver

**URL:** <https://qa.fmod.com/t/a-crash-occured-when-using-abnormal-record-driver/19914>\
**Category:** FMOD Engine\
**Tags:** cpp\
**Created:** [February 27, 2023, 1:39am UTC](https://qa.fmod.com/t/a-crash-occured-when-using-abnormal-record-driver/19914 "2023-02-27T01:39:11Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Neople](https://avatars.discourse-cdn.com/v4/letter/n/f9ae1b/32.png) [@Neople](https://qa.fmod.com/u/Neople)\
**Post date:** [February 27, 2023, 1:39am UTC](https://qa.fmod.com/t/a-crash-occured-when-using-abnormal-record-driver/19914/1 "2023-02-27T01:39:11Z")

</div>

Model : ASUS TUF FX505GM-BQ251  
OS : Windows 11 Pro (10.0.22621)  
Audio dirver : Realtek(R) Audio  
Record driver : Abnormal (blank)  
FMOD Core : 2.02.09

A Crash when calling fmod recordGetDireverInfo.  
In this case, getRecordNumDrivers returns error FMOD\_ERR\_OUTPUT\_INIT.  
I ignored it, but a crash occurred in fmod System::update.

```auto
fmod.dll!FMOD_strcpy_safe(char * dst, const char * src, int destBytes) line 120	C++
fmod.dll!FMOD::OutputWASAPI::recordGetDriverInfo(int) line 717	C++
fmod.dll!FMOD::recordGetDriverInfoCallback(FMOD_OUTPUT_STATE * output, int id, char * name, int nameLen, FMOD_GUID * guid, int * systemRate, FMOD_SPEAKERMODE * speakerMode, int * speakerModeChannels) line 990	C++
fmod.dll!FMOD::SystemI::updateRecordCache() line 4961	C++
fmod.dll!FMOD::SystemI::updateInternal(bool checkdriverlist) line 168	C++
fmod.dll!FMOD::System::update() line 578	C++

```

The record dirver name is empty(blank), when checking in Windows sound settings.  
It look like in an abnormal environment.  
When resetting the record device, it is changed to a state without a record device(no record device).  
However, unless disable or renew an abnomal device, it will remain in that state permanently.  
For some unknown reason, Windows did not completely remove the record device, ramains dummy information.

This problem occurs is the user’s PC, so there is nothing we can do about it.  
Is it possible to disable update record device? (recordGetDireverInfo)

---

<div class="post-metadata">

**Author:** ![Leah\_FMOD](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/leah_fmod/32/3685_2.png) [@Leah\_FMOD](https://qa.fmod.com/u/Leah_FMOD)\
**Post date:** [February 28, 2023, 12:19am UTC](https://qa.fmod.com/t/a-crash-occured-when-using-abnormal-record-driver/19914/2 "2023-02-28T00:19:52Z")

</div>

Thanks for bringing up your issue - I’ll be taking a look into it and will get back to you shortly.

---

<div class="post-metadata">

**Author:** ![Leah\_FMOD](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/leah_fmod/32/3685_2.png) [@Leah\_FMOD](https://qa.fmod.com/u/Leah_FMOD)\
**Post date:** [March 1, 2023, 12:57am UTC](https://qa.fmod.com/t/a-crash-occured-when-using-abnormal-record-driver/19914/3 "2023-03-01T00:57:55Z")

</div>

Thanks for your patience,

After looking into the issue, it does seem to be related to the abnormal record driver’s name, though I’ve been unable to reproduce the issue exactly. Would it be possible to provide me with a dxdiag and a log of the crash from the user so that I can look into the exact data from device info that is causing the crash? If you can do so, I may be able to diagnose the problem in greater detail and flag it internally for a fix.

Obviously having the user fix the abnormal record driver on their end would probably be best, but a workaround would be to set an empty callback of type `FMOD_SYSTEM_CALLBACK_RECORDLISTCHANGED` with the following line `system->setCallback(0, FMOD_SYSTEM_CALLBACK_RECORDLISTCHANGED);`. Setting a custom callback like this will stop FMOD from calling the problematic code from System::update - however, in doing so it also stops FMOD from automatically updating the driver list.

---

<div class="post-metadata">

**Author:** ![Neople](https://avatars.discourse-cdn.com/v4/letter/n/f9ae1b/32.png) [@Neople](https://qa.fmod.com/u/Neople)\
**Post date:** [March 2, 2023, 12:12am UTC](https://qa.fmod.com/t/a-crash-occured-when-using-abnormal-record-driver/19914/4 "2023-03-02T00:12:20Z")

</div>

Thanks for the answer

Unfortunately, no additional logs were obtained.  
When contacting the user with the problem, it did not occur after forced initialization of the record driver list.  
It seems to happen very infrequently, with only two cases reported in about a year.

I think it seems to happen, getRecordNumDrivers returns error FMOD\_ERR\_OUTPUT\_INIT.  
Only this case, I decided to set an empty callback of type `FMOD_SYSTEM_CALLBACK_RECORDLISTCHANGED`

---

<div class="post-metadata">

**Author:** ![Leah\_FMOD](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/leah_fmod/32/3685_2.png) [@Leah\_FMOD](https://qa.fmod.com/u/Leah_FMOD)\
**Post date:** [March 2, 2023, 4:27am UTC](https://qa.fmod.com/t/a-crash-occured-when-using-abnormal-record-driver/19914/5 "2023-03-02T04:27:49Z")

</div>

Thanks for the extra information. If you do begin to run into this crash more frequently, feel free to get in touch and we can go from there.
