bala
bala

Reputation: 1

Alsa: snd_pci_readi() recording

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.

Upvotes: 0

Views: 959

Answers (1)

CL.
CL.

Reputation: 180060

To reduce the chances of an overrun, increase the buffer size. For best results, make it as large as possible.

As long as the period size stays the same, latency will not change.

Upvotes: 1

Related Questions