diff --git a/output.c b/output.c index 2b4aa3f..775e90e 100644 --- a/output.c +++ b/output.c @@ -241,9 +241,8 @@ wrote = output.write_cb(out_frames, silence, gainL, gainR, cross_gain_in, cross_gain_out, &cross_ptr); - if (wrote < 0) { - LOG_WARN("error in write cb"); - frames -= out_frames; + if (wrote <= 0) { + frames -= size; break; } else { out_frames = (frames_t)wrote; diff --git a/output_alsa.c b/output_alsa.c index 5526999..4a35ea2 100644 --- a/output_alsa.c +++ b/output_alsa.c @@ -589,7 +589,13 @@ } // process frames - _output_frames(avail); + frames_t wrote = _output_frames(avail); + + // some output devices such as alsa null refuse any data, avoid spinning + if (!wrote) { + LOG_SDEBUG("wrote 0 - sleeping"); + usleep(10000); + } UNLOCK; }