summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
70812d3)
This was really a brain fart. Instead, introduce a small delay
in alsa_open() that defers audio data writing by 100ms. This seems
to be enough to get rid of the buffer underruns with the udp sender.
PARA_INFO_LOG("bytes per frame: %zu\n", pad->bytes_per_frame);
if (snd_pcm_nonblock(pad->handle, 1))
PARA_ERROR_LOG("failed to set nonblock mode\n");
PARA_INFO_LOG("bytes per frame: %zu\n", pad->bytes_per_frame);
if (snd_pcm_nonblock(pad->handle, 1))
PARA_ERROR_LOG("failed to set nonblock mode\n");
+ tv_add(now, &(struct timeval ){0, 100 * 1000}, &pad->next_chunk);
return period_size * pad->bytes_per_frame;
}
return period_size * pad->bytes_per_frame;
}
if (ret == -EPIPE) {
PARA_WARNING_LOG("EPIPE\n");
snd_pcm_prepare(pad->handle);
if (ret == -EPIPE) {
PARA_WARNING_LOG("EPIPE\n");
snd_pcm_prepare(pad->handle);
- /* try to write the same data again */
- ret = snd_pcm_writei(pad->handle, data, frames);
return 1;
}
if (ret < 0 && ret != -EAGAIN) {
return 1;
}
if (ret < 0 && ret != -EAGAIN) {