fix: poll output device name so it updates during playback

The device name was only read on mount and on hover, so it stayed
as "No device" until the user hovered the badges area. Now the
1-second poll also reads get_audio_output_status (cheap in-memory
read) alongside hardware status, keeping the device name current.
This commit is contained in:
vicrodh committed 2026-03-08 13:10:53 -06:00
1 parent bdc24c5a2e
commit 8c626c0e6a
1 file changed
+9 -5
+9 -5
View File
@@ -182,15 +182,19 @@
castProtocol = getConnectedProtocol();
});
// Lightweight polling: ONLY update hardware status (no device enumeration)
// This reads /proc/asound which is very cheap, no CPAL/ALSA enumeration
// Lightweight polling: update hardware status + output device name
const pollInterval = setInterval(async () => {
// Only poll if using bit-perfect modes AND not casting
if (!castConnected && (settings?.dac_passthrough || settings?.backend_type === 'Alsa')) {
try {
hardwareStatus = await invoke<HardwareAudioStatus>('v2_get_hardware_audio_status').catch(() => null);
} catch (err) {
// Silently fail - don't spam console
const [hwStatus, status] = await Promise.all([
invoke<HardwareAudioStatus>('v2_get_hardware_audio_status').catch(() => null),
invoke<AudioOutputStatus>('get_audio_output_status').catch(() => null),
]);
hardwareStatus = hwStatus;
if (status) outputStatus = status;
} catch {
// Silently fail
}
}
}, 1000);