The open source OpenXR runtime
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

rift_s: Ignore the first 100 samples for the clock

After turning on the display, the Rift S
sends a burst of stale data and it can lead to
wildly incorrect clock estimates that then
recover really slowly and cause SLAM tracking to
lag horribly.

Throw away the first 100 samples, which seems to be
enough (only the first 20 or so seem to be bad).

Also reduce the clock a2b cutoff frequency, for
faster adaptation to changes.

Tested-By: Nova <technobaboo@gmail.com>

authored by

Jan Schmidt and committed by
Jakob Bornecrantz
699a92d9 f6ab734b

+9 -1
+8 -1
src/xrt/drivers/rift_s/rift_s_tracker.c
··· 468 468 { 469 469 os_mutex_lock(&t->mutex); 470 470 time_duration_ns last_hw2mono = t->hw2mono; 471 - m_clock_offset_a2b(25000, device_timestamp_ns, local_timestamp_ns, &t->hw2mono); 471 + const float freq = 250.0; 472 + 473 + t->seen_clock_observations++; 474 + if (t->seen_clock_observations < 100) 475 + goto done; 476 + 477 + m_clock_offset_a2b(freq, device_timestamp_ns, local_timestamp_ns, &t->hw2mono); 472 478 473 479 if (!t->have_hw2mono) { 474 480 time_duration_ns change_ns = last_hw2mono - t->hw2mono; ··· 477 483 t->have_hw2mono = true; 478 484 } 479 485 } 486 + done: 480 487 os_mutex_unlock(&t->mutex); 481 488 } 482 489
+1
src/xrt/drivers/rift_s/rift_s_tracker.h
··· 84 84 struct xrt_pose left_cam_from_imu; 85 85 86 86 //!< Estimated offset from HMD device timestamp to local monotonic clock 87 + uint64_t seen_clock_observations; 87 88 bool have_hw2mono; 88 89 time_duration_ns hw2mono; 89 90 timepoint_ns last_frame_time;