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:
1 parent
334a7a7e80
commit
8b825856d2
2 files changed
+52
-14
No files matched your search
@@ -8,6 +8,8 @@
|
|||||||
exclusive_mode: boolean;
|
exclusive_mode: boolean;
|
||||||
dac_passthrough: boolean;
|
dac_passthrough: boolean;
|
||||||
preferred_sample_rate: number | null;
|
preferred_sample_rate: number | null;
|
||||||
|
backend_type: 'PipeWire' | 'Alsa' | 'Pulse' | null;
|
||||||
|
alsa_plugin: 'Hw' | 'PlugHw' | 'Pcm' | null;
|
||||||
}
|
}
|
||||||
|
|
||||||
interface AudioOutputStatus {
|
interface AudioOutputStatus {
|
||||||
@@ -67,6 +69,11 @@
|
|||||||
|
|
||||||
const isExternal = $derived(currentDevice ? isExternalDevice(currentDevice) : false);
|
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
|
// DAC badge state logic - 3 states: green, yellow, gray
|
||||||
const dacBadgeState = $derived.by(() => {
|
const dacBadgeState = $derived.by(() => {
|
||||||
if (!settings?.dac_passthrough) {
|
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)
|
// Whether to show badges at all (only if at least one setting is enabled or device is external)
|
||||||
const shouldShowBadges = $derived(
|
const shouldShowBadges = $derived(
|
||||||
settings?.dac_passthrough || settings?.exclusive_mode || isExternal
|
settings?.dac_passthrough || settings?.exclusive_mode || isExternal || isAlsaDirect
|
||||||
);
|
);
|
||||||
|
|
||||||
async function loadStatus() {
|
async function loadStatus() {
|
||||||
@@ -166,15 +173,23 @@
|
|||||||
onmouseenter={() => { isHovering = true; loadStatus(); }}
|
onmouseenter={() => { isHovering = true; loadStatus(); }}
|
||||||
onmouseleave={() => isHovering = false}
|
onmouseleave={() => isHovering = false}
|
||||||
>
|
>
|
||||||
<!-- DAC Badge -->
|
<!-- DAC Badge or HW Badge (mutually exclusive) -->
|
||||||
<div
|
{#if isAlsaDirect}
|
||||||
class="badge dac-badge"
|
<!-- Hardware Direct Badge (ALSA Direct mode) -->
|
||||||
class:active={dacBadgeState === 'active'}
|
<div class="badge hw-badge active">
|
||||||
class:warning={dacBadgeState === 'warning'}
|
<span class="badge-label">HW</span>
|
||||||
class:off={dacBadgeState === 'off'}
|
</div>
|
||||||
>
|
{:else}
|
||||||
<span class="badge-label">DAC</span>
|
<!-- DAC Passthrough Badge (PipeWire mode) -->
|
||||||
</div>
|
<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 -->
|
<!-- Exclusive Mode Badge -->
|
||||||
<div
|
<div
|
||||||
@@ -202,10 +217,22 @@
|
|||||||
{/if}
|
{/if}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- DAC Status -->
|
<!-- Audio Settings -->
|
||||||
{#if settings?.dac_passthrough || settings?.exclusive_mode}
|
{#if isAlsaDirect || settings?.dac_passthrough || settings?.exclusive_mode}
|
||||||
<div class="tooltip-section">
|
<div class="tooltip-section">
|
||||||
<div class="tooltip-label">Audio Settings</div>
|
<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}
|
{#if settings.dac_passthrough}
|
||||||
<div class="tooltip-setting" class:warning={dacBadgeState === 'warning'}>
|
<div class="tooltip-setting" class:warning={dacBadgeState === 'warning'}>
|
||||||
<span class="setting-icon" class:active={dacBadgeState === 'active'} class:warning={dacBadgeState === 'warning'}>●</span>
|
<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);
|
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 {
|
.badge-label {
|
||||||
line-height: 1;
|
line-height: 1;
|
||||||
}
|
}
|
||||||
@@ -393,6 +427,10 @@
|
|||||||
color: #eab308;
|
color: #eab308;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.setting-icon.hw-icon {
|
||||||
|
color: #3b82f6;
|
||||||
|
}
|
||||||
|
|
||||||
.setting-text {
|
.setting-text {
|
||||||
color: rgba(255, 255, 255, 0.7);
|
color: rgba(255, 255, 255, 0.7);
|
||||||
line-height: 1.4;
|
line-height: 1.4;
|
||||||
|
|||||||
@@ -1399,9 +1399,9 @@
|
|||||||
{/if}
|
{/if}
|
||||||
{#if showAlsaHardwareVolume}
|
{#if showAlsaHardwareVolume}
|
||||||
<div class="setting-row">
|
<div class="setting-row">
|
||||||
<div class="label-with-tooltip">
|
<div class="setting-info">
|
||||||
<span class="setting-label">Enable Hardware Volume Control</span>
|
<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>
|
</div>
|
||||||
<Toggle enabled={alsaHardwareVolume} onchange={handleAlsaHardwareVolumeChange} />
|
<Toggle enabled={alsaHardwareVolume} onchange={handleAlsaHardwareVolumeChange} />
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in new issue
Block a user