[alsa-devel] 答复: 答复: how to combine mutil-channel in playback or capture?

Daniel Mack zonque at gmail.com
Fri Mar 22 11:19:06 CET 2013


please don't top-post.

On 22.03.2013 11:11, Zhang wei wrote:
> But what is the mechanism to synchronize the data from different
> channel,and maybe different channel pairs use different DMA buffer.

You can try and see if syncing the individual, non-combinded PCM streams


> So, I guess ,about the combine ,according to the alsa.conf,the alsa-lib
> opened the 4 devices(in my case) and got every channel paris’s data in
> turns in a monent. And then combine them together in order as one frame?

It will feed the input to all pcm streams. I don't really know if it
uses the sync mechanism on that, but I'd guess so.

> Because all the CODEC have the same clock timing,so the different DMA
> buffer stored the different channel data for the same moment. Alsa-lib
> obtains the same size data from each buffer in turns in once.repeat it
> again and again.
> Right?

Yes, and so the streams won't drift.

Why don't you just go ahead and try it? You should play back some wav
file with a test pattern which you can recognize on a DSO or IIS
analyzer on the bus. Then see if they are in sync.


More information about the Alsa-devel mailing list