diff options
author | Mikhail Naganov <mnaganov@google.com> | 2017-06-02 13:51:00 -0700 |
---|---|---|
committer | Arne Coucheron <arco68@gmail.com> | 2019-09-28 00:23:56 +0200 |
commit | 9d78a156b8e0b92fd2bb0b91703fbf1a21df2643 (patch) | |
tree | fc78f2a22312c14eab6d21cc3e7ef23d5cc0a0ee | |
parent | 15fdc27a8e55f2abb0ca4a966a665c60873bf550 (diff) | |
download | hardware_qcom_audio-9d78a156b8e0b92fd2bb0b91703fbf1a21df2643.tar.gz hardware_qcom_audio-9d78a156b8e0b92fd2bb0b91703fbf1a21df2643.tar.bz2 hardware_qcom_audio-9d78a156b8e0b92fd2bb0b91703fbf1a21df2643.zip |
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
-rw-r--r-- | hal/audio_hw.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/hal/audio_hw.c b/hal/audio_hw.c index f71985e7..246f7778 100644 --- a/hal/audio_hw.c +++ b/hal/audio_hw.c @@ -1440,13 +1440,12 @@ int start_output_stream(struct stream_out *out) ALOGV("%s: Opening PCM device card_id(%d) device_id(%d)", __func__, 0, out->pcm_device_id); if (out->usecase != USECASE_AUDIO_PLAYBACK_OFFLOAD) { - 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) { flags |= PCM_MMAP | PCM_NOIRQ; pcm_open_retry_count = PROXY_OPEN_RETRY_COUNT; - } else - flags |= PCM_MONOTONIC; + } while (1) { out->pcm = pcm_open(adev->snd_card, out->pcm_device_id, |