diff --git a/src/lib/components/AudioOutputBadges.svelte b/src/lib/components/AudioOutputBadges.svelte index c6579768f..14d918da5 100644 --- a/src/lib/components/AudioOutputBadges.svelte +++ b/src/lib/components/AudioOutputBadges.svelte @@ -8,6 +8,8 @@ exclusive_mode: boolean; dac_passthrough: boolean; preferred_sample_rate: number | null; + backend_type: 'PipeWire' | 'Alsa' | 'Pulse' | null; + alsa_plugin: 'Hw' | 'PlugHw' | 'Pcm' | null; } interface AudioOutputStatus { @@ -67,6 +69,11 @@ const isExternal = $derived(currentDevice ? isExternalDevice(currentDevice) : false); + // ALSA Direct mode detection (bit-perfect hardware access) + const isAlsaDirect = $derived( + settings?.backend_type === 'Alsa' && settings?.alsa_plugin === 'Hw' + ); + // DAC badge state logic - 3 states: green, yellow, gray const dacBadgeState = $derived.by(() => { if (!settings?.dac_passthrough) { @@ -120,7 +127,7 @@ // Whether to show badges at all (only if at least one setting is enabled or device is external) const shouldShowBadges = $derived( - settings?.dac_passthrough || settings?.exclusive_mode || isExternal + settings?.dac_passthrough || settings?.exclusive_mode || isExternal || isAlsaDirect ); async function loadStatus() { @@ -166,15 +173,23 @@ onmouseenter={() => { isHovering = true; loadStatus(); }} onmouseleave={() => isHovering = false} > - -
- DAC -
+ + {#if isAlsaDirect} + +
+ HW +
+ {:else} + +
+ DAC +
+ {/if}
- - {#if settings?.dac_passthrough || settings?.exclusive_mode} + + {#if isAlsaDirect || settings?.dac_passthrough || settings?.exclusive_mode}
Audio Settings
+ {#if isAlsaDirect} +
+ ● + + ✓ Hardware Direct: Bit-perfect ALSA + {#if hardwareStatus?.hardware_sample_rate} +
{(hardwareStatus.hardware_sample_rate / 1000).toFixed(1)} kHz native + {/if} +
{prettyDeviceName} +
+
+ {/if} {#if settings.dac_passthrough}
● @@ -285,6 +312,13 @@ border-color: rgba(255, 255, 255, 0.06); } + /* HW Badge (ALSA Direct) - Blue like audio equipment LED */ + .badge.hw-badge.active { + background: rgba(59, 130, 246, 0.2); + color: #3b82f6; + border-color: rgba(59, 130, 246, 0.4); + } + .badge-label { line-height: 1; } @@ -393,6 +427,10 @@ color: #eab308; } + .setting-icon.hw-icon { + color: #3b82f6; + } + .setting-text { color: rgba(255, 255, 255, 0.7); line-height: 1.4; diff --git a/src/lib/components/views/SettingsView.svelte b/src/lib/components/views/SettingsView.svelte index d181461ad..f1faca7a0 100644 --- a/src/lib/components/views/SettingsView.svelte +++ b/src/lib/components/views/SettingsView.svelte @@ -1399,9 +1399,9 @@ {/if} {#if showAlsaHardwareVolume}
-
+
Enable Hardware Volume Control - + Experimental: Controls DAC volume via ALSA mixer. Some DACs don't support this - disable for maximum compatibility. If it fails, playback continues normally.