Improve timesync

Initial timesync algorithm assumed that latency was symmetrical, but it
appears that it is not. Add a mechanism to estimate where latency
happens, which leads to much more stable values: about 200µs variation
between estimations.
This commit is contained in:
Patrick Nicolas
2023-10-21 17:53:04 +02:00
parent 5b527fdfcf
commit 4e233d99c2
16 changed files with 151 additions and 19 deletions
+3 -1
View File
@@ -20,7 +20,7 @@
#pragma once
#include "clock_offset.h"
#include "main/comp_target.h"
#include "offset_estimator.h"
#include "wivrn_connection.h"
#include "wivrn_packets.h"
#include "xrt/xrt_system.h"
@@ -33,6 +33,7 @@
class wivrn_hmd;
class wivrn_controller;
struct audio_device;
struct comp_target_factory;
namespace xrt::drivers::wivrn
{
@@ -55,6 +56,7 @@ class wivrn_session : public std::enable_shared_from_this<wivrn_session>
std::unique_ptr<wivrn_controller> right_hand;
clock_offset offset;
offset_estimator offset_est;
std::chrono::steady_clock::time_point offset_expiration{};
std::mutex csv_mutex;