Skip to content

Add soundcore K20i (read-only A3949 alias) and honor the read-only, TWS-gated equalizer - #6

Open
alfiyansys wants to merge 8 commits into
d7omdev:mainfrom
alfiyansys:feat/k20i-support
Open

alfiyansys wants to merge 8 commits into
d7omdev:mainfrom
alfiyansys:feat/k20i-support

Conversation

@alfiyansys

Copy link
Copy Markdown

Summary

Adds the soundcore K20i, which openscq30-lib does not support, as a conservative alias of the A3949 (P20i) model.

  • K20i alias: the K20i state packet matches A3949 except for the button section, so a new read_only_controls profile flag hides daily/button controls and drops their writes. The entry sits first in assets/devices.toml so a SOUNDCORE_CONTROL_MAC override cannot match an earlier profile by MAC alone.
  • Equalizer: VolumeAdjustments is read-only for models without custom presets, so the UI now honors that (sliders disabled, hint shown). The equalizer is also TWS-gated in the lib (hidden and silently ignored unless both buds are connected), so the empty-state text now says so.
  • Tooling: examples/eq_probe.rs switches one preset on real hardware and restores it; documented in CLAUDE.md.
  • Tests: profile-matching tests no longer assume the first catalog entry is Liberty 4 Pro; new tests for the read-only equalizer flag.

Test plan

  • cargo fmt --all -- --check, cargo clippy --all-targets --all-features -- -D warnings, cargo test --all-targets
  • K20i on hardware (BlueZ, both buds connected): connects as A3949, battery/firmware parse, 0 daily and 0 button controls shown
  • eq_probe: preset SoundcoreSignature to BassBooster is ACKed ([2,131]) and restored cleanly
  • Per-band EQ writes are not exercised (the device accepts presets only)
  • Other supported models unaffected: the new flag defaults to false; not re-tested on hardware

Needs libsqlite3-dev and a Rust toolchain recent enough for the pinned openscq30-lib.

alfiyansys and others added 6 commits November 24, 2026 21:50
Look the profile up by display name so adding or reordering catalog
entries does not break the matching tests.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Models aliased onto a similar openscq30-lib model can have a state
packet that only partly matches, so their daily and button settings
would be misparsed. The flag (default false) marks such profiles.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
For profiles with read_only_controls, clear daily/button controls from
the snapshot and drop SetToggle/SetSelect commands in the event loop.
Battery, ambient and equalizer stay available.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
K20i is not in openscq30-lib. Its state packet matches A3949 (P20i)
except the button section (one byte per button), so daily and button
controls are hidden. The entry must precede profiles that could match
by MAC alone when SOUNDCORE_CONTROL_MAC is set. Profiles without a
dedicated icon use the generic placeholder, so the icon test skips
read-only aliases.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
openscq30-lib marks VolumeAdjustments read-only for models without custom
presets (e.g. A3949/K20i): only preset selection is accepted. Carry the
flag in EqualizerState so the UI can honor it.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…lable

Disable the band sliders when the device only accepts presets, with a short
hint, and replace the misleading 'will appear after connection' text with
a message that some earbuds need both buds connected.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
alfiyansys and others added 2 commits November 24, 2026 21:58
Switches one preset on a given device model, prints the device state before
and after, and restores the original preset. Refuses to write when the
device reports no current preset. Uses a throwaway database.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant