[pulseaudio-commits] [SCM] PulseAudio Sound Server branch, master, updated. v0.9.15-test7-69-g5388b44

Lennart Poettering gitmailer-noreply at 0pointer.de
Thu Apr 9 16:58:51 PDT 2009


This is an automated email from the git hooks/post-receive script. It was
generated because of a push to the "PulseAudio Sound Server" repository.

The master branch has been updated
      from  ee6657aa9a654d334a5a900ea359c726550383e0 (commit)

- Log -----------------------------------------------------------------
5388b44 alsa: when printing warning about bogus data from alsa include snd_pcm_dump()
-----------------------------------------------------------------------

Summary of changes:
 src/modules/alsa/alsa-sink.c   |    2 +-
 src/modules/alsa/alsa-source.c |    2 +-
 src/modules/alsa/alsa-util.c   |    9 ++++++---
 src/modules/alsa/alsa-util.h   |    3 ++-
 src/pulsecore/log.h            |    1 +
 5 files changed, 11 insertions(+), 6 deletions(-)

-----------------------------------------------------------------------

commit 5388b44b9acf6bf11296803632ea4ca8d3d2d4d2
Author: Lennart Poettering <lennart at poettering.net>
Date:   Fri Apr 10 01:58:39 2009 +0200

    alsa: when printing warning about bogus data from alsa include snd_pcm_dump()

diff --git a/src/modules/alsa/alsa-sink.c b/src/modules/alsa/alsa-sink.c
index f9fb033..c18c34e 100644
--- a/src/modules/alsa/alsa-sink.c
+++ b/src/modules/alsa/alsa-sink.c
@@ -1728,7 +1728,7 @@ pa_sink *pa_alsa_sink_new(pa_module *m, pa_modargs *ma, const char*driver, pa_ca
     if (setup_mixer(u, ignore_dB) < 0)
         goto fail;
 
-    pa_alsa_dump(u->pcm_handle);
+    pa_alsa_dump(PA_LOG_DEBUG, u->pcm_handle);
 
     if (!(u->thread = pa_thread_new(thread_func, u))) {
         pa_log("Failed to create thread.");
diff --git a/src/modules/alsa/alsa-source.c b/src/modules/alsa/alsa-source.c
index 9c36211..9cbd79f 100644
--- a/src/modules/alsa/alsa-source.c
+++ b/src/modules/alsa/alsa-source.c
@@ -1579,7 +1579,7 @@ pa_source *pa_alsa_source_new(pa_module *m, pa_modargs *ma, const char*driver, p
     if (setup_mixer(u, ignore_dB) < 0)
         goto fail;
 
-    pa_alsa_dump(u->pcm_handle);
+    pa_alsa_dump(PA_LOG_DEBUG, u->pcm_handle);
 
     if (!(u->thread = pa_thread_new(thread_func, u))) {
         pa_log("Failed to create thread.");
diff --git a/src/modules/alsa/alsa-util.c b/src/modules/alsa/alsa-util.c
index 870cf0f..fbf88b0 100644
--- a/src/modules/alsa/alsa-util.c
+++ b/src/modules/alsa/alsa-util.c
@@ -1297,7 +1297,7 @@ int pa_alsa_calc_mixer_map(snd_mixer_elem_t *elem, const pa_channel_map *channel
     return 0;
 }
 
-void pa_alsa_dump(snd_pcm_t *pcm) {
+void pa_alsa_dump(pa_log_level_t level, snd_pcm_t *pcm) {
     int err;
     snd_output_t *out;
 
@@ -1306,11 +1306,11 @@ void pa_alsa_dump(snd_pcm_t *pcm) {
     pa_assert_se(snd_output_buffer_open(&out) == 0);
 
     if ((err = snd_pcm_dump(pcm, out)) < 0)
-        pa_log_debug("snd_pcm_dump(): %s", snd_strerror(err));
+        pa_logl(level, "snd_pcm_dump(): %s", snd_strerror(err));
     else {
         char *s = NULL;
         snd_output_buffer_string(out, &s);
-        pa_log_debug("snd_pcm_dump():\n%s", pa_strnull(s));
+        pa_logl(level, "snd_pcm_dump():\n%s", pa_strnull(s));
     }
 
     pa_assert_se(snd_output_close(out) == 0);
@@ -1612,6 +1612,7 @@ snd_pcm_sframes_t pa_alsa_safe_avail(snd_pcm_t *pcm, size_t hwbuf_size, const pa
                    (unsigned long) (pa_bytes_to_usec(k, ss) / PA_USEC_PER_MSEC),
                    pa_strnull(dn));
             pa_xfree(dn);
+            pa_alsa_dump(PA_LOG_ERROR, pcm);
         } PA_ONCE_END;
 
         /* Mhmm, let's try not to fail completely */
@@ -1653,6 +1654,7 @@ int pa_alsa_safe_delay(snd_pcm_t *pcm, snd_pcm_sframes_t *delay, size_t hwbuf_si
                    (unsigned long) (pa_bytes_to_usec(abs_k, ss) / PA_USEC_PER_MSEC),
                    pa_strnull(dn));
             pa_xfree(dn);
+            pa_alsa_dump(PA_LOG_ERROR, pcm);
         } PA_ONCE_END;
 
         /* Mhmm, let's try not to fail completely */
@@ -1698,6 +1700,7 @@ int pa_alsa_safe_mmap_begin(snd_pcm_t *pcm, const snd_pcm_channel_area_t **areas
                    (unsigned long) (pa_bytes_to_usec(k, ss) / PA_USEC_PER_MSEC),
                    pa_strnull(dn));
             pa_xfree(dn);
+            pa_alsa_dump(PA_LOG_ERROR, pcm);
         } PA_ONCE_END;
 
     return r;
diff --git a/src/modules/alsa/alsa-util.h b/src/modules/alsa/alsa-util.h
index 94f27d1..9fce6da 100644
--- a/src/modules/alsa/alsa-util.h
+++ b/src/modules/alsa/alsa-util.h
@@ -33,6 +33,7 @@
 
 #include <pulsecore/rtpoll.h>
 #include <pulsecore/core.h>
+#include <pulsecore/log.h>
 
 typedef struct pa_alsa_fdlist pa_alsa_fdlist;
 
@@ -114,7 +115,7 @@ int pa_alsa_probe_profiles(
 
 int pa_alsa_calc_mixer_map(snd_mixer_elem_t *elem, const pa_channel_map *channel_map, snd_mixer_selem_channel_id_t mixer_map[], pa_bool_t playback);
 
-void pa_alsa_dump(snd_pcm_t *pcm);
+void pa_alsa_dump(pa_log_level_t level, snd_pcm_t *pcm);
 void pa_alsa_dump_status(snd_pcm_t *pcm);
 
 void pa_alsa_redirect_errors_inc(void);
diff --git a/src/pulsecore/log.h b/src/pulsecore/log.h
index 8628bf4..2f379f6 100644
--- a/src/pulsecore/log.h
+++ b/src/pulsecore/log.h
@@ -113,6 +113,7 @@ void pa_log_levelv(
 #define pa_log_notice(...) pa_log_level_meta(PA_LOG_NOTICE, __FILE__, __LINE__, __func__, __VA_ARGS__)
 #define pa_log_warn(...)   pa_log_level_meta(PA_LOG_WARN,   __FILE__, __LINE__, __func__, __VA_ARGS__)
 #define pa_log_error(...)  pa_log_level_meta(PA_LOG_ERROR,  __FILE__, __LINE__, __func__, __VA_ARGS__)
+#define pa_logl(level, ...)  pa_log_level_meta(level,  __FILE__, __LINE__, __func__, __VA_ARGS__)
 
 #else
 

-- 
hooks/post-receive
PulseAudio Sound Server



More information about the pulseaudio-commits mailing list