Sound Open Firmware
Loading...
Searching...
No Matches
topology.h
Go to the documentation of this file.
1/* SPDX-License-Identifier: BSD-3-Clause
2 *
3 * Copyright(c) 2018 Intel Corporation. All rights reserved.
4 *
5 * Author: Liam Girdwood <liam.r.girdwood@linux.intel.com>
6 * Keyon Jie <yang.jie@linux.intel.com>
7 */
8
15
16#ifndef __IPC_TOPOLOGY_H__
17#define __IPC_TOPOLOGY_H__
18
19#include <ipc/header.h>
20#include <stdint.h>
21
22/*
23 * Component
24 */
25
26/* types of component */
55
56/* XRUN action for component */
57#define SOF_XRUN_STOP 1
58#define SOF_XRUN_UNDER_ZERO 2
59#define SOF_XRUN_OVER_NULL 4
60
61/* create new generic component - SOF_IPC_TPLG_COMP_NEW */
64 uint32_t id;
65 /* holds an "enum sof_comp_type" value. Fixed-size because of #9378 */
66 uint32_t type;
67 uint32_t pipeline_id;
68 uint32_t core;
69
72} __attribute__((packed, aligned(4)));
73
74/*
75 * Component Buffers
76 */
77
78/*
79 * SOF memory capabilities, add new ones at the end
80 */
81#define SOF_MEM_CAPS_RAM BIT(0)
82#define SOF_MEM_CAPS_ROM BIT(1)
83#define SOF_MEM_CAPS_EXT BIT(2)
84#define SOF_MEM_CAPS_LP BIT(3)
85#define SOF_MEM_CAPS_HP BIT(4)
86#define SOF_MEM_CAPS_DMA BIT(5)
87#define SOF_MEM_CAPS_CACHE BIT(6)
88#define SOF_MEM_CAPS_EXEC BIT(7)
89#define SOF_MEM_CAPS_L3 BIT(8)
90/* Don't forget to update when adding a new bit to the ABI. */
91#define SOF_MEM_CAPS_LOWEST_INVALID BIT(9)
92
93/*
94 * overrun will cause ring buffer overwrite, instead of XRUN.
95 */
96#define SOF_BUF_OVERRUN_PERMITTED BIT(0)
97
98/*
99 * underrun will cause readback of 0s, instead of XRUN.
100 */
101#define SOF_BUF_UNDERRUN_PERMITTED BIT(1)
102
103/* the UUID size in bytes, shared between FW and host */
104#define SOF_UUID_SIZE 16
105
106/* create new component buffer - SOF_IPC_TPLG_BUFFER_NEW */
109 uint32_t size;
110 uint32_t caps;
111 uint32_t flags;
112 uint32_t reserved;
113} __attribute__((packed, aligned(4)));
114
115/* generic component config data - must always be after struct sof_ipc_comp */
118 uint32_t periods_sink;
120 uint32_t reserved1;
121 uint32_t frame_fmt;
122 uint32_t xrun_action;
123
124 /* reserved for future use */
125 uint32_t reserved[2];
126} __attribute__((packed, aligned(4)));
127
128/* generic host component */
132 uint32_t direction;
133 uint32_t no_irq;
134 uint32_t dmac_config;
135} __attribute__((packed, aligned(4)));
136
137/* generic DAI component */
141 uint32_t direction;
142 uint32_t dai_index;
143 uint32_t type;
144 uint32_t reserved;
145} __attribute__((packed, aligned(4)));
146
147/* generic mixer component */
151} __attribute__((packed, aligned(4)));
152
153/* volume ramping types */
162
163/* generic volume component */
167 uint32_t channels;
168 uint32_t min_value;
169 uint32_t max_value;
170 uint32_t ramp;
171 uint32_t initial_ramp;
172} __attribute__((packed, aligned(4)));
173
174/* generic SRC component */
178 /* either source or sink rate must be non zero */
179 uint32_t source_rate;
180 uint32_t sink_rate;
181 uint32_t rate_mask;
182} __attribute__((packed, aligned(4)));
183
184/* generic ASRC component */
188 /* either source or sink rate must be non zero */
189 uint32_t source_rate;
192 uint32_t sink_rate;
198 uint32_t operation_mode;
205
206 /* reserved for future use */
207 uint32_t reserved[4];
208} __attribute__((packed, aligned(4)));
209
210/* generic MUX component */
214} __attribute__((packed, aligned(4)));
215
216/* generic tone generator component */
220 int32_t sample_rate;
221 int32_t frequency;
222 int32_t amplitude;
223 int32_t freq_mult;
224 int32_t ampl_mult;
225 int32_t length;
226 int32_t period;
227 int32_t repeats;
228 int32_t ramp_step;
229} __attribute__((packed, aligned(4)));
230
231/* generic "effect", "codec" or proprietary processing component */
235 uint32_t size;
236 uint32_t type;
237
238 /* reserved for future use */
239 uint32_t reserved[7];
240
241 unsigned char data[];
242} __attribute__((packed, aligned(4)));
243
244/* IPC file component used by testbench only */
246 /* These need to be the same as in above sof_ipc_comp_process */
249 uint32_t size;
250 uint32_t type;
251
252 /* reserved for future use */
253 uint32_t reserved[7];
254
255 /* These are additional parameters for file */
256 uint32_t rate;
257 uint32_t channels;
258 char *fn;
259 uint32_t mode;
260 uint32_t frame_fmt;
261 uint32_t direction;
262} __attribute__((packed, aligned(4)));
263
264/* frees components, buffers and pipelines
265 * SOF_IPC_TPLG_COMP_FREE, SOF_IPC_TPLG_PIPE_FREE, SOF_IPC_TPLG_BUFFER_FREE
266 */
269 uint32_t id;
270} __attribute__((packed, aligned(4)));
271
274 uint32_t id;
275 uint32_t offset;
276} __attribute__((packed, aligned(4)));
277
278/*
279 * Pipeline
280 */
281
287
288/* new pipeline - SOF_IPC_TPLG_PIPE_NEW */
291 uint32_t comp_id;
292 uint32_t pipeline_id;
293 uint32_t sched_id;
294 uint32_t core;
295 uint32_t period;
296 uint32_t priority;
297 uint32_t period_mips;
300 uint32_t time_domain;
301} __attribute__((packed, aligned(4)));
302
303/* pipeline construction complete - SOF_IPC_TPLG_PIPE_COMPLETE */
306 uint32_t comp_id;
307} __attribute__((packed, aligned(4)));
308
311 uint32_t comp_id;
312} __attribute__((packed, aligned(4)));
313
314/* connect two components in pipeline - SOF_IPC_TPLG_COMP_CONNECT */
317 uint32_t source_id;
318 uint32_t sink_id;
319} __attribute__((packed, aligned(4)));
320
321/* extended data struct for UUID components */
324} __attribute__((packed, aligned(4)));
325
326#endif /* __IPC_TOPOLOGY_H__ */
IPC command header.
sof_volume_ramp
Definition topology.h:154
@ SOF_VOLUME_WINDOWS_NO_FADE
Definition topology.h:160
@ SOF_VOLUME_LOG
Definition topology.h:156
@ SOF_VOLUME_LOG_ZC
Definition topology.h:158
@ SOF_VOLUME_LINEAR
Definition topology.h:155
@ SOF_VOLUME_LINEAR_ZC
Definition topology.h:157
@ SOF_VOLUME_WINDOWS_FADE
Definition topology.h:159
sof_ipc_pipe_sched_time_domain
Types of pipeline scheduling time domains.
Definition topology.h:283
@ SOF_TIME_DOMAIN_DMA
DMA interrupt.
Definition topology.h:284
@ SOF_TIME_DOMAIN_TIMER
Timer interrupt.
Definition topology.h:285
sof_comp_type
Definition topology.h:27
@ SOF_COMP_FILEWRITE
host test based file IO
Definition topology.h:53
@ SOF_COMP_SMART_AMP
smart amplifier component
Definition topology.h:49
@ SOF_COMP_DAI
Definition topology.h:30
@ SOF_COMP_DEPRECATED0
Definition topology.h:37
@ SOF_COMP_ASRC
Asynchronous sample rate converter.
Definition topology.h:47
@ SOF_COMP_VOLUME
Definition topology.h:33
@ SOF_COMP_KPB
Definition topology.h:44
@ SOF_COMP_SG_HOST
scatter gather variant
Definition topology.h:31
@ SOF_COMP_MUX
Definition topology.h:35
@ SOF_COMP_TONE
Definition topology.h:38
@ SOF_COMP_EQ_FIR
Definition topology.h:42
@ SOF_COMP_SELECTOR
channel selector component
Definition topology.h:45
@ SOF_COMP_MIXER
Definition topology.h:34
@ SOF_COMP_DEPRECATED1
Definition topology.h:39
@ SOF_COMP_KEYWORD_DETECT
Definition topology.h:43
@ SOF_COMP_FILEREAD
host test based file IO
Definition topology.h:52
@ SOF_COMP_BUFFER
Definition topology.h:40
@ SOF_COMP_MODULE_ADAPTER
module adapter
Definition topology.h:50
@ SOF_COMP_SG_DAI
scatter gather variant
Definition topology.h:32
@ SOF_COMP_DEMUX
Definition topology.h:46
@ SOF_COMP_SRC
Definition topology.h:36
@ SOF_COMP_HOST
Definition topology.h:29
@ SOF_COMP_EQ_IIR
Definition topology.h:41
@ SOF_COMP_DCBLOCK
Definition topology.h:48
@ SOF_COMP_NONE
Definition topology.h:28
#define SOF_UUID_SIZE
Definition topology.h:104
Definition topology.h:107
struct sof_ipc_comp comp
Definition topology.h:108
uint32_t reserved
reserved for future use
Definition topology.h:112
uint32_t caps
SOF_MEM_CAPS_.
Definition topology.h:110
uint32_t size
buffer size in bytes
Definition topology.h:109
uint32_t flags
SOF_BUF_ flags defined above.
Definition topology.h:111
Command Header - Header for all IPC commands.
Definition header.h:357
Definition topology.h:185
struct sof_ipc_comp comp
Definition topology.h:186
uint32_t operation_mode
push 0, pull 1, In push mode the
Definition topology.h:198
uint32_t source_rate
Define fixed source rate or.
Definition topology.h:189
struct sof_ipc_comp_config config
Definition topology.h:187
uint32_t asynchronous_mode
synchronous 0, asynchronous 1
Definition topology.h:195
uint32_t sink_rate
Define fixed sink rate or.
Definition topology.h:192
uint32_t reserved[4]
Definition topology.h:207
Definition topology.h:116
uint32_t frame_fmt
SOF_IPC_FRAME_.
Definition topology.h:121
uint32_t periods_sink
0 means variable
Definition topology.h:118
uint32_t reserved1
reserved
Definition topology.h:120
struct sof_ipc_cmd_hdr hdr
Definition topology.h:117
uint32_t periods_source
0 means variable
Definition topology.h:119
uint32_t reserved[2]
Definition topology.h:125
uint32_t xrun_action
Definition topology.h:122
Definition topology.h:138
uint32_t dai_index
index of this type dai
Definition topology.h:142
struct sof_ipc_comp comp
Definition topology.h:139
uint32_t type
DAI type - SOF_DAI_.
Definition topology.h:143
uint32_t reserved
reserved
Definition topology.h:144
uint32_t direction
SOF_IPC_STREAM_.
Definition topology.h:141
struct sof_ipc_comp_config config
Definition topology.h:140
Definition topology.h:322
uint8_t uuid[SOF_UUID_SIZE]
Definition topology.h:323
Definition topology.h:245
uint32_t rate
Definition topology.h:256
char * fn
Definition topology.h:258
uint32_t mode
Definition topology.h:259
uint32_t frame_fmt
Definition topology.h:260
struct sof_ipc_comp_config config
Definition topology.h:248
uint32_t direction
SOF_IPC_STREAM_.
Definition topology.h:261
uint32_t channels
Definition topology.h:257
uint32_t type
sof_ipc_process_type
Definition topology.h:250
struct sof_ipc_comp comp
Definition topology.h:247
uint32_t reserved[7]
Definition topology.h:253
uint32_t size
size of bespoke data section in bytes
Definition topology.h:249
Definition topology.h:129
struct sof_ipc_comp_config config
Definition topology.h:131
uint32_t direction
SOF_IPC_STREAM_.
Definition topology.h:132
uint32_t no_irq
don't send periodic IRQ to host/DSP
Definition topology.h:133
uint32_t dmac_config
DMA engine specific.
Definition topology.h:134
struct sof_ipc_comp comp
Definition topology.h:130
Definition topology.h:148
struct sof_ipc_comp comp
Definition topology.h:149
struct sof_ipc_comp_config config
Definition topology.h:150
Definition topology.h:211
struct sof_ipc_comp_config config
Definition topology.h:213
struct sof_ipc_comp comp
Definition topology.h:212
Definition topology.h:232
struct sof_ipc_comp comp
Definition topology.h:233
struct sof_ipc_comp_config config
Definition topology.h:234
uint32_t reserved[7]
Definition topology.h:239
unsigned char data[]
Definition topology.h:241
uint32_t type
sof_ipc_process_type
Definition topology.h:236
uint32_t size
size of bespoke data section in bytes
Definition topology.h:235
Definition topology.h:272
uint32_t offset
Definition topology.h:275
struct sof_ipc_reply rhdr
Definition topology.h:273
uint32_t id
Definition topology.h:274
Definition topology.h:175
uint32_t source_rate
source rate or 0 for variable
Definition topology.h:179
struct sof_ipc_comp comp
Definition topology.h:176
uint32_t rate_mask
SOF_RATE_ supported rates.
Definition topology.h:181
struct sof_ipc_comp_config config
Definition topology.h:177
uint32_t sink_rate
sink rate or 0 for variable
Definition topology.h:180
Definition topology.h:217
int32_t sample_rate
Definition topology.h:220
struct sof_ipc_comp_config config
Definition topology.h:219
int32_t period
Definition topology.h:226
int32_t freq_mult
Definition topology.h:223
int32_t ampl_mult
Definition topology.h:224
int32_t frequency
Definition topology.h:221
int32_t amplitude
Definition topology.h:222
int32_t repeats
Definition topology.h:227
int32_t length
Definition topology.h:225
int32_t ramp_step
Definition topology.h:228
struct sof_ipc_comp comp
Definition topology.h:218
Definition topology.h:164
uint32_t initial_ramp
ramp space in ms
Definition topology.h:171
uint32_t min_value
Definition topology.h:168
uint32_t channels
Definition topology.h:167
struct sof_ipc_comp_config config
Definition topology.h:166
uint32_t ramp
SOF_VOLUME_.
Definition topology.h:170
uint32_t max_value
Definition topology.h:169
struct sof_ipc_comp comp
Definition topology.h:165
Definition topology.h:62
uint32_t pipeline_id
Definition topology.h:67
struct sof_ipc_cmd_hdr hdr
Definition topology.h:63
uint32_t id
Definition topology.h:64
uint32_t ext_data_length
extended data length, 0 if no extended data (ABI3.17)
Definition topology.h:71
uint32_t type
Definition topology.h:66
uint32_t core
Definition topology.h:68
Definition topology.h:267
uint32_t id
Definition topology.h:269
struct sof_ipc_cmd_hdr hdr
Definition topology.h:268
Definition topology.h:315
uint32_t source_id
Definition topology.h:317
struct sof_ipc_cmd_hdr hdr
Definition topology.h:316
uint32_t sink_id
Definition topology.h:318
Definition topology.h:309
uint32_t comp_id
Definition topology.h:311
struct sof_ipc_cmd_hdr hdr
Definition topology.h:310
Definition topology.h:289
uint32_t core
core we run on
Definition topology.h:294
struct sof_ipc_cmd_hdr hdr
Definition topology.h:290
uint32_t frames_per_sched
output frames of pipeline, 0 is variable
Definition topology.h:298
uint32_t pipeline_id
pipeline id
Definition topology.h:292
uint32_t period_mips
worst case instruction count per period
Definition topology.h:297
uint32_t time_domain
scheduling time domain
Definition topology.h:300
uint32_t sched_id
Scheduling component id.
Definition topology.h:293
uint32_t xrun_limit_usecs
report xruns greater than limit
Definition topology.h:299
uint32_t priority
priority level 0 (low) to 10 (max)
Definition topology.h:296
uint32_t comp_id
component id for pipeline
Definition topology.h:291
uint32_t period
execution period in us
Definition topology.h:295
Definition topology.h:304
uint32_t comp_id
Definition topology.h:306
struct sof_ipc_cmd_hdr hdr
Definition topology.h:305
Generic reply message.
Definition header.h:366