[alsa-devel] Exemple of source code for capture without using callback

James Courtier-Dutton james.dutton at gmail.com
Thu Oct 22 21:47:45 CEST 2009

2009/10/22 Clemens Ladisch <clemens at ladisch.de>:
> James Courtier-Dutton wrote:
>> 2009/10/20 brunal2496 gmail <brunal2496 at gmail.com>:
>> > I've read everywhere that using callback is a bad method to use the
>> > alsa drivers.
>> This is wrong. callback is the best method.
> But _not_ the snd_async_add_pcm_handler function, which is evil.
> (This is the only ALSA PCM function that mentions "callback" in its
> documentation, so these are often confused.)
> The 'good' callback method means that the audio driver informs the
> application when its wants to have new audio data, not the other way.
Yes, to clarify, not that call.
A poll() that then does the callback is the preferred method.

More information about the Alsa-devel mailing list