From 34c1c1614e5e85cea4ec21854a92daf5d59e3398 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Thu, 4 Aug 2022 14:25:24 +0200 Subject: [PATCH] alsa: add some more debug See #2614 --- spa/plugins/alsa/alsa-pcm.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/spa/plugins/alsa/alsa-pcm.c b/spa/plugins/alsa/alsa-pcm.c index 8e335a89d..24b30beda 100644 --- a/spa/plugins/alsa/alsa-pcm.c +++ b/spa/plugins/alsa/alsa-pcm.c @@ -763,6 +763,9 @@ static int add_rate(struct state *state, uint32_t scale, bool all, uint32_t inde CHECK(snd_pcm_hw_params_get_rate_min(params, &min, &dir), "get_rate_min"); CHECK(snd_pcm_hw_params_get_rate_max(params, &max, &dir), "get_rate_max"); + spa_log_debug(state->log, "min:%u max:%u min-allowed:%u scale:%u all:%d", + min, max, min_allowed_rate, scale, all); + min_allowed_rate /= scale; min = SPA_MAX(min_allowed_rate, min); @@ -782,6 +785,9 @@ static int add_rate(struct state *state, uint32_t scale, bool all, uint32_t inde rate = SPA_CLAMP(rate, min, max); + spa_log_debug(state->log, "rate:%u multi:%d card:%d def:%d", + rate, state->multi_rate, state->card->rate, state->default_rate); + spa_pod_builder_prop(b, SPA_FORMAT_AUDIO_rate, 0); spa_pod_builder_push_choice(b, &f[0], SPA_CHOICE_None, 0); @@ -833,7 +839,8 @@ static int add_channels(struct state *state, bool all, uint32_t index, uint32_t CHECK(snd_pcm_hw_params_get_channels_min(params, &min), "get_channels_min"); CHECK(snd_pcm_hw_params_get_channels_max(params, &max), "get_channels_max"); - spa_log_debug(state->log, "channels (%d %d)", min, max); + spa_log_debug(state->log, "channels (%d %d) default:%d all:%d", + min, max, state->default_channels, all); if (state->default_channels != 0 && !all) { if (min < state->default_channels)