Skip to content

Commit ffbf9c2

Browse files
authored
Merge pull request #27 from nashif/cache_api
2 parents ac71254 + 7e8eec3 commit ffbf9c2

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+636
-590
lines changed

scripts/xtensa-build-zephyr.py

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,15 @@ def execute_command(*run_args, **run_kwargs):
270270
cwd = run_kwargs.get('cwd')
271271
print_cwd = f"In dir: {cwd}" if cwd else f"in current dir: {os.getcwd()}"
272272
print_args = shlex.join(command_args)
273-
print(f"{print_cwd}; running command: {print_args}", flush=True)
273+
output = f"{print_cwd}; running command:\n {print_args}"
274+
env_arg = run_kwargs.get('env')
275+
env_change = set(env_arg.items()) - set(os.environ.items()) if env_arg else None
276+
if env_change:
277+
output += "\n... with extra/modified environment:"
278+
for k_v in env_change:
279+
output += f"\n{k_v[0]}={k_v[1]}"
280+
print(output, flush=True)
281+
274282

275283
if run_kwargs.get('check') is None:
276284
run_kwargs['check'] = True
@@ -568,8 +576,6 @@ def build_platforms():
568576
TOOLCHAIN_VER = platform_dict["XTENSA_TOOLS_VERSION"]
569577
XTENSA_CORE = platform_dict["XTENSA_CORE"]
570578
platf_build_environ["TOOLCHAIN_VER"] = TOOLCHAIN_VER
571-
print(f"XTENSA_TOOLCHAIN_PATH={XTENSA_TOOLCHAIN_PATH}")
572-
print(f"TOOLCHAIN_VER={TOOLCHAIN_VER}")
573579

574580
# Set variables expected by xcc toolchain. CMake cannot set (evil) build-time
575581
# environment variables at configure time:
@@ -578,7 +584,6 @@ def build_platforms():
578584
TOOLCHAIN_VER).absolute())
579585
XTENSA_SYSTEM = str(pathlib.Path(XTENSA_BUILDS_DIR, XTENSA_CORE, "config").absolute())
580586
platf_build_environ["XTENSA_SYSTEM"] = XTENSA_SYSTEM
581-
print(f"XTENSA_SYSTEM={XTENSA_SYSTEM}")
582587

583588
platform_build_dir_name = f"build-{platform}"
584589

src/audio/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -436,6 +436,7 @@ endif # COMP_ASRC
436436

437437
config COMP_TDFB
438438
bool "TDFB component"
439+
depends on COMP_MODULE_ADAPTER
439440
select MATH_FIR
440441
select MATH_IIR_DF1
441442
select SQRT_FIXED

