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.
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,
snd_pcm_link()
Quoted 3 lines
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
Quoted 7 lines · Clemens Ladisch
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,
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
Thanks very much for the feedback
Quoted 8 lines
Regards,
Clemens
_______________________________________________
Alsa-devel mailing list
[email protected]
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel
Signature · 2 lines
Sent by an employee of the Qualcomm Innovation Center, Inc. The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum.
Quoted 2 lines · Patrick Lai
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
Signature · 2 lines
Eliot Blennerhassett AudioScience Inc.