Skip to content

Commit 96f841a

Browse files
softwareckikv2019i
authored andcommitted
ipc4: notification: Add function to prepare mixer underrun notification
Add function preparing ipc4 notification about underrun detected by mixer. Signed-off-by: Adrian Warecki <adrian.warecki@intel.com>
1 parent fb1d34b commit 96f841a

2 files changed

Lines changed: 32 additions & 0 deletions

File tree

src/include/ipc4/notification.h

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -242,6 +242,19 @@ struct ipc4_process_data_error_event_data {
242242
uint32_t error_code;
243243
};
244244

245+
/**
246+
* \brief This notification is sent by the mixer on stream underrun detection. The frequency of
247+
* sending this notification by Mixer depends on the MixIn settings.
248+
*/
249+
struct ipc4_mixer_underrun_event_data {
250+
/* Indicates EndOfStream */
251+
uint32_t eos_flag;
252+
/* Data processed by module (in bytes) */
253+
uint32_t data_mixed;
254+
/* Expected data to be processed (in bytes) */
255+
uint32_t expected_data_mixed;
256+
};
257+
245258
/**
246259
* \brief Input data payload is reserved field in parent technical spec which can be easily
247260
* extendable if needed by specific resource event types in the future. For backward compatibility
@@ -252,6 +265,8 @@ union ipc4_resource_event_data {
252265
uint32_t dws[6];
253266
/* Process Data Error Data (res type = MODULE_INSTANCE) */
254267
struct ipc4_process_data_error_event_data process_data_error;
268+
/* Mixer Underrun Detected Data (res type = PIPELINE) */
269+
struct ipc4_mixer_underrun_event_data mixer_underrun;
255270
};
256271

257272
struct ipc4_resource_event_data_notification {
@@ -279,4 +294,7 @@ void copier_gateway_overrun_notif_msg_init(struct ipc_msg *msg, uint32_t pipelin
279294
void gateway_underrun_notif_msg_init(struct ipc_msg *msg, uint32_t resource_id);
280295
void gateway_overrun_notif_msg_init(struct ipc_msg *msg, uint32_t resource_id);
281296

297+
void mixer_underrun_notif_msg_init(struct ipc_msg *msg, uint32_t resource_id, uint32_t eos_flag,
298+
uint32_t data_mixed, uint32_t expected_data_mixed);
299+
282300
#endif /* __IPC4_NOTIFICATION_H__ */

src/ipc/ipc4/notification.c

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,20 @@ void gateway_overrun_notif_msg_init(struct ipc_msg *msg, uint32_t resource_id)
6464
notif_data->resource_type = SOF_IPC4_GATEWAY;
6565
}
6666

67+
void mixer_underrun_notif_msg_init(struct ipc_msg *msg, uint32_t resource_id, uint32_t eos_flag,
68+
uint32_t data_mixed, uint32_t expected_data_mixed)
69+
{
70+
struct ipc4_resource_event_data_notification *notif_data = msg->tx_data;
71+
72+
resource_notif_header_init(msg);
73+
notif_data->resource_id = resource_id;
74+
notif_data->event_type = SOF_IPC4_MIXER_UNDERRUN_DETECTED;
75+
notif_data->resource_type = SOF_IPC4_PIPELINE;
76+
notif_data->event_data.mixer_underrun.eos_flag = eos_flag;
77+
notif_data->event_data.mixer_underrun.data_mixed = data_mixed;
78+
notif_data->event_data.mixer_underrun.expected_data_mixed = expected_data_mixed;
79+
}
80+
6781
void process_data_error_notif_msg_init(struct ipc_msg *msg, uint32_t resource_id,
6882
uint32_t error_code)
6983
{

0 commit comments

Comments
 (0)