w->private_data = pad;
snd_pcm_info_alloca(&info);
err = snd_pcm_open(&pad->handle, conf->device_arg,
- SND_PCM_STREAM_PLAYBACK, 0);
+ SND_PCM_STREAM_PLAYBACK, SND_PCM_NONBLOCK);
if (err < 0)
return -E_PCM_OPEN;
if ((err = snd_pcm_info(pad->handle, info)) < 0)
struct timeval diff;
t->ret = 1;
- if (*wng->input_eof && *wng->loaded < pad->bytes_per_frame)
+ if (*wng->loaded < pad->bytes_per_frame)
return;
if (tv_diff(&s->now, &pad->next_chunk, &diff) < 0) {
if (tv_diff(&s->timeout, &diff, NULL) > 0)
s->timeout = diff;
} else {
s->timeout.tv_sec = 0;
- s->timeout.tv_usec = 1000;
+ s->timeout.tv_usec = 1;
}
// PARA_INFO_LOG("timeout: %lu\n", tv2ms(&s->timeout));
}
static void alsa_close(struct writer_node *wn)
{
struct private_alsa_data *pad = wn->private_data;
+ PARA_INFO_LOG("closing writer node %p\n", wn);
snd_pcm_drain(pad->handle);
snd_pcm_close(pad->handle);
snd_config_update_free_global();