Browse Source

alsa: Exit JackAlsaDriver::Read if the XRUN recovery is not recovering the device

Currently on XRUN, Jack tries a recovery and goes back to read again.

But in a case where the device is not recovering at all, Jack is looping
continuously taking up 100% cpu as there is no other exit condition.

Signed-off-by: Laxmi Devi <Laxmi.Devi@in.bosch.com>
pull/484/head
Laxmi Devi 6 years ago
parent
commit
8a129a26a9
1 changed files with 8 additions and 0 deletions
  1. +8
    -0
      linux/alsa/JackAlsaDriver.cpp

+ 8
- 0
linux/alsa/JackAlsaDriver.cpp View File

@@ -406,6 +406,9 @@ int JackAlsaDriver::Read()
int wait_status;
jack_nframes_t nframes;
fDelayedUsecs = 0.f;
int retry_cnt = 0;

#define MAX_RECOVERY_RETRY 10

retry:

@@ -420,6 +423,11 @@ retry:
*/
jack_log("ALSA XRun wait_status = %d", wait_status);
NotifyXRun(fBeginDateUst, fDelayedUsecs);
if(retry_cnt >= MAX_RECOVERY_RETRY) {
jack_error("ALSA Device not recovering, tried Xrun recovery for %d times", retry_cnt);
return -1;
}
retry_cnt++;
goto retry; /* recoverable error*/
}



Loading…
Cancel
Save