[Sound-open-firmware] [PATCH 3/5] host: host_copy(): add handle for capture

Ughreja, Rakesh A rakesh.a.ughreja at intel.com
Wed Feb 15 16:15:17 CET 2017



>-----Original Message-----
>From: sound-open-firmware-bounces at alsa-project.org [mailto:sound-open-
>firmware-bounces at alsa-project.org] On Behalf Of Keyon Jie
>Sent: Wednesday, February 15, 2017 3:38 PM
>To: sound-open-firmware at alsa-project.org; liam.r.girdwood at linux.intel.com
>Cc: Zhang, Keqiao <keqiao.zhang at intel.com>; Jie, Yang <yang.jie at intel.com>;
>Ingalsuo, Seppo <seppo.ingalsuo at intel.com>; Keyon Jie
><yang.jie at 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 ?

>
>Signed-off-by: Keyon Jie <yang.jie at 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 at alsa-project.org
>http://mailman.alsa-project.org/mailman/listinfo/sound-open-firmware


More information about the Sound-open-firmware mailing list