Skip to content

[BUG] Thread deadlock when system mic changes #624

Closed

Description

@dain

Describe the bug

I have a macbook with a Shure microphone connected via USBC, which I use exclusively for dictation. When this mic is selected and I put on my AirpodMax 2 headphones, the mac switches both input and output the the AirpodMax automatically. Something like 50% of the time, the causes Fluid Voice to lockup and I have to force quit the application and restart it. Since this can happen any time I take my headphone of it is pretty frustrating (in an otherwise amazing application).

Reproduction steps

  1. open FluidVoice
  2. select the share microphone
  3. take AirPod Max off
  4. wait a second
  5. put them back on.

Expected behavior

Ideally, just ignore the system change a say with my shure mic (there is a separate issue for this), but at the very least, don't lock up.

Actual behavior

Fluid void freezes

App Version

1.6.4 build 15

macOS Version

macOS 26.5.2 build 25F84

Architecture

Apple Silicon

Logs or crash report

I had codex analyze the log and pull ou the relevant sections.

## 1. Strongest apparent hang: blocked while instantiating the input node


[12:30:53.379] [DEBUG] [ASRService] Audio engine retired (idle_route_change:default input changed)
[12:30:53.410] [DEBUG] [ASRService] 🔧 configureSession() - ENTERED
[12:30:53.410] [DEBUG] [ASRService] ℹ️ Creating audio engine lazily
[12:30:53.410] [DEBUG] [ASRService] 📍 Forcing input node instantiation...

... no "Input node instantiated" or "configureSession() - COMPLETED" entry ...

[RUN] PID=<REDACTED_PROCESS_ID> AppVersion=1.6.4 Build=15 OS=Version 26.5.2 (Build 25F84)
[12:31:17.077] [INFO] [AppServices] 📦 AppServices singleton created (services not yet initialized)


Light analysis: the last operation logged by the old process is input-node instantiation during handling of a default-input change. The next event is a fresh Fluid process about 24 seconds later. This is consistent with the application blocking inside or immediately around `AVAudioEngine.inputNode` until it is force-quit and relaunched.

For comparison, the same initialization path completes normally after relaunch:


[12:31:18.896] [DEBUG] [ASRService] 🔧 configureSession() - ENTERED
[12:31:18.897] [DEBUG] [ASRService] ℹ️ Creating audio engine lazily
[12:31:18.897] [DEBUG] [ASRService] 📍 Forcing input node instantiation...
[12:31:19.014] [DEBUG] [ASRService] Input node instantiated
[12:31:19.014] [DEBUG] [ASRService] 📍 Forcing output node instantiation...
[12:31:19.030] [DEBUG] [ASRService] ✅ Output node instantiated
[12:31:19.030] [DEBUG] [ASRService] ✅ configureSession() - COMPLETED
[12:31:19.030] [INFO] [ASRBenchmark] ASR_BENCH session=0 audio_engine_prewarm reason=startup elapsedMs=134


## 2. Another apparent hang following an output-route change


[12:28:59.163] [DEBUG] [ASRService] Audio engine retired (idle_route_change:default output changed)

... no further entries from that process ...

[RUN] PID=<REDACTED_PROCESS_ID> AppVersion=1.6.4 Build=15 OS=Version 26.5.2 (Build 25F84)
[12:30:45.819] [INFO] [AppServices] 📦 AppServices singleton created (services not yet initialized)


Light analysis: after Fluid retires the engine in response to a default-output change, logging stops. A new process starts about 1 minute 46 seconds later. This looks like a second hang in the idle route-change path, although this excerpt alone cannot identify the exact blocking call.

## 3. AirPods arrival causes a burst of duplicate disconnect callbacks


[11:34:14.685] [DEBUG] [ASRService] Audio engine retired (idle_route_change:default output changed)
[11:34:14.806] [DEBUG] [ASRService] ✅ configureSession() - COMPLETED
[11:34:14.806] [INFO]  [ASRService] ⚠️ Device availability changed for ID: <REDACTED_DEVICE_ID>
[11:34:14.806] [WARN]  [ASRService] ❌ Monitored device (ID: <REDACTED_DEVICE_ID>) DISCONNECTED
[11:34:14.806] [DEBUG] [ASRService] Current input devices: AirPods Max 2, <OTHER_INPUT_DEVICES_REDACTED>, Shure MV7+
[11:34:14.808] [INFO]  [ASRService] 🎧 New Bluetooth device detected: 'AirPods Max 2'. Auto-switching...
[11:34:14.808] [INFO]  [ASRService] Not recording - Bluetooth device will be used on next recording

