From 23522651f939527424012231bd06847e10bb283d Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Wed, 7 Sep 2022 19:54:09 +0200 Subject: [PATCH] alsa: dsd rates are expressed in byte rate DSD64 would be a rate of 44100 * 64 / 8. When packed in U32_BE, we would negotiate 44100 * 8 / 4 (88200) with the device, this means all rates from 88200 and up are allowed for DSD64 in U32_BE. --- spa/plugins/alsa/alsa-pcm.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/spa/plugins/alsa/alsa-pcm.c b/spa/plugins/alsa/alsa-pcm.c index c171e5f88..013a61962 100644 --- a/spa/plugins/alsa/alsa-pcm.c +++ b/spa/plugins/alsa/alsa-pcm.c @@ -828,16 +828,16 @@ static int add_rate(struct state *state, uint32_t scale, bool all, uint32_t inde uint32_t i, v, last = 0, count = 0; if (uint32_array_contains(state->allowed_rates, state->n_allowed_rates, rate)) { - spa_pod_builder_int(b, rate * scale); + spa_pod_builder_int(b, rate * 8); count++; } for (i = 0; i < state->n_allowed_rates; i++) { v = SPA_CLAMP(state->allowed_rates[i], min, max); if (v != last && uint32_array_contains(state->allowed_rates, state->n_allowed_rates, v)) { - spa_pod_builder_int(b, v * scale); + spa_pod_builder_int(b, v * 8); if (count == 0) - spa_pod_builder_int(b, v * scale); + spa_pod_builder_int(b, v * 8); count++; } last = v; @@ -845,11 +845,11 @@ static int add_rate(struct state *state, uint32_t scale, bool all, uint32_t inde if (count > 1) choice->body.type = SPA_CHOICE_Enum; } else { - spa_pod_builder_int(b, rate * scale); + spa_pod_builder_int(b, rate * 8); if (min != max) { - spa_pod_builder_int(b, min * scale); - spa_pod_builder_int(b, max * scale); + spa_pod_builder_int(b, min * 8); + spa_pod_builder_int(b, max * 8); choice->body.type = SPA_CHOICE_Range; } }