{"record":{"id":"96e3bbaf872e959f","repo":"Zackriya-Solutions/meetily","slug":"failed-to-get-output-config","errorCode":null,"errorMessage":"Failed to get output config: {}","messagePattern":"Failed to get output config: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"frontend/src-tauri/src/audio/devices/configuration.rs","lineNumber":148,"sourceCode":"                            let default_config = device\n                                .default_input_config()\n                                .map_err(|e| anyhow!(\"Failed to get default input config: {}\", e))?;\n                            return Ok((device, default_config));\n                        }\n                    }\n                }\n            }\n            DeviceType::Output => {\n                #[cfg(target_os = \"macos\")]\n                {\n                    // Use default host for all macOS output devices\n                    // Core Audio backend uses direct cidre API for system capture, not cpal\n                    for device in host.output_devices()? {\n                        if let Ok(name) = device.name() {\n                            if name == audio_device.name {\n                                let default_config = device\n                                    .default_output_config()\n                                    .map_err(|e| anyhow!(\"Failed to get output config: {}\", e))?;\n                                return Ok((device, default_config));\n                            }\n                        }\n                    }\n                }\n\n                #[cfg(target_os = \"linux\")]\n                {\n                    // For Linux, we use PulseAudio monitor sources for system audio\n                    if let Ok(pulse_host) = cpal::host_from_id(cpal::HostId::Alsa) {\n                        for device in pulse_host.input_devices()? {\n                            if let Ok(name) = device.name() {\n                                if name == audio_device.name {\n                                    let default_config = device\n                                        .default_input_config()\n                                        .map_err(|e| anyhow!(\"Failed to get default input config: {}\", e))?;\n                                    return Ok((device, default_config));\n                                }","sourceCodeStart":130,"sourceCodeEnd":166,"githubUrl":"https://github.com/Zackriya-Solutions/meetily/blob/0281737d87d26352fb0adc78c8c0975f691b23d1/frontend/src-tauri/src/audio/devices/configuration.rs#L130-L166","documentation":"Wrapped cpal error from Device::default_output_config() in the macOS branch of get_cpal_device (configuration.rs:148). On macOS, output devices are enumerated from the default host for later system-audio capture; when the named output device is found but its default output config cannot be queried, the ? operator aborts the entire lookup. The comment notes actual capture uses the cidre/Core Audio backend, so this query only serves capability matching.","triggerScenarios":"macOS only, DeviceType::Output: a device matches by name but default_output_config() fails - device unplugged (HDMI/USB DAC disconnected), a virtual driver (BlackHole/Loopback) uninstalled or misconfigured since it was listed, an AirPlay device vanishing when the target disconnected, or a Bluetooth speaker that dropped its connection.","commonSituations":"User picks BlackHole 2ch for system audio then removes the BlackHole driver without refreshing the list; selecting an HDMI/DisplayPort output that disappears when the display sleeps or switches inputs; stale cached device list from a previous session; Bluetooth speaker power-off between selection and record start.","solutions":["Refresh the device list (list_audio_devices) and re-select the output device; stale names are the most common cause.","If using a virtual device for system capture, reinstall/verify it (BlackHole: check Audio MIDI Setup) and restart the app.","Confirm the display/speaker is actually connected and playing (test with a system sound).","Fall back to the default output device or start recording with system audio disabled (system_device_name: null).","Structurally: skip failing devices instead of aborting, same as the input branch."],"exampleFix":"// before: config failure on macOS output device aborts lookup\nlet default_config = device.default_output_config()\n    .map_err(|e| anyhow!(\"Failed to get output config: {}\", e))?;\n\n// after: log and continue enumerating remaining output devices\nmatch device.default_output_config() {\n    Ok(cfg) => return Ok((device, cfg)),\n    Err(e) => { warn!(\"Skipping output device '{}': {}\", name, e); continue; }\n}","handlingStrategy":"fallback","validationCode":"// Verify the output device exists right before capture\nlet listed = list_audio_devices()?;\nif !listed.iter().any(|d| d.name == target_name && d.device_type == DeviceType::Output) {\n    // stale selection: re-pick or record mic-only\n}","typeGuard":null,"tryCatchPattern":"// Degrade to mic-only recording when the system-audio lookup fails\nmatch get_cpal_device(&system_dev) {\n    Ok(found) => start_with_system_audio(found),\n    Err(e) if e.to_string().starts_with(\"Failed to get output config\") => {\n        warn!(\"System audio device unavailable: {}\", e);\n        start_mic_only() // system_device_name: None path\n    }\n    Err(e) => Err(e),\n}","preventionTips":["Reinstall/verify virtual loopback drivers (BlackHole etc.) after OS updates.","Re-select system-audio devices each session rather than persisting across restarts.","Prefer skip-and-continue enumeration over aborting on the first failing device."],"tags":["audio","cpal","macos","output-device","system-audio","coreaudio"],"backgroundTag":"audio-device-unavailable","analyzedSha":"0281737d87d26352fb0adc78c8c0975f691b23d1","analyzedAt":"2026-08-16T20:57:52.567Z","schemaVersion":2},"datasetVersion":"2026-08-16T23:17:17.608Z"}