Skip to contentSkip to conversation

Playback and capture synchronization

DISCUSSION anish kumar 1 participant 1 message Nov 10, 2011 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw
Quoted 6 lines
Quoted 6 lines
Quoted 4 lines · Patrick Lai

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 loopback.
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

Quoted 14 lines
Quoted 1 line

snd_pcm_link()

Awesome! I will look into this API

Quoted 6 lines

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