Skip to content

Commit 1163151

Browse files
committed
mixin: Add EOS notification
Signed-off-by: Adrian Warecki <adrian.warecki@intel.com>
1 parent f43a890 commit 1163151

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

src/audio/mixin_mixout/mixin_mixout.c

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -248,11 +248,12 @@ static void silence(struct cir_buf_ptr *stream, uint32_t start_offset,
248248

249249
#if CONFIG_XRUN_NOTIFICATIONS_ENABLE
250250
static void mixin_check_notify_underrun(struct comp_dev *dev, struct mixin_data *mixin_data,
251-
size_t source_avail_frames, size_t sinks_free_frames)
251+
size_t source_avail, size_t sinks_free)
252252
{
253253
mixin_data->last_reported_underrun++;
254-
if (source_avail_frames < sinks_free_frames &&
255-
mixin_data->last_reported_underrun >= mixin_data->underrun_notification_period) {
254+
255+
if (!source_avail && mixin_data->last_reported_underrun >=
256+
mixin_data->underrun_notification_period) {
256257
mixin_data->last_reported_underrun = 0;
257258

258259
struct ipc_msg *notify = ipc_notification_pool_get(IPC4_RESOURCE_EVENT_SIZE);
@@ -385,7 +386,11 @@ static int mixin_process(struct processing_module *mod,
385386
return 0;
386387

387388
#if CONFIG_XRUN_NOTIFICATIONS_ENABLE
388-
mixin_check_notify_underrun(dev, mixin_data, source_avail_frames, sinks_free_frames);
389+
size_t frame_bytes = source_get_frame_bytes(sources[0]);
390+
size_t min_frames = MIN(dev->frames, sinks_free_frames);
391+
mixin_check_notify_underrun(dev, mixin_data,
392+
source_avail_frames * frame_bytes,
393+
min_frames * frame_bytes);
389394
#endif
390395

391396
if (source_avail_frames > 0) {

0 commit comments

Comments
 (0)