alsa_write: Print more detailed error message.
authorAndre Noll <maan@systemlinux.org>
Fri, 30 Nov 2007 21:45:19 +0000 (22:45 +0100)
committerAndre Noll <maan@systemlinux.org>
Fri, 30 Nov 2007 21:45:19 +0000 (22:45 +0100)
alsa_write.c

index 3ad8f5d..fab886c 100644 (file)
@@ -184,12 +184,13 @@ static int alsa_write_post_select(__a_unused struct sched *s,
                return 1;
        ret = snd_pcm_writei(pad->handle, data, frames);
        if (ret == -EPIPE) {
                return 1;
        ret = snd_pcm_writei(pad->handle, data, frames);
        if (ret == -EPIPE) {
-               PARA_WARNING_LOG("%s", "EPIPE\n");
+               PARA_WARNING_LOG("EPIPE\n");
                snd_pcm_prepare(pad->handle);
                return 1;
        }
        if (ret < 0) {
                snd_pcm_prepare(pad->handle);
                return 1;
        }
        if (ret < 0) {
-               PARA_WARNING_LOG("%s", "ALSA ERROR\n");
+               PARA_WARNING_LOG("alsa error (%zu frames, ret = %d\n",
+                       frames, (int)ret);
                return -E_ALSA_WRITE;
        }
        ms2tv(pad->buffer_time / 4000, &tv);
                return -E_ALSA_WRITE;
        }
        ms2tv(pad->buffer_time / 4000, &tv);