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