aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPhil Burk <philburk@mobileer.com>2020-06-11 15:26:49 -0700
committerPhil Burk <philburk@mobileer.com>2020-06-17 11:23:02 -0700
commit1f623872ba5ca7f725dfc2c8c38627fb73f5b954 (patch)
tree74bfcc48253467d0bdeff9d67c0c348afc0ca497 /src
parentcb01be56e08c1e6ac24c3bf202dc5add75895051 (diff)
downloadoboe-1f623872ba5ca7f725dfc2c8c38627fb73f5b954.tar.gz
oboe: warn user of permission errors
AAudio returns confusing error codes when an open fails due to permission errors. Suggest a possible reason. Related to #888
Diffstat (limited to 'src')
-rw-r--r--src/aaudio/AudioStreamAAudio.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/aaudio/AudioStreamAAudio.cpp b/src/aaudio/AudioStreamAAudio.cpp
index 52d85b9b..9f493ea2 100644
--- a/src/aaudio/AudioStreamAAudio.cpp
+++ b/src/aaudio/AudioStreamAAudio.cpp
@@ -239,6 +239,11 @@ Result AudioStreamAAudio::open() {
mAAudioStream.store(stream);
}
if (result != Result::OK) {
+ // Warn developer because ErrorInternal is not very informative.
+ if (result == Result::ErrorInternal && mDirection == Direction::Input) {
+ LOGW("AudioStreamAAudio.open() may have failed due to lack of "
+ "audio recording permission.");
+ }
goto error2;
}