From 25a4c5b0db74a5d7476a8152fcc7ddae7e7a7120 Mon Sep 17 00:00:00 2001 From: Keyon Jie Date: Fri, 21 Jun 2019 19:35:41 +0800 Subject: [PATCH] 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 --- src/audio/detect_test.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/audio/detect_test.c b/src/audio/detect_test.c index 3f0a78c20..e30758427 100644 --- a/src/audio/detect_test.c +++ b/src/audio/detect_test.c @@ -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");