# FMOD.System.getDriver is unreliable after the default device is changed on Windows

**URL:** <https://qa.fmod.com/t/fmod-system-getdriver-is-unreliable-after-the-default-device-is-changed-on-windows/17294>\
**Category:** FMOD Engine\
**Tags:** unity, csharp\
**Created:** [June 4, 2021, 9:49am UTC](https://qa.fmod.com/t/fmod-system-getdriver-is-unreliable-after-the-default-device-is-changed-on-windows/17294 "2021-06-04T09:49:51Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![Reification](https://avatars.discourse-cdn.com/v4/letter/r/9f8e36/32.png) [@Reification](https://qa.fmod.com/u/Reification)\
**Post date:** [July 18, 2022, 11:56pm UTC](https://qa.fmod.com/t/fmod-system-getdriver-is-unreliable-after-the-default-device-is-changed-on-windows/17294/5 "2022-07-18T23:56:30Z")

</div>

I just ran into the same issue…

In my case I am using the `FMOD_SYSTEM_CALLBACK_DEVICELISTCHANGED` override and had previously called SetDriver, so my initial configuration is:

- 0: Device A = System
- 1: Device B
- 2: Device C = Output  
A call to System::getDriver yields 2.

Next, I switch the system device from A to C, so the new configuration is:

- 0: Device C = System, Output
- 1: Device A
- 2: Device B  
A call to System::getDriver STILL yields 2, so it is incorrect under any interpretation.

WORKAROUND: Do not use getDriver.  
According to the specification, the output driver switches with the system driver IFF a callback is NOT registered for FMOD\_SYSTEM\_CALLBACK\_DEVICELISTCHANGED. So, register the callback, cache the driver GUID, and check each device to see if the previously active device is still connected.

WARNING: When I tried to enumerate connected devices _in_ the callback I caused Unity to deadlock. Instead, use the callback to flag that an update is needed, then update on Unity’s main thread. See: [BUG: Unity Editor hangs when handling DEVICELISTCHANGED callback - #2 by Reification](https://qa.fmod.com/t/bug-unity-editor-hangs-when-handling-devicelistchanged-callback/19021/2)

---

_[View the full topic](https://qa.fmod.com/t/fmod-system-getdriver-is-unreliable-after-the-default-device-is-changed-on-windows/17294)._
