Skip to content

Commit

Permalink
toml: (draft) modularise TOML configuration
Browse files Browse the repository at this point in the history
Split TOML configuration files into platform and module parts. Use
the C preprocessor to merge them back together.

Signed-off-by: Guennadi Liakhovetski <[email protected]>
  • Loading branch information
lyakh committed Nov 17, 2023
1 parent 20e7e31 commit 9eacc99
Show file tree
Hide file tree
Showing 5 changed files with 169 additions and 137 deletions.
30 changes: 30 additions & 0 deletions src/audio/copier/copier.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
[[module.entry]]
name = "COPIER"
uuid = "9BA00C83-CA12-4A83-943C-1FA2E82F9DDA"
affinity_mask = "0x1"
instance_count = "32"
domain_types = "0"
load_type = "0"
module_type = "3"
auto_start = "0"
sched_caps = [1, 0x00008000]

// # pin = [dir, type, sample rate, size, container, channel-cfg]
pin = [0, 0, 0xfeef, 0xf, 0xf, 0x45ff,
1, 0, 0xfeef, 0xf, 0xf, 0x1ff,
1, 0, 0xfeef, 0xf, 0xf, 0x1ff,
1, 0, 0xfeef, 0xf, 0xf, 0x1ff,
1, 0, 0xfeef, 0xf, 0xf, 0x1ff]

// # mod_cfg [PAR_0 PAR_1 PAR_2 PAR_3 IS_BYTES CPS IBS OBS MOD_FLAGS CPC OBLS]
mod_cfg = [ 0, 0, 0, 0, 280, 640100, 45, 60, 0, 0, 0,
1, 0, 0, 0, 280, 1106300, 192, 192, 0, 0, 0,
2, 0, 0, 0, 280, 1573000, 45, 45, 0, 0, 0,
3, 0, 0, 0, 280, 2040600, 192, 256, 0, 0, 0,
4, 0, 0, 0, 280, 2507500, 192, 256, 0, 0, 0,
5, 0, 0, 0, 280, 2999000, 192, 256, 0, 0, 0,
6, 0, 0, 0, 280, 3501000, 45, 60, 0, 0, 0,
7, 0, 0, 0, 280, 3927000, 192, 256, 0, 0, 0,
8, 0, 0, 0, 280, 4424000, 192, 256, 0, 0, 0,
9, 0, 0, 0, 280, 4941000, 192, 256, 0, 0, 0]
index = __COUNTER__
63 changes: 63 additions & 0 deletions src/audio/mixin_mixout/mixin_mixout.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
[[module.entry]]
name = "MIXIN"
uuid = "39656EB2-3B71-4049-8D3F-F92CD5C43C09"
affinity_mask = "0x1"
instance_count = "30"
domain_types = "0"
load_type = "0"
module_type = "1"
auto_start = "0"
sched_caps = [1, 0x00008000]

// # pin = [dir, type, sample rate, size, container, channel-cfg]
pin = [0, 0, 0xfeef, 0xc, 0x8, 0x45ff,
1, 0, 0xfeef, 0xc, 0x8, 0x1ff,
1, 0, 0xfeef, 0xc, 0x8, 0x1ff,
1, 0, 0xfeef, 0xc, 0x8, 0x1ff,
1, 0, 0xfeef, 0xc, 0x8, 0x1ff]

// # mod_cfg [PAR_0 PAR_1 PAR_2 PAR_3 IS_BYTES CPS IBS OBS MOD_FLAGS CPC OBLS]
mod_cfg = [ 0, 0, 0, 0, 296, 644000, 45, 60, 0, 0, 0,
1, 0, 0, 0, 296, 669900, 48, 64, 0, 0, 0,
2, 0, 0, 0, 296, 934000, 96, 128, 0, 0, 0,
3, 0, 0, 0, 296, 1137000, 96, 128, 0, 0, 0,
4, 0, 0, 0, 296, 1482000, 48, 64, 0, 0, 0,
5, 0, 0, 0, 296, 1746000, 96, 128, 0, 0, 0,
6, 0, 0, 0, 296, 2274000, 192, 256, 0, 0, 0,
7, 0, 0, 0, 296, 2700000, 48, 64, 0, 0, 0,
8, 0, 0, 0, 296, 2964000, 96, 128, 0, 0, 0,
9, 0, 0, 0, 296, 3492000, 192, 256, 0, 0, 0]
index = __COUNTER__

[[module.entry]]
name = "MIXOUT"
uuid = "3C56505A-24D7-418F-BDDC-C1F5A3AC2AE0"
affinity_mask = "0x1"
instance_count = "30"
domain_types = "0"
load_type = "0"
module_type = "2"
auto_start = "0"
sched_caps = [1, 0x00008000]

// # pin = [dir, type, sample rate, size, container, channel-cfg]
pin = [1, 0, 0xfeef, 0xc, 0x8, 0x45ff,
1, 0, 0xfeef, 0xc, 0x8, 0x1ff,
1, 0, 0xfeef, 0xc, 0x8, 0x1ff,
1, 0, 0xfeef, 0xc, 0x8, 0x1ff,
1, 0, 0xfeef, 0xc, 0x8, 0x1ff,
1, 0, 0xfeef, 0xc, 0x8, 0x1ff,
1, 0, 0xfeef, 0xc, 0x8, 0x1ff,
1, 0, 0xfeef, 0xc, 0x8, 0x1ff,
0, 0, 0xfeef, 0xc, 0x8, 0x1ff]

// # mod_cfg [PAR_0 PAR_1 PAR_2 PAR_3 IS_BYTES CPS IBS OBS MOD_FLAGS CPC OBLS]
mod_cfg = [0, 0, 0, 0, 520, 649600, 48, 64, 0, 0, 0,
1, 0, 0, 0, 520, 966300, 96, 128, 0, 0, 0,
2, 0, 0, 0, 520, 2101000, 48, 64, 0, 0, 0,
3, 0, 0, 0, 520, 2500800, 192, 256, 0, 0, 0,
4, 0, 0, 0, 520, 2616700, 192, 256, 0, 0, 0,
5, 0, 0, 0, 520, 2964500, 192, 256, 0, 0, 0,
6, 0, 0, 0, 520, 4202000, 96, 128, 0, 0, 0,
7, 0, 0, 0, 520, 3730000, 192, 256, 0, 0, 0]
index = __COUNTER__
Loading

0 comments on commit 9eacc99

Please sign in to comment.