Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions src/audio/asrc/asrc.c
Original file line number Diff line number Diff line change
Expand Up @@ -221,8 +221,6 @@ static int asrc_init(struct processing_module *mod)
*/
cd->track_drift = asrc_get_asynchronous_mode(ipc_asrc);
cd->skew = 0;
mod->skip_src_buffer_invalidate = true;
mod->skip_sink_buffer_writeback = true;

return 0;
}
Expand Down
4 changes: 0 additions & 4 deletions src/audio/mixin_mixout/mixin_mixout.c
Original file line number Diff line number Diff line change
Expand Up @@ -150,8 +150,6 @@ static int mixin_init(struct processing_module *mod)
md->sink_config[i].gain = IPC4_MIXIN_UNITY_GAIN;
}

mod->skip_src_buffer_invalidate = true;

mod->max_sinks = MIXIN_MAX_SINKS;
return 0;
}
Expand All @@ -169,8 +167,6 @@ static int mixout_init(struct processing_module *mod)

mod->priv.private = mo_data;

mod->skip_sink_buffer_writeback = true;

mod->max_sources = MIXOUT_MAX_SOURCES;
return 0;
}
Expand Down
2 changes: 1 addition & 1 deletion src/audio/module_adapter/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ To unify components operating directly in interrupt boundaries (DMA Low Latency
For LL modules, processing is fully synchronous within the pipeline tick:

1. `comp_copy()` invokes `module_adapter_copy()`.
2. Data is fetched directly into `module_process_legacy()` or `module_process_sink_src()`.
2. Data is fetched directly into `module_process_sink_src()`.
3. `ops->process()` consumes upstream arrays and produces downstream arrays.

### Data Processing (DP) Execution
Expand Down
2 changes: 1 addition & 1 deletion src/audio/module_adapter/module/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ It implements the full `struct module_interface` contract:

* **Memory Management**: It intercepts memory allocation mappings using `mod_balloc_align` and tracks memory requests in a module-specific resource pool (`module_resource`). When the module goes out of scope, the framework garbage-collects any leaked allocations automatically via `mod_free_all()`.
* **Configuration Handling**: Manages large blob configuration messages across multiple IPC fragments (`module_set_configuration`). It allocates memory for `runtime_params` until the blob is fully assembled, then triggers the underlying algorithm with the completed struct.
* **State Machine Enforcement**: It wraps `process_audio_stream` calls to verify the module is in either `MODULE_IDLE` or `MODULE_PROCESSING` states before execution.
* **State Machine Enforcement**: It wraps `process` calls to verify the module is in either `MODULE_IDLE` or `MODULE_PROCESSING` states before execution.

## 2. Modules (IADK Shim) Adapter (`modules.c`)

Expand Down
59 changes: 2 additions & 57 deletions src/audio/module_adapter/module/generic.c
Original file line number Diff line number Diff line change
Expand Up @@ -115,9 +115,8 @@ int module_init(struct processing_module *mod)
return -EIO;
}

/* check interface, there must be one and only one of processing procedure */
if (!interface->init ||
(!!interface->process + !!interface->process_audio_stream < 1)) {
/* check interface, there must be a processing procedure */
if (!interface->init || !interface->process) {
comp_err(dev, "comp is missing mandatory interfaces");
return -EIO;
}
Expand Down Expand Up @@ -675,48 +674,6 @@ int module_prepare(struct processing_module *mod,
return 0;
}

int module_process_legacy(struct processing_module *mod,
struct input_stream_buffer *input_buffers, int num_input_buffers,
struct output_stream_buffer *output_buffers,
int num_output_buffers)
{
struct comp_dev *dev = mod->dev;
const struct module_interface *const ops = dev->drv->adapter_ops;
int ret;

comp_dbg(dev, "entry");

#if CONFIG_IPC_MAJOR_3
struct module_data *md = &mod->priv;

if (md->state != MODULE_IDLE) {
comp_err(dev, "wrong state %d", md->state);
return -EPERM;
}

/* set state to processing */
md->state = MODULE_PROCESSING;
#endif
if (IS_PROCESSING_MODE_AUDIO_STREAM(mod))
ret = ops->process_audio_stream(mod, input_buffers, num_input_buffers,
output_buffers, num_output_buffers);
else
ret = -EOPNOTSUPP;

if (ret && ret != -ENOSPC && ret != -ENODATA) {
comp_err(dev, "error %d", ret);
return ret;
}

comp_dbg(dev, "done");

#if CONFIG_IPC_MAJOR_3
/* reset state to idle */
md->state = MODULE_IDLE;
#endif
return 0;
}

int module_process_sink_src(struct processing_module *mod,
struct sof_source **sources, int num_of_sources,
struct sof_sink **sinks, int num_of_sinks)
Expand Down Expand Up @@ -1050,18 +1007,6 @@ int module_unbind(struct processing_module *mod, const struct bind_info *unbind_
return ret;
}

void module_update_buffer_position(struct input_stream_buffer *input_buffers,
struct output_stream_buffer *output_buffers,
uint32_t frames)
{
struct audio_stream *source = input_buffers->data;
struct audio_stream *sink = output_buffers->data;

input_buffers->consumed += audio_stream_frame_bytes(source) * frames;
output_buffers->size += audio_stream_frame_bytes(sink) * frames;
}
EXPORT_SYMBOL(module_update_buffer_position);

uint32_t module_get_deadline(struct processing_module *mod)
{
uint32_t deadline;
Expand Down
1 change: 0 additions & 1 deletion src/audio/module_adapter/module/modules.c
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ static int modules_init(struct processing_module *mod)
md->mpd.in_buff_size = src_cfg->ibs;
md->mpd.out_buff_size = src_cfg->obs;

mod->proc_type = MODULE_PROCESS_TYPE_SOURCE_SINK;
return iadk_wrapper_init(module_get_private_data(mod));
}

Expand Down
Loading
Loading