mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-10-29 05:40:27 -04:00
alsa: fill with right amount of silence when starting
When we start or after an xrun, we need fill the buffer with one period + headroom of samples, not period*2. This is because after start we set our timeout immediately and expect there to be period + headroom samples in the buffer. With period*2 we take one period longer to start and we also feed one period of error in the dll, which causes it to wobble for no good reason.
This commit is contained in:
parent
1b6060ef5f
commit
ffeb2e0f0e
1 changed files with 2 additions and 2 deletions
|
|
@ -803,7 +803,7 @@ recover:
|
|||
state->alsa_started = false;
|
||||
|
||||
if (state->stream == SND_PCM_STREAM_PLAYBACK)
|
||||
spa_alsa_silence(state, state->threshold * 2 + state->headroom);
|
||||
spa_alsa_silence(state, state->threshold + state->headroom);
|
||||
|
||||
return do_start(state);
|
||||
}
|
||||
|
|
@ -1478,7 +1478,7 @@ int spa_alsa_start(struct state *state)
|
|||
state->alsa_started = false;
|
||||
|
||||
if (state->stream == SND_PCM_STREAM_PLAYBACK)
|
||||
spa_alsa_silence(state, state->threshold * 2 + state->headroom);
|
||||
spa_alsa_silence(state, state->threshold + state->headroom);
|
||||
|
||||
if ((err = do_start(state)) < 0)
|
||||
return err;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue