[alsa-devel] How to retrieve the final data being played by HW

Yu Hang hangy at fortemedia.com.cn
Thu Apr 29 11:15:38 CEST 2010

I'm studying ALSA lib and trying to write a plugin that can perform AEC 
function. I have to retrieve the data being played and use it as reference.
I've read pcm_dmix.c and found dmix just simply mixes data into HW mmap 
buffer (destination buffer). My problem is, there might be several dmix 
instances, which doesn't know if there is other dmix instance. So how 
can I know the mixed data is exactly the data being played.
For example, the 1st instance had mixes the data into destination 
buffer, but 2nd instance haven't complete the mix operation. Would the 
data in destination buffer be playing by HW?
Or there is some mechanism to guarantee the data will be played after 
all mix operation is done.

More information about the Alsa-devel mailing list