[pulseaudio-commits] [Git][pulseaudio/pulseaudio][master] alsa-util: Dump probed rates

PulseAudio Marge Bot (@pulseaudio-merge-bot) gitlab at gitlab.freedesktop.org
Mon Feb 6 16:24:04 UTC 2023



PulseAudio Marge Bot pushed to branch master at PulseAudio / pulseaudio


Commits:
8152f396 by Igor V. Kovalenko at 2023-02-06T18:09:30+03:00
alsa-util: Dump probed rates

Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/775>

- - - - -


1 changed file:

- src/modules/alsa/alsa-util.c


Changes:

=====================================
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;
 }
 



View it on GitLab: https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/commit/8152f39603d1c1235c1944c75220ae6d3fef3493

-- 
View it on GitLab: https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/commit/8152f39603d1c1235c1944c75220ae6d3fef3493
You're receiving this email because of your account on gitlab.freedesktop.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/pulseaudio-commits/attachments/20230206/ee4e96e2/attachment-0001.htm>


More information about the pulseaudio-commits mailing list