src/audio/data_blob.c

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,13 +164,26 @@ int comp_init_data_blob(struct comp_data_blob_handler *blob_handler,
164164

165165
int comp_data_blob_set(struct comp_data_blob_handler *blob_handler,
166166
enum module_cfg_fragment_position pos, uint32_t data_offset_size,
167-
const uint8_t *fragment, size_t fragment_size)
167+
const uint8_t *fragment_in, size_t fragment_size)
168168
{
169+
#if CONFIG_IPC_MAJOR_3
170+
struct sof_ipc_ctrl_data *cdata = (struct sof_ipc_ctrl_data *)fragment_in;
171+
const uint8_t *fragment = (const uint8_t *)cdata->data[0].data;
172+
#elif CONFIG_IPC_MAJOR_4
173+
const uint8_t *fragment = fragment_in;
174+
#endif
169175
int ret;
170176

171177
if (!blob_handler)
172178
return -EINVAL;
173179

180+
#if CONFIG_IPC_MAJOR_3
181+
if (cdata->cmd != SOF_CTRL_CMD_BINARY) {
182+
comp_err(blob_handler->dev, "comp_data_blob_set_cmd(), illegal control command");
183+
return -EINVAL;
184+
}
185+
#endif
186+
174187
comp_dbg(blob_handler->dev, "comp_data_blob_set_cmd() pos = %d, fragment size = %d",
175188
pos, fragment_size);
176189

@@ -556,6 +569,11 @@ int comp_data_blob_get_cmd(struct comp_data_blob_handler *blob_handler,
556569

557570
assert(blob_handler);
558571

572+
if (cdata->cmd != SOF_CTRL_CMD_BINARY) {
573+
comp_err(blob_handler->dev, "comp_data_blob_set_cmd(), illegal control command");
574+
return -EINVAL;
575+
}
576+
559577
comp_dbg(blob_handler->dev, "comp_data_blob_get_cmd() msg_index = %d, num_elems = %d, remaining = %d ",
560578
cdata->msg_index, cdata->num_elems,
561579
cdata->elems_remaining);

src/audio/mixer/mixer.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ static int mixer_process(struct processing_module *mod,
8282
struct mixer_data *md = module_get_private_data(mod);
8383
struct comp_dev *dev = mod->dev;
8484
const struct audio_stream __sparse_cache *sources_stream[PLATFORM_MAX_STREAMS];
85+
int sources_indices[PLATFORM_MAX_STREAMS];
8586
int32_t i = 0, j = 0;
8687
uint32_t frames = INT32_MAX;
8788
/* Redundant, but helps the compiler */
@@ -143,6 +144,7 @@ static int mixer_process(struct processing_module *mod,
143144
if (avail_frames == 0)
144145
continue;
145146

147+
sources_indices[j] = i;
146148
sources_stream[j++] = mod->input_buffers[i].data;
147149
}
148150

@@ -152,7 +154,7 @@ static int mixer_process(struct processing_module *mod,
152154

153155
/* update source buffer consumed bytes */
154156
for (i = 0; i < j; i++)
155-
mod->input_buffers[i].consumed = source_bytes;
157+
mod->input_buffers[sources_indices[i]].consumed = source_bytes;
156158

157159
return 0;
158160
}

src/audio/module_adapter/module/cadence.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616
#include <ipc/compress_params.h>
1717
#include <rtos/init.h>
1818

19+
LOG_MODULE_REGISTER(cadence, CONFIG_SOF_LOG_LEVEL);
20+
1921
/* d8218443-5ff3-4a4c-b388-6cfe07b956aa */
2022
DECLARE_SOF_RT_UUID("cadence_codec", cadence_uuid, 0xd8218443, 0x5ff3, 0x4a4c,
2123
0xb3, 0x88, 0x6c, 0xfe, 0x07, 0xb9, 0x56, 0xaa);

src/audio/module_adapter/module_adapter.c

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -170,13 +170,10 @@ int module_adapter_prepare(struct comp_dev *dev)
170170
/* Prepare module */
171171
ret = module_prepare(mod);
172172
if (ret) {
173-
if (ret == PPL_STATUS_PATH_STOP)
174-
return ret;
175-
176-
comp_err(dev, "module_adapter_prepare() error %x: module prepare failed",
177-
ret);
178-
179-
return -EIO;
173+
if (ret != PPL_STATUS_PATH_STOP)
174+
comp_err(dev, "module_adapter_prepare() error %x: module prepare failed",
175+
ret);
176+
return ret;
180177
}
181178

182179
/* Get period_bytes first on prepare(). At this point it is guaranteed that the stream
@@ -942,12 +939,11 @@ static int module_adapter_get_set_params(struct comp_dev *dev, struct sof_ipc_ct
942939
*/
943940
if (set && md->ops->set_configuration)
944941
return md->ops->set_configuration(mod, cdata->data[0].type, pos, data_offset_size,
945-
(const uint8_t *)cdata->data[0].data,
946-
cdata->num_elems, NULL, 0);
942+
(const uint8_t *)cdata, cdata->num_elems,
943+
NULL, 0);
947944
else if (!set && md->ops->get_configuration)
948945
return md->ops->get_configuration(mod, pos, &data_offset_size,
949-
(uint8_t *)cdata->data[0].data,
950-
cdata->num_elems);
946+
(uint8_t *)cdata, cdata->num_elems);
951947

952948
comp_warn(dev, "module_adapter_get_set_params(): no configuration op set for %d",
953949
dev_comp_id(dev));

0 commit comments

Comments
 (0)