... the same monitored-device DISCONNECTED callback occurs 7 more times ...
... all 8 callbacks occur between 11:34:14.806 and 11:34:14.867 ...

[11:34:15.335] [DEBUG] [ASRService] Audio engine retired (idle_route_change:default input changed)
[11:34:15.466] [DEBUG] [ASRService] ✅ configureSession() - COMPLETED
[11:34:15.466] [INFO]  [ASRBenchmark] ASR_BENCH session=8 audio_engine_prewarm reason=idle_route_change elapsedMs=104


Light analysis: a single Bluetooth/device transition produces eight disconnect callbacks within roughly 61 ms. This may indicate duplicate observer registration, reentrant notification handling, or a need to coalesce route-change notifications. Repeated callbacks could cause overlapping engine retirement/recreation work and increase the chance of a deadlock or blocked Core Audio call.

## 4. Route change while recording: 48 kHz to 24 kHz


[12:20:56.747] [DEBUG] [ASRService] Engine IO device = 48000.0Hz, Input format = 48000.0Hz 1ch
[12:20:56.850] [INFO]  [ASRService] AVAudioEngine started successfully on attempt 1
[12:20:56.851] [INFO]  [ASRService] ✅ Audio capture running
[12:20:57.263] [WARN]  [ASRService] Audio route changed while recording; scheduling recovery (engine configuration changed)
[12:20:58.265] [INFO]  [ASRService] Recovering audio route after engine configuration changed
[12:20:58.266] [DEBUG] [ASRService] Audio engine retired (audio_route_recovery)
[12:20:58.266] [DEBUG] [ASRService] 🔧 configureSession() - ENTERED
[12:20:58.362] [DEBUG] [ASRService] ✅ configureSession() - COMPLETED
[12:20:58.362] [INFO]  [ASRService] Sync mode enabled - using system default input device
[12:20:58.374] [DEBUG] [ASRService] Engine IO device = 24000.0Hz, Input format = 24000.0Hz 1ch
[12:20:58.391] [INFO]  [ASRService] AVAudioEngine started successfully on attempt 1
[12:20:58.393] [INFO]  [ASRService] Audio route recovery succeeded
[12:20:58.393] [WARN]  [ASRService] Audio buffer not growing after 6 seconds (count: 0). Audio capture may have failed. Check if engine is running and tap is installed.
[12:20:58.575] [INFO]  [ASRBenchmark] ASR_BENCH session=5 first_audio sampleCount=2731 frameLength=4096 sampleRate=24000 bufferMs=171 acquisitionMs=126 elapsedMs=309


Light analysis: this instance recovered, but it demonstrates the relevant transition. The active engine changes from 48 kHz to 24 kHz during recording, is retired and recreated, temporarily has a zero-length capture buffer, and then receives audio. The 24 kHz route is consistent with the AirPods microphone route seen elsewhere in the log.

## 5. Explicit Shure to AirPods transition followed by an immediate Shure rebind


[17:36:06.450] [DEBUG] [ASRService] Audio engine retired (idle_route_change:default output changed)
[17:36:06.483] [INFO]  [ASRService] Prepared direct Core Audio input 'Shure MV7+' (48000Hz, 512 frames, reason=idle_route_change)
[17:36:10.929] [DEBUG] [ASRService] Audio engine retired (idle_route_change:default input changed)
[17:36:10.948] [INFO]  [ASRService] Prepared direct Core Audio input 'AirPods Max 2' (24000Hz, 480 frames, reason=idle_route_change)
[17:36:10.974] [INFO]  [ASRService] Preferred device 'Shure MV7+' reconnected. Auto-switching...
[17:36:10.974] [INFO]  [ASRService] Not recording - updating binding for next session
[17:36:11.061] [INFO]  [ASRService] Bound ASR input to 'Shure MV7+' (uid: <REDACTED_DEVICE_UID>, id: <REDACTED_DEVICE_ID>)


A later occurrence generates the same Shure reconnection and binding sequence four times within approximately 3 ms:


