alsa: IRQ based scheduling wakes up after finishing 1 period

So we need to keep 2 periods of silence to keep 1 period of data inside
the ringbuffer when starting the graph.
This commit is contained in:
Wim Taymans 2023-09-15 15:33:00 +02:00
parent eac74f6ece
commit c6f9cfa220

View file

@ -2903,8 +2903,12 @@ int spa_alsa_prepare(struct state *state)
state->name, snd_strerror(err));
return err;
}
if (state->stream == SND_PCM_STREAM_PLAYBACK)
spa_alsa_silence(state, state->start_delay + state->threshold + state->headroom);
if (state->stream == SND_PCM_STREAM_PLAYBACK) {
snd_pcm_uframes_t silence = state->start_delay + state->threshold + state->headroom;
if (state->disable_tsched)
silence += state->threshold;
spa_alsa_silence(state, silence);
}
reset_buffers(state);
state->alsa_sync = true;