mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-10-31 22:25:38 -04:00
alsa: use 3 periods in IRQ mode by default
3 seems to work better as a default for Firewire. It does not actually add latency because we only keep 1 period filled with data at all times.
This commit is contained in:
parent
00bb4a936a
commit
9606b37776
1 changed files with 6 additions and 2 deletions
|
|
@ -2342,8 +2342,12 @@ int spa_alsa_set_format(struct state *state, struct spa_audio_info *fmt, uint32_
|
||||||
/* period number given use that */
|
/* period number given use that */
|
||||||
periods = state->default_period_num;
|
periods = state->default_period_num;
|
||||||
else
|
else
|
||||||
/* IRQ mode, use 2 periods or 3 for batch */
|
/* IRQ mode, use 3 periods. This is a bit of a workaround
|
||||||
periods = state->is_batch ? 3 : 2;
|
* for Firewire devices, which seem to only work with 3 periods.
|
||||||
|
* For PipeWire it does not actually matter how many periods
|
||||||
|
* are used, we will always keep 1 filled, so we can work fine
|
||||||
|
* with anything from 2 periods to MAX. */
|
||||||
|
periods = 3;
|
||||||
CHECK(snd_pcm_hw_params_set_periods_near(hndl, params, &periods, &dir), "set_periods");
|
CHECK(snd_pcm_hw_params_set_periods_near(hndl, params, &periods, &dir), "set_periods");
|
||||||
state->buffer_frames = period_size * periods;
|
state->buffer_frames = period_size * periods;
|
||||||
} else {
|
} else {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue