--- src/host/alsa/mod.rs.orig 2026-04-18 22:12:00.169721000 -0700 +++ src/host/alsa/mod.rs 2026-04-18 22:12:29.636442000 -0700 @@ -91,6 +91,14 @@ // TODO: Not yet defined in rust-lang/libc crate const LIBC_ENOTSUPP: libc::c_int = 524; + +// ESTRPIPE is Linux-specific (hardware suspend from ALSA); not present on FreeBSD. +// The ALSA compatibility library on FreeBSD never returns this, so defining it as an +// out-of-range sentinel ensures the match arms are unreachable without compile errors. +#[cfg(target_os = "linux")] +const ESTRPIPE: libc::c_int = libc::ESTRPIPE; +#[cfg(not(target_os = "linux"))] +const ESTRPIPE: libc::c_int = 86; /// The default Linux and BSD host type. #[derive(Debug, Clone)] @@ -1024,7 +1032,7 @@ // Xrun: recover via prepare() (+ start() for capture, handled by the worker). Err(err) if err.errno() == libc::EPIPE => return Err(StreamError::BufferUnderrun), // Suspend: try hardware resume first; fall back to prepare() if unsupported. - Err(err) if err.errno() == libc::ESTRPIPE => return try_resume(&stream.channel), + Err(err) if err.errno() == ESTRPIPE => return try_resume(&stream.channel), res => res, }? as usize; let delay_frames = match status.get_delay() { @@ -1076,7 +1084,7 @@ Err(err) if err.errno() == libc::EPIPE => return Err(StreamError::BufferUnderrun), // ESTRPIPE = hardware suspend: try soft resume first, falling back to underrun // recovery if the hardware doesn't support it. - Err(err) if err.errno() == libc::ESTRPIPE => { + Err(err) if err.errno() == ESTRPIPE => { return try_resume(&stream.channel).map(|_| ()); } Err(err) if err.errno() == libc::ENODEV => return Err(StreamError::DeviceNotAvailable), @@ -1151,7 +1159,7 @@ Err(err) if err.errno() == libc::EPIPE => return Err(StreamError::BufferUnderrun), // ESTRPIPE = hardware suspend: try soft resume first, falling back to underrun // recovery if the hardware doesn't support it. - Err(err) if err.errno() == libc::ESTRPIPE => { + Err(err) if err.errno() == ESTRPIPE => { return try_resume(&stream.channel).map(|_| ()); } Err(err) if err.errno() == libc::ENODEV => return Err(StreamError::DeviceNotAvailable),