Skip to content

docs: CNSDK C-ABI surface reference#18

Open
leaiss wants to merge 1 commit into
feat/android-cnsdk-calibration-knobsfrom
docs/cnsdk-c-abi-surface
Open

docs: CNSDK C-ABI surface reference#18
leaiss wants to merge 1 commit into
feat/android-cnsdk-calibration-knobsfrom
docs/cnsdk-c-abi-surface

Conversation

@leaiss
Copy link
Copy Markdown
Collaborator

@leaiss leaiss commented May 27, 2026

Summary

Stacked on #17 (calibration knobs). New doc at docs/cnsdk-c-abi-surface.md — reference for the ~30 CNSDK calls leia_cnsdk.cpp actually makes, with init order, thread affinity, and undocumented behaviors that took trial-and-error at POC time.

Sections

  • 29-step init/teardown timeline showing strict ordering of leia_platform_*leia_core_* async init → device-config snapshot → face-tracking enable → interlacer init → per-frame loop → teardown
  • Thread affinity table (main / face_tracking_worker / render) — since CNSDK doesn't document thread safety, we serialize the device-config calls to one thread
  • Per-function notes for every CNSDK call with parameter expectations, error semantics, blocking/non-blocking, and gotchas (e.g. leia_core_enable_face_tracking is blocking with no cancel — workaround is a 2s watchdog detach in our leia_cnsdk_destroy)
  • Tile-to-eye mapping note linking back to the calibration doc's B17 limitation
  • Version drift watch-list — what to recheck when bumping CNSDK (e.g. leia_core_shutdown was leia_core_release in 0.6.x)

Why this matters pre-Lume-Pad

Three things eat real hardware time when learning CNSDK from scratch: thread-affinity surprises (deadlocks), init-order surprises (NULL handles), and ABI-drift surprises (silent renames). This doc compresses each into a 30-second lookup, so when Lume Pad arrives you spend hardware time on calibration, not figuring out which call order works.

Stacking

Based on #17. Rebase onto main once #17 lands.

🤖 Generated with Claude Code

@leaiss leaiss requested a review from dfattal as a code owner May 27, 2026 21:47
@leaiss leaiss force-pushed the feat/android-cnsdk-calibration-knobs branch from 8c883ca to fae05db Compare June 2, 2026 15:51
@leaiss leaiss force-pushed the docs/cnsdk-c-abi-surface branch from 3f9b609 to 026ca75 Compare June 2, 2026 15:51
Documents the ~30 CNSDK calls leia_cnsdk.cpp actually makes, plus the
init order, thread affinity, and undocumented behaviors that took
trial-and-error to figure out at POC time. Pre-Lume-Pad reference for
anyone touching CNSDK call sites — most of these constraints aren't
in the CNSDK headers.

Sections:
- Init/teardown timeline (29 numbered steps)
- Thread affinity table (main / face_tracking_worker / render)
- Per-function notes with parameter expectations + error semantics
- Tile-to-eye mapping note + B17 limitation pointer
- Version drift watch-list — what to recheck when bumping CNSDK

Why this matters pre-Lume-Pad: thread affinity surprises (deadlocks),
init-order surprises (NULL handles), and ABI drift surprises (silent
renames) each take real hardware time to debug. This doc compresses
each into a 30-second lookup.

Cross-links: docs/cnsdk-android-calibration.md (the runtime-tunable
knobs for B15/B17/B18) and ../docs/getting-started/android-vulkan-
extension-survey.md (the runtime side's VK extension list).
@leaiss leaiss force-pushed the docs/cnsdk-c-abi-surface branch from 026ca75 to 8bb779b Compare June 2, 2026 16:46
@leaiss leaiss force-pushed the feat/android-cnsdk-calibration-knobs branch from fae05db to 5635607 Compare June 2, 2026 16:46
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