alsa: call prepare again but ignore EBUSY

Not calling _prepare can cause problems on my card. So call it
again but ignore -EBUSY.
This commit is contained in:
Wim Taymans 2021-01-15 18:42:35 +01:00
parent b4e3d546e0
commit 02295c5e2b

View file

@ -1432,6 +1432,12 @@ int spa_alsa_start(struct state *state)
if (SPA_UNLIKELY(spa_log_level_enabled(state->log, SPA_LOG_LEVEL_DEBUG)))
snd_pcm_dump(state->hndl, state->output);
if ((err = snd_pcm_prepare(state->hndl)) < 0 && err != -EBUSY) {
spa_log_error(state->log, NAME" %p: snd_pcm_prepare error: %s", state,
snd_strerror(err));
return err;
}
state->source.func = alsa_on_timeout_event;
state->source.data = state;
state->source.fd = state->timerfd;