Testbench: Instantiate file component as host or DAI and other updates

This patch fixes the fail to execute tests due to recent pipeline
updates. Now the fileread and filewrite component is instantiated
as host or DAI depending on stream direction. The DAI file component
is added the capability to report HW stream parameters. In testbench
case the stream parameters originate from command line parameters.

The file params() handling is updated to be similar as in other
components to successfully propagate the parameters.

The added capture pipelines support is not fully functional and will
be fixed later.

The testbench cleanup includes elimination of global variables for
certain component ids. The needed misc parameters were added to
testbench parameters struct that is passed through most topology
parsing functions.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
This commit is contained in:
Seppo Ingalsuo 2020-02-21 19:27:03 +02:00 committed by Liam Girdwood
parent fc167f5e56
commit 0bce9e4f36
8 changed files with 236 additions and 127 deletions

View File

@ -50,8 +50,7 @@ int tb_pipeline_setup(struct sof *sof)
}
/* set up pcm params, prepare and trigger pipeline */
int tb_pipeline_start(struct ipc *ipc, int nch,
struct sof_ipc_pipe_new *ipc_pipe,
int tb_pipeline_start(struct ipc *ipc, struct sof_ipc_pipe_new *ipc_pipe,
struct testbench_prm *tp)
{
struct ipc_comp_dev *pcm_dev;
@ -60,7 +59,7 @@ int tb_pipeline_start(struct ipc *ipc, int nch,
int ret;
/* set up pipeline params */
ret = tb_pipeline_params(ipc, nch, ipc_pipe, tp);
ret = tb_pipeline_params(ipc, ipc_pipe, tp);
if (ret < 0) {
fprintf(stderr, "error: pipeline params\n");
return -EINVAL;
@ -89,8 +88,7 @@ int tb_pipeline_start(struct ipc *ipc, int nch,
}
/* pipeline pcm params */
int tb_pipeline_params(struct ipc *ipc, int nch,
struct sof_ipc_pipe_new *ipc_pipe,
int tb_pipeline_params(struct ipc *ipc, struct sof_ipc_pipe_new *ipc_pipe,
struct testbench_prm *tp)
{
struct ipc_comp_dev *pcm_dev;
@ -110,27 +108,27 @@ int tb_pipeline_params(struct ipc *ipc, int nch,
/* set pcm params */
params.comp_id = ipc_pipe->comp_id;
params.params.buffer_fmt = SOF_IPC_BUFFER_INTERLEAVED;
params.params.frame_fmt = find_format(tp->bits_in);
params.params.frame_fmt = tp->frame_fmt;
params.params.direction = SOF_IPC_STREAM_PLAYBACK;
params.params.rate = tp->fs_in;
params.params.channels = nch;
params.params.channels = tp->channels;
switch (params.params.frame_fmt) {
case(SOF_IPC_FRAME_S16_LE):
params.params.sample_container_bytes = 2;
params.params.sample_valid_bytes = 2;
params.params.host_period_bytes = fs_period * nch *
params.params.host_period_bytes = fs_period * tp->channels *
params.params.sample_container_bytes;
break;
case(SOF_IPC_FRAME_S24_4LE):
params.params.sample_container_bytes = 4;
params.params.sample_valid_bytes = 3;
params.params.host_period_bytes = fs_period * nch *
params.params.host_period_bytes = fs_period * tp->channels *
params.params.sample_container_bytes;
break;
case(SOF_IPC_FRAME_S32_LE):
params.params.sample_container_bytes = 4;
params.params.sample_valid_bytes = 4;
params.params.host_period_bytes = fs_period * nch *
params.params.host_period_bytes = fs_period * tp->channels *
params.params.sample_container_bytes;
break;
default:
@ -162,8 +160,7 @@ int tb_pipeline_params(struct ipc *ipc, int nch,
}
/* getindex of shared library from table */
int get_index_by_name(char *comp_type,
struct shared_lib_table *lib_table)
int get_index_by_name(char *comp_type, struct shared_lib_table *lib_table)
{
int i;
@ -176,8 +173,7 @@ int get_index_by_name(char *comp_type,
}
/* getindex of shared library from table by widget type*/
int get_index_by_type(uint32_t comp_type,
struct shared_lib_table *lib_table)
int get_index_by_type(uint32_t comp_type, struct shared_lib_table *lib_table)
{
int i;

View File

@ -21,6 +21,9 @@
#include "testbench/common_test.h"
#include "testbench/file.h"
static const struct comp_driver comp_file_dai;
static const struct comp_driver comp_file_host;
static inline void buffer_check_wrap_32(int32_t **ptr, int32_t *end,
size_t size)
{
@ -409,6 +412,8 @@ static struct comp_dev *file_new(const struct comp_driver *drv,
(struct sof_ipc_comp_file *)comp;
struct file_comp_data *cd;
debug_print("file_new()\n");
if (IPC_IS_SIZE_INVALID(ipc_file->config)) {
fprintf(stderr, "error: file_new() Invalid IPC size.\n");
return NULL;
@ -445,6 +450,10 @@ static struct comp_dev *file_new(const struct comp_driver *drv,
/* set file comp mode */
cd->fs.mode = ipc_file->mode;
cd->rate = ipc_file->rate;
cd->channels = ipc_file->channels;
cd->frame_fmt = ipc_file->frame_fmt;
/* open file handle(s) depending on mode */
switch (cd->fs.mode) {
case FILE_READ:
@ -482,6 +491,8 @@ static void file_free(struct comp_dev *dev)
{
struct file_comp_data *cd = comp_get_drvdata(dev);
comp_dbg(dev, "file_free()");
if (cd->fs.mode == FILE_READ)
fclose(cd->fs.rfh);
else
@ -490,42 +501,44 @@ static void file_free(struct comp_dev *dev)
free(cd->fs.fn);
free(cd);
free(dev);
debug_print("free file component\n");
}
/* set component audio stream parameters */
static int file_verify_params(struct comp_dev *dev,
struct sof_ipc_stream_params *params)
{
int ret;
comp_dbg(dev, "file_verify_params()");
ret = comp_verify_params(dev, 0, params);
if (ret < 0) {
comp_err(dev, "file_verify_params() error: comp_verify_params() failed.");
return ret;
}
return 0;
}
/**
* \brief Sets file component audio stream parameters.
* \param[in,out] dev Volume base component device.
* \param[in] params Audio (PCM) stream parameters (ignored for this component)
* \return Error code.
*
* All done in prepare() since we need to know source and sink component params.
*/
static int file_params(struct comp_dev *dev,
struct sof_ipc_stream_params *params)
{
struct file_comp_data *cd = comp_get_drvdata(dev);
struct sof_ipc_comp_config *config = dev_comp_config(dev);
struct audio_stream *stream;
int err;
/* file component source or sink buffer */
if (cd->fs.mode == FILE_WRITE) {
stream = &list_first_item(&dev->bsource_list,
struct comp_buffer, sink_list)->stream;
} else {
stream = &list_first_item(&dev->bsink_list, struct comp_buffer,
source_list)->stream;
}
comp_info(dev, "file_params()");
stream->frame_fmt = config->frame_fmt;
if (stream->frame_fmt == SOF_IPC_FRAME_S16_LE)
cd->sample_container_bytes = 2;
else
cd->sample_container_bytes = 4;
/* calculate period size based on config */
cd->period_bytes = dev->frames * cd->sample_container_bytes *
stream->channels;
/* File to sink supports only S32_LE/S16_LE/S24_4LE PCM formats */
if (config->frame_fmt != SOF_IPC_FRAME_S32_LE &&
config->frame_fmt != SOF_IPC_FRAME_S24_4LE &&
config->frame_fmt != SOF_IPC_FRAME_S16_LE)
err = file_verify_params(dev, params);
if (err < 0) {
comp_err(dev, "file_params(): pcm params verification failed.");
return -EINVAL;
}
return 0;
}
@ -537,6 +550,7 @@ static int fr_cmd(struct comp_dev *dev, struct sof_ipc_ctrl_data *cdata)
static int file_trigger(struct comp_dev *dev, int cmd)
{
comp_info(dev, "file_trigger()");
return comp_set_state(dev, cmd);
}
@ -547,6 +561,7 @@ static int file_cmd(struct comp_dev *dev, int cmd, void *data,
struct sof_ipc_ctrl_data *cdata = data;
int ret = 0;
comp_info(dev, "file_cmd()");
switch (cmd) {
case COMP_CMD_SET_DATA:
ret = fr_cmd(dev, cdata);
@ -623,7 +638,36 @@ static int file_prepare(struct comp_dev *dev)
struct sof_ipc_comp_config *config = dev_comp_config(dev);
struct comp_buffer *buffer = NULL;
struct file_comp_data *cd = comp_get_drvdata(dev);
int ret = 0, periods;
struct audio_stream *stream;
int periods;
int ret = 0;
comp_info(dev, "file_prepare()");
ret = comp_set_state(dev, COMP_TRIGGER_PREPARE);
if (ret < 0)
return ret;
if (ret == COMP_STATUS_STATE_ALREADY_SET)
return PPL_STATUS_PATH_STOP;
/* file component source or sink buffer */
if (cd->fs.mode == FILE_WRITE) {
stream = &list_first_item(&dev->bsource_list,
struct comp_buffer, sink_list)->stream;
} else {
stream = &list_first_item(&dev->bsink_list, struct comp_buffer,
source_list)->stream;
}
if (stream->frame_fmt == SOF_IPC_FRAME_S16_LE)
cd->sample_container_bytes = 2;
else
cd->sample_container_bytes = 4;
/* calculate period size based on config */
cd->period_bytes = dev->frames * cd->sample_container_bytes *
stream->channels;
/* file component sink/source buffer period count */
switch (cd->fs.mode) {
@ -693,13 +737,26 @@ static int file_prepare(struct comp_dev *dev)
static int file_reset(struct comp_dev *dev)
{
dev->state = COMP_STATE_INIT;
comp_info(dev, "file_reset()");
comp_set_state(dev, COMP_TRIGGER_RESET);
return 0;
}
static const struct comp_driver comp_file = {
.type = SOF_COMP_FILEREAD,
static int file_get_hw_params(struct comp_dev *dev,
struct sof_ipc_stream_params *params)
{
struct file_comp_data *cd = comp_get_drvdata(dev);
comp_info(dev, "file_hw_params()");
params->rate = cd->rate;
params->channels = cd->channels;
params->buffer_fmt = 0;
params->frame_fmt = cd->frame_fmt;
return 0;
}
static const struct comp_driver comp_file_host = {
.type = SOF_COMP_HOST,
.ops = {
.new = file_new,
.free = file_free,
@ -712,11 +769,31 @@ static const struct comp_driver comp_file = {
},
};
static struct comp_driver_info comp_file_info = {
.drv = &comp_file,
static const struct comp_driver comp_file_dai = {
.type = SOF_COMP_DAI,
.ops = {
.new = file_new,
.free = file_free,
.params = file_params,
.cmd = file_cmd,
.trigger = file_trigger,
.copy = file_copy,
.prepare = file_prepare,
.reset = file_reset,
.dai_get_hw_params = file_get_hw_params,
},
};
static struct comp_driver_info comp_file_host_info = {
.drv = &comp_file_host,
};
static struct comp_driver_info comp_file_dai_info = {
.drv = &comp_file_dai,
};
void sys_comp_file_init(void)
{
comp_register(&comp_file_info);
comp_register(&comp_file_host_info);
comp_register(&comp_file_dai_info);
}

View File

@ -33,6 +33,11 @@ struct testbench_prm {
*/
uint32_t fs_in;
uint32_t fs_out;
uint32_t channels;
int fr_id;
int fw_id;
int sched_id;
enum sof_ipc_frame frame_fmt;
};
struct shared_lib_table {
@ -53,12 +58,10 @@ void sys_comp_filewrite_init(void);
int tb_pipeline_setup(struct sof *sof);
int tb_pipeline_start(struct ipc *ipc, int nch,
struct sof_ipc_pipe_new *ipc_pipe,
int tb_pipeline_start(struct ipc *ipc, struct sof_ipc_pipe_new *ipc_pipe,
struct testbench_prm *tp);
int tb_pipeline_params(struct ipc *ipc, int nch,
struct sof_ipc_pipe_new *ipc_pipe,
int tb_pipeline_params(struct ipc *ipc, struct sof_ipc_pipe_new *ipc_pipe,
struct testbench_prm *tp);
void debug_print(char *message);
@ -70,6 +73,5 @@ int get_index_by_type(uint32_t comp_type,
struct shared_lib_table *lib_table);
int parse_topology(struct sof *sof, struct shared_lib_table *library_table,
struct testbench_prm *tp, int *fr_id, int *fw_id,
int *sched_id, char *pipeline_msg);
struct testbench_prm *tp, char *pipeline_msg);
#endif

View File

@ -41,6 +41,7 @@ struct file_comp_data {
uint32_t rate;
struct file_state fs;
int sample_container_bytes;
enum sof_ipc_frame frame_fmt;
int (*file_func)(struct comp_dev *dev, struct audio_stream *sink,
struct audio_stream *source, uint32_t frames);
@ -50,7 +51,10 @@ struct file_comp_data {
struct sof_ipc_comp_file {
struct sof_ipc_comp comp;
struct sof_ipc_comp_config config;
uint32_t rate;
uint32_t channels;
char *fn;
enum file_mode mode;
enum sof_ipc_frame frame_fmt;
} __attribute__((packed));
#endif

View File

@ -26,9 +26,6 @@ struct shared_lib_table lib_table[NUM_WIDGETS_SUPPORTED] = {
/* main firmware context */
static struct sof sof;
static int fr_id; /* comp id for fileread */
static int fw_id; /* comp id for filewrite */
static int sched_id; /* comp id for scheduling comp */
/* compatible variables, not used */
intptr_t _comp_init_start, _comp_init_end;
@ -148,6 +145,7 @@ static void parse_input_args(int argc, char **argv, struct testbench_prm *tp)
/* input samples bit format */
case 'b':
tp->bits_in = strdup(optarg);
tp->frame_fmt = find_format(tp->bits_in);
break;
/* override default libraries */
@ -199,6 +197,7 @@ int main(int argc, char **argv)
tp.bits_in = 0;
tp.input_file = NULL;
tp.output_file = NULL;
tp.channels = TESTBENCH_NCH;
/* command line arguments*/
parse_input_args(argc, argv, &tp);
@ -216,20 +215,19 @@ int main(int argc, char **argv)
}
/* parse topology file and create pipeline */
if (parse_topology(&sof, lib_table, &tp, &fr_id, &fw_id, &sched_id,
pipeline) < 0) {
if (parse_topology(&sof, lib_table, &tp, pipeline) < 0) {
fprintf(stderr, "error: parsing topology\n");
exit(EXIT_FAILURE);
}
/* Get pointers to fileread and filewrite */
pcm_dev = ipc_get_comp_by_id(sof.ipc, fw_id);
pcm_dev = ipc_get_comp_by_id(sof.ipc, tp.fw_id);
fwcd = comp_get_drvdata(pcm_dev->cd);
pcm_dev = ipc_get_comp_by_id(sof.ipc, fr_id);
pcm_dev = ipc_get_comp_by_id(sof.ipc, tp.fr_id);
frcd = comp_get_drvdata(pcm_dev->cd);
/* Run pipeline until EOF from fileread */
pcm_dev = ipc_get_comp_by_id(sof.ipc, sched_id);
pcm_dev = ipc_get_comp_by_id(sof.ipc, tp.sched_id);
p = pcm_dev->cd->pipeline;
ipc_pipe = &p->ipc_pipe;
@ -241,7 +239,7 @@ int main(int argc, char **argv)
tp.fs_out = ipc_pipe->period * ipc_pipe->frames_per_sched;
/* set pipeline params and trigger start */
if (tb_pipeline_start(sof.ipc, TESTBENCH_NCH, ipc_pipe, &tp) < 0) {
if (tb_pipeline_start(sof.ipc, ipc_pipe, &tp) < 0) {
fprintf(stderr, "error: pipeline params\n");
exit(EXIT_FAILURE);
}

View File

@ -52,7 +52,9 @@ void register_comp(int comp_type)
/* register file comp driver (no shared library needed) */
if (comp_type == SND_SOC_TPLG_DAPM_DAI_IN ||
comp_type == SND_SOC_TPLG_DAPM_AIF_IN) {
comp_type == SND_SOC_TPLG_DAPM_DAI_OUT ||
comp_type == SND_SOC_TPLG_DAPM_AIF_IN ||
comp_type == SND_SOC_TPLG_DAPM_AIF_OUT) {
if (!lib_table[0].register_drv) {
sys_comp_file_init();
lib_table[0].register_drv = 1;
@ -207,44 +209,6 @@ static int tplg_load_fileread(int comp_id, int pipeline_id, int size,
return 0;
}
/* load fileread component */
static int load_fileread(void *dev, int comp_id, int pipeline_id,
int size, int *fr_id, int *sched_id,
struct testbench_prm *tp)
{
struct sof *sof = (struct sof *)dev;
struct sof_ipc_comp_file fileread;
int ret;
fileread.config.frame_fmt = find_format(tp->bits_in);
ret = tplg_load_fileread(comp_id, pipeline_id, size, &fileread);
if (ret < 0)
return ret;
/* configure fileread */
fileread.fn = strdup(tp->input_file);
/* use fileread comp as scheduling comp */
*fr_id = *sched_id = comp_id;
/* create fileread component */
if (ipc_comp_new(sof->ipc, (struct sof_ipc_comp *)&fileread) < 0) {
fprintf(stderr, "error: comp register\n");
return -EINVAL;
}
free(fileread.fn);
return 0;
}
int load_aif_in_out(void *dev, int comp_id, int pipeline_id,
int size, int *fr_id, int *sched_id, void *tp, int dir)
{
return load_fileread(dev, comp_id, pipeline_id, size, fr_id,
sched_id, (struct testbench_prm *)tp);
}
/* load filewrite component */
static int tplg_load_filewrite(int comp_id, int pipeline_id, int size,
struct sof_ipc_comp_file *filewrite)
@ -296,9 +260,49 @@ static int tplg_load_filewrite(int comp_id, int pipeline_id, int size,
return 0;
}
/* load fileread component */
static int load_fileread(void *dev, int comp_id, int pipeline_id,
int size, int dir, struct testbench_prm *tp)
{
struct sof *sof = (struct sof *)dev;
struct sof_ipc_comp_file fileread;
int ret;
fileread.config.frame_fmt = find_format(tp->bits_in);
ret = tplg_load_fileread(comp_id, pipeline_id, size, &fileread);
if (ret < 0)
return ret;
/* configure fileread */
fileread.fn = strdup(tp->input_file);
/* use fileread comp as scheduling comp */
tp->fr_id = comp_id;
tp->sched_id = comp_id;
/* Set format from testbench command line*/
fileread.rate = tp->fs_in;
fileread.channels = tp->channels;
fileread.frame_fmt = tp->frame_fmt;
/* Set type depending on direction */
fileread.comp.type = (dir == SOF_IPC_STREAM_PLAYBACK) ?
SOF_COMP_HOST : SOF_COMP_DAI;
/* create fileread component */
if (ipc_comp_new(sof->ipc, (struct sof_ipc_comp *)&fileread) < 0) {
fprintf(stderr, "error: comp register\n");
return -EINVAL;
}
free(fileread.fn);
return 0;
}
/* load filewrite component */
static int load_filewrite(struct sof *sof, int comp_id, int pipeline_id,
int size, int *fw_id, struct testbench_prm *tp)
int size, int dir, struct testbench_prm *tp)
{
struct sof_ipc_comp_file filewrite;
int ret;
@ -309,7 +313,16 @@ static int load_filewrite(struct sof *sof, int comp_id, int pipeline_id,
/* configure filewrite */
filewrite.fn = strdup(tp->output_file);
*fw_id = comp_id;
tp->fw_id = comp_id;
/* Set format from testbench command line*/
filewrite.rate = tp->fs_out;
filewrite.channels = tp->channels;
filewrite.frame_fmt = tp->frame_fmt;
/* Set type depending on direction */
filewrite.comp.type = (dir == SOF_IPC_STREAM_PLAYBACK) ?
SOF_COMP_DAI : SOF_COMP_HOST;
/* create filewrite component */
if (ipc_comp_new(sof->ipc, (struct sof_ipc_comp *)&filewrite) < 0) {
@ -321,13 +334,28 @@ static int load_filewrite(struct sof *sof, int comp_id, int pipeline_id,
return 0;
}
int load_dai_in_out(void *dev, int comp_id, int pipeline_id,
int size, int *fw_id, void *tp)
int load_aif_in_out(void *dev, int comp_id, int pipeline_id,
int size, int dir, void *tp)
{
return load_filewrite(dev, comp_id, pipeline_id, size, fw_id,
if (dir == SOF_IPC_STREAM_PLAYBACK)
return load_fileread(dev, comp_id, pipeline_id, size, dir,
(struct testbench_prm *)tp);
return load_filewrite(dev, comp_id, pipeline_id, size, dir,
(struct testbench_prm *)tp);
}
int load_dai_in_out(void *dev, int comp_id, int pipeline_id,
int size, int dir, void *tp)
{
if (dir == SOF_IPC_STREAM_PLAYBACK)
return load_filewrite(dev, comp_id, pipeline_id, size, dir,
(struct testbench_prm *)tp);
return load_fileread(dev, comp_id, pipeline_id, size, dir,
(struct testbench_prm *)tp);
}
/* load pda dapm widget */
int load_pga(void *dev, int comp_id, int pipeline_id, int size)
{
@ -350,7 +378,7 @@ int load_pga(void *dev, int comp_id, int pipeline_id, int size)
/* load scheduler dapm widget */
int load_pipeline(void *dev, int comp_id, int pipeline_id, int size,
int *sched_id)
int sched_id)
{
struct sof *sof = (struct sof *)dev;
struct sof_ipc_pipe_new pipeline;
@ -360,7 +388,7 @@ int load_pipeline(void *dev, int comp_id, int pipeline_id, int size,
if (ret < 0)
return ret;
pipeline.sched_id = *sched_id;
pipeline.sched_id = sched_id;
/* Create pipeline */
if (ipc_pipeline_new(sof->ipc, &pipeline) < 0) {
@ -454,8 +482,7 @@ int load_mixer(void *dev, int comp_id, int pipeline_id, int size)
/* parse topology file and set up pipeline */
int parse_topology(struct sof *sof, struct shared_lib_table *library_table,
struct testbench_prm *tp, int *fr_id, int *fw_id,
int *sched_id, char *pipeline_msg)
struct testbench_prm *tp, char *pipeline_msg)
{
struct snd_soc_tplg_hdr *hdr;
@ -517,8 +544,8 @@ int parse_topology(struct sof *sof, struct shared_lib_table *library_table,
ret = load_widget(sof, SOF_DEV,
temp_comp_list,
next_comp_id++, i,
hdr->index, tp, fr_id,
fw_id, sched_id, file);
hdr->index, tp, &tp->sched_id,
file);
if (ret < 0) {
printf("error: loading widget\n");
goto finish;

View File

@ -213,18 +213,18 @@ int tplg_load_graph(int num_comps, int pipeline_id,
int load_pga(void *dev, int comp_id, int pipeline_id, int size);
int load_aif_in_out(void *dev, int comp_id, int pipeline_id,
int size, int *fr_id, int *sched_id, void *tp, int dir);
int size, int dir, void *tp);
int load_dai_in_out(void *dev, int comp_id, int pipeline_id,
int size, int *fw_id, void *tp);
int size, int dir, void *tp);
int load_buffer(void *dev, int comp_id, int pipeline_id, int size);
int load_pipeline(void *dev, int comp_id, int pipeline_id, int size,
int *sched_id);
int sched_id);
int load_src(void *dev, int comp_id, int pipeline_id, int size, void *params);
int load_asrc(void *dev, int comp_id, int pipeline_id, int size, void *params);
int load_mixer(void *dev, int comp_id, int pipeline_id, int size);
int load_widget(void *dev, int dev_type, struct comp_info *temp_comp_list,
int comp_id, int comp_index, int pipeline_id,
void *tp, int *fr_id, int *fw_id, int *sched_id, FILE *file);
int comp_id, int comp_index, int pipeline_id, void *tp,
int *sched_id, FILE *file);
void register_comp(int comp_type);
int find_widget(struct comp_info *temp_comp_list, int count, char *name);
#endif

View File

@ -730,7 +730,7 @@ int tplg_load_graph(int num_comps, int pipeline_id,
/* load dapm widget */
int load_widget(void *dev, int dev_type, struct comp_info *temp_comp_list,
int comp_id, int comp_index, int pipeline_id,
void *tp, int *fr_id, int *fw_id, int *sched_id, FILE *file)
void *tp, int *sched_id, FILE *file)
{
struct snd_soc_tplg_dapm_widget *widget;
size_t read_size, size;
@ -781,8 +781,7 @@ int load_widget(void *dev, int dev_type, struct comp_info *temp_comp_list,
case(SND_SOC_TPLG_DAPM_AIF_IN):
if (load_aif_in_out(dev, temp_comp_list[comp_index].id,
pipeline_id, widget->priv.size,
fr_id, sched_id, tp,
SOF_IPC_STREAM_PLAYBACK) < 0) {
SOF_IPC_STREAM_PLAYBACK, tp) < 0) {
fprintf(stderr, "error: load AIF IN failed\n");
return -EINVAL;
}
@ -790,17 +789,23 @@ int load_widget(void *dev, int dev_type, struct comp_info *temp_comp_list,
case(SND_SOC_TPLG_DAPM_AIF_OUT):
if (load_aif_in_out(dev, temp_comp_list[comp_index].id,
pipeline_id, widget->priv.size,
fr_id, sched_id, tp,
SOF_IPC_STREAM_CAPTURE) < 0) {
SOF_IPC_STREAM_CAPTURE, tp) < 0) {
fprintf(stderr, "error: load AIF OUT failed\n");
return -EINVAL;
}
break;
case(SND_SOC_TPLG_DAPM_DAI_IN):
if (load_dai_in_out(dev, temp_comp_list[comp_index].id,
pipeline_id, widget->priv.size,
SOF_IPC_STREAM_PLAYBACK, tp) < 0) {
fprintf(stderr, "error: load filewrite\n");
return -EINVAL;
}
break;
case(SND_SOC_TPLG_DAPM_DAI_OUT):
if (load_dai_in_out(dev, temp_comp_list[comp_index].id,
pipeline_id, widget->priv.size,
fw_id, tp) < 0) {
SOF_IPC_STREAM_CAPTURE, tp) < 0) {
fprintf(stderr, "error: load filewrite\n");
return -EINVAL;
}
@ -820,7 +825,7 @@ int load_widget(void *dev, int dev_type, struct comp_info *temp_comp_list,
if (load_pipeline(dev, temp_comp_list[comp_index].id,
pipeline_id, widget->priv.size,
sched_id) < 0) {
*sched_id) < 0) {
fprintf(stderr, "error: load pipeline\n");
return -EINVAL;
}