Skip to contentSkip to conversation

snd_pcm_readi() takes to much time.

DISCUSSION GitHub issues - opened 1 participant 1 message Sep 6, 2022 1 message not in the archive

lore
Share & tools
lore
#1 lore raw
In reply to a message not in the archive

alsa-project/alsa-lib issue #270 was opened from coder0201200:

I am using alsa open source library for my project to read and write audio data.

For that I am using snd_pcm_readi function to read audio data. I am able to read audio data.

But issue is that sometimes it will take so much time to read data.(200-230 msec).
Normally this function executed in 1-3 ms that is normal case, but after every 2-4 frames it is taking 200-300 msec. So this is affecting my whole application process.

I have also try to set this call as nonblock with the help of snd_pcm_nonblock function. With that I have observed some improvements but still after 2-3 frames it is taking 100msec time to get a data.

Issue URL : https://github.com/alsa-project/alsa-lib/issues/270
Repository URL: https://github.com/alsa-project/alsa-lib