From cf80edff3e69b2c52633ed6dd06e87de3db8dc4a Mon Sep 17 00:00:00 2001 From: Alexandre Ratchov Date: Mon, 8 Oct 2012 23:36:29 +0200 Subject: [PATCH] check for missed tick after record cycle completion --- sndiod/siofile.c | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/sndiod/siofile.c b/sndiod/siofile.c index d4eac38..786461a 100644 --- a/sndiod/siofile.c +++ b/sndiod/siofile.c @@ -377,6 +377,10 @@ siofile_run(void *arg) log_puts(": recording, but POLLIN not set\n"); panic(); } +#endif + if (!siofile_rec(f)) + return; +#ifdef DEBUG if (f->rused < d->round) { siofile_log(f); log_puts(": missed clock tick, rused = "); @@ -386,10 +390,6 @@ siofile_run(void *arg) log_puts("\n"); panic(); } -#endif - if (!siofile_rec(f)) - return; -#ifdef DEBUG f->rused -= d->round; if (f->rused < 0) { /* rec buffer size is not known */ @@ -401,14 +401,6 @@ siofile_run(void *arg) log_puts("\n"); panic(); } - if (f->rused >= 2 * d->round) { - siofile_log(f); - log_puts(": rec hw xrun, rused = "); - log_puti(f->rused); - log_puts("/"); - log_puti(d->bufsz); - log_puts("\n"); - } #endif f->state = STATE_CYCLE; break;