Skip to content

build(rokid): CXR-M 1.0.4 -> 1.2.2 (16 KB page alignment) - #66

Closed
Chikati wants to merge 2 commits into
mainfrom
rokid-cxr-122
Closed

Chikati wants to merge 2 commits into
mainfrom
rokid-cxr-122

Conversation

@Chikati

@Chikati Chikati commented Jul 7, 2026

Copy link
Copy Markdown
Collaborator

Migrates the Rokid adapter to CXR-M 1.2.2, primarily for the 16 KB native-library alignment that Play-distributed consumer apps need (targetSdk 35+ requirement since 2025-11) — verified at the AAR and packaged-APK level (PT_LOAD p_align=0x4000).

Adapts the enumerated 1.2.2 breaking surface (audio listener signatures + onAudioStreamFinish → mic end-of-stream, openAudioRecord 4-arg overload with researched mode/denoiseMode compat values, two new diagnostic-only callbacks). Compile matrix, publishToMavenLocal, and a --devices rokid generated app are green.

Draft until a Rokid hardware smoke confirms: audio capture semantics under mode=1, denoiseMode=2 (16 kHz mono as before), onAudioStreamFinish timing, and the inactive-connect flow. ~15 minutes with real glasses — see #63.

🤖 Generated with Claude Code

@Chikati Chikati added the hardware-validation Needs testing on real glasses label Jul 7, 2026
CXR-M 1.2.2 ships 16 KB-aligned native libraries (1.0.4 is 4 KB-
aligned), which downstream Play-distributed apps need for the
targetSdk 35+ 16 KB page-size requirement -- verified at both the AAR
and the packaged-APK level (PT_LOAD p_align=0x4000 for every CXR lib).

API adaptations per the 1.2.2 surface: AudioStreamListener's widened
onStartAudioStream/onAudioStream signatures (new stream-id metadata
logged), the new abstract onAudioStreamFinish wired to the mic
session's end-of-stream, openAudioRecord moved to the 4-arg overload
(mode=1, denoiseMode=2 -- denoiseMode taken from the decompiled 3-arg
delegation; centralized as compat constants pending hardware
re-validation), and diagnostic-only implementations for the new
onInActiveConnected and onP2pDeviceAvailable callbacks. The dependabot
ignore for com.rokid.cxr:client-m is removed.

Verified: compile matrix, publishToMavenLocal, and a rokid-only
generated app, all green. Real-glasses smoke (capture/display/mic with
the new audio params) is required before merge.
Per adversarial review of the CXR-M 1.2.2 migration: audio callbacks
now correlate against the stream id recorded at onStartAudioStream
(unexpected ids get rate-limited warnings instead of silently acting
on or dropping them -- a vendor-side pipe restart can no longer
truncate a session invisibly); onInActiveConnected warns explicitly
that the adapter does not resolve connect from it (breadcrumb for the
hardware smoke), and the cached-reconnect fallback rethrows
CancellationException so a connect timeout is no longer misreported as
a stale-cache failure; stop() regains its atomic entry gate so double
stop cannot double-close the vendor recorder; the ambiguous
modeOrChannels parameter is documented with its evidence; null/invalid
audio frames are counted and rate-limit-warned (device-even pattern).
@Chikati

Chikati commented Jul 7, 2026

Copy link
Copy Markdown
Collaborator Author

Adversarial review round complete — 2 HIGH + 3 MEDIUM findings all fixed in the follow-up commit (stream-id correlation gating, CancellationException rethrow in the cached-reconnect fallback, restored atomic stop gate, parameter-evidence docs, dropped-frame counters).

Hardware-smoke checklist for un-drafting (adds the review's two items to the audio semantics check):

  • capture/display/mic happy path on real glasses (audio: mode=1, denoiseMode=2 still yields 16 kHz mono)
  • onConnected (not onInActiveConnected) fires for BOTH the scan/init and cached-reconnect Bluetooth paths — watch for the new warning breadcrumb
  • onAudioStreamFinish fires exactly once per startMicrophone session; no unexpected-stream-id warnings during a normal session

Chikati added a commit that referenced this pull request Jul 7, 2026
…sion catalog

Pure refactor; no version number changes. New catalog entries: appcompat,
exifinterface, gson, tink-android, adblib, junit4, and the androidx.test
trio, now consumed by six device modules and core-android. build-logic is
wired to the root catalog via dependencyResolutionManagement so its
AGP/KGP/vanniktech classpath deps can no longer drift from the catalog
when Dependabot bumps it.

Intentionally left alone: the Rokid CXR-M coordinate (migrated separately
by the hardware-gated PR #66), versionless kotlin-test deps (aligned by
the Kotlin plugin), and the synthetic Flutter AAR coordinates in
device-frame-embedded.
@Chikati Chikati closed this Sep 9, 2026
@Chikati
Chikati deleted the rokid-cxr-122 branch September 9, 2026 07:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

hardware-validation Needs testing on real glasses

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant