fix(meta_quest): auto-discovery responder + viewer preview - #15
Merged
Conversation
…empty On-device diagnosis against a live Quest session showed two reasons the viewer sat empty even though the Unity sender app was running and the adapters were "connected": 1. Quest sender wasn't reaching the Mac's UDP :14043 at all. The Quest app ships with a hardcoded default target IP of ``172.30.1.51`` (a dev LAN from the original project template) and relies on auto-discovery to find the recorder at runtime. MetaQuestHandStream never responded to those discovery probes, so the Quest kept firing UDP into the void while the viewer cheerfully said "connected" (one stale packet from an old session had set the heartbeat). Add a background UDP :14044 responder that replies to the ``SYNCFIELD_DISCOVER_RECORDER_V1`` broadcasts Unity's UDPTrackingSender already emits every 2 s. Reply shape matches the ``RecorderDiscoveryResponse`` parser in the Unity client. We pick the "right" local IP per responder by opening a scratch UDP socket toward the Quest's address and reading getsockname — no packets sent, but the kernel chooses the correct outbound interface, which is the interface the Quest should target. Single-process multi-Quest setups would fight over :14044, so a bind failure silently falls back to "manual IP only" with a log hint. Normal single-Quest use now auto-resolves. 2. MetaQuestCameraStream declared ``kind="video"`` but exposed only ``latest_frame_left`` / ``latest_frame_right``, not the ``latest_frame`` attribute the viewer's StreamSnapshot polls for every video stream. Result: the camera card rendered black even while MjpegPreviewConsumer was happily decoding JPEGs into the per-eye slots. Add a ``latest_frame`` property that returns the left eye (falling back to right) so the existing video panel lights up without any viewer-side changes. Phase-1 caveat still applies: both eyes get the primary-camera view until Meta XR 2.4 exposes per-eye acquisition cleanly (spec §9 Q1). Once that lands ``latest_frame`` can switch to a side-by-side composite. Co-Authored-By: Claude Opus 4.6 <[email protected]>
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.
Diagnosed on live Quest session
Viewer showed
quest_trackingas 'Waiting for data…' andquest_camas black even though both were 'connected'. Two distinct bugs:Tracking: Quest app's hardcoded target IP is
172.30.1.51(template default from a dev LAN); Mac was on192.168.4.35. Quest's auto-discovery broadcastsSYNCFIELD_DISCOVER_RECORDER_V1on UDP :14044 every 2s but we never responded → Quest stuck sending into the void. Python adapter now listens on :14044 and replies with the correct local IP per outbound interface.Camera preview: MJPEG was actually arriving (verified with
curl /preview/left— valid JPEG bytes), but viewer pollsstream.latest_frame(a single attribute), and MetaQuestCameraStream only exposedlatest_frame_left/latest_frame_right. Added alatest_frameproxy returning the left eye.52 unit tests pass.
🤖 Generated with Claude Code