Skip to content
Permalink
Browse files

Handle input device suspend/recovery gracefully

  • Loading branch information...
s1gtrap authored and mkrautz committed Jun 26, 2015
1 parent d19e266 commit b4d48ef43dc83ad924392527084af393ace1b7ba
Showing with 5 additions and 2 deletions.
  1. +5 −2 src/mumble/ALSAAudio.cpp
@@ -382,8 +382,11 @@ void ALSAAudioInput::run() {
#endif
readblapp = snd_pcm_readi(capture_handle, inbuff, static_cast<int>(wantPeriod));
if (readblapp == -ESTRPIPE) {
// suspend event - what to do?
qWarning("ALSAAudioInput: %s", snd_strerror(static_cast<int>(readblapp)));
qWarning("ALSAAudioInput: PCM suspended, trying to resume");
while (bRunning && snd_pcm_resume(capture_handle) == -EAGAIN)
msleep(1000);
if ((err = snd_pcm_prepare(capture_handle)) < 0)
qWarning("ALSAAudioInput: %s: %s", snd_strerror(static_cast<int>(readblapp)), snd_strerror(err));
} else if (readblapp == -EPIPE) {
err = snd_pcm_prepare(capture_handle);
qWarning("ALSAAudioInput: %s: %s", snd_strerror(static_cast<int>(readblapp)), snd_strerror(err));

0 comments on commit b4d48ef

Please sign in to comment.
You can’t perform that action at this time.