aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames Dong <jdong@google.com>2010-03-03 11:54:12 -0800
committerJames Dong <jdong@google.com>2010-03-04 09:43:28 -0800
commitfe5c20c9b209c48ded8a1ceee510b75046f46e6a (patch)
tree6a3302b33cd254e4dfb13b4b8f116a5d8d7d50c8
parentd88ab3acafaa5592e5e3990dd3341f294a019fd1 (diff)
downloadopencore-fe5c20c9b209c48ded8a1ceee510b75046f46e6a.tar.gz
Log a potential deadlock issue in audio MIO for recording
When the number of bytes returned from audio driver is <= 0, the existing audio MIO terminates the audio recording thread in the MIO immediately. but when the application tries to terminate the audio recording via stop or reset, the stop or reset can potentially wait forever. This is not verified, thus I enable the logging first to get confirmation should this happens. bug - 2484098
-rw-r--r--android/author/android_audio_input.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/android/author/android_audio_input.cpp b/android/author/android_audio_input.cpp
index d50bf1c1b..c8a841202 100644
--- a/android/author/android_audio_input.cpp
+++ b/android/author/android_audio_input.cpp
@@ -1190,9 +1190,15 @@ int AndroidAudioInput::audin_thread_func() {
}
int numOfBytes = record->read(data, kBufferSize);
- //LOGV("read %d bytes", numOfBytes);
- if (numOfBytes <= 0)
+ if (numOfBytes <= 0) {
+ // FIXME:
+ // When numOfBytes is not greater than 0, instead of terminating the audio
+ // recording thread immediately, wait for next incoming audio frame or stop/reset
+ // command to terminate the thread. Lets log the case to see whether the deadlock
+ // root cause is here. To resolve the problem, change the break to continue.
+ LOGW("numOfBytes (%d) <= 0.", numOfBytes);
break;
+ }
if (iFirstFrameReceived == false) {
iFirstFrameReceived = true;