summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/modules/alsa/alsa-sink.c2
-rw-r--r--src/modules/alsa/alsa-source.c2
-rw-r--r--src/modules/alsa/alsa-util.c9
-rw-r--r--src/modules/alsa/alsa-util.h3
-rw-r--r--src/pulsecore/log.h1
5 files changed, 11 insertions, 6 deletions
diff --git a/src/modules/alsa/alsa-sink.c b/src/modules/alsa/alsa-sink.c
index f9fb0335..c18c34ef 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 9c36211b..9cbd79fa 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 870cf0f1..fbf88b08 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 94f27d14..9fce6daf 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 8628bf40..2f379f68 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