summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMisael Lopez Cruz2014-09-18 19:28:06 -0500
committerMisael Lopez Cruz2014-09-18 19:34:10 -0500
commit24fa7c33bc6e336814aea4672c04686487506e1f (patch)
tree9f91839bf36d52bca42008e792b163fe87b2d72d
parent867f08398c3c913a7823c2b04d04f93a20fdf2f7 (diff)
downloaddevice-ti-common-open-24fa7c33bc6e336814aea4672c04686487506e1f.tar.gz
device-ti-common-open-24fa7c33bc6e336814aea4672c04686487506e1f.tar.xz
device-ti-common-open-24fa7c33bc6e336814aea4672c04686487506e1f.zip
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.cpp4
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)
114 114
115 int ret = pcm_read(mPcm, buffer, bytes); 115 int ret = pcm_read(mPcm, buffer, bytes);
116 if (ret) { 116 if (ret) {
117 ALOGE("ALSAInPort: %s: failed to read %d", getName(), ret); 117 ALOGE("ALSAInPort: %s: failed to read: %s", getName(), pcm_get_error(mPcm));
118 return ret; 118 return ret;
119 } 119 }
120 120
@@ -237,7 +237,7 @@ int ALSAOutPort::write(const void *buffer, size_t frames)
237 237
238 int ret = pcm_write(mPcm, buffer, bytes); 238 int ret = pcm_write(mPcm, buffer, bytes);
239 if (ret) { 239 if (ret) {
240 ALOGE("ALSAOutPort: %s: failed to write %d", getName(), ret); 240 ALOGE("ALSAOutPort: %s: failed to write: %s", getName(), pcm_get_error(mPcm));
241 return ret; 241 return ret;
242 } 242 }
243 243