printf("EOF\n");
exit(0);
}
- if (ret == -1) {
- perror("read");
+ if (ret == -EPIPE) {
+ fprintf(stderr, "ALSA underrun\n");
+ snd_pcm_prepare(handle);
+ continue;
+ }
+ if (ret < 0) {
+ fprintf(stderr, "snd_pcm_readi: %s\n", snd_strerror(ret));
exit(1);
}
in += ret;