AdvancedParaEQ: use slot 1 as a multi-slot-capable canary

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.
This commit is contained in:
Ken Sanislo 2026-05-10 17:24:22 -07:00
parent 7c73c88867
commit 6b61e0ef19
1 changed files with 30 additions and 4 deletions

View File

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