Skip to content

fix(scintilla): correct vendor protocols, scope probing, harden udev rules - #20

Merged
arcultus merged 3 commits into
mainfrom
chore/review-scintilla
Nov 29, 2026
Merged

arcultus merged 3 commits into
mainfrom
chore/review-scintilla

Conversation

@arcultus

Copy link
Copy Markdown
Contributor

Review and fix pass over crates/scintilla and its consumer in battery/.

Core

  • KDE Connect never worked: zbus defaulted to PascalCase names; KDE Connect uses camelCase (devices, isReachable, charge, …). Verified on real hardware (Pixel 9 now reports over KDE Connect).
  • GSConnect exposes battery as a battery GAction ((bsii)), not a D-Bus interface; provider and watch rewritten around org.gtk.Actions.
  • Watches/polls re-read only the watched device and react only to its own D-Bus objects (previously every PropertiesChanged triggered a full discovery with RFCOMM/hidraw probing). Session watch no longer spins when a stream ends.
  • Probing cost: vendor readings cached 120 s in devices(), devices probed in parallel with a timeout, one probe per physical device, devices with a kernel power_supply skipped.
  • Bluetooth: deadline-based read loops instead of a single read(), SDP lookup of RFCOMM channels instead of hard-coded ones.
  • BLE GATT: cached values, 2 s timeout (was BlueZ's 25 s), cell roles from 0x2901 descriptors.
  • UPower kind/state mapping, sysfs HID-parent correlation (hidpp_battery_N merges with its hidraw stub), transport detection, union-find correlation, round-trippable address keys, HID Power Page field offset/logical max.
  • Builds on Windows and macOS (no providers there yet).

Vendors

  • Rewritten from HeadsetControl: SteelSeries (per-family requests/offsets), Corsair (mic bit ≠ charging, Bragi), HyperX, Jabra (GNP), Audeze (GET_REPORT input), EPOS GSP 370 (USB serial), PULSE 3D (passive).
  • Fixed: Logitech voltage flags + all receiver slots + reply validation; Razer busy retry, tx IDs, OpenRazer sysfs; AirPods L/R swap (per OpenPods) and AACP session; Samsung offsets/framing; Sony escaping, ACKs, V2 protocol; Soundcore TWS offsets; Huawei request params + CRC.
  • HID drivers only write to vendor-defined interfaces and check every reply (no more stray writes to keyboard LED reports or ASUS AURA controllers). INZONE dropped (undocumented checksum).
  • Keychron M6 via Link-KM now reads a level on real hardware.

udev / applet

  • Rules never grant boot-keyboard interfaces (two-step mark + grant, since udev ATTRS must match one parent).
  • User-applied rules merge into /etc/udev/rules.d/71-scintilla-local.rules instead of overwriting or shadowing the packaged 70-scintilla.rules.
  • Applet's copyable command now comes from the crate (all vendors, not 5); discovery is cancellable on shutdown.

Docs

scintilla README / architecture / compatibility / adding-vendors / Hall of Shame, battery README, root README, AGENTS.md.

Testing

just test, just test-san, just lint pass (64 scintilla tests). Real-hardware smoke test: Keychron Link-KM/M6, Pixel 9 (BlueZ + KDE Connect). Other vendor drivers are verified against upstream sources and test vectors only.

🤖 Generated with Claude Code

arcultus and others added 3 commits November 29, 2026 17:51
…rules

Review fixes across the scintilla crate and its battery applet consumer.

Core:
- KDE Connect: use KDE Connect's camelCase D-Bus names (zbus defaulted to
  PascalCase, so the provider never found anything)
- GSConnect: read battery from the `battery` GAction (`(bsii)`)
- watches and polls re-read only the watched device and only react to its
  own D-Bus objects; fix session watch spinning when a stream ends
- cache vendor readings (120 s), probe devices in parallel with a timeout,
  probe each physical device once, skip devices with a kernel power_supply
- Bluetooth: deadline-based read loops and SDP RFCOMM channel lookup
- BLE GATT: cached values, 2 s read timeout, roles from 0x2901 descriptors
- UPower kind/state mapping, sysfs HID-parent correlation and transport,
  union-find correlation, round-trippable address keys
- HID Power Page reader honours field offsets and logical maximum
- builds on Windows/macOS (no providers there yet)

Vendors: rewrite SteelSeries, Corsair, HyperX, Jabra, Audeze, EPOS (serial)
and PULSE 3D from HeadsetControl; fix Logitech voltage flags and slots,
Razer busy/tx IDs/OpenRazer sysfs, AirPods L/R and AACP session, Samsung,
Sony (escaping, ACKs, V2), Soundcore and Huawei offsets/CRC. HID drivers
now only write to vendor-defined interfaces and check every reply.

udev: never grant keyboard interfaces; merge user rules into
71-scintilla-local.rules instead of overwriting or shadowing the packaged
file. Battery applet uses the crate's install command and cancels discovery
on shutdown.

Docs: scintilla README/architecture/compat/Hall of Shame, battery README,
root README and AGENTS.md updated.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@arcultus
arcultus merged commit 1567e16 into main Nov 29, 2026
2 checks passed
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