I've got a dedicated thread that caputures audio from Alsa through snd_pcm_readi()
. Recording happens fine for some 30 mins (each file of one minute duration), After that file size gradually decreases and results in "read from audio interface failed err = -32"
if ((err = snd_pcm_readi(capture_handle, buffer, buffer_frames)) != buffer_frames)
{
fprintf (stderr, "read from audio interface failed (%s)\n",err, snd_strerror (err));
audio_outbuf_size = (err * snd_pcm_format_width(AUDIO_FORMAT)/ 8 * 2);
}
Any helps are apperciated. Thank you.