Skip to content

Commit 485dbdc

Browse files
committed
rimage: add ipc4 extended module config introduction
This is a introduction of ipc4 extended module config and how to add this information in the xxx.toml for template. Signed-off-by: Rander Wang <[email protected]>
1 parent 0960d7c commit 485dbdc

File tree

2 files changed

+227
-1
lines changed

2 files changed

+227
-1
lines changed

developer_guides/rimage/index.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ For more details see:
1919
:maxdepth: 1
2020

2121
extended_manifest
22-
22+
ipc4_extended_module_config
2323

2424

2525
Build flow
Lines changed: 226 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,226 @@
1+
.. _ipc4_extended_module_config:
2+
3+
Ipc4_extended_module_config
4+
###########################
5+
6+
The ipc4 extended module config is stored in the extended manifest structure of the
7+
output binary file. This config includes many module attributes such as name, uuid
8+
or capabilities. The host driver will rely on the extended module config for IPC
9+
messages to the DSP
10+
11+
Rimage builds extended module config based on module setting in config/xxx.toml.
12+
The following setting is for gain module.
13+
14+
.. code-block:: bash
15+
16+
[[module.entry]]
17+
name = "GAIN"
18+
uuid = "61BCA9A8-18D0-4A18-8E7B-2639219804B7"
19+
affinity_mask = "0x1"
20+
instance_count = "40"
21+
domain_types = "0"
22+
load_type = "0"
23+
module_type = "5"
24+
auto_start = "0"
25+
init_config = "0"
26+
27+
# pin settings
28+
pin in
29+
stream_type pcm
30+
sample_rates r8000 r11025 r12000 r16000 r22050 r24000 r32000 r44100 r48000 r64000 r88200 r96000 r176400 r192000
31+
sample_sizes s8 s16 s24 s32
32+
sample_containers c8 c16 c24 c32
33+
channel_cfg ch_mono ch_dual_mono ch_stereo ch_2_1 ch_3_0 ch_3_1 ch_quad ch_surround ch_5_0 ch_5_1 ch_7_1
34+
35+
pin out
36+
stream_type pcm
37+
sample_rates r8000 r11025 r12000 r16000 r22050 r24000 r32000 r44100 r48000 r64000 r88200 r96000 r176400 r192000
38+
sample_sizes s8 s16 s24 s32
39+
sample_containers c8 c16 c24 c32
40+
channel_cfg ch_mono ch_dual_mono ch_stereo ch_2_1 ch_3_0 ch_3_1 ch_quad ch_surround ch_5_0 ch_5_1 ch_7_1
41+
42+
# mod_cfg [PAR_0 PAR_1 PAR_2 PAR_3 IS_BYTES CPS IBS OBS MOD_FLAGS CPC OBLS]
43+
mod_cfg = [0, 0, 0, 0, 416, 914000, 48, 64, 0, 0, 0,
44+
1, 0, 0, 0, 416, 1321600, 192, 256, 0, 0, 0,
45+
2, 0, 0, 0, 416, 1786000, 192, 256, 0, 0, 0,
46+
3, 0, 0, 0, 416, 2333000, 48, 64, 0, 0, 0,
47+
4, 0, 0, 0, 416, 2910000, 192, 256, 0, 0, 0,
48+
5, 0, 0, 0, 416, 3441000, 192, 256, 0, 0, 0,
49+
6, 0, 0, 0, 416, 4265000, 192, 256, 0, 0, 0]
50+
51+
Module entry definition
52+
***********************
53+
| **name**: name of the module
54+
| **uuid**: uuid of the module
55+
| **affinity_mask**: restriction on which core a module can run, with the actual determination done on a per-instance basis.
56+
| bit N is for core N, 0x3 means module instance can run on core 0 and 1. Use 0xffff to ignore this restriction.
57+
| **instance_count**: max module instance count can be active in fw
58+
| **domain_types**: two schedule domains: domain ll - low latency (0), and dp - data processing (1), please check
59+
| https://thesofproject.github.io/latest/architectures/firmware/sof-zephyr/mpp_layer/mpp_scheduling.html
60+
| **load_type**: build-in module (BIT(0)), loadable (BIT(1)) or both BIT(0) | BIT(1)
61+
| **module_type**: defined in the following enum module_type
62+
63+
.. code-block:: bash
64+
65+
enum module_type {
66+
basefw = 0,
67+
mixin = 1,
68+
mixout = 2,
69+
copier = 3,
70+
peakvol = 4,
71+
updwmix = 5,
72+
mux = 6,
73+
src = 7,
74+
wov = 8,
75+
fx = 9,
76+
aec = 10,
77+
kpb = 11,
78+
micselect = 12,
79+
fxf = 13,
80+
audclass = 14,
81+
fakecopier = 15,
82+
iodriver = 16,
83+
whm = 17,
84+
gdbstub = 18,
85+
sensing = 19,
86+
max = 20,
87+
invalid = emax
88+
};
89+
90+
| **auto_start**: Indicates whether a instance of the module should be created at the base fw startup
91+
| **init_config**: 0 (only basic config in payload) or 1 (basic config with extension that contains pin format).
92+
| **pin**: is array of data used to define the capability of input & output. All supported value are defined in the following enum
93+
94+
.. code-block:: bash
95+
96+
pin in
97+
stream_type pcm
98+
sample_rates r8000 r11025 r12000 r16000 r22050 r24000 r32000 r44100 r48000 r64000 r88200 r96000 r176400 r192000
99+
sample_sizes s8 s16 s24 s32
100+
sample_containers c8 c16 c24 c32
101+
channel_cfg ch_mono ch_dual_mono ch_stereo ch_2_1 ch_3_0 ch_3_1 ch_quad ch_surround ch_5_0 ch_5_1 ch_7_1
102+
103+
enum pin {
104+
in = 0, //input
105+
out, // output
106+
}
107+
108+
enum stream_type {
109+
pcm = 0,
110+
mp3,
111+
aac,
112+
};
113+
114+
enum sample_rates {
115+
r8000,
116+
r11500,
117+
r12000,
118+
r16000,
119+
r18900,
120+
r22050,
121+
r24000,
122+
r32000,
123+
r37800,
124+
r44100,
125+
r48000,
126+
r64000,
127+
r88200,
128+
r96000,
129+
r176400,
130+
r192000
131+
};
132+
133+
enum sample_sizes {
134+
s8,
135+
s16,
136+
s24,
137+
s32,
138+
s64,
139+
};
140+
141+
enum sample_containers {
142+
c8 ,
143+
c16,
144+
c32,
145+
c64,
146+
};
147+
148+
enum channel_configurations {
149+
// FRONT_CENTER
150+
channel_mono,
151+
152+
// FRONT_LEFT | BACK_LEFT
153+
channel_dual_mono,
154+
155+
// FRONT_LEFT | FRONT_RIGHT
156+
channel_stereo,
157+
158+
// FRONT_LEFT | FRONT_RIGHT | LOW_FREQUENCY
159+
channel_2_1,
160+
161+
// FRONT_LEFT | FRONT_RIGHT | FRONT_CENTER
162+
channel_3_0,
163+
164+
// FRONT_LEFT | FRONT_RIGHT | BACK_LEFT | BACK_RIGHT
165+
channel_quad,
166+
167+
// FRONT_LEFT | FRONT_RIGHT | FRONT_CENTER | BACK_CENTER
168+
channel_surround,
169+
170+
// FRONT_LEFT | FRONT_RIGHT | FRONT_CENTER | LOW_FREQUENCY
171+
channel_3_1,
172+
173+
// FRONT_LEFT | FRONT_RIGHT | FRONT_CENTER | BACK_LEFT | BACK_RIGHT
174+
channel_5_0,
175+
176+
// FRONT_LEFT | FRONT_RIGHT | FRONT_CENTER | SIDE_LEFT | SIDE_RIGHT
177+
channel_5_0_surround,
178+
179+
// FRONT_LEFT | FRONT_RIGHT | FRONT_CENTER | LOW_FREQUENCY | BACK_LEFT | BACK_RIGHT
180+
channel_5_1,
181+
182+
// FRONT_LEFT | FRONT_RIGHT | FRONT_CENTER | LOW_FREQUENCY | SIDE_LEFT | SIDE_RIGHT
183+
channel_5_1_surround,
184+
185+
// FRONT_LEFT | FRONT_RIGHT | FRONT_CENTER | BACK_LEFT | BACK_RIGHT | FRONT_LEFT_OF_CENTER | FRONT_RIGHT_OF_CENTER
186+
channel_7_0,
187+
188+
// FRONT_LEFT | FRONT_RIGHT | FRONT_CENTER | BACK_LEFT | BACK_RIGHT | SIDE_LEFT | SIDE_RIGHT
189+
channel_7_0_surround,
190+
191+
// FRONT_LEFT | FRONT_RIGHT | FRONT_CENTER | LOW_FREQUENCY | BACK_LEFT | BACK_RIGHT | FRONT_LEFT_OF_CENTER | FRONT_RIGHT_OF_CENTER
192+
channel_7_1,
193+
194+
// FRONT_LEFT | FRONT_RIGHT | FRONT_CENTER | LOW_FREQUENCY | BACK_LEFT | BACK_RIGHT | SIDE_LEFT | SIDE_RIGHT
195+
channel_7_1_surround,
196+
};
197+
198+
| **mod_cfg**: It is generated by fw for each different stream format in real case, such as 48khz, 16bit, 4channel. Use should copy
199+
| these config to module entry. If there is no mod_cfg built by fw, the mod_cfg can be skipped. The definition is:
200+
201+
.. code-block:: bash
202+
203+
struct ModuleConfig {
204+
uint32_t par[4];
205+
uint32_t is_bytes;
206+
uint32_t cps;
207+
uint32_t ibs;
208+
uint32_t obs;
209+
uint32_t module_flags;
210+
uint32_t cpc;
211+
uint32_t obls;
212+
};
213+
214+
par: Configuration lookup parameters used by the host driver
215+
is_byte: Number of bytes required by the module instance for dynamic allocation
216+
cps: Number of DSP cycles consumed by the module instance to process one second of data
217+
ibs: input buffer size in byte
218+
obs: input buffer size in byte
219+
module_flags: Reserved for future use
220+
cpc: Number of DSP cycles required to process one frame of data (1ms data)
221+
obls: Output block size (reserved for future use)
222+
223+
Build new module entry
224+
**********************
225+
226+
All these module setting are defined in module_binmaps and mod_cfgs files in FW/portable/platform/platform_name/ if the module is a existing one in reference fw and just do simple conversion and copy it to module entry. If the module is a totally new one, everything needs to build according to above definitions.

0 commit comments

Comments
 (0)