UX improvements for ALSA Direct settings

1. Change hardware volume to visible help text (like Offline settings)
   - More critical info should be always visible
   - Clearer explanation of experimental nature

2. Add blue HW badge for ALSA Direct mode
   - Replaces DAC badge (mutually exclusive)
   - Blue color simulates audio equipment LED
   - Shows 'Hardware Direct: Bit-perfect ALSA' in tooltip
   - Displays device name and sample rate
   - Only visible when: ALSA Direct + hw plugin

3. Gapless logic already correct
   - Only restricts gapless with DAC Passthrough (PipeWire)
   - ALSA Direct can do gapless (same sample rate)
   - Note: Different sample rates need investigation
This commit is contained in:
vicrodh committed 2026-01-19 08:35:15 -06:00
1 parent 334a7a7e80
commit 8b825856d2
2 files changed
+52 -14

No files matched your search

+50 -12
View File
@@ -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 Badge -->
<div
class="badge dac-badge"
class:active={dacBadgeState === 'active'}
class:warning={dacBadgeState === 'warning'}
class:off={dacBadgeState === 'off'}
>
<span class="badge-label">DAC</span>
</div>
<!-- DAC Badge or HW Badge (mutually exclusive) -->
{#if isAlsaDirect}
<!-- Hardware Direct Badge (ALSA Direct mode) -->
<div class="badge hw-badge active">
<span class="badge-label">HW</span>
</div>
{:else}
<!-- DAC Passthrough Badge (PipeWire mode) -->
<div
class="badge dac-badge"
class:active={dacBadgeState === 'active'}
class:warning={dacBadgeState === 'warning'}
class:off={dacBadgeState === 'off'}
>
<span class="badge-label">DAC</span>
</div>
{/if}
<!-- Exclusive Mode Badge -->
<div
@@ -202,10 +217,22 @@
{/if}
</div>
<!-- DAC Status -->
{#if settings?.dac_passthrough || settings?.exclusive_mode}
<!-- Audio Settings -->
{#if isAlsaDirect || settings?.dac_passthrough || settings?.exclusive_mode}
<div class="tooltip-section">
<div class="tooltip-label">Audio Settings</div>
{#if isAlsaDirect}
<div class="tooltip-setting">
<span class="setting-icon hw-icon">●</span>
<span class="setting-text">
✓ Hardware Direct: Bit-perfect ALSA
{#if hardwareStatus?.hardware_sample_rate}
<br><span class="setting-detail">{(hardwareStatus.hardware_sample_rate / 1000).toFixed(1)} kHz native</span>
{/if}
<br><span class="setting-detail">{prettyDeviceName}</span>
</span>
</div>
{/if}
{#if settings.dac_passthrough}
<div class="tooltip-setting" class:warning={dacBadgeState === 'warning'}>
<span class="setting-icon" class:active={dacBadgeState === 'active'} class:warning={dacBadgeState === 'warning'}>●</span>
@@ -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;
+2 -2
View File
@@ -1399,9 +1399,9 @@
{/if}
{#if showAlsaHardwareVolume}
<div class="setting-row">
<div class="label-with-tooltip">
<div class="setting-info">
<span class="setting-label">Enable Hardware Volume Control</span>
<Tooltip text="Try to control DAC volume via ALSA mixer. Some DACs don't support this - disable for maximum compatibility or enable experimentally. Failure doesn't break playback." />
<span class="setting-desc">Experimental: Controls DAC volume via ALSA mixer. Some DACs don't support this - disable for maximum compatibility. If it fails, playback continues normally.</span>
</div>
<Toggle enabled={alsaHardwareVolume} onchange={handleAlsaHardwareVolumeChange} />
</div>