Zackriya-Solutions/meetily · error

Device not found: {}

Error message

Device not found: {}

What it means

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.

Source

Thrown at frontend/src-tauri/src/audio/devices/configuration.rs:174

                {
                    // For Linux, we use PulseAudio monitor sources for system audio
                    if let Ok(pulse_host) = cpal::host_from_id(cpal::HostId::Alsa) {
                        for device in pulse_host.input_devices()? {
                            if let Ok(name) = device.name() {
                                if name == audio_device.name {
                                    let default_config = device
                                        .default_input_config()
                                        .map_err(|e| anyhow!("Failed to get default input config: {}", e))?;
                                    return Ok((device, default_config));
                                }
                            }
                        }
                    }
                }
            }
        }

        Err(anyhow!("Device not found: {}", audio_device.name))
    }
}

View on GitHub (pinned to 0281737d87)

Solutions

  1. Re-list devices via list_audio_devices and pass a name exactly as currently reported; this fixes stale/renamed devices in one step.
  2. If the goal is just any working device, call default_input_device()/default_output_device() instead of a stored name.
  3. Compare names case- and whitespace-insensitively, or add a contains() fallback like the Windows branch, when patching the app.
  4. On Linux, verify the selected output device is actually a .monitor source name.
  5. Persist device names only as opaque tokens returned by list_audio_devices, never user-edited strings.

Example fix

// before: exact equality only
if name == audio_device.name { ... }

// after: exact match first, then trimmed/contains fallback before giving up
if name == audio_device.name
    || name.trim_end_matches(" (input)") == audio_device.name
    || name.contains(audio_device.name.as_str())
{ ... }
Defensive patterns

Strategy: fallback

Validate before calling

// Re-verify the stored selection against the live list before use
let live = list_audio_devices()?;
let still_there = live.iter().any(|d| d.name == stored.name && d.device_type == stored.device_type);
if !still_there { /* re-prompt or fall back to default */ }

Try / catch

// Name lookup failed -> fall back to the default device for that direction
let dev = match get_cpal_device(&wanted) {
    Ok(ok) => ok,
    Err(e) if e.to_string().starts_with("Device not found") => {
        info!("Falling back to default device");
        default_for_type(wanted.device_type)?
    }
    Err(e) => return Err(e),
};

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


AI-assisted analysis of Zackriya-Solutions/meetily@0281737d87 (2026-08-16). Data as JSON: /api/errors/78aafe804078122a. Report an issue: GitHub.