Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions src/audio/pipeline/pipeline-xrun.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ LOG_MODULE_DECLARE(pipe, CONFIG_SOF_LOG_LEVEL);
*/
#define NO_XRUN_RECOVERY 1

#if CONFIG_IPC_MAJOR_3

/* This function always returns success */
static int pipeline_comp_xrun(struct comp_dev *current,
struct comp_buffer *calling_buf,
Expand All @@ -49,6 +51,8 @@ static int pipeline_comp_xrun(struct comp_dev *current,
return pipeline_for_each_comp(current, ctx, dir);
}

#endif /* CONFIG_IPC_MAJOR_3 */

#if NO_XRUN_RECOVERY
/* recover the pipeline from a XRUN condition */
int pipeline_xrun_recover(struct pipeline *p)
Expand Down Expand Up @@ -139,13 +143,15 @@ int pipeline_xrun_handle_trigger(struct pipeline *p, int cmd)
void pipeline_xrun(struct pipeline *p, struct comp_dev *dev,
int32_t bytes)
{
#if CONFIG_IPC_MAJOR_3
struct pipeline_data data;
struct pipeline_walk_context walk_ctx = {
.comp_func = pipeline_comp_xrun,
.comp_data = &data,
.skip_incomplete = true,
};
struct sof_ipc_stream_posn posn;
#endif
int ret;

/* don't flood host */
Expand All @@ -162,6 +168,12 @@ void pipeline_xrun(struct pipeline *p, struct comp_dev *dev,
pipe_err(p, "Pipelines notification about XRUN failed, ret = %d",
ret);

/*
* The IPC position info reporting via window2 is only
* used for IPC3 and e.g. in IPC4 this is conflicting
* with the debug window usages (logging, debug, ..)
*/
#if CONFIG_IPC_MAJOR_3
memset(&posn, 0, sizeof(posn));
ipc_build_stream_posn(&posn, SOF_IPC_STREAM_TRIG_XRUN,
dev_comp_id(dev));
Expand All @@ -172,4 +184,5 @@ void pipeline_xrun(struct pipeline *p, struct comp_dev *dev,
data.p = p;

walk_ctx.comp_func(dev, NULL, &walk_ctx, dev->direction);
#endif
}
9 changes: 9 additions & 0 deletions src/include/sof/lib/mailbox.h
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,14 @@ void mailbox_hostbox_read(void *dest, size_t dest_size,
assert(!host_read_err);
}

#if CONFIG_IPC_MAJOR_4
static inline
void mailbox_stream_write(size_t offset, const void *src, size_t bytes)
{
/* in IPC4, the stream mailbox must not be used */
assert(false);
}
#else
static inline
void mailbox_stream_write(size_t offset, const void *src, size_t bytes)
{
Expand All @@ -110,5 +118,6 @@ void mailbox_stream_write(size_t offset, const void *src, size_t bytes)
dcache_writeback_region((__sparse_force void __sparse_cache *)(MAILBOX_STREAM_BASE +
offset), bytes);
}
#endif

#endif /* __SOF_LIB_MAILBOX_H__ */
Loading