google / google/oboe

Weird ErrorInvalidState for gettimestamp() in Android 11

Open
#1,477 4 comments 0 reactions 1 assignee Claimed by @sunwell1994 View on GitHub
bug
Dominant language
C++
Stars
4.1k
Forks
639
Avg merge
2d 23h
Merged PRs (30d)
8

Description

Android version(s): 11
Android device(s): Pixel 5a
Oboe version: 1.6.1
App name used for testing:
use mediarecorder to record video and Oboe to record audio

**Short description**
It only happens in Android 11. It works well in Android 10
It can record the audio but cannot get timestamps.
Check the getstate() before call gettimestamp(). It is **StreamState::Started.**
The error comes from https://github.com/google/oboe/blob/a0731d6041561da9a15efdfd4ed49718b57bf5b4/src/aaudio/AudioStreamAAudio.cpp#L661-L662

It may be the error from aaudio.

**Steps to reproduce**
call mInputStream->getTimestamp(CLOCK_MONOTONIC)
**Expected behavior**
Get the timestamp
**Actual behavior**
return the error result
**Device**
Pixel 5a with Android 11 does not work.
Pixel 3 XL with Android 10 and Redmi Note 9s with Android 10 work well

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.