Android: setprop-tunable calibration knobs (face axes + UV flip)#17
Open
leaiss wants to merge 1 commit into
Open
Android: setprop-tunable calibration knobs (face axes + UV flip)#17leaiss wants to merge 1 commit into
leaiss wants to merge 1 commit into
Conversation
54a525f to
e76cb87
Compare
8c883ca to
fae05db
Compare
Wires the cnsdk-android-calibration.md symptom→fix table into runtime
`debug.dxr.leia.*` system properties so post-Lume-Pad calibration
iteration doesn't need rebuild + reinstall + relaunch — just setprop
+ am force-stop.
Knobs:
debug.dxr.leia.flip_uv (default 1) — UV flip pass-through
debug.dxr.leia.face_flip_x (default 0) — negate out_x
debug.dxr.leia.face_flip_y (default 0) — negate out_y
debug.dxr.leia.face_flip_z (default 0) — negate out_z
debug.dxr.leia.face_swap_xy (default 0) — swap x↔y before flips
Implementation:
- Reads cached at first plug-in call to ensure_calibration_loaded()
(under std::atomic<bool> g_calib_loaded). Re-reading mid-session
would race in-flight frames, and __system_property_get isn't free
per-frame.
- Logged ONCE via U_LOG_W at first read so the values land in logcat
at every session start — visible even when CNSDK init never runs
(e.g. emulator hits VK_ERROR_EXTENSION_NOT_PRESENT before DP).
- Hooked from leia_plugin_android_probe() (runs at xrCreateInstance
time) via new C-callable leia_cnsdk_log_calibration_knobs() in
leia_cnsdk.h, so emulator validation can confirm the knob plumbing
even though CNSDK init can't complete there.
Tile-to-eye swap (B17) intentionally left out — current atlas mode
has no CNSDK-side swap parameter; would need a runtime-side atlas
blit change. Documented as a known limitation.
Verified on Android-36 emulator: defaults log
`flip_uv=1 face_flip_xyz=000 face_swap_xy=0`. After `setprop
debug.dxr.leia.{flip_uv 0,face_flip_x 1,face_swap_xy 1}` + force-stop
+ relaunch, logs flip to `flip_uv=0 face_flip_xyz=100 face_swap_xy=1`.
e76cb87 to
cfef49d
Compare
fae05db to
5635607
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Stacked on #14 (bundle-transitive). Wires the symptom→fix table in docs/cnsdk-android-calibration.md into runtime
debug.dxr.leia.*system properties so post-Lume-Pad calibration iteration doesn't need a rebuild + reinstall + relaunch cycle — just `setprop` + `am force-stop` + restart.Knobs
falsetoleia_interlacer_set_flip_input_uv_verticalout_xout_yout_zout_x↔out_y(before flips)Tile-to-eye swap (B17) intentionally out of scope — the current atlas mode has no CNSDK-side swap parameter; that needs a runtime-side atlas blit change.
Implementation notes
std::atomic<bool> g_calib_loaded). Re-reading mid-session would race in-flight frames, and__system_property_getisn't free per-frame.U_LOG_Wat first read so values land in logcat at every session start — visible even when CNSDK init never completes (e.g. emulator).leia_plugin_android_probe()(runs at xrCreateInstance time) via new C-callableleia_cnsdk_log_calibration_knobs(), so emulator validation can confirm the plumbing even though CNSDK init can't complete there.Verification
Run `scripts/android-smoketest.sh` from the runtime repo (validated against the new plug-in build):
```
Defaults:
W monado.ensure_calibration_loaded: HW_DBG_CNSDK calibration: flip_uv=1 face_flip_xyz=000 face_swap_xy=0
After: adb shell setprop debug.dxr.leia.{flip_uv 0,face_flip_x 1,face_swap_xy 1}
+ adb shell am force-stop ...
+ adb shell am start ...
W monado.ensure_calibration_loaded: HW_DBG_CNSDK calibration: flip_uv=0 face_flip_xyz=100 face_swap_xy=1
```
Why
Without this, every calibration iteration on Lume Pad costs:
≈ 3 minutes per flip. With 5 binary knobs there are 32 combinations to potentially test; this collapses to 5 seconds per knob via setprop.
Stacking
Based on plug-in #14. Rebase onto main once #14 lands.
🤖 Generated with Claude Code