()
| 1519 | // Audio settings merged into SettingsView |
| 1520 | |
| 1521 | private func refreshDevices() { |
| 1522 | // Query CoreAudio off the main thread — during device topology changes, synchronous |
| 1523 | // CoreAudio calls on main can deadlock while the HAL is still settling. |
| 1524 | DispatchQueue.global(qos: .userInitiated).async { |
| 1525 | let inputs = AudioDevice.listInputDevicesRefreshingLiveness() |
| 1526 | let outputs = AudioDevice.listOutputDevices() |
| 1527 | let defaultInputUID = AudioDevice.getDefaultInputDevice()?.uid |
| 1528 | DispatchQueue.main.async { |
| 1529 | self.inputDevices = inputs |
| 1530 | self.outputDevices = outputs |
| 1531 | if let selectedInput = self.appServices.microphonePreferenceCoordinator |
| 1532 | .reconcileMicrophoneSelection( |
| 1533 | availableInputs: inputs, |
| 1534 | defaultInputUID: defaultInputUID |
| 1535 | ) |
| 1536 | { |
| 1537 | self.selectedInputUID = selectedInput.uid |
| 1538 | } |
| 1539 | } |
| 1540 | } |
| 1541 | } |
| 1542 | |
| 1543 | private func refreshInputDevices() { |
| 1544 | DispatchQueue.global(qos: .userInitiated).async { |
no test coverage detected