alsa: scale buffer with frame_scale

Make the alsa buffer a little larger when we scaled the samplerate,
like for DSD. This allows us to go all the way up to the quantum
limit.
This commit is contained in:
Wim Taymans 2022-04-28 13:04:39 +02:00
parent c48a4bc166
commit b7845bd702

View file

@ -1483,7 +1483,7 @@ int spa_alsa_set_format(struct state *state, struct spa_audio_info *fmt, uint32_
} else {
CHECK(snd_pcm_hw_params_get_buffer_size_max(params, &state->buffer_frames), "get_buffer_size_max");
state->buffer_frames = SPA_MIN(state->buffer_frames, state->quantum_limit * 4);
state->buffer_frames = SPA_MIN(state->buffer_frames, state->quantum_limit * 4)* state->frame_scale;
CHECK(snd_pcm_hw_params_set_buffer_size_min(hndl, params, &state->buffer_frames), "set_buffer_size_min");
CHECK(snd_pcm_hw_params_set_buffer_size_near(hndl, params, &state->buffer_frames), "set_buffer_size_near");