# BUG: Unity Editor hangs when handling DEVICELISTCHANGED callback

**URL:** <https://qa.fmod.com/t/bug-unity-editor-hangs-when-handling-devicelistchanged-callback/19021>\
**Category:** FMOD Engine\
**Tags:** unity\
**Created:** [July 18, 2022, 9:26pm UTC](https://qa.fmod.com/t/bug-unity-editor-hangs-when-handling-devicelistchanged-callback/19021 "2022-07-18T21:26:19Z")\
**Posts on this page:** 1\
**Showing post:** 2

<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, 9:27pm UTC](https://qa.fmod.com/t/bug-unity-editor-hangs-when-handling-devicelistchanged-callback/19021/2 "2022-07-18T21:27:55Z")

</div>

FAILED WORK AROUND: Disable stats. Registered callback is not received, and program hangs in editor when playing is stopped. While playing switching devices cause problems indicated by console warning:

```auto
[FMOD] AsyncCommandBuffer::growBuffer : Growing command buffer to 524288 bytes. Initial command buffer size can be tuned to avoid dynamic growth using Studio::System::setAdvancedSettings()

UnityEngine.Debug:LogWarning (object)

FMODUnity.RuntimeUtils:DebugLogWarning (string) (at Assets/Plugins/FMOD/src/RuntimeUtils.cs:533)

FMODUnity.RuntimeManager:DEBUG_CALLBACK (FMOD.DEBUG_FLAGS,intptr,int,intptr,intptr) (at Assets/Plugins/FMOD/src/RuntimeManager.cs:86)

FMOD.Studio.System:getBus (string,FMOD.Studio.Bus&) (at Assets/Plugins/FMOD/src/fmod_studio.cs:444)

FMODUnity.RuntimeManager:ApplyMuteState () (at Assets/Plugins/FMOD/src/RuntimeManager.cs:1447)

FMODUnity.RuntimeManager:Update () (at Assets/Plugins/FMOD/src/RuntimeManager.cs:537)

```

WORKAROUND: Set (in a thread-safe way) a flag to trigger updating devices on the main Unity thread.

---

_[View the full topic](https://qa.fmod.com/t/bug-unity-editor-hangs-when-handling-devicelistchanged-callback/19021)._
