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",