-----Original Message----- From: Ughreja, Rakesh A Sent: Wednesday, February 15, 2017 11:15 PM To: Keyon Jie yang.jie@linux.intel.com; sound-open-firmware@alsa- project.org; liam.r.girdwood@linux.intel.com Cc: Zhang, Keqiao keqiao.zhang@intel.com; Jie, Yang yang.jie@intel.com; Ingalsuo, Seppo seppo.ingalsuo@intel.com Subject: RE: [Sound-open-firmware] [PATCH 3/5] host: host_copy(): add handle for capture
-----Original Message----- From: sound-open-firmware-bounces@alsa-project.org [mailto:sound-open- firmware-bounces@alsa-project.org] On Behalf Of Keyon Jie Sent: Wednesday, February 15, 2017 3:38 PM To: sound-open-firmware@alsa-project.org; liam.r.girdwood@linux.intel.com Cc: Zhang, Keqiao keqiao.zhang@intel.com; Jie, Yang yang.jie@intel.com; Ingalsuo, Seppo seppo.ingalsuo@intel.com; Keyon Jie yang.jie@linux.intel.com Subject: [Sound-open-firmware] [PATCH 3/5] host: host_copy(): add handle for capture
For playback, don't copy if there is no available data; For capture, don't copy if there is no free host side buffer.
How would you know that there is data available in the ring buffer ? Are you talking about SPIB mode ?
We implemented the R/W pointers check mechanism, and the host_avail will keep the ring buffer available size at runtime, you can refer to host.c for that.
We don't have SPIB mode concept in sound-open-firmware ATM.
Thanks, ~Keyon
Signed-off-by: Keyon Jie yang.jie@linux.intel.com
src/audio/host.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/audio/host.c b/src/audio/host.c index b604ddc..61d2b62 100644 --- a/src/audio/host.c +++ b/src/audio/host.c @@ -815,7 +815,10 @@ static int host_copy(struct comp_dev *dev) if (dev->state != COMP_STATE_RUNNING) return 0;
- if (hd->host_avail == 0)
/* don't copy if the host side buffer is not ready */
if (((hd->params.direction == STREAM_DIRECTION_PLAYBACK)
&& (hd->host_avail == 0)) || ((hd->host_free == 0) &&
(hd->params.direction == STREAM_DIRECTION_CAPTURE)))
return 0;
/* do DMA transfer */
-- 2.7.4
Sound-open-firmware mailing list Sound-open-firmware@alsa-project.org http://mailman.alsa-project.org/mailman/listinfo/sound-open-firmware