diff options
author | Robin Gareus <robin@gareus.org> | 2020-03-28 22:06:12 +0100 |
---|---|---|
committer | Robin Gareus <robin@gareus.org> | 2020-03-28 22:06:12 +0100 |
commit | eea697b260a97f0755693a7ec76e259bbf035424 (patch) | |
tree | b317bb0a47410452ffc2efa440780f7adfc1e58f /libs/backends/alsa | |
parent | 4001ed7515ddec29aa6fbb0a815f76165d4b1ad8 (diff) |
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.
Diffstat (limited to 'libs/backends/alsa')
-rw-r--r-- | libs/backends/alsa/zita-alsa-pcmi.cc | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/libs/backends/alsa/zita-alsa-pcmi.cc b/libs/backends/alsa/zita-alsa-pcmi.cc index 4c5298f0d9..534d183025 100644 --- a/libs/backends/alsa/zita-alsa-pcmi.cc +++ b/libs/backends/alsa/zita-alsa-pcmi.cc @@ -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; } |