diff options
author | Misael Lopez Cruz <misael.lopez@ti.com> | 2014-09-18 19:28:06 -0500 |
---|---|---|
committer | Misael Lopez Cruz <misael.lopez@ti.com> | 2014-09-18 19:34:10 -0500 |
commit | 24fa7c33bc6e336814aea4672c04686487506e1f (patch) | |
tree | 9f91839bf36d52bca42008e792b163fe87b2d72d | |
parent | 867f08398c3c913a7823c2b04d04f93a20fdf2f7 (diff) | |
download | common-open-24fa7c33bc6e336814aea4672c04686487506e1f.tar.gz |
audio: utils: Print ALSA PCM error messages
tinyalsa's pcm_read() and pcm_write() return -1 when an error
has occurred, which doesn't give enough information about the
actual problem. Use pcm_get_error() to give a human readable
reason of the error.
Change-Id: I6046402859e52e3b5ab10d407ddfe80658098427
Signed-off-by: Misael Lopez Cruz <misael.lopez@ti.com>
-rw-r--r-- | audio/utils/src/ALSAPcm.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/audio/utils/src/ALSAPcm.cpp b/audio/utils/src/ALSAPcm.cpp index adbed03..f25633e 100644 --- a/audio/utils/src/ALSAPcm.cpp +++ b/audio/utils/src/ALSAPcm.cpp @@ -114,7 +114,7 @@ int ALSAInPort::read(void *buffer, size_t frames) int ret = pcm_read(mPcm, buffer, bytes); if (ret) { - ALOGE("ALSAInPort: %s: failed to read %d", getName(), ret); + ALOGE("ALSAInPort: %s: failed to read: %s", getName(), pcm_get_error(mPcm)); return ret; } @@ -237,7 +237,7 @@ int ALSAOutPort::write(const void *buffer, size_t frames) int ret = pcm_write(mPcm, buffer, bytes); if (ret) { - ALOGE("ALSAOutPort: %s: failed to write %d", getName(), ret); + ALOGE("ALSAOutPort: %s: failed to write: %s", getName(), pcm_get_error(mPcm)); return ret; } |