8#ifndef __SOF_AUDIO_PIPELINE_H__
9#define __SOF_AUDIO_PIPELINE_H__
18#include <ipc/topology.h>
34#define PPL_STATUS_PATH_STOP 1
39#define PPL_STATUS_PATH_TERMINATE 2
42#define PPL_STATUS_SCHEDULED 2
45#define PPL_CONN_DIR_COMP_TO_BUFFER 0
46#define PPL_CONN_DIR_BUFFER_TO_COMP 1
49#define PPL_DIR_DOWNSTREAM 0
50#define PPL_DIR_UPSTREAM 1
76#ifdef CONFIG_IPC_MAJOR_4
77 struct task *trigger_task;
130#if CONFIG_KCPS_DYNAMIC_CLOCK_CONTROL
131 int32_t kcps[CONFIG_CORE_COUNT];
142struct ipc4_pipeline_ext_obj_mem_data;
146 const struct ipc4_pipeline_ext_obj_mem_data *
mem_data;
149#define pipeline_task_get(t) container_of(t, struct pipeline_task, task)
212#ifdef CONFIG_SOF_USERSPACE_LL
217void pipeline_posn_grant_access(
struct k_thread *thread);
246#if CONFIG_IPC_MAJOR_4
424 uint32_t core, uint32_t
period,
425 uint32_t period_mips, uint32_t frames_per_sched,
426 uint32_t time_domain);
static int cpu_get_id(void)
Definition cpu.h:98
uint32_t data[]
Definition debug_stream_slot.h:2
@ SOF_TIME_DOMAIN_TIMER
Timer interrupt.
Definition topology.h:285
#define list_item(item, type, member)
Definition list.h:80
static bool pipeline_is_this_cpu(struct pipeline *p)
Is pipeline is scheduled on this core.
Definition pipeline.h:363
static bool pipeline_is_same_sched_comp(struct pipeline *current, struct pipeline *previous)
Checks if two pipelines have the same scheduling component.
Definition pipeline.h:342
int pipeline_comp_ll_task_init(struct pipeline *p)
Init an LL task for a pipeline.
int pipeline_reset(struct pipeline *p, struct comp_dev *host_cd)
Resets the pipeline and free runtime resources.
int pipeline_prepare(struct pipeline *p, struct comp_dev *cd)
Prepares pipeline for processing.
void pipeline_schedule_config(struct pipeline *p, uint32_t sched_id, uint32_t core, uint32_t period, uint32_t period_mips, uint32_t frames_per_sched, uint32_t time_domain)
Configure pipeline scheduling.
void pipeline_comp_trigger_sched_comp(struct pipeline *p, struct comp_dev *comp, struct pipeline_walk_context *ctx)
Trigger pipeline's scheduling component.
void pipeline_schedule_triggered(struct pipeline_walk_context *ctx, int cmd)
Schedule all triggered pipelines.
static uint32_t pipeline_id(struct pipeline *p)
Retrieves pipeline id from pipeline.
Definition pipeline.h:261
int pipeline_for_each_comp(struct comp_dev *current, struct pipeline_walk_context *ctx, int dir)
Walks the pipeline graph for each component.
struct comp_dev * pipeline_get_dai_comp(uint32_t pipeline_id, int dir)
Walks pipeline graph to find dai component.
void pipeline_xrun(struct pipeline *p, struct comp_dev *dev, int32_t bytes)
notify host that we have XRUN.
int pipeline_free(struct pipeline *p)
Free's a pipeline.
void pipeline_get_timestamp(struct pipeline *p, struct comp_dev *host_dev, struct sof_ipc_stream_posn *posn)
Get time pipeline timestamps from host to dai.
int pipeline_params(struct pipeline *p, struct comp_dev *cd, struct sof_ipc_pcm_params *params)
Creates a new pipeline.
struct pipeline * pipeline_new(struct k_heap *heap, uint32_t pipeline_id, uint32_t priority, uint32_t comp_id, struct create_pipeline_params *pparams)
Creates a new pipeline.
int pipeline_copy(struct pipeline *p)
Copy data along a pipeline.
void pipeline_posn_init(struct sof *sof)
Initializes pipeline position structure.
int pipeline_complete(struct pipeline *p, struct comp_dev *source, struct comp_dev *sink)
Completes a pipeline.
int pipeline_trigger(struct pipeline *p, struct comp_dev *host, int cmd)
Trigger pipeline - IPC context.
int pipeline_xrun_set_limit(struct pipeline *p, uint32_t xrun_limit_usecs)
Set tolerance for pipeline xrun handling.
int pipeline_xrun_recover(struct pipeline *p)
Recover the pipeline from a XRUN condition.
int pipeline_trigger_run(struct pipeline *p, struct comp_dev *host, int cmd)
Trigger pipeline - either IPC or pipeline task context.
int pipeline_xrun_handle_trigger(struct pipeline *p, int cmd)
Perform xrun recovery.
void pipeline_comp_ll_task_free(struct pipeline *p)
Free the LL tasks owned by a pipeline.
int pipeline_comp_dp_task_init(struct comp_dev *comp)
Init a DP task for a component.
void pipeline_comp_copy_error_notify(const struct comp_dev *component, int error_code)
Sends an ipc notification that an error occurred in the module's processing function.
void pipeline_disconnect(struct comp_dev *comp, struct comp_buffer *buffer, int dir)
Creates a new pipeline.
void pipeline_schedule_copy(struct pipeline *p, uint64_t start)
Schedule a pipeline copy to run after a delay.
int pipeline_connect(struct comp_dev *comp, struct comp_buffer *buffer, int dir)
Connect components in a pipeline.
static bool pipeline_is_timer_driven(struct pipeline *p)
Is pipeline is scheduled with timer.
Definition pipeline.h:353
Audio component base device "class".
Definition component.h:645
uint32_t period
component's processing period for LL modules is set to LL pipeline's period for DP module its meaning...
Definition component.h:658
For storing IPC payload data.
Definition pipeline.h:145
const struct ipc4_pipeline_ext_obj_mem_data * mem_data
Definition pipeline.h:146
Definition pipeline.h:123
struct comp_dev * start
Definition pipeline.h:124
struct sof_ipc_pcm_params * params
Definition pipeline.h:125
uint32_t delay_ms
Definition pipeline.h:129
struct pipeline * p
Definition pipeline.h:127
struct sof_ipc_stream_posn * posn
Definition pipeline.h:126
int cmd
Definition pipeline.h:128
Task type registered by pipelines.
Definition pipeline.h:136
bool registrable
should task be registered on irq
Definition pipeline.h:138
struct task task
parent structure
Definition pipeline.h:137
struct comp_dev * sched_comp
pipeline scheduling component
Definition pipeline.h:139
Definition pipeline.h:104
void * comp_data
Definition pipeline.h:107
struct list_item pipelines
Definition pipeline.h:112
bool skip_incomplete
Definition pipeline.h:119
void(* buff_func)(struct comp_buffer *buffer, void *data)
Definition pipeline.h:108
int(* comp_func)(struct comp_dev *cd, struct comp_buffer *buffer, struct pipeline_walk_context *ctx, int dir)
Definition pipeline.h:105
struct comp_buffer * incoming
pipelines to be scheduled after trigger walk
Definition pipeline.h:110
void * buff_data
Definition pipeline.h:109
uint32_t priority
priority level 0 (low) to 10 (max)
Definition pipeline.h:62
uint32_t comp_id
component id for pipeline
Definition pipeline.h:57
uint32_t time_domain
scheduling time domain
Definition pipeline.h:66
uint32_t posn_offset
Definition pipeline.h:93
uint32_t core
core we run on
Definition pipeline.h:60
struct tr_ctx tctx
Definition pipeline.h:72
struct comp_dev * sched_comp
Definition pipeline.h:84
uint32_t pipeline_id
pipeline id
Definition pipeline.h:58
int cmd
Definition pipeline.h:96
int32_t xrun_bytes
Definition pipeline.h:70
struct k_heap * heap
heap used for allocating this pipeline
Definition pipeline.h:56
uint32_t period
execution period in us
Definition pipeline.h:61
struct comp_dev * sink_comp
Definition pipeline.h:88
struct comp_dev * host
Definition pipeline.h:97
struct task * pipe_task
Definition pipeline.h:79
bool expect_eos
Definition pipeline.h:73
unsigned int delay
Definition pipeline.h:98
struct list_item list
list in walk context
Definition pipeline.h:90
uint32_t xrun_limit_usecs
report xruns greater than limit
Definition pipeline.h:65
struct pipeline * sched_prev
Definition pipeline.h:81
uint32_t period_mips
worst case instruction count per period
Definition pipeline.h:63
bool aborted
Definition pipeline.h:99
struct ipc_msg * msg
Definition pipeline.h:94
struct comp_dev * source_comp
Definition pipeline.h:86
struct pipeline::@136334161205271162314161116057173351246237250367 trigger
uint32_t sched_id
Scheduling component id.
Definition pipeline.h:59
uint32_t status
Definition pipeline.h:71
bool pending
Definition pipeline.h:100
uint32_t frames_per_sched
output frames of pipeline, 0 is variable
Definition pipeline.h:64
uint32_t attributes
pipeline attributes from IPC extension msg/
Definition pipeline.h:67
struct pipeline * sched_next
Definition pipeline.h:80
General firmware context.
Definition sof.h:44
Task used by schedulers.
Definition task.h:56