13
0

ALSA backend: try to recover from poll errors

When recover() successfully re-initializes the device,
processing can continue just like after an x-run.

This can happen during initial session load of "expensive"
sessions (in particular on slow systems, e.g. Raspberry Pi)
usually with synths. Worker thread pulls in many external
files in the background which blocks the bus for a long time.
resulting in a poll-timeout.
This commit is contained in:
Robin Gareus 2020-03-28 22:06:12 +01:00
parent 4001ed7515
commit eea697b260
Signed by: rgareus
GPG Key ID: A090BCE02CF57F04

View File

@ -229,14 +229,18 @@ snd_pcm_sframes_t Alsa_pcmi::pcm_wait (void)
if (_play_handle && (play_av = snd_pcm_avail_update (_play_handle)) < 0)
{
_state = -1;
recover ();
if (!recover ()) {
_state = 1;
}
return 0;
}
capt_av = 999999999;
if (_capt_handle && (capt_av = snd_pcm_avail_update (_capt_handle)) < 0)
{
_state = -1;
recover ();
if (!recover ()) {
_state = 1;
}
return 0;
}