From 0e37ab93b7c611d4c1f94c4bfbee7acf312c9aec Mon Sep 17 00:00:00 2001 From: Jonathan Aillet Date: Wed, 7 Nov 2018 16:52:38 +0900 Subject: Tweaking debug prints Replace some 'printf' by application framework debug functions. Improve 'ALSA_PCM_UID' macro. Correct minor errors in debug prints. Change-Id: I49899fd904d42b5b3bec46017eb319ed7d321dc5 Signed-off-by: Jonathan Aillet --- plugins/alsa/alsa-core-pcm.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'plugins/alsa/alsa-core-pcm.c') diff --git a/plugins/alsa/alsa-core-pcm.c b/plugins/alsa/alsa-core-pcm.c index f80b1e4..509e1ac 100644 --- a/plugins/alsa/alsa-core-pcm.c +++ b/plugins/alsa/alsa-core-pcm.c @@ -345,7 +345,7 @@ STATIC int AlsaPcmReadCB( struct pollfd * pfd, AlsaPcmCopyHandleT * pcmCopyHandl if (availIn <= 0) { if (availIn == -EPIPE) { int ret = xrun(pcmIn, (int)availIn); - printf("XXX read EPIPE (recov=%d) !\n", ret); + AFB_ApiDebug(pcmCopyHandle->api, "XXX read EPIPE (recov=%d) {%s}!", ret, ALSA_PCM_UID(pcmIn, string)); // For some (undocumented...) reason, a start is mandatory. snd_pcm_start(pcmIn); @@ -392,10 +392,10 @@ STATIC int AlsaPcmReadCB( struct pollfd * pfd, AlsaPcmCopyHandleT * pcmCopyHandl if (r < 0) { if (r == -EPIPE) { err = xrun(pcmIn, (int)r); - printf("read EPIPE (%d), recov %d\n", ++pcmCopyHandle->read_err_count, err); + AFB_ApiDebug(pcmCopyHandle->api, "read EPIPE (%d), recov %d", ++pcmCopyHandle->read_err_count, err); goto ExitOnSuccess; } else if (r == -ESTRPIPE) { - printf("read ESTRPIPE\n"); + AFB_ApiDebug(pcmCopyHandle->api, "read ESTRPIPE"); if ((err = suspend(pcmIn, (int)r)) < 0) goto ExitOnSuccess; r = 0; @@ -567,12 +567,12 @@ static void *writeThreadEntry(void *handle) { if (availOut < 0) { if (availOut == -EPIPE) { - printf("write update EPIPE\n"); + AFB_ApiDebug(pcmCopyHandle->api, "write update EPIPE"); xrun(pcmOut, (int)availOut); continue; } if (availOut == -ESTRPIPE) { - printf("write update ESTRPIPE\n"); + AFB_ApiDebug(pcmCopyHandle->api, "write update ESTRPIPE"); suspend(pcmOut, (int)availOut); continue; } @@ -602,14 +602,14 @@ static void *writeThreadEntry(void *handle) { if (r <= 0) { if (r == -EPIPE) { int err = xrun(pcmOut, (int)r); - printf("XXX write EPIPE (%d), recov %d\n", ++pcmCopyHandle->write_err_count , err); + AFB_ApiDebug(pcmCopyHandle->api, "XXX write EPIPE (%d), recov %d", ++pcmCopyHandle->write_err_count , err); continue; } else if (r == -ESTRPIPE) { - printf("XXX write ESTRPIPE\n"); + AFB_ApiDebug(pcmCopyHandle->api, "XXX write ESTRPIPE"); break; } - printf("Unhandled error %s\n", strerror(errno)); + AFB_ApiDebug(pcmCopyHandle->api, "Unhandled error %s", strerror(errno)); break; } @@ -741,9 +741,9 @@ PUBLIC int AlsaPcmCopy(SoftMixerT *mixer, AlsaStreamAudioT *stream, AlsaPcmCtlT int pMuteFd[2]; error = pipe(pMuteFd); if (error < 0) { - AFB_ApiError(mixer->api, - "Unable to create the mute signaling pipe\n"); - goto OnErrorExit; + AFB_ApiError(mixer->api, + "Unable to create the mute signaling pipe"); + goto OnErrorExit; } struct pollfd mutePFd; -- cgit 1.2.3-korg