I would like to call snd_pcm_readi () and get AUDIO DATA every 20 ms or every 40 ms. I want to know how to get my data synchronously ... this is every X ms ...
Thanks for any answers.
To read or play in real time, you usually create a dedicated, high-priority workflow for the call, and then use several ring buffers. your thread should avoid blocking.
alsa:
http://www.alsa-project.org/alsa-doc/alsa-lib/_2test_2latency_8c-example.html#a36
http://www.alsa-project.org/alsa-doc/alsa-lib/_2test_2pcm_8c-example.html
, , , ( ).