Zackriya-Solutions/meetily · error
No default input device found
Error message
No default input device found
What it means
default_input_device (microphone.rs:12) asks cpal's default host for host.default_input_device() and gets None - the OS reports no default capture device at all. Unlike Device-not-found, this fails before any name matching: there is no input device selected/available system-wide. (On success the function also propagates device.name()? errors, but the ok_or_else is specifically the None case.)
Source
Thrown at frontend/src-tauri/src/audio/devices/microphone.rs:12
use anyhow::{anyhow, Result};
use cpal::traits::{HostTrait, DeviceTrait};
use log::{info, warn};
use super::configuration::{AudioDevice, DeviceType};
/// Get the default input (microphone) device for the system
pub fn default_input_device() -> Result<AudioDevice> {
let host = cpal::default_host();
let device = host
.default_input_device()
.ok_or_else(|| anyhow!("No default input device found"))?;
Ok(AudioDevice::new(device.name()?, DeviceType::Input))
}
/// Find the built-in microphone device (wired, stable, consistent sample rate)
///
/// Searches for MacBook/built-in microphone patterns to find the hardware
/// microphone instead of Bluetooth devices. This is useful for:
/// - Avoiding Bluetooth variable sample rate issues
/// - Getting stable wired audio for recording
/// - Fallback when Bluetooth device is default but unreliable
///
/// Returns None if no built-in microphone found
pub fn find_builtin_input_device() -> Result<Option<AudioDevice>> {
let host = cpal::default_host();
// Built-in microphone name patterns (platform-specific)
let builtin_patterns = [
// macOS patternsView on GitHub (pinned to 0281737d87)
Solutions
- Attach/enable a physical input device and confirm the OS shows one (macOS System Settings > Sound > Input; Windows Sound settings; Linux pactl list short sources).
- On macOS grant microphone permission and relaunch; on Linux check PulseAudio/PipeWire is running (pulseaudio --check / systemctl --user status pipewire-pulse).
- In the app, pick a specific mic from the device list instead of relying on the default; find_built_in_microphone() is this module's own fallback for exactly this situation.
- If a virtual driver was removed, set any remaining device as system default so the OS default is valid again.
- For headless test environments, load a null source (pactl load-module module-null-source) so a default exists.
Example fix
// before: hard failure when the OS has no default input
let device = host.default_input_device()
.ok_or_else(|| anyhow!("No default input device found"))?;
// after: fall back to the built-in mic finder already present in this module
let device = host.default_input_device()
.or_else(find_built_in_microphone) // Option-returning helper
.ok_or_else(|| anyhow!("No input device found (default missing and no built-in mic)"))?; Defensive patterns
Strategy: fallback
Validate before calling
// Check whether any input device exists before entering the record flow
fn any_input_available() -> bool {
cpal::default_host().input_devices().map(|mut it| it.next().is_some()).unwrap_or(false)
} Try / catch
// No default input -> try the built-in mic finder, else instruct the user
let mic = match default_input_device() {
Ok(m) => m,
Err(e) if e.to_string().contains("No default input device") => {
find_built_in_microphone().ok_or_else(|| anyhow!("Connect or enable a microphone"))?
}
Err(e) => return Err(e),
}; Prevention
- Ship a device-availability check on the record screen: disable Record when no input enumerates.
- Request OS mic permission during onboarding so CoreAudio exposes inputs.
- After uninstalling virtual audio drivers, set a real default device in OS settings.
- In headless CI, load a null source (PulseAudio) so a default exists for tests.
When it happens
Trigger: No microphone attached (desktop without webcam/mic); mic disabled in BIOS/Device Manager or blocked by policy; macOS microphone privacy denial can surface as no default input; headless/CI environments with no audio hardware; the default device was a virtual driver (BlackHole/Soundflower) that has been uninstalled, leaving the OS without a default; Linux sandbox with an empty PulseAudio source list.
Common situations: First run on a fresh machine before any input device is configured; after uninstalling a virtual audio driver that held the default-input slot; running over X-forwarding/remote desktop where no audio devices are exported; OS update resetting the default device while none is connected.
Related errors
- Failed to get default input config: {}
- Failed to get output config: {}
- Device not found: {}
- No default output device found
- Unsupported sample format: {:?}
AI-assisted analysis of Zackriya-Solutions/meetily@0281737d87 (2026-08-16).
Data as JSON: /api/errors/17ccd2ea6cf9c35d.
Report an issue: GitHub.