Add supported sample rates detection and display for ALSA devices

Backend changes:
- Add supported_sample_rates field to AudioDevice struct
- Detect common audio sample rates (44.1, 48, 88.2, 96, 176.4, 192, 352.8, 384 kHz)
- Use CPAL's supported_output_configs() to check rate support for hw: devices

Frontend changes:
- Display sample rates as subtitle in DeviceDropdown (e.g., "44.1, 48, 96, 192 kHz")
- Only shown for bit-perfect devices where detection is available
- Search not sensitive to sample rates field (per user request)
This commit is contained in:
vicrodh committed 2026-01-30 11:11:05 -06:00
1 parent 91fa7c7f5f
commit 0ccdd9981f
5 files changed
+120 -20

No files matched your search

+4 -2
View File
@@ -465,7 +465,7 @@
// Device options for grouped dropdown (ALSA Direct only)
let groupedDeviceOptions = $derived.by(() => {
// System Default is always first
const options: { value: string; id: string; isDefault?: boolean }[] = [
const options: { value: string; id: string; isDefault?: boolean; sampleRates?: number[] }[] = [
{ value: 'System Default', id: 'system-default', isDefault: true }
];
@@ -488,7 +488,8 @@
options.push({
value: displayName,
id: device.id,
isDefault: device.is_default
isDefault: device.is_default,
sampleRates: device.supported_sample_rates ?? undefined
});
});
@@ -1082,6 +1083,7 @@
description: string | null;
is_default: boolean;
max_sample_rate: number | null;
supported_sample_rates: number[] | null;
}
interface AlsaPluginInfo {