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).
This commit is contained in:
vicrodh committed 2026-01-17 23:41:04 -06:00
1 parent b224538088
commit 02469aa7b2
1 file changed
+27 -14
+27 -14
View File
@@ -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 {