Fix parameters passed to pcm_open to include PCM_MONOTONIC
This fixes the problem of not getting CLOCK_MONOTONIC timestamps
from output stream's get_presentation_position function
Bug: 37755299
Test: aaudio LOW_LATENCY mode
Change-Id: I256fa2769ced99139b3c7690e0908ac69359067c
diff --git a/hal/audio_hw.c b/hal/audio_hw.c
index e7de4a9..6f0c9c9 100644
--- a/hal/audio_hw.c
+++ b/hal/audio_hw.c
@@ -1673,7 +1673,7 @@
goto error_open;
}
} else {
- unsigned int flags = PCM_OUT;
+ unsigned int flags = PCM_OUT | PCM_MONOTONIC;
unsigned int pcm_open_retry_count = 0;
if (out->usecase == USECASE_AUDIO_PLAYBACK_AFE_PROXY) {
@@ -1681,8 +1681,7 @@
pcm_open_retry_count = PROXY_OPEN_RETRY_COUNT;
} else if (out->realtime) {
flags |= PCM_MMAP | PCM_NOIRQ;
- } else
- flags |= PCM_MONOTONIC;
+ }
while (1) {
out->pcm = pcm_open(adev->snd_card, out->pcm_device_id,