Skip to content

Maintain Sennheiser GAIA battery and noise integration - #125

Draft
silverpoetry wants to merge 6 commits into
mainfrom
codex/pr122-sennheiser-maintenance
Draft

silverpoetry wants to merge 6 commits into
mainfrom
codex/pr122-sennheiser-maintenance

Conversation

@silverpoetry

@silverpoetry silverpoetry commented Nov 8, 2026 •

Copy link
Copy Markdown
Owner

本维护版

基于 #122,保留 ErodeNine 的全部原始提交并同步当前 main。范围为整机电量、核心噪声模式、既有抗风噪卡片扩展与 Smart Control 导航/退避。

  • 修正 ACCENTUM 独立通透开关的状态投影,ANC 关闭、通透开启时正确显示通透。
  • 修正 MOMENTUM 4 从关闭切到通透时的写入顺序:开启 ANC 会清除通透,随后必须重新开启通透,不能沿用旧缓存跳过。
  • 四态开放前确认两主开关及合法抗风噪选择器;分别校验 Qualcomm / Sennheiser 厂商 ID、布尔值与电量长度,非法载荷不确认握手。
  • 已知型号使用完整名称匹配,ACCENTUM Plus/Open 等其他型号留在标准家族;只通过 SDP UUID 连接,不固定 RFCOMM channel。
  • 保留作者的差异写入、Adapter 内有界读回、原生卡片扩展及来源署名,补齐应用内清单与证据说明。

验证

定向 codec、Adapter、控制 App、继承与卡片注册测试通过;Markdown、链接及 32 项控制 App 目录一致性检查通过。最终提交 b1244027dd731ae83615689494777cbdcb74cfd4 的 CI 与签名构建均通过。

下载官方签名维护包(登录 GitHub 后下载 ZIP,解压 APK);构建记录。APK SHA-256:ebc4016bc1a96cf92705fbdeca1d06fc9f85a1381bc8613564ab808254196334,证书与正式版一致。

原 PR 的 MOMENTUM 4 实测已保留。维护版改变了协议确认及模式行为,需以最终签名包复核关闭后通透、四态互切、卡片回读、重连、Smart Control 跳转与退避恢复;ACCENTUM 两款仍按参考协议记录。

等待最终实机复核期间,本 PR 保持 Draft,原 #122 保持开放,不提前合入。

Implement the Qualcomm GAIA V3 subset needed for MiLink integration:

- SennheiserGaiaWireCodec: 8-byte big-endian framing, streaming reader with
  resynchronisation, battery / combined noise mode / toggle parsing.
- SennheiserEarbudAdapter: family adapter, three model configs and two noise
  dialects. MOMENTUM 4 uses combined modes (0x1A00 / 0x1A01) and offers four
  states including anti-wind; ACCENTUM and ACCENTUM True Wireless use the
  independent 0x1A04 / 0x1804 switch pair and offer three states.
- Private capabilities stay locked until a valid GAIA response arrives.
- MiLink anti-wind card for MOMENTUM 4, plus the Sennheiser Smart Control
  entry in the control app catalog and all four LSPosed scopes.

The RFCOMM endpoint is resolved from the SDP UUID
a2129ff3-081b-4c45-8afe-469d9c4842ec; no channel number is hardcoded because
channel 14 carries iAP2 and a GAIA frame there powers the headset off.

MOMENTUM 4 is hardware-verified on 2026-11-02: exact match, headphone form
factor, private channel, protocol confirmation, private aggregate battery and
all four noise states. ACCENTUM remains reference-protocol pending hardware.

44 new unit tests cover framing, parsing, mode projection, write sequences and
capability gating.
The noise layer only wrote the 0x1A00 sub-mode table and never touched the
ANC master switch (0x1A04), so "off" and "transparency" both landed on
"master switch on, no sub-selector active" -- the headset pass-through
state -- and were indistinguishable to the listener.

0x1A00 is not the master switch: it tunes anti-wind (1), comfort (2) and
adaptive (3) on top of it, and writing it always ends transparent hearing
and resets the level. Drive 0x1A04 / 0x1804 directly instead:

- off  -> 1A04 [00] alone; transparent hearing stays formally on but has
  no effect without ANC, and switching it off would discard the level
- anc  -> 1A04 [01], 1804 [00]
- th   -> 1A04 [01], 1804 [01] (ANC first: switching ANC on ends TH)
- wind -> 1A04 [01], 1804 [00], 1A00 [01 02]

Projection now reads the two switches plus the anti-wind selector, and
the mode table no longer claims selector 2 is transparency -- it is
comfort. Both dialects share the same readback and notification set.

Covered by 24 adapter tests including the previously untested off path.
The first round of hardware testing found two regressions: every mode switch
played two confirmation chimes, and the four states flickered through modes the
user never selected.

The write path built a fixed frame list that ignored the observed state, so each
switch resent frames whose value was already correct. Every accepted write is
answered by the headset with a chime, and every write also pushes its own
notification, which is how the intermediate states leaked into the snapshot.

Writes are now computed as a diff against the observed master switches and the
cached anti-wind selector, so a frame is only sent when it actually changes the
device. The anti-wind selector is cleared when entering ANC, because nothing
else clears it, and the protocol reset now drops the cached selector as well.

Reports that disagree with a pending request are held behind a bounded delay
ladder (150/300/500 ms) instead of being published, while the requested mode is
published optimistically right after the write. Device-initiated reports pass
through untouched.

The state query no longer re-registers notifications on every poll: it re-reads
the three noise commands only.
The changelog described the master-switch rework but not the write
minimisation and the intermediate-report suppression that followed the second
round of hardware testing.
@silverpoetry

Copy link
Copy Markdown
Owner Author

@ErodeNine 跟进一下 #125 的最终维护包 b1244027:目前尚未收到这份包的实机结果,因此原 PR #122 和维护 PR 都继续保留,维护 PR 仍为 Draft。

方便时请基于上面提供的最终签名包确认电量、三态互切(尤其关闭与通透)、实际效果与回读、重连,以及厂商 App 退出后的恢复。开启详细日志并导出一次测试记录即可。如果已经测试但遇到问题,也可以直接补充现象与日志,我们继续在这个分支处理。谢谢!

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