From 02469aa7b2c970765aa11a279ca2d2e96a4d20ac Mon Sep 17 00:00:00 2001 From: vicrodh <103399283+vicrodh@users.noreply.github.com> Date: Sat, 17 Jan 2026 23:41:04 -0600 Subject: [PATCH] Temporarily disable ALSA Direct backend from UI ALSA Direct is currently non-functional due to CPAL limitations: - CPAL cannot enumerate or open hw:X,Y devices required for bit-perfect playback - Only named devices (front:, iec958:, sysdefault:) work, but they all use ALSA plugins with resampling - User's DAC cannot achieve bit-perfect playback (stuck at 44.1kHz regardless of track sample rate) Changes: - Filter out ALSA Direct from backend selector dropdown - Auto-switch users from ALSA Direct to Auto on settings load - Add comments indicating this is temporary until alsa-rs rewrite This prevents user frustration with a broken backend while we evaluate implementing direct ALSA support via alsa-rs (bypassing CPAL entirely). --- src/lib/components/views/SettingsView.svelte | 41 +++++++++++++------- 1 file changed, 27 insertions(+), 14 deletions(-) diff --git a/src/lib/components/views/SettingsView.svelte b/src/lib/components/views/SettingsView.svelte index 390113e74..cfe691112 100644 --- a/src/lib/components/views/SettingsView.svelte +++ b/src/lib/components/views/SettingsView.svelte @@ -214,7 +214,8 @@ let isLoadingDevices = $state(false); // Backend selector options (derived) - let backendOptions = $derived(['Auto', ...availableBackends.filter(b => b.is_available).map(b => b.name)]); + // TEMPORARILY hide ALSA Direct until hw: device support is implemented with alsa-rs + let backendOptions = $derived(['Auto', ...availableBackends.filter(b => b.is_available && b.name !== 'ALSA Direct').map(b => b.name)]); // Helper to check if a device name looks like raw ALSA (needs translation) function needsTranslation(name: string): boolean { @@ -813,21 +814,33 @@ // Load backend and plugin settings if (settings.backend_type) { const backend = availableBackends.find(b => b.backend_type === settings.backend_type); - selectedBackend = backend?.name ?? 'Auto'; + const backendName = backend?.name ?? 'Auto'; - // Load devices for selected backend - await loadBackendDevices(settings.backend_type); + // TEMPORARILY: If user had ALSA Direct selected, switch to Auto + // (ALSA Direct is temporarily disabled until hw: device support is implemented with alsa-rs) + if (backendName === 'ALSA Direct') { + selectedBackend = 'Auto'; + // Switch backend to Auto in backend + await invoke('set_audio_backend_type', { backendType: null }); + console.log('[Audio] Switched from ALSA Direct to Auto (ALSA Direct temporarily disabled)'); + // Don't load devices for ALSA backend + backendDevices = []; + } else { + selectedBackend = backendName; + // Load devices for selected backend + await loadBackendDevices(settings.backend_type); - // Set selected device from backend devices - if (settings.output_device) { - const device = backendDevices.find(d => d.id === settings.output_device); - if (device) { - // Use description from aplay -L if available (ALSA), otherwise translate - outputDevice = (device.description && settings.backend_type === 'Alsa') - ? device.description - : (needsTranslation(device.name) ? getDevicePrettyName(device.name) : device.name); - } else { - outputDevice = 'System Default'; + // Set selected device from backend devices + if (settings.output_device) { + const device = backendDevices.find(d => d.id === settings.output_device); + if (device) { + // Use description from aplay -L if available (ALSA), otherwise translate + outputDevice = (device.description && settings.backend_type === 'Alsa') + ? device.description + : (needsTranslation(device.name) ? getDevicePrettyName(device.name) : device.name); + } else { + outputDevice = 'System Default'; + } } } } else {