[18:19:21.484] [DEBUG] [ASRService] Audio engine retired (idle_route_change:default input changed)
[18:19:21.503] [INFO]  [ASRService] Prepared direct Core Audio input 'AirPods Max 2' (48000Hz, 480 frames, reason=idle_route_change)
[18:19:21.552] [INFO]  [ASRService] Preferred device 'Shure MV7+' reconnected. Auto-switching...
[18:19:21.637] [INFO]  [ASRService] Bound ASR input to 'Shure MV7+' (uid: <REDACTED_DEVICE_UID>, id: <REDACTED_DEVICE_ID>)
[18:19:21.652] [INFO]  [ASRService] Preferred device 'Shure MV7+' reconnected. Auto-switching...
[18:19:21.652] [INFO]  [ASRService] Bound ASR input to 'Shure MV7+' (uid: <REDACTED_DEVICE_UID>, id: <REDACTED_DEVICE_ID>)
[18:19:21.653] [INFO]  [ASRService] Preferred device 'Shure MV7+' reconnected. Auto-switching...
[18:19:21.653] [INFO]  [ASRService] Bound ASR input to 'Shure MV7+' (uid: <REDACTED_DEVICE_UID>, id: <REDACTED_DEVICE_ID>)
[18:19:21.655] [INFO]  [ASRService] Preferred device 'Shure MV7+' reconnected. Auto-switching...
[18:19:21.655] [INFO]  [ASRService] Bound ASR input to 'Shure MV7+' (uid: <REDACTED_DEVICE_UID>, id: <REDACTED_DEVICE_ID>)


Light analysis: Fluid is not merely observing the system route change; its preferred-device behavior immediately attempts to switch the input back to the Shure. The duplicated rebind sequence suggests multiple callbacks can act on the same device event.

## Overall interpretation

The logs appear to narrow the persistent hang to the audio-engine recreation path triggered by default-device changes. The strongest case stops immediately after `Forcing input node instantiation...`, whereas a healthy run logs `Input node instantiated` about 117 ms later.

Possible areas to investigate:

- Calling `AVAudioEngine.inputNode` or creating/configuring `AVAudioEngine` synchronously while Core Audio is still rebuilding a Bluetooth/USB route.
- Multiple device observers or reentrant callbacks issuing duplicate disconnect/reconnect handling.
- Overlapping default-input, default-output, engine-configuration, and preferred-device auto-switch events.
- Serializing and coalescing route changes before retiring or recreating the engine.
- Ensuring route-change work does not block the main/UI thread.

Screenshots or screen recording

No response

Activity

  1. added
    bug
    on Jul 15, 2026
  2. dain commented on Jul 15, 2026

    @dain
    Author

    I reproduced the lockup again and I had Codex perform diagnostics:

    I captured a 10-second live process sample before force-quitting FluidVoice. I’ve attached the sanitized diagnostic bundle.

    The sample captured the hang clearly: all 8,804 samples show the main thread blocked in ASRService.retireAudioEngine → AVAudioEngine dealloc → synchronous dispatch wait. Simultaneously, Core Audio’s device-teardown notification queue is waiting for main-thread progress, while the AVAudioIOUnit queue is waiting inside Core Audio during device rebinding and property-listener removal.

    The timestamps correlate with the route change: macOS reported a default-output change at 16:13:58.510, and FluidVoice’s final application-log entry at 16:13:58.730 was:

    Audio engine retired (idle_route_change:default output changed)

    No further FluidVoice log entries appeared before the live sample at 16:17:40. The ZIP includes the full sanitized sample, relevant Core Audio unified logs, the FluidVoice log excerpt, and a short analysis.

    fluid-hang-diagnostics-2026-07-15-1617.zip

  3. changed the title [-][BUG] Lockup when system mic changes[/-] [+][BUG] Thread deadlock when system mic changes[/+] on Jul 15, 2026
  4. grohith327 commented on Jul 16, 2026

    @grohith327
    Collaborator

    Thanks for the detailed issue @dain, possibly related to #136.

    Are you open to running a local build for few days from this custom branch - allow-default-audio-input ??

    If you are having issues building locally, I can also share a pre-built app from that branch. Would help us fix one

  5. dain commented on Jul 16, 2026

    @dain
    Author

    @grohith327 Yes, I’m happy to test the custom branch for a few days. I checked the local build instructions, but the project uses your signing team and com.FluidApp.app bundle identifier, so I would need to change the signing configuration and bundle ID for my Personal Team. The public build also excludes the private Fluid Intelligence component, which could make it less representative of the release build I’m currently using.

    Could you share a signed prebuilt app from the branch? I’ll repeatedly switch between the Shure MV7+ and AirPods Max, use it normally for several days, and report whether the lockup returns.

  6. dain commented on Jul 16, 2026

    @dain
    Author

    I had Codex build a local version for me and it seems to work fine. I don't have any hangs anymore. I also had it inspect the code and compare against the problems I was having, and it was very confident that you have fixed the issue.

  7. grohith327 commented on Jul 17, 2026

    @grohith327
    Collaborator

    Sounds good, thank you so much @dain. I will hold off merging until tomorrow evening. Please get back on me if you run into any issues.

  8. MarcBickel commented on Jul 17, 2026

    @MarcBickel

    Hit what looks like exactly this deadlock, and captured a full thread sample of the hung process (sample over 3s, 1777 samples/thread). Hopefully useful — the sample shows the complete deadlock cycle, not just the log symptom.

    Environment: FluidVoice 1.6.4 (15), macOS 27.0 beta (26A5378n), Apple Silicon (Mac14,9). No Bluetooth involved in my case — the device churn comes from a Continuity iPhone microphone and a Studio Display mic appearing/disappearing every few minutes.

    Symptom: App had been running since Jul 14. On Jul 16 08:47 an idle_route_change:default output changed fired while the app was idle in the background. Fluid.log ends mid-operation:

    [08:47:25.657] [INFO] [ASRService] 🔄 Device list changed - checking for new/removed devices
    [08:47:25.666] [DEBUG] [ASRService] Audio engine retired (idle_route_change:default output changed)
    [08:47:25.666] [DEBUG] [ASRService] 🔧 configureSession() - ENTERED
    [08:47:25.667] [DEBUG] [ASRService] ℹ️ Creating audio engine lazily
    [08:47:25.667] [DEBUG] [ASRService] 📍 Forcing input node instantiation...
    

    The process then stayed alive but fully unresponsive for ~25 hours, pinned at ~30% CPU, until I force-quit it.

    The deadlock cycle (4 threads, all at 1777/1777 samples, i.e. permanently blocked):

    1. Main thread — ASRService.configureSession() → -[AVAudioEngine inputNode] → GetHWFormat → dispatch_sync onto an AVAudioIOUnit serial queue → waits forever.
    2. AVAudioIOUnit queue (11157) — BindToDeviceInternal → setDeviceID: → AudioObjectRemovePropertyListener → CAGuard::WaitFor → blocked waiting for an in-flight property-listener callback to finish.
    3. That in-flight callback is on AVAudioIOUnit queue (19267) — IOUnitPropertyListener → _GetHWFormat → AVAEHalUtil::GetSubDevices → mach_msg to coreaudiod, repeatedly querying sub-devices of the app's CADefaultDeviceAggregate — which is simultaneously being torn down (this loop is the ~30% CPU).
    4. HALC_ProxyNotification queue — AudioObjectsPublishedAndDied → HALDevice::Teardown → dispatch_sync onto the main thread → completes the cycle.

    Plus a fifth blocked party: the retired engine's -[AVAudioEngine dealloc] on a utility queue, also stuck in dispatch_sync onto the same AVAudioIOUnit queue — matching the dealloc-vs-reconfigure race described in #542.

    Net: main → IOUnit queue → listener/teardown → main. Classic lock-inversion between the route-change handler recreating the engine and CoreAudio tearing down the old aggregate device.

    Main thread (hung in configureSession → AVAudioEngine.inputNode)
    Call graph:
        1777 Thread_295561   DispatchQueue_1: com.apple.main-thread  (serial)
        + 1777 start  (in dyld) + 6688  [0x191763bec]
        +   1777 main  (in FluidVoice) + 64  [0x104a4dd18]
        +     1777 static App.main()  (in SwiftUI) + 224  [0x1ca9f6dcc]
        +       1777 runApp<A>(_:)  (in SwiftUI) + 108  [0x1ca70cae8]
        +         1777 specialized runApp(_:)  (in SwiftUI) + 140  [0x1ca301978]
        +           1777 NSApplicationMain  (in AppKit) + 880  [0x196021be4]
        +             1777 -[NSApplication run]  (in AppKit) + 396  [0x196049940]
        +               1777 -[NSApplication(NSEventRouting) nextEventMatchingMask:untilDate:inMode:dequeue:]  (in AppKit) + 244  [0x1968bcb68]
        +                 1777 -[NSApplication(NSEventRouting) _nextEventMatchingEventMask:untilDate:inMode:dequeue:]  (in AppKit) + 780  [0x1968bd044]
        +                   1777 _DPSNextEvent  (in AppKit) + 580  [0x19605660c]
        +                     1777 _DPSBlockUntilNextEventMatchingListInMode  (in AppKit) + 292  [0x196399550]
        +                       1777 _BlockUntilNextEventMatchingListInMode  (in HIToolbox) + 48  [0x19f0e0368]
        +                         1777 ReceiveNextEventCommon  (in HIToolbox) + 492  [0x19ef5d904]
        +                           1777 RunCurrentEventLoopInMode  (in HIToolbox) + 320  [0x19ef5a578]
        +                             1777 _CFRunLoopRunSpecificWithOptions  (in CoreFoundation) + 536  [0x191cd30e0]
        +                               1777 __CFRunLoopRun  (in CoreFoundation) + 2124  [0x191bf950c]
        +                                 1777 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__  (in CoreFoundation) + 16  [0x191c376d8]
        +                                   1777 _dispatch_main_queue_callback_4CF  (in libdispatch.dylib) + 44  [0x191987aa4]
        +                                     1777 _dispatch_main_queue_drain  (in libdispatch.dylib) + 176  [0x191987b64]
        +                                       1777 _dispatch_main_queue_drain.cold.6  (in libdispatch.dylib) + 832  [0x1919b0990]
        +                                         1777 _dispatch_client_callout  (in libdispatch.dylib) + 16  [0x1919925fc]
        +                                           1777 _dispatch_call_block_and_release  (in libdispatch.dylib) + 32  [0x191978a34]
        +                                             1777 <deduplicated_symbol>  (in FluidVoice) + 28  [0x1044970fc]
        +                                               1777 partial apply for closure #1 in closure #2 in ASRService.registerDefaultDeviceChangeListener()  (in FluidVoice) + 140  [0x10453b2c0]
        +                                                 1777 ASRService.scheduleAudioRouteRecovery(reason:)  (in FluidVoice) + 544  [0x10452078c]
        +                                                   1777 ASRService.prewarmAudioEngineIfPossible(reason:)  (in FluidVoice) + 868  [0x10450a4e8]
        +                                                     1777 ASRService.configureSession()  (in FluidVoice) + 600  [0x10450af60]
        +                                                       1777 -[AVAudioEngine inputNode]  (in AVFAudio) + 132  [0x22a6c3218]
        +                                                         1777 AVAudioEngineImpl::UpdateInputNode(bool)  (in AVFAudio) + 800  [0x22a6cc270]
        +                                                           1777 -[AVAudioNode inputFormatForBus:]  (in AVFAudio) + 76  [0x22a6ac704]
        +                                                             1777 AVAudioIONodeImpl::GetInputFormat(unsigned long)  (in AVFAudio) + 148  [0x22a6ba708]
        +                                                               1777 AVAudioIOUnit::GetHWFormat(unsigned int, unsigned int*)  (in AVFAudio) + 176  [0x22a6b7510]
        +                                                                 1777 _dispatch_sync_f_slow  (in libdispatch.dylib) + 144  [0x191988380]
        +                                                                   1777 __DISPATCH_WAIT_FOR_QUEUE__  (in libdispatch.dylib) + 432  [0x191988834]
        +                                                                     1777 _dispatch_event_loop_wait_for_ownership  (in libdispatch.dylib) + 384  [0x19199c5b8]
        +                                                                       1777 _dispatch_kq_poll  (in libdispatch.dylib) + 220  [0x19199bbdc]
        +                                                                         1777 kevent_id  (in libsystem_kernel.dylib) + 8  [0x191af6a70]
    
    AVAudioIOUnit queue 11157 (BindToDeviceInternal → RemovePropertyListener → CAGuard::WaitFor)
        1777 Thread_3272348   DispatchQueue_11157: AVAudioIOUnit  (serial)
        + 1777 start_wqthread  (in libsystem_pthread.dylib) + 8  [0x191b34cd8]
        +   1777 _pthread_wqthread  (in libsystem_pthread.dylib) + 292  [0x191b35f98]
        +     1777 _dispatch_workloop_worker_thread  (in libdispatch.dylib) + 720  [0x19198b8c4]
        +       1777 _dispatch_root_queue_drain_deferred_wlh  (in libdispatch.dylib) + 284  [0x19198bfc0]
        +         1777 _dispatch_lane_invoke  (in libdispatch.dylib) + 392  [0x191981b1c]
        +           1777 _dispatch_lane_serial_drain  (in libdispatch.dylib) + 744  [0x191981020]
        +             1777 _dispatch_client_callout  (in libdispatch.dylib) + 16  [0x1919925fc]
        +               1777 _dispatch_call_block_and_release  (in libdispatch.dylib) + 32  [0x191978a34]
        +                 1777 AVAudioIOUnit_OSX::BindToDeviceInternal(unsigned int)  (in AVFAudio) + 400  [0x22a6b89a0]
        +                   1777 AUInterfaceIOV3::SetCurrentDevice(unsigned int, unsigned int)  (in AVFAudio) + 76  [0x22a5eea04]
        +                     1777 -[AUHALOutputUnit setDeviceID:error:]  (in AudioToolboxCore) + 56  [0x1948df7ec]
        +                       1777 AudioUnitSetProperty  (in AudioToolboxCore) + 500  [0x194996e30]
        +                         1777 ???  (in CoreAudio)  load address 0x11e620000 + 0xd4668  [0x11e6f4668]
        +                           1777 ???  (in CoreAudio)  load address 0x11e620000 + 0xd003c  [0x11e6f003c]
        +                             1777 ???  (in CoreAudio)  load address 0x11e620000 + 0xd84c  [0x11e62d84c]
        +                               1777 ???  (in CoreAudio)  load address 0x11e620000 + 0x891c  [0x11e62891c]
        +                                 1777 AudioObjectRemovePropertyListener_mac_imp  (in CoreAudio) + 268  [0x194f2e224]
        +                                   1777 HALObject::RemovePropertyListener(AudioObjectPropertyAddress const&, HALPropertyListener const&)  (in CoreAudio) + 464  [0x194cccbb8]
        +                                     1777 CADeprecated::CAGuard::WaitFor(unsigned long long)  (in CoreAudio) + 136  [0x19518aaf8]
        +                                       1777 _pthread_cond_wait  (in libsystem_pthread.dylib) + 1024  [0x191b3a1f8]
        +                                         1777 __psynch_cvwait  (in libsystem_kernel.dylib) + 8  [0x191af850c]
    
    AVAudioIOUnit queue 19267 (IOUnitPropertyListener → GetSubDevices spin against coreaudiod)
        1777 Thread_3272357   DispatchQueue_19267: AVAudioIOUnit  (serial)
        + 1777 start_wqthread  (in libsystem_pthread.dylib) + 8  [0x191b34cd8]
        +   1777 _pthread_wqthread  (in libsystem_pthread.dylib) + 292  [0x191b35f98]
        +     1777 _dispatch_workloop_worker_thread  (in libdispatch.dylib) + 720  [0x19198b8c4]
        +       1777 _dispatch_root_queue_drain_deferred_wlh  (in libdispatch.dylib) + 284  [0x19198bfc0]
        +         1777 _dispatch_lane_invoke  (in libdispatch.dylib) + 392  [0x191981b1c]
        +           1777 _dispatch_lane_serial_drain  (in libdispatch.dylib) + 744  [0x191981020]
        +             1777 _dispatch_client_callout  (in libdispatch.dylib) + 16  [0x1919925fc]
        +               1777 _dispatch_call_block_and_release  (in libdispatch.dylib) + 32  [0x191978a34]
        +                 1777 invocation function for block in AVAudioIOUnit::IOUnitPropertyListener(void*, ComponentInstanceRecord*, unsigned int, unsigned int, unsigned int)  (in AVFAudio) + 328  [0x22a6b73f4]
        +                   1021 AVAudioIOUnit_OSX::_GetHWFormat(unsigned int, unsigned int*)  (in AVFAudio) + 544  [0x22a6b906c]
        +                   ! 1009 AVAEHalUtil::GetSubDevices(unsigned int)  (in AVFAudio) + 88  [0x22a66e4ac]
        +                   ! : 1000 AudioObjectGetPropertyDataSize_mac_imp  (in CoreAudio) + 300  [0x194f2b674]
        +                   ! : | 1000 HALPlugIn::ObjectHasProperty(HALObject const&, AudioObjectPropertyAddress const&) const  (in CoreAudio) + 44  [0x194ccb5f0]
        +                   ! : |   986 HAL_HardwarePlugIn_ObjectHasProperty(AudioHardwarePlugInInterface**, unsigned int, AudioObjectPropertyAddress const*)  (in CoreAudio) + 440  [0x194e6dcd4]
        +                   ! : |   + 973 HALC_ShellObject::HasProperty(unsigned int, AudioObjectPropertyAddress const&, bool&) const  (in CoreAudio) + 488  [0x194fb9040]
        +                   ! : |   + ! 930 HALC_ProxyObjectMap::CopyObjectByObjectID(unsigned int)  (in CoreAudio) + 640  [0x1951b80f0]
        +                   ! : |   + ! : 930 mach_msg  (in libsystem_kernel.dylib) + 24  [0x191af4fac]
        +                   ! : |   + ! :   928 mach_msg_overwrite  (in libsystem_kernel.dylib) + 480  [0x191afda28]
        +                   ! : |   + ! :   | 928 mach_msg2_internal  (in libsystem_kernel.dylib) + 76  [0x191b078b0]
        +                   ! : |   + ! :   |   928 mach_msg2_trap  (in libsystem_kernel.dylib) + 8  [0x191af4c20]
        +                   ! : |   + ! :   2 mach_msg_overwrite  (in libsystem_kernel.dylib) + 216,480  [0x191afd920,0x191afda28]
        +                   ! : |   + ! 30 HALC_ProxyObjectMap::CopyObjectByObjectID(unsigned int)  (in CoreAudio) + 1432  [0x1951b8408]
        +                   ! : |   + ! : 30 _os_log_impl  (in libsystem_trace.dylib) + 28  [0x19184fc58]
        +                   ! : |   + ! :   30 _os_log  (in libsystem_trace.dylib) + 160  [0x19184fd00]
        +                   ! : |   + ! :     13 _os_log_impl_flatten_and_send  (in libsystem_trace.dylib) + 800  [0x191850038]
        +                   ! : |   + ! :     | 7 os_log_fmt_flatten  (in libsystem_trace.dylib) + 1768  [0x191861bdc]
        +                   ! : |   + ! :     | + 2 _dyld_is_memory_immutable  (in libdyld.dylib) + 0,24  [0x19170d29c,0x19170d2b4]
        +                   ! : |   + ! :     | + 2 dyld4::APIs::_dyld_is_memory_immutable(void const*, unsigned long)  (in dyld) + 192  [0x19174ed3c]
        +                   ! : |   + ! :     | + ! 1 DyldSharedCache::forEachCache(void (DyldSharedCache const*, bool&) block_pointer) const  (in dyld) + 60  [0x19173cdc4]
        +                   ! : |   + ! :     | + ! : 1 invocation function for block in dyld4::APIs::_dyld_is_memory_immutable(void const*, unsigned long)  (in dyld) + 116  [0x19174ee4c]
        +                   ! : |   + ! :     | + ! :   1 DyldSharedCache::forEachRegion(void (void const*, unsigned long long, unsigned long long, unsigned int, unsigned int, unsigned long long, unsigned long long, bool&) block_pointer) const  (in dyld) + 276  [0x19173cd70]
        +                   ! : |   + ! :     | + ! :     1 invocation function for block in dyld4::APIs::_dyld_is_memory_immutable(void const*, unsigned long)  (in dyld) + 0  [0x19174ee58]
        +                   ! : |   + ! :     | + ! 1 DyldSharedCache::forEachCache(void (DyldSharedCache const*, bool&) block_pointer) const  (in dyld) + 168  [0x19173ce30]
        +                   ! : |   + ! :     | + !   1 invocation function for block in dyld4::APIs::_dyld_is_memory_immutable(void const*, unsigned long)  (in dyld) + 116  [0x19174ee4c]
        +                   ! : |   + ! :     | + !     1 DyldSharedCache::forEachRegion(void (void const*, unsigned long long, unsigned long long, unsigned int, unsigned int, unsigned long long, unsigned long long, bool&) block_pointer) const  (in dyld) + 52  [0x19173cc90]
    
    HALC_ProxyNotification queue (HALDevice::Teardown → dispatch_sync onto main)
        1777 Thread_3261152   DispatchQueue_293: HALC_ProxyNotification Call Listener Queue  (serial)
        + 1777 start_wqthread  (in libsystem_pthread.dylib) + 8  [0x191b34cd8]
        +   1777 _pthread_wqthread  (in libsystem_pthread.dylib) + 292  [0x191b35f98]
        +     1777 _dispatch_workloop_worker_thread  (in libdispatch.dylib) + 720  [0x19198b8c4]
        +       1777 _dispatch_root_queue_drain_deferred_wlh  (in libdispatch.dylib) + 284  [0x19198bfc0]
        +         1777 _dispatch_workloop_invoke  (in libdispatch.dylib) + 1604  [0x191982ed4]
        +           1777 _dispatch_lane_invoke  (in libdispatch.dylib) + 448  [0x191981b54]
        +             1777 _dispatch_lane_serial_drain  (in libdispatch.dylib) + 744  [0x191981020]
        +               1777 _dispatch_client_callout  (in libdispatch.dylib) + 16  [0x1919925fc]
        +                 1777 applesauce::dispatch::v1::async<HALC_ProxyNotifications::_SendPropertiesChanged(unsigned int, unsigned int, AudioObjectPropertyAddress const*, bool, std::vector<HALC_ProxyNotifications::Listener> const&)::$_0&>(dispatch_queue_s*, HALC_ProxyNotifications::_SendPropertiesChanged(unsigned int, unsigned int, AudioObjectPropertyAddress const*, bool, std::vector<HALC_ProxyNotifications::Listener> const&)::$_0&)::'lambda'(void*)::__invoke(void*)  (in CoreAudio) + 60  [0x194ec007c]
        +                   1777 HALC_ProxyNotifications::CallListener(unsigned int, unsigned int, unsigned int, AudioObjectPropertyAddress const*)  (in CoreAudio) + 84  [0x194ebfbd0]
        +                     1777 HALC_ShellPlugIn::ProxyObject_PropertiesChanged(unsigned int, unsigned int, AudioObjectPropertyAddress const*)  (in CoreAudio) + 964  [0x194e6abdc]
        +                       1777 HALSystem::AudioObjectsPublishedAndDied(AudioHardwarePlugInInterface**, unsigned int, unsigned int, unsigned int const*, unsigned int, unsigned int const*)  (in CoreAudio) + 196  [0x194da0c04]
        +                         1777 HALSystem::ObjectsPublishedAndDied(unsigned int, unsigned int const*, unsigned int, unsigned int const*)  (in CoreAudio) + 1148  [0x194d9fff4]
        +                           1777 HALDevice::Teardown()  (in CoreAudio) + 80  [0x195278148]
        +                             1777 HALObject::PropertiesChanged(unsigned int, AudioObjectPropertyAddress const*)  (in CoreAudio) + 1808  [0x194f2350c]
        +                               1777 _dispatch_sync_f_slow  (in libdispatch.dylib) + 144  [0x191988380]
        +                                 1777 __DISPATCH_WAIT_FOR_QUEUE__  (in libdispatch.dylib) + 464  [0x191988854]
        +                                   1777 _dispatch_thread_main_event_wait_slow  (in libdispatch.dylib) + 76  [0x19197a664]
        +                                     1777 __ulock_wait  (in libsystem_kernel.dylib) + 8  [0x191af6af4]
        1777 Thread_3272245   DispatchQueue_22: com.apple.libtrace.state.block-list  (serial)
        + 1777 start_wqthread  (in libsystem_pthread.dylib) + 8  [0x191b34cd8]
    
    Old engine dealloc (blocked on same AVAudioIOUnit queue)
        1777 Thread_3272345   DispatchQueue_10: com.apple.root.utility-qos  (concurrent)
        + 1777 start_wqthread  (in libsystem_pthread.dylib) + 8  [0x191b34cd8]
        +   1777 _pthread_wqthread  (in libsystem_pthread.dylib) + 232  [0x191b35f5c]
        +     1777 _dispatch_worker_thread2  (in libdispatch.dylib) + 184  [0x19198b2b0]
        +       1777 _dispatch_root_queue_drain  (in libdispatch.dylib) + 708  [0x19198ac70]
        +         1777 <deduplicated_symbol>  (in libdispatch.dylib) + 28  [0x1919b030c]
        +           1777 _dispatch_client_callout  (in libdispatch.dylib) + 16  [0x1919925fc]
        +             1777 _Block_release  (in libsystem_blocks.dylib) + 236  [0x1917f21c0]
        +               1777 _call_dispose_helpers_excp  (in libsystem_blocks.dylib) + 48  [0x1917f23fc]
        +                 1777 swift::RefCounts<swift::RefCountBitsT<(swift::RefCountInlinedness)1>>::doDecrementSlow<(swift::PerformDeinit)1>(swift::RefCountBitsT<(swift::RefCountInlinedness)1>, unsigned int)  (in libswiftCore.dylib) + 168  [0x1a67b48f4]
        +                   1777 _swift_release_dealloc  (in libswiftCore.dylib) + 64  [0x1a674dfb8]
        +                     1777 __swift_closure_destructor.419  (in FluidVoice) + 16  [0x10453b770]
        +                       1777 -[AVAudioEngine dealloc]  (in AVFAudio) + 284  [0x22a6c2684]
        +                         1777 AVAudioIOUnit_OSX::~AVAudioIOUnit_OSX()  (in AVFAudio) + 16  [0x22a6b8690]
        +                           1777 AVAudioIOUnit::~AVAudioIOUnit()  (in AVFAudio) + 200  [0x22a6b71a8]
        +                             1777 _dispatch_sync_f_slow  (in libdispatch.dylib) + 144  [0x191988380]
        +                               1777 __DISPATCH_WAIT_FOR_QUEUE__  (in libdispatch.dylib) + 432  [0x191988834]
        +                                 1777 _dispatch_event_loop_wait_for_ownership  (in libdispatch.dylib) + 384  [0x19199c5b8]
        +                                   1777 _dispatch_kq_poll  (in libdispatch.dylib) + 220  [0x19199bbdc]
        +                                     1777 kevent_id  (in libsystem_kernel.dylib) + 8  [0x191af6a70]
    

    Happy to share the full sample file (316 KB, includes all 13 threads + binary images) if useful.

  9. grohith327 commented on Jul 18, 2026

    @grohith327
    Collaborator

    Hey folks, merged the PR which hopefully fixes it. There are few others running into similar problems which is related to audio input switching, so keeping just #644 open and resolving others. Please follow up there

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions