volume: pass format change to downstream components.

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@linux.intel.com>
Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
This commit is contained in:
Pierre-Louis Bossart 2017-12-12 22:22:44 -06:00 committed by Liam Girdwood
parent 1824001278
commit c077cb31fa
1 changed files with 7 additions and 0 deletions

View File

@ -407,8 +407,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;
}
@ -655,6 +660,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;