mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-12-19 08:57:14 -05:00
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.
This commit is contained in:
parent
c9ee142b78
commit
23522651f9
1 changed files with 6 additions and 6 deletions
|
|
@ -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;
|
uint32_t i, v, last = 0, count = 0;
|
||||||
|
|
||||||
if (uint32_array_contains(state->allowed_rates, state->n_allowed_rates, rate)) {
|
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++;
|
count++;
|
||||||
}
|
}
|
||||||
for (i = 0; i < state->n_allowed_rates; i++) {
|
for (i = 0; i < state->n_allowed_rates; i++) {
|
||||||
v = SPA_CLAMP(state->allowed_rates[i], min, max);
|
v = SPA_CLAMP(state->allowed_rates[i], min, max);
|
||||||
if (v != last &&
|
if (v != last &&
|
||||||
uint32_array_contains(state->allowed_rates, state->n_allowed_rates, v)) {
|
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)
|
if (count == 0)
|
||||||
spa_pod_builder_int(b, v * scale);
|
spa_pod_builder_int(b, v * 8);
|
||||||
count++;
|
count++;
|
||||||
}
|
}
|
||||||
last = v;
|
last = v;
|
||||||
|
|
@ -845,11 +845,11 @@ static int add_rate(struct state *state, uint32_t scale, bool all, uint32_t inde
|
||||||
if (count > 1)
|
if (count > 1)
|
||||||
choice->body.type = SPA_CHOICE_Enum;
|
choice->body.type = SPA_CHOICE_Enum;
|
||||||
} else {
|
} else {
|
||||||
spa_pod_builder_int(b, rate * scale);
|
spa_pod_builder_int(b, rate * 8);
|
||||||
|
|
||||||
if (min != max) {
|
if (min != max) {
|
||||||
spa_pod_builder_int(b, min * scale);
|
spa_pod_builder_int(b, min * 8);
|
||||||
spa_pod_builder_int(b, max * scale);
|
spa_pod_builder_int(b, max * 8);
|
||||||
choice->body.type = SPA_CHOICE_Range;
|
choice->body.type = SPA_CHOICE_Range;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue