{"record":{"id":"78aafe804078122a","repo":"Zackriya-Solutions/meetily","slug":"device-not-found","errorCode":null,"errorMessage":"Device not found: {}","messagePattern":"Device not found: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"frontend/src-tauri/src/audio/devices/configuration.rs","lineNumber":174,"sourceCode":"                {\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                                }\n                            }\n                        }\n                    }\n                }\n            }\n        }\n\n        Err(anyhow!(\"Device not found: {}\", audio_device.name))\n    }\n}","sourceCodeStart":156,"sourceCodeEnd":176,"githubUrl":"https://github.com/Zackriya-Solutions/meetily/blob/0281737d87d26352fb0adc78c8c0975f691b23d1/frontend/src-tauri/src/audio/devices/configuration.rs#L156-L176","documentation":"Terminal error of get_cpal_device (configuration.rs:174): the per-platform enumeration finished without any device whose cpal name exactly equals audio_device.name (exact == comparison, unlike the Windows path which also does contains()). The device list the user picked from no longer reflects what the host reports, or the stored name was transformed (suffix-stripped, localized, renamed) so the equality never matches.","triggerScenarios":"Device unplugged/disabled after selection; stored name mismatch: from_name strips the (input)/(output) suffix so the compared value is the bare device name - any host that itself appends a suffix or renames devices (macOS appending '2' for a re-enumerated device) fails the exact match; on Linux the Output path requires the name to match a PulseAudio monitor inside the ALSA host enumeration, and non-monitor names never match.","commonSituations":"Bluetooth headset reconnects under a slightly different name; macOS re-enumerates an interface as 'Yeti Stereo Microphone 2'; user manually edits a config file storing the device name; device list fetched in a previous session/app version.","solutions":["Re-list devices via list_audio_devices and pass a name exactly as currently reported; this fixes stale/renamed devices in one step.","If the goal is just any working device, call default_input_device()/default_output_device() instead of a stored name.","Compare names case- and whitespace-insensitively, or add a contains() fallback like the Windows branch, when patching the app.","On Linux, verify the selected output device is actually a .monitor source name.","Persist device names only as opaque tokens returned by list_audio_devices, never user-edited strings."],"exampleFix":"// before: exact equality only\nif name == audio_device.name { ... }\n\n// after: exact match first, then trimmed/contains fallback before giving up\nif name == audio_device.name\n    || name.trim_end_matches(\" (input)\") == audio_device.name\n    || name.contains(audio_device.name.as_str())\n{ ... }","handlingStrategy":"fallback","validationCode":"// Re-verify the stored selection against the live list before use\nlet live = list_audio_devices()?;\nlet still_there = live.iter().any(|d| d.name == stored.name && d.device_type == stored.device_type);\nif !still_there { /* re-prompt or fall back to default */ }","typeGuard":null,"tryCatchPattern":"// Name lookup failed -> fall back to the default device for that direction\nlet dev = match get_cpal_device(&wanted) {\n    Ok(ok) => ok,\n    Err(e) if e.to_string().starts_with(\"Device not found\") => {\n        info!(\"Falling back to default device\");\n        default_for_type(wanted.device_type)?\n    }\n    Err(e) => return Err(e),\n};","preventionTips":["Treat device names as opaque tokens from list_audio_devices; never hand-edit them.","Re-enumerate on app focus/resume - USB/Bluetooth names change constantly.","Consider contains()/case-insensitive matching as a secondary strategy (the Windows path already does).","Persist the device type alongside the name so fallback can pick the right default."],"tags":["audio","cpal","device-enumeration","name-mismatch","device-not-found"],"backgroundTag":"audio-device-not-found","analyzedSha":"0281737d87d26352fb0adc78c8c0975f691b23d1","analyzedAt":"2026-08-16T20:57:52.567Z","schemaVersion":2},"datasetVersion":"2026-08-16T23:17:17.608Z"}