|
63 | 63 | /* default number of samples before detection is activated */ |
64 | 64 | #define KEYPHRASE_DEFAULT_PREAMBLE_LENGTH 0 |
65 | 65 |
|
| 66 | +#define NOTIFICATION_DEFAULT_WORD_ID 1 |
| 67 | +#define NOTIFICATION_DEFAULT_SCORE 0 |
| 68 | + |
66 | 69 | #define KWD_NN_BUFF_ALIGN 64 |
67 | 70 |
|
68 | 71 | static const struct comp_driver comp_keyword; |
@@ -164,10 +167,29 @@ static void notify_host(const struct comp_dev *dev) |
164 | 167 | { |
165 | 168 | struct comp_data *cd = comp_get_drvdata(dev); |
166 | 169 |
|
167 | | - comp_info(dev, "entry"); |
| 170 | + comp_err(dev, "notify_host: WOV module_id=0x%x instance_id=0x%x slot_id=%u detected", |
| 171 | + dev_comp_id(dev) >> 16, dev_comp_id(dev) & 0xffff, cd->wov_slot_id); |
168 | 172 |
|
169 | 173 | #if CONFIG_IPC_MAJOR_4 |
170 | | - ipc_msg_send(cd->msg, NULL, true); |
| 174 | + struct ipc4_voice_cmd_notification notif; |
| 175 | + memset_s(¬if, sizeof(notif), 0, sizeof(notif)); |
| 176 | + |
| 177 | + notif.primary.r.word_id = (cd->wov_slot_id != WOV_SLOT_INVALID) ? cd->wov_slot_id : NOTIFICATION_DEFAULT_WORD_ID; |
| 178 | + notif.primary.r.notif_type = SOF_IPC4_NOTIFY_PHRASE_DETECTED; |
| 179 | + notif.primary.r.type = SOF_IPC4_GLB_NOTIFICATION; |
| 180 | + notif.primary.r.rsp = SOF_IPC4_MESSAGE_DIR_MSG_REQUEST; |
| 181 | + notif.primary.r.msg_tgt = SOF_IPC4_MESSAGE_TARGET_FW_GEN_MSG; |
| 182 | + |
| 183 | + /* Store WOV component module ID & instance ID in extension payload */ |
| 184 | + notif.extension.r.sv_score = (uint16_t)(dev_comp_id(dev) & 0xffff); |
| 185 | + notif.extension.r.rsvd1 = (uint32_t)(dev_comp_id(dev) >> 16); |
| 186 | + |
| 187 | + if (cd->msg) |
| 188 | + ipc_msg_free(cd->msg); |
| 189 | + cd->msg = ipc_msg_w_ext_init(notif.primary.dat, notif.extension.dat, 0); |
| 190 | + |
| 191 | + if (cd->msg) |
| 192 | + ipc_msg_send(cd->msg, NULL, true); |
171 | 193 | #else |
172 | 194 | ipc_msg_send(cd->msg, &cd->event, true); |
173 | 195 | #endif /* CONFIG_IPC_MAJOR_4 */ |
|
0 commit comments