mirror of https://github.com/thesofproject/sof.git
detect_test: Do not overwrite supplied threshold
Default threshold should be applied only if it was not already set via IPC4_DETECT_TEST_SET_CONFIG call. Signed-off-by: Serhiy Katsyuba <serhiy.katsyuba@intel.com>
This commit is contained in:
parent
c77a4feb2f
commit
784da5468e
|
@ -836,6 +836,11 @@ static int test_keyword_params(struct comp_dev *dev,
|
||||||
cd->keyphrase_samples = KEYPHRASE_DEFAULT_PREAMBLE_LENGTH;
|
cd->keyphrase_samples = KEYPHRASE_DEFAULT_PREAMBLE_LENGTH;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Threshold might be already set via IPC4_DETECT_TEST_SET_CONFIG,
|
||||||
|
* otherwise apply default value.
|
||||||
|
*/
|
||||||
|
if (!cd->config.activation_threshold) {
|
||||||
err = test_keyword_get_threshold(dev, params->sample_valid_bytes * 8);
|
err = test_keyword_get_threshold(dev, params->sample_valid_bytes * 8);
|
||||||
if (err < 0) {
|
if (err < 0) {
|
||||||
comp_err(dev, "test_keyword_params(): unsupported sample width %u",
|
comp_err(dev, "test_keyword_params(): unsupported sample width %u",
|
||||||
|
@ -843,12 +848,13 @@ static int test_keyword_params(struct comp_dev *dev,
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
cd->config.activation_threshold = err;
|
||||||
|
}
|
||||||
|
|
||||||
#if CONFIG_AMS
|
#if CONFIG_AMS
|
||||||
cd->kpd_uuid_id = AMS_INVALID_MSG_TYPE;
|
cd->kpd_uuid_id = AMS_INVALID_MSG_TYPE;
|
||||||
#endif /* CONFIG_AMS */
|
#endif /* CONFIG_AMS */
|
||||||
|
|
||||||
cd->config.activation_threshold = err;
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue