From cd4685820e38b830dc3e4fee0e768f4c8869b007 Mon Sep 17 00:00:00 2001 From: vicrodh <103399283+vicrodh@users.noreply.github.com> Date: Fri, 27 Feb 2026 12:41:52 -0600 Subject: [PATCH] fix: ALSA backend unavailable due to cpal 0.17 HostId::name() case change cpal 0.15 returned "ALSA" from HostId::name(), cpal 0.17 returns "Alsa" (now uses stringify! on the enum variant). Use eq_ignore_ascii_case() for the comparison so it works regardless of cpal version. --- crates/qbz-audio/src/alsa_backend.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/crates/qbz-audio/src/alsa_backend.rs b/crates/qbz-audio/src/alsa_backend.rs index 16d8c8317..be053bca1 100644 --- a/crates/qbz-audio/src/alsa_backend.rs +++ b/crates/qbz-audio/src/alsa_backend.rs @@ -247,7 +247,8 @@ impl AlsaBackend { let available_hosts = rodio::cpal::available_hosts(); // Check if ALSA is available - if !available_hosts.iter().any(|h| h.name() == "ALSA") { + // cpal 0.17 changed HostId::name() from "ALSA" to "Alsa" (uses stringify!) + if !available_hosts.iter().any(|h| h.name().eq_ignore_ascii_case("alsa")) { return Err("ALSA host not available on this system".to_string()); } @@ -255,7 +256,7 @@ impl AlsaBackend { let host = rodio::cpal::host_from_id( available_hosts .into_iter() - .find(|h| h.name() == "ALSA") + .find(|h| h.name().eq_ignore_ascii_case("alsa")) .ok_or("ALSA host not found".to_string())? ).map_err(|e| format!("Failed to create ALSA host: {}", e))?;