Solaar/tests/logitech_receiver
Ken Sanislo 14807fdf28 Add OnboardEQ (0x0636) support for Centurion headsets
Implement host-computed biquad EQ coefficient generation and multi-fragment
bridge writes for the PRO X 2 LIGHTSPEED headset's 5-band parametric EQ.

The coefficient algorithm uses standard Audio EQ Cookbook peaking EQ formulas
with a simplified rescale normalization (max_b0 × 1.19 headroom). This is our
own implementation — not an exact replica of LGHUB's ~350-line per-band cascade
normalization — but it produces functionally correct results. The DSP
compensates via the rescale factor, and the EQ changes are audible and working
on real hardware.

Wire format verified against 38 LGHUB pcap writes:
- 4-byte LE section headers, LE uint16 coefficient words
- Mixed Q1.31/Q2.30 fixed-point with 24-bit precision
- Only b-coefficients divided by rescale; a-coefficients unchanged
- Two sections: 48kHz playback + 16kHz mic
- No trailing padding, no extra words between sections

Changes:
- base.py: Add flags parameter to write_centurion_cpl() for multi-fragment CPL
- device.py: Rewrite multi-fragment bridge send — proper CPL fragmentation with
  fragment 0 carrying bridge prefix/hdr and continuations carrying raw sub_msg,
  all fragments sent back-to-back without intermediate ACKs
- hidpp20.py: Replace placeholder coefficient code with full biquad math,
  mixed Q-format quantization, rescale normalization, and dual-section output
- settings_templates.py: Persist EQ to slot 0x80 after writing to slot 0x00
  so settings survive power cycle
- tests: Update expected SetEQParameters payloads for new coefficient format
2026-04-12 14:51:54 -07:00
..
__init__.py tests: Add tests of common module 2024-02-18 06:10:53 -05:00
fake_hidpp.py Remove static PRO X 2 descriptor; fully probe Centurion devices at runtime 2026-04-12 14:51:54 -07:00
test_base.py base: Refactor device filtering 2025-01-01 11:20:28 -05:00
test_base_usb.py Speedup lookup of known receivers 2025-01-01 11:33:07 -05:00
test_common.py refactor: use IntEnum for firmware and cidgroup constances 2024-10-23 16:25:35 -04:00
test_desktop_notifications.py testing: upgrade desktop notifications tests to take notifications availability into account 2025-01-02 10:47:53 -05:00
test_device.py Add Centurion transport and PRO X 2 LIGHTSPEED headset support 2026-04-12 14:51:54 -07:00
test_diversion.py Refactor: Introduce Feature enum 2024-10-14 07:28:09 -04:00
test_hidpp10.py tests: remove test that doesn't work in older Pythons 2025-12-24 08:11:04 -05:00
test_hidpp20_complex.py Fix headset setting validators and code formatting 2026-04-12 14:51:54 -07:00
test_hidpp20_simple.py Estimate accurate battery level for some rechargable devices (#2745) 2025-01-02 10:58:07 -05:00
test_notifications.py show better pairing errors (#3063) 2025-12-10 11:18:50 -05:00
test_receiver.py receiver: Handle unknown power switch locations again 2025-02-22 15:29:35 -05:00
test_setting_templates.py Add OnboardEQ (0x0636) support for Centurion headsets 2026-04-12 14:51:54 -07:00
test_settings_validator.py Split up huge settings module 2025-01-01 10:46:04 -05:00