summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIgor V. Kovalenko <igor.v.kovalenko@gmail.com>2023-01-23 08:55:04 +0300
committerIgor V. Kovalenko <igor.v.kovalenko@gmail.com>2023-02-06 18:09:30 +0300
commit8152f39603d1c1235c1944c75220ae6d3fef3493 (patch)
tree58f5d134d8001453c04527d1b552e3b87793d83a
parentf8b90105824ac66a30e56efb32a44dc896f2b2c5 (diff)
downloadpulseaudio-8152f39603d1c1235c1944c75220ae6d3fef3493.tar.gz
alsa-util: Dump probed rates
Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/775>
-rw-r--r--src/modules/alsa/alsa-util.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/modules/alsa/alsa-util.c b/src/modules/alsa/alsa-util.c
index 9d464a8ac..9f35cb20f 100644
--- a/src/modules/alsa/alsa-util.c
+++ b/src/modules/alsa/alsa-util.c
@@ -40,6 +40,7 @@
#include <pulsecore/thread.h>
#include <pulsecore/conf-parser.h>
#include <pulsecore/core-rtclock.h>
+#include <pulsecore/strbuf.h>
#include "alsa-util.h"
#include "alsa-mixer.h"
@@ -1406,6 +1407,23 @@ char *pa_alsa_get_reserve_name(const char *device) {
return pa_sprintf_malloc("Audio%i", i);
}
+static void dump_supported_rates(unsigned int* values)
+{
+ pa_strbuf *buf;
+ char *str;
+ int i;
+
+ buf = pa_strbuf_new();
+
+ for (i = 0; values[i]; i++) {
+ pa_strbuf_printf(buf, " %u", values[i]);
+ }
+
+ str = pa_strbuf_to_string_free(buf);
+ pa_log_debug("Supported rates:%s", str);
+ pa_xfree(str);
+}
+
unsigned int *pa_alsa_get_supported_rates(snd_pcm_t *pcm, unsigned int fallback_rate) {
static unsigned int all_rates[] = { 8000, 11025, 12000,
16000, 22050, 24000,
@@ -1454,6 +1472,7 @@ unsigned int *pa_alsa_get_supported_rates(snd_pcm_t *pcm, unsigned int fallback_
rates[1] = 0;
}
+ dump_supported_rates(rates);
return rates;
}