if (ret == 0)
return 1;
if (ret < 0) {
- underrun = 10;
- goto timeout;
+ sched_request_timeout_ms(20, s);
+ return 42;
}
} else {
if (*wng->loaded - wn->written < pad->bytes_per_frame)
if (underrun < 50)
underrun = 50;
underrun -= 50;
-timeout:
ms2tv(underrun, &tv);
if (tv_diff(&s->timeout, &tv, NULL) > 0)
s->timeout = tv;
wn->min_iqs = pad->bytes_per_frame;
}
frames = bytes / pad->bytes_per_frame;
- avail = snd_pcm_avail_update(pad->handle);
- if (avail <= 0)
- return;
- frames = PARA_MIN(frames, avail);
- //PARA_CRIT_LOG("writing %ld frames\n", frames);
frames = snd_pcm_writei(pad->handle, data, frames);
if (frames >= 0) {
btr_consume(btrn, frames * pad->bytes_per_frame);
snd_pcm_prepare(pad->handle);
return;
}
- PARA_WARNING_LOG("%s\n", snd_strerror(-frames));
if (frames == -EAGAIN)
return;
+ PARA_WARNING_LOG("%s\n", snd_strerror(-frames));
ret = -E_ALSA_WRITE;
err:
assert(ret < 0);