[alsa-devel] Playback and capture synchronization

anish kumar anish198519851985 at gmail.com
Thu Nov 10 15:57:28 CET 2011

> > Patrick Lai wrote:
> >> I have a use case requiring playback and capture starting at the same
> >> time. Latency between starting of playback and capture streams need to
> >> be less than few PCM samples. Base on my understanding on ALSA which
> >> does not have the concept of grouping multiple streams,

Is this use case for loopback?Right now i am doing loopback with two
terminals with one terminal running aplay and other arecord and before
running aplay and arecord we use couple of mixer controls to set the
paths but we want to do all this from user space i.e. ALSA UCM(use case
manager) & Android Audio Flinger.We are not using snd-aloop for
After reading this thread looks like I need to implement support in
driver to trigger playback and capture at the same time using the api's
mentioned in this thread.
Is my understanding correct?Or am I completely off track here?
Kernel used is:3.0 

> > snd_pcm_link()
> Awesome! I will look into this API
> > If the driver doesn't actually implement starting of linked streams
> > (which would be pointless if the hardware doesn't support it), ALSA
> > calls the second trigger callback after the first one.
> >
> > It might be possible to implement simultaneous starting of two streams.
> > What hardware (driver) are you using?
> It's Qualcomm hardware. As far as I know, HW has this synchronization 
> support but I would have to build driver to make use of this functionality

> To see examples of drivers that support HW linking, search for
> snd_pcm_group_for_each_entry

More information about the Alsa-devel mailing list