[alsa-devel] Playback and capture synchronization
Hi,
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, the best I can do is getting playback and capture to prepared state then trigger start two streams one after the other. Then, the latency would be the time for trigger start of first stream to complete. Is there a better way to deal with my use case from ALSA API standpoint?
Thanks Patrick
---- Sent by an employee of the Qualcomm Innovation Center, Inc. The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum.
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,
snd_pcm_link()
the best I can do is getting playback and capture to prepared state then trigger start two streams one after the other. Then, the latency would be the time for trigger start of first stream to complete.
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?
Regards, Clemens
On 11/9/2011 3:55 AM, Clemens Ladisch wrote:
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,
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
Thanks very much for the feedback
Regards, Clemens _______________________________________________ Alsa-devel mailing list Alsa-devel@alsa-project.org http://mailman.alsa-project.org/mailman/listinfo/alsa-devel
On 10/11/11 07:38, Patrick Lai wrote:
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
participants (3)
-
Clemens Ladisch
-
Eliot Blennerhassett
-
Patrick Lai