[Sound-open-firmware] [PATCH] volume: pass format change to downstream components.

Pierre-Louis Bossart pierre-louis.bossart at linux.intel.com
Wed Dec 13 05:22:44 CET 2017


The volume component can change the sink data format depending on sink
component/pipeline topology configuration. This change is set locally,
but not to the host params that are passed downstream.

Fix this so that downstream components can check params match their
topology configuration.

Tested with test-passthrough-48k-vol-ssp2 and reef-byt-rt5651
topology files. Note that there are quite a few underflows likely added by
recent changes, more work needed to identify what goes on.

(first fix for prepare() from Liam, additional update for the params()
case by Pierre)

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart at linux.intel.com>
Signed-off-by: Liam Girdwood <liam.r.girdwood at linux.intel.com>
---
 src/audio/volume.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/src/audio/volume.c b/src/audio/volume.c
index 5ae1cce..572c88e 100644
--- a/src/audio/volume.c
+++ b/src/audio/volume.c
@@ -408,8 +408,13 @@ static void volume_free(struct comp_dev *dev)
  */
 static int volume_params(struct comp_dev *dev)
 {
+	struct comp_data *cd = comp_get_drvdata(dev);
+
 	trace_volume("par");
 
+	/* rewrite params format for all downstream */
+	dev->params.frame_fmt = cd->sink_format;
+
 	return 0;
 }
 
@@ -656,6 +661,8 @@ static int volume_prepare(struct comp_dev *dev)
 			comp_frame_bytes(sinkb->sink);
 		break;
 	}
+	/* rewrite params format for all downstream */
+	dev->params.frame_fmt = cd->sink_format;
 
 	dev->frame_bytes = cd->sink_period_bytes / dev->frames;
 
-- 
2.14.1



More information about the Sound-open-firmware mailing list