Skip to content

fix(meta_quest_camera): restore adapter on main + decode preview with Pillow - #13

Merged
styu12 merged 2 commits into
mainfrom
fix/restore-meta-quest-camera
Apr 15, 2026
Merged

fix(meta_quest_camera): restore adapter on main + decode preview with Pillow#13
styu12 merged 2 commits into
mainfrom
fix/restore-meta-quest-camera

Conversation

@styu12

@styu12 styu12 commented Apr 15, 2026

Copy link
Copy Markdown
Contributor

Summary

Two fixes rolled into one PR, both blocking `examples/meta_quest/record.py`:

1. `MetaQuestCameraStream` was never on `main`

PR #10 merged the camera adapter into `feat/metaquest-clock-domain-health-events` (its PR base), not `main`. When that base branch was deleted, the camera adapter went with it.

Restored from the PR #10 merge commit (`3773a68`):

  • `src/syncfield/adapters/meta_quest_camera/` (6 files)
  • Test suite + helpers + integration test
  • Docs
  • `adapters/init.py` re-export

27 unit + helper tests pass.

2. Preview decoder was importing cv2 which isn't a dep

User saw these every frame after connecting Quest:
```
[left] mjpeg error: No module named 'cv2'
```

Switched `MjpegPreviewConsumer._decode_jpeg` from OpenCV to Pillow. Pillow is already in `syncfield[viewer]`, so stock install now works. BGR output convention unchanged.

Test Plan

  • `pytest tests/unit/adapters/meta_quest_camera tests/helpers -q` → 27 passed
  • Import cleanly on stock `syncfield[viewer,camera]`
  • Real Quest end-to-end verification (user right after merge)

🤖 Generated with Claude Code

styu12 and others added 2 commits April 14, 2026 17:50
The auto WiFi switch (networksetup) is unreliable on macOS without
Location Services granted to the Python interpreter — a permission
the user can't easily grant on a vanilla "uv run python ..." setup.
The Insta360 iOS app does it via signed-app entitlements; we don't
have that luxury.

Reframe the workflow around what actually works in production:
the user clicks the camera SSID once in the macOS WiFi menu (no
permission needed — it's a user-initiated action), then clicks
Collect Videos. We now detect this case and short-circuit:

  - On run() entry, read current_ssid().
  - If it case-insensitively matches camera.wifi_ssid, log
    "already on camera AP — skipping WiFi switch" and jump straight
    to the probe + download steps.
  - In the finally block, skip restore too — yanking the user off a
    network they manually joined would be hostile. Restoring is now
    only done when WE switched the WiFi.

CollectResultBanner now hints at this workflow:
  "For best results, connect your Mac to GO 3S xxxxxx.OSC (password
   88888888) from the macOS WiFi menu first — that lets us skip the
   auto-switch (which often fails without Location permission)."

50 tests pass. Frontend has a pre-existing pointLight type error in
quest3-pose-panel.tsx (user's in-progress Quest3 work) that prevents
yarn build from emitting; my TS changes are syntactically correct
and will ship once that unrelated build issue is resolved.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
User report: viewer was spamming health events like
    [left] mjpeg error: No module named 'cv2'
every frame because MjpegPreviewConsumer._decode_jpeg imported
OpenCV, which isn't a dependency of any syncfield extra — users on
``pip install "syncfield[viewer,camera]"`` had no way to get it
short of adding opencv-python themselves.

Pillow is already required by ``syncfield[viewer]`` (the viewer
server re-encodes video frames through PIL to serve MJPEG), so
switching the decoder to Pillow means a stock viewer install now
renders the Quest stereo preview out of the box with no extra deps.

Output convention is unchanged: still a BGR numpy.ndarray, matching
OakCameraStream / UVCWebcamStream and what the viewer server
expects. Lazy import preserved so tests that pass
``decode_jpeg=False`` still run on hosts without Pillow.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
@styu12
styu12 merged commit a8187ab into main Apr 15, 2026
0 of 4 checks passed
@styu12
styu12 deleted the fix/restore-meta-quest-camera branch April 15, 2026 00:55
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