Skip to content

Commit 7bafdad

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 7bafdad

File tree

2 files changed

+222
-1
lines changed

2 files changed

+222
-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: 221 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,221 @@
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 = [dir, type, sample rate, size, container, channel-cfg]
28+
pin = [0, 0, 0xfeef, 0xf, 0xf, 0x45ff,
29+
1, 0, 0xfeef, 0xf, 0xf, 0x1ff]
30+
31+
# mod_cfg [PAR_0 PAR_1 PAR_2 PAR_3 IS_BYTES CPS IBS OBS MOD_FLAGS CPC OBLS]
32+
mod_cfg = [0, 0, 0, 0, 416, 914000, 48, 64, 0, 0, 0,
33+
1, 0, 0, 0, 416, 1321600, 192, 256, 0, 0, 0,
34+
2, 0, 0, 0, 416, 1786000, 192, 256, 0, 0, 0,
35+
3, 0, 0, 0, 416, 2333000, 48, 64, 0, 0, 0,
36+
4, 0, 0, 0, 416, 2910000, 192, 256, 0, 0, 0,
37+
5, 0, 0, 0, 416, 3441000, 192, 256, 0, 0, 0,
38+
6, 0, 0, 0, 416, 4265000, 192, 256, 0, 0, 0]
39+
40+
Module entry definition
41+
***********************
42+
| **name**: name of the module
43+
| **uuid**: uuid of the module
44+
| **affinity_mask**: restriction on which core a module can run, with the actual determination done on a per-instance basis.
45+
| bit N is for core N, 0x3 means module instance can run on core 0 and 1. Use 0xffff to ignore this restriction.
46+
| **instance_count**: max module instance count can be active in fw
47+
| **domain_types**: two schedule domains: domain ll - low latency (0), and dp - data processing (1)
48+
| **load_type**: build-in module (BIT(0)), loadable (BIT(1)) or both BIT(0) | BIT(1)
49+
| **module_type**: defined in the following enum module_type
50+
51+
.. code-block:: bash
52+
53+
enum module_type {
54+
basefw = 0,
55+
mixin = 1,
56+
mixout = 2,
57+
copier = 3,
58+
peakvol = 4,
59+
updwmix = 5,
60+
mux = 6,
61+
src = 7,
62+
wov = 8,
63+
fx = 9,
64+
aec = 10,
65+
kpb = 11,
66+
micselect = 12,
67+
fxf = 13,
68+
audclass = 14,
69+
fakecopier = 15,
70+
iodriver = 16,
71+
whm = 17,
72+
gdbstub = 18,
73+
sensing = 19,
74+
max = 20,
75+
invalid = emax
76+
};
77+
78+
| **auto_start**: Indicates whether a instance of the module should be created at the base fw startup
79+
| **init_config**: 0 (only basic config in payload) or 1 (basic config with extension that contains pin format).
80+
| **pin**: is array of data used to define the capability of input & output
81+
82+
.. code-block:: bash
83+
84+
pin = [dir, type, sample rates, sample size, sample container size, channel config]
85+
For example, gain module pin = [0, 0, 0xfeef, 0xf, 0xf, 0x45ff], it supports input pcm
86+
supported sample rate [0xxfeef]: 8000, 11500, 12000, 16000, 22050, 24000, 32000, 44100,
87+
48000, 64000, 88200, 96000, 176400, 19200,
88+
supported sample size [0xf]: 8bits, 16bits, 24bits, 32bits.
89+
supported sample container size [0xa]: 16bits and 32bits
90+
supported channel config [0x45ff]: mono, dual mono, stereo, 2_1, 3_0, quad, surround, 3_1,
91+
5_0_surround, 7_1
92+
93+
enum dir {
94+
input = 0,
95+
output,
96+
}
97+
98+
enum type {
99+
pcm = 0,
100+
mp3,
101+
aac,
102+
};
103+
104+
struct sample_rates {
105+
uint32_t freq_8000 : 1;
106+
uint32_t freq_11500 : 1;
107+
uint32_t freq_12000 : 1;
108+
uint32_t freq_16000 : 1;
109+
uint32_t freq_18900 : 1;
110+
uint32_t freq_22050 : 1;
111+
uint32_t freq_24000 : 1;
112+
uint32_t freq_32000 : 1;
113+
uint32_t freq_37800 : 1;
114+
uint32_t freq_44100 : 1;
115+
uint32_t freq_48000 : 1;
116+
uint32_t freq_64000 : 1;
117+
uint32_t freq_88200 : 1;
118+
uint32_t freq_96000 : 1;
119+
uint32_t freq_176400 : 1;
120+
uint32_t freq_192000 : 1;
121+
uint32_t reserved_ : 16;
122+
};
123+
124+
struct sample_sizes {
125+
uint16_t bits_8 : 1;
126+
uint16_t bits_16 : 1;
127+
uint16_t bits_24 : 1;
128+
uint16_t bits_32 : 1;
129+
uint16_t bits_64 : 1;
130+
uint16_t reserved_ : 11;
131+
};
132+
133+
struct sample_containers {
134+
uint16_t bits_8 : 1;
135+
uint16_t bits_16 : 1;
136+
uint16_t bits_32 : 1;
137+
uint16_t bits_64 : 1;
138+
uint16_t reserved_ : 12;
139+
};
140+
141+
struct channel_configurations {
142+
// FRONT_CENTER
143+
uint32_t channel_mono : 1;
144+
145+
// FRONT_LEFT | BACK_LEFT
146+
uint32_t channel_dual_mono : 1;
147+
148+
// FRONT_LEFT | FRONT_RIGHT
149+
uint32_t channel_stereo : 1;
150+
151+
// FRONT_LEFT | FRONT_RIGHT | LOW_FREQUENCY
152+
uint32_t channel_2_1 : 1;
153+
154+
// FRONT_LEFT | FRONT_RIGHT | FRONT_CENTER
155+
uint32_t channel_3_0 : 1;
156+
157+
// FRONT_LEFT | FRONT_RIGHT | BACK_LEFT | BACK_RIGHT
158+
uint32_t channel_quad : 1;
159+
160+
// FRONT_LEFT | FRONT_RIGHT | FRONT_CENTER | BACK_CENTER
161+
uint32_t channel_surround : 1;
162+
163+
// FRONT_LEFT | FRONT_RIGHT | FRONT_CENTER | LOW_FREQUENCY
164+
uint32_t channel_3_1 : 1;
165+
166+
// FRONT_LEFT | FRONT_RIGHT | FRONT_CENTER | BACK_LEFT | BACK_RIGHT
167+
uint32_t channel_5_0 : 1;
168+
169+
// FRONT_LEFT | FRONT_RIGHT | FRONT_CENTER | SIDE_LEFT | SIDE_RIGHT
170+
uint32_t channel_5_0_surround : 1;
171+
172+
// FRONT_LEFT | FRONT_RIGHT | FRONT_CENTER | LOW_FREQUENCY | BACK_LEFT | BACK_RIGHT
173+
uint32_t channel_5_1 : 1;
174+
175+
// FRONT_LEFT | FRONT_RIGHT | FRONT_CENTER | LOW_FREQUENCY | SIDE_LEFT | SIDE_RIGHT
176+
uint32_t channel_5_1_surround : 1;
177+
178+
// FRONT_LEFT | FRONT_RIGHT | FRONT_CENTER | BACK_LEFT | BACK_RIGHT | FRONT_LEFT_OF_CENTER | FRONT_RIGHT_OF_CENTER
179+
uint32_t channel_7_0 : 1;
180+
181+
// FRONT_LEFT | FRONT_RIGHT | FRONT_CENTER | BACK_LEFT | BACK_RIGHT | SIDE_LEFT | SIDE_RIGHT
182+
uint32_t channel_7_0_surround : 1;
183+
184+
// FRONT_LEFT | FRONT_RIGHT | FRONT_CENTER | LOW_FREQUENCY | BACK_LEFT | BACK_RIGHT | FRONT_LEFT_OF_CENTER | FRONT_RIGHT_OF_CENTER
185+
uint32_t channel_7_1 : 1;
186+
187+
// FRONT_LEFT | FRONT_RIGHT | FRONT_CENTER | LOW_FREQUENCY | BACK_LEFT | BACK_RIGHT | SIDE_LEFT | SIDE_RIGHT
188+
uint32_t channel_7_1_surround : 1;
189+
190+
uint32_t reserved_ : 16;
191+
};
192+
193+
| **mod_cfg**: It is generated by fw for each different stream format in real case, such as 48khz, 16bit, 4channel. Use should copy
194+
| these config to module entry. If there is no mod_cfg built by fw, the mod_cfg can be skipped. The definition is:
195+
196+
.. code-block:: bash
197+
198+
struct ModuleConfig {
199+
uint32_t par[4];
200+
uint32_t is_bytes;
201+
uint32_t cps;
202+
uint32_t ibs;
203+
uint32_t obs;
204+
uint32_t module_flags;
205+
uint32_t cpc;
206+
uint32_t obls;
207+
};
208+
209+
par: Configuration lookup parameters used by the host driver
210+
is_byte: Number of bytes required by the module instance for dynamic allocation
211+
cps: Number of DSP cycles consumed by the module instance to process one second of data
212+
ibs: input buffer size in byte
213+
obs: input buffer size in byte
214+
module_flags: Reserved for future use
215+
cpc: Number of DSP cycles required to process one frame of data (1ms data)
216+
obls: Output block size (reserved for future use)
217+
218+
Build new module entry
219+
**********************
220+
221+
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)