mirror of https://github.com/thesofproject/sof.git
detect-test: allocate model data memory at set_model stage
We are aligned to use separate IPC for set_config and set_model, so don't allocate model buffer at set_config stage, but do that in the first IPC for model blob config IPC sequences. Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
This commit is contained in:
parent
440cd55f60
commit
25a4c5b0db
|
@ -185,7 +185,7 @@ static int test_keyword_apply_config(struct comp_dev *dev,
|
|||
cd->config.activation_threshold =
|
||||
ACTIVATION_DEFAULT_THRESHOLD_S16;
|
||||
|
||||
return alloc_mem_load(cd, cd->config.load_memory_size);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static struct comp_dev *test_keyword_new(struct sof_ipc_comp *comp)
|
||||
|
@ -318,8 +318,15 @@ static int test_keyword_set_config(struct comp_dev *dev,
|
|||
static int test_keyword_set_model(struct comp_dev *dev,
|
||||
struct sof_ipc_ctrl_data *cdata)
|
||||
{
|
||||
int ret = 0;
|
||||
struct comp_data *cd = comp_get_drvdata(dev);
|
||||
|
||||
if (!cdata->msg_index) {
|
||||
ret = alloc_mem_load(cd, cdata->num_elems);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
}
|
||||
|
||||
if (!cd->load_memory) {
|
||||
trace_keyword_error("keyword_ctrl_set_model() error: "
|
||||
"buffer not allocated");
|
||||
|
|
Loading…
Reference in New Issue