Skip to content

docs: refresh emulator setup doc post-merge (broker + namespace fix landed)#340

Open
leaiss wants to merge 1 commit into
mainfrom
docs/android-emulator-followup
Open

docs: refresh emulator setup doc post-merge (broker + namespace fix landed)#340
leaiss wants to merge 1 commit into
mainfrom
docs/android-emulator-followup

Conversation

@leaiss
Copy link
Copy Markdown
Collaborator

@leaiss leaiss commented May 27, 2026

Summary

PR #331 (the emulator setup doc) merged before PRs #332 (runtime broker) and #333 (plug-in namespace fix) — so as soon as those two landed, the doc became out of date. This PR refreshes it against the actual current main.

Caught by running a fresh-checkout dry-run of the merged docs against the merged code.

What changes

  1. "What works" table — broker discovery, plug-in dlopen with the namespace preload fix, plug-in probe + negotiate, and `xrCreateInstance` now all work end-to-end on the emulator. Previously this doc framed the broker as the wall.

  2. "What doesn't work" table — the actual wall is now `xrCreateVulkanDeviceKHR` returning `VK_ERROR_EXTENSION_NOT_PRESENT` (swiftshader missing extensions the runtime requests). Lume Pad's hardware Vulkan should clear that.

  3. Build procedure (step 2) was wrong in 3 ways for a fresh checkout:

    • Order: plug-in first then runtime — but the plug-in CMake consumes `Eigen3_DIR` from the runtime's build/intermediates/ tree, which only exists after the runtime build runs once. Reversed: runtime first, then plug-in.
    • Bundle: showed basic `scripts/build-android.sh` + single `cp` of the plug-in .so. Produces an APK with 2 .so files instead of 16; runtime fails at first `xrCreateInstance` with `dlopen libleiaSDK-faceTrackingInApp.so not found`. Switch to `scripts/build-android.sh install-runtime-jnilibs` (PR plug-in XR_EXT_display_info: rendering mode enumeration API #8 — pending merge) which bundles all 16 .so files in one command.
    • Re-build step: the third runtime build (`--rerun-tasks` so gradle picks up the freshly-installed jniLibs//) was implicit. Now explicit.
  4. Expected-log section updated to show the full success path through broker → preload → plug-in negotiate → `xrCreateInstance` → `xrCreateVulkanInstanceKHR` → `xrCreateVulkanDeviceKHR vk_result=-7`.

Sanity check for users

Added to the doc: `unzip -l <runtime.apk> | grep '.so$'` should list 16 entries after a correct build. If it shows only 1 or 2, the `install-runtime-jnilibs` step didn't run or the runtime rebuild didn't pick them up.

Dependency

The new build procedure relies on the plug-in repo's `scripts/build-android.sh install-runtime-jnilibs` target — currently in leia-plugin#8, pending merge. Once that lands the doc commands work as written.

🤖 Generated with Claude Code

PR #331 (this doc) merged before #332 (runtime broker) and #333
(plug-in namespace fix), so the doc still framed the broker as
a gap and showed a build procedure that produces an APK missing
CNSDK transitive .so deps. Refresh:

1. Update the "what works on emulator" table — broker, plug-in
   dlopen + namespace, plug-in probe/negotiate, and xrCreateInstance
   now all work end-to-end on the emulator after #332/#333 landed.

2. Update "what doesn't work on emulator" — the wall is now
   xrCreateVulkanDeviceKHR (swiftshader missing an extension the
   runtime requests), not the broker. Lume Pad's hardware Vulkan
   should clear that.

3. Build procedure in step 2 was wrong:
   - Order was plug-in first, then runtime — should be runtime
     first (downloads Eigen) then plug-in (consumes Eigen3_DIR).
   - Showed basic `scripts/build-android.sh` + single manual `cp` —
     produces APK with 2 .so files instead of 16. Switch to
     `scripts/build-android.sh install-runtime-jnilibs` which
     handles the CNSDK transitive .so bundle in one command.
   - Added the third step (runtime rebuild --rerun-tasks) which
     was implicit before.

4. Expected-log section now shows the full xrCreateInstance
   success path with broker resolution + preloads + plug-in
   negotiate, ending at `xrCreateVulkanDeviceKHR vk_result=-7`.

Findings from a fresh-checkout dry-run of the merged docs against
the merged code. Sanity check: `unzip -l <runtime.apk> | grep .so$`
should list 16 entries after a correct build.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@leaiss leaiss requested a review from dfattal as a code owner May 27, 2026 00:13
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