mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-10-29 05:40:27 -04:00
alsa: limit batch period size to default
We take half of the current quantum as the period size for batch devices. Limit this to the default quantum to ensure we don't end up with too much headroom.
This commit is contained in:
parent
59042251ee
commit
39716cdd44
1 changed files with 4 additions and 2 deletions
|
|
@ -1420,8 +1420,10 @@ int spa_alsa_set_format(struct state *state, struct spa_audio_info *fmt, uint32_
|
|||
if (period_size == 0)
|
||||
period_size = state->position ? state->position->clock.duration : DEFAULT_PERIOD;
|
||||
/* batch devices get their hw pointers updated every period. Make
|
||||
* the period smaller and add one period of headroom */
|
||||
period_size /= 2;
|
||||
* the period smaller and add one period of headroom. Limit the
|
||||
* period size to our default so that we don't create too much
|
||||
* headroom. */
|
||||
period_size = SPA_MIN(period_size, DEFAULT_PERIOD) / 2;
|
||||
spa_log_info(state->log, "%s: batch mode, period_size:%ld",
|
||||
state->props.device, period_size);
|
||||
} else {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue