From 19a571dddcc08666e351b7de20d8577da163e3e7 Mon Sep 17 00:00:00 2001 From: vicrodh <103399283+vicrodh@users.noreply.github.com> Date: Mon, 19 Jan 2026 12:07:30 -0600 Subject: [PATCH] Remove that was spamming backend calls on playback The (() => { if (outputStatus?.is_playing) loadStatus(); }) was causing massive console spam ("spam masivo") that continued even after removing mouse from badge. Root causes: 1. was cherry-picked from feature/ui-fixes for badge auto-update 2. But now we have 1s polling that already keeps data fresh 3. outputStatus object was being mutated/recreated frequently 4. This triggered repeatedly, calling loadStatus() 5. Each loadStatus() enumerated 12 CPAL devices + PipeWire sinks 6. CPAL enumeration causes ALSA errors: "Cannot get card index for 0" Previous commit (0c3ca16) removed loadStatus() from onmouseenter, but spam continued because kept triggering during playback. Solution: - Removed completely (lines 150-156) - loadStatus() now only called once on mount - Polling interval (1s) only calls get_hardware_audio_status - get_hardware_audio_status just reads /proc/asound (no device enumeration) Result: - Console spam eliminated completely - Badge still updates every 1s via polling - Zero CPAL/ALSA enumeration during playback - Massive reduction in CPU/battery usage --- src/lib/components/AudioOutputBadges.svelte | 7 ------- 1 file changed, 7 deletions(-) diff --git a/src/lib/components/AudioOutputBadges.svelte b/src/lib/components/AudioOutputBadges.svelte index 3d2faca4b..133dae754 100644 --- a/src/lib/components/AudioOutputBadges.svelte +++ b/src/lib/components/AudioOutputBadges.svelte @@ -147,13 +147,6 @@ } } - // Reload status when playback starts - $effect(() => { - if (outputStatus?.is_playing) { - loadStatus(); - } - }); - onMount(() => { loadStatus();