Skip to content

Commit d3d348c

Browse files
committed
ASoC: SOF: ipc4: Handle compressed drain done notification from firmware
The decoder module sends a drain done notification when the last chunk of the stream after the EOS from host has been decoded. The notification is a module notification with 0xc0c0 as magic number in event_id upper 16 bit. Call sof_ipc4_compr_drain_done() when the notification arrives to handle it. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
1 parent 8072cfd commit d3d348c

2 files changed

Lines changed: 13 additions & 3 deletions

File tree

include/sound/sof/ipc4/header.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -677,9 +677,10 @@ struct sof_ipc4_notify_module_data {
677677
* The event_data contains the struct sof_ipc4_control_msg_payload of the control
678678
* which sent the notification.
679679
*/
680-
#define SOF_IPC4_NOTIFY_MODULE_EVENTID_ALSA_MAGIC_MASK GENMASK(31, 16)
680+
#define SOF_IPC4_NOTIFY_MODULE_EVENTID_SOF_MAGIC_MASK GENMASK(31, 16)
681681
#define SOF_IPC4_NOTIFY_MODULE_EVENTID_ALSA_MAGIC_VAL 0xA15A0000
682682
#define SOF_IPC4_NOTIFY_MODULE_EVENTID_ALSA_PARAMID_MASK GENMASK(15, 0)
683+
#define SOF_IPC4_NOTIFY_MODULE_EVENTID_COMPR_MAGIC_VAL 0xC0C00000
683684

684685
/*
685686
* Macros for creating struct sof_ipc4_module_init_ext_init payload

sound/soc/sof/ipc4.c

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -782,12 +782,21 @@ static void sof_ipc4_module_notification_handler(struct snd_sof_dev *sdev,
782782
}
783783

784784
/* Handle ALSA kcontrol notification */
785-
if ((data->event_id & SOF_IPC4_NOTIFY_MODULE_EVENTID_ALSA_MAGIC_MASK) ==
786-
SOF_IPC4_NOTIFY_MODULE_EVENTID_ALSA_MAGIC_VAL) {
785+
switch (data->event_id & SOF_IPC4_NOTIFY_MODULE_EVENTID_SOF_MAGIC_MASK) {
786+
case SOF_IPC4_NOTIFY_MODULE_EVENTID_ALSA_MAGIC_VAL:
787+
{
787788
const struct sof_ipc_tplg_ops *tplg_ops = sdev->ipc->ops->tplg;
788789

789790
if (tplg_ops->control->update)
790791
tplg_ops->control->update(sdev, ipc4_msg);
792+
793+
break;
794+
}
795+
case SOF_IPC4_NOTIFY_MODULE_EVENTID_COMPR_MAGIC_VAL:
796+
sof_ipc4_compr_drain_done(sdev, ipc4_msg);
797+
break;
798+
default:
799+
break;
791800
}
792801
}
793802

0 commit comments

Comments
 (0)