qcom/audio/hal: add offset to MMAP output time
Try to fix glitches on AAudio MMAP output on some devices.
The DSP is returning a position/time pair that is too soon.
Bug: 122680738
Test: Should see glitch.count = 0 when you run this test.
Test: adb shell aaudio_loopback -tm -b999 -s20 -x -X
Change-Id: I7bc9924a7aaa34d2e721365aa8ee0b69de5936f8
Merged-In: I7bc9924a7aaa34d2e721365aa8ee0b69de5936f8
diff --git a/hal/audio_hw.h b/hal/audio_hw.h
index 0b3b028..8c95d51 100644
--- a/hal/audio_hw.h
+++ b/hal/audio_hw.h
@@ -230,6 +230,7 @@
uint32_t supported_sample_rates[MAX_SUPPORTED_SAMPLE_RATES + 1];
bool muted;
uint64_t written; /* total frames written, not cleared when entering standby */
+ int64_t mmap_time_offset_nanos; /* fudge factor to correct inaccuracies in DSP */
audio_io_handle_t handle;
int non_blocking;