Fix the latency model.
We were being too clever in modeling the latency using exponentially
moving average. The issue is that the average changes as new samples come in
which we then use to update the timestamps.
If the sampling rate is high enough (like IMU) then the changes in the average
are close to the delta times between samples. This causes the sample times
to move, and sometimes even change their updated timestamp order. This
causes all kinds of mess when we linearly extrapolate because the slope is bogus.
The fix is to just average a certain number of latency samples and then stick with that
constant average.
Bug: 36997591
Test: Run any 3DOF VR app.
Change-Id: I5411b2a6b7c3f258bf197f0615c0339d68fd2fd7
3 files changed