Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

alsa_sound: prevent lowlatency errors triggering WD reset

- HAL tries to recover from pcm write or read failure
  by closing and reopening pcm driver.
- There is no check when pcm is reopened. If the
  reopen fails it keeps trying multiple times in loop
- Fix the issue by checking error condition and
  return on failure.

Bug: 7253359
Change-Id: Ia15153f5b43bb0f255a8b34b70025a6215484cee
Signed-off-by: Iliyan Malchev <malchev@google.com>
  • Loading branch information...
commit 89c224e298fd280a3f2a69da8cc930ff6d036e18 1 parent 2c79891
SathishKumar Mani authored Iliyan Malchev committed
View
7 alsa_sound/AudioStreamInALSA.cpp
@@ -435,6 +435,13 @@ ssize_t AudioStreamInALSA::read(void *buffer, ssize_t bytes)
}
else
mHandle->module->open(mHandle);
+
+ if(mHandle->handle == NULL) {
+ ALOGE("read:: PCM device re-open failed");
+ mParent->mLock.unlock();
+ return 0;
+ }
+
mParent->mLock.unlock();
continue;
}
View
6 alsa_sound/AudioStreamOutALSA.cpp
@@ -260,8 +260,12 @@ ssize_t AudioStreamOutALSA::write(const void *buffer, size_t bytes)
mHandle->rxHandle = NULL;
mHandle->module->startVoipCall(mHandle);
}
- else {
+ else
mHandle->module->open(mHandle);
+ if(mHandle->handle == NULL) {
+ ALOGE("write:: device re-open failed");
+ mParent->mLock.unlock();
+ return bytes;
}
}
mParent->mLock.unlock();
Please sign in to comment.
Something went wrong with that request. Please try again.