[Sound-open-firmware] [PATCH] comp: mixer: report any mixer XRUNs to pipeline.

Liam Girdwood liam.r.girdwood at linux.intel.com
Wed Sep 6 00:53:55 CEST 2017


Report any mixer underruns or overruns for each source and sink to
pipeline.

Signed-off-by: Liam Girdwood <liam.r.girdwood at linux.intel.com>
---
 src/audio/mixer.c | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

diff --git a/src/audio/mixer.c b/src/audio/mixer.c
index e82b5f0..932c3ad 100644
--- a/src/audio/mixer.c
+++ b/src/audio/mixer.c
@@ -203,7 +203,7 @@ static int mixer_copy(struct comp_dev *dev)
 	struct mixer_data *md = comp_get_drvdata(dev);
 	struct comp_buffer *sink, *sources[PLATFORM_MAX_STREAMS], *source;
 	struct list_item *blist;
-	int32_t i = 0, num_mix_sources = 0;
+	int32_t i = 0, num_mix_sources = 0, xru = 0;
 
 	tracev_mixer("cpy");
 
@@ -223,17 +223,19 @@ static int mixer_copy(struct comp_dev *dev)
 	/* make sure no sources have underruns */
 	for (i = 0; i < num_mix_sources; i++) {
 		if (sources[i]->avail < md->period_bytes) {
-			trace_mixer("xru");
-			trace_value(source[i].source->comp.id);
-			return 0;
+			comp_underrun(dev, sources[i], sources[i]->avail,
+				md->period_bytes);
+			xru = 1;
 		}
 	}
+	/* underrun ? */
+	if (xru)
+		return 0;
 
 	/* make sure sink has no overuns */
 	sink = list_first_item(&dev->bsink_list, struct comp_buffer, source_list);
 	if (sink->free < md->period_bytes) {
-		trace_mixer("xro");
-		trace_value(sink[i].sink->comp.id);
+		comp_overrun(dev, sink, sink->free, md->period_bytes);
 		return 0;
 	}
 
-- 
2.11.0



More information about the Sound-open-firmware mailing list