From 6b61e0ef1925f202b1a181eda546439c0d83e849 Mon Sep 17 00:00:00 2001 From: Ken Sanislo Date: Sun, 10 May 2026 17:24:22 -0700 Subject: [PATCH] AdvancedParaEQ: use slot 1 as a multi-slot-capable canary MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit G522 advertises 6 RO + 10 custom slots in getEQInfos but the firmware only honors slot 0; LGHUB never touches the rest either. Probing all 16 generated 15 NOT_SUPPORTED log lines per device boot. Probe slot 0, then slot 1 as a canary — if it fails, skip the remaining 14 redundant probes. Behavior is unchanged on hypothetical multi-slot firmware: slot 1 success triggers the full 0..total-1 probe. --- lib/logitech_receiver/advanced_para_eq.py | 34 ++++++++++++++++++++--- 1 file changed, 30 insertions(+), 4 deletions(-) diff --git a/lib/logitech_receiver/advanced_para_eq.py b/lib/logitech_receiver/advanced_para_eq.py index 75b2a98a..29819ecd 100644 --- a/lib/logitech_receiver/advanced_para_eq.py +++ b/lib/logitech_receiver/advanced_para_eq.py @@ -330,11 +330,11 @@ def probe_advanced_eq_slots(device, direction=DIRECTION_PLAYBACK, info=None): total = ro_count + custom_count if total == 0: return [] - working = [] - for slot in range(total): + + def probe(slot): bands = get_advanced_eq_params(device, direction=direction, slot=slot) if bands is None: - continue + return None name = get_advanced_eq_friendly_name(device, direction=direction, slot=slot) kind = "factory" if slot < ro_count else "custom" logger.info( @@ -345,7 +345,33 @@ def probe_advanced_eq_slots(device, direction=DIRECTION_PLAYBACK, info=None): name, [f"{_band_label(t, f)} {round(g, 2)}dB" for t, f, g in bands], ) - working.append((slot, name, bands)) + return (slot, name, bands) + + working = [] + # Slot 0 is canonical. If it fails the device is unusable; bail. + entry = probe(0) + if entry is None: + device._advanced_eq_working_slots = working + return working + working.append(entry) + # Slot 1 acts as a "multi-slot capable?" canary. G522 firmware + # advertises 16 slots but only honors slot 0; LGHUB itself never + # touches slots > 0 on this device. When the canary fails, skip the + # remaining 14 NOT_SUPPORTED probes. + if total > 1: + entry = probe(1) + if entry is None: + logger.info( + "AdvancedParaEQ: slot 1 returned NOT_SUPPORTED; " "firmware advertises %d slots but only honors slot 0", + total, + ) + device._advanced_eq_working_slots = working + return working + working.append(entry) + for slot in range(2, total): + entry = probe(slot) + if entry is not None: + working.append(entry) device._advanced_eq_working_slots = working logger.info( "AdvancedParaEQ working slots on dir=%d: %d of %d advertised %s",