From 8c3311c31fcb9c001bfb64d63d8f2b2ada248081 Mon Sep 17 00:00:00 2001 From: Adrian Warecki Date: Tue, 27 Oct 2026 11:13:06 +0100 Subject: [PATCH] audio: module_adapter: remove process_raw_data callback Remove the process_raw_data callback from struct module_interface together with the raw data processing mode in module_adapter. This drops the MODULE_PROCESS_TYPE_RAW type, the raw data copy path with its deep buffering and intermediate sink buffers, and the fields that only served it (raw_data_buffers_list, deep_buff_bytes and output_buffer_size in struct processing_module, buffers_list in struct comp_buffer). Related comments and documentation are updated. Bump SOF_MODULE_API_CURRENT_VERSION to 5.0.2 since the layout of struct processing_module and struct module_interface changed. Modules built against the previous version are rejected by the loaders. All modules that used this callback were converted to process() earlier, so the code is no longer reachable. Signed-off-by: Adrian Warecki d --- src/audio/ffmpeg_dec/TESTING.md | 4 +- src/audio/module_adapter/README.md | 2 +- src/audio/module_adapter/module/README.md | 2 +- src/audio/module_adapter/module/generic.c | 6 +- src/audio/module_adapter/module_adapter.c | 433 +----------------- src/include/module/module/api_ver.h | 2 +- src/include/module/module/base.h | 9 +- src/include/module/module/interface.h | 19 +- src/include/sof/audio/buffer.h | 3 - .../sof/audio/module_adapter/module/generic.h | 1 - 10 files changed, 14 insertions(+), 467 deletions(-) diff --git a/src/audio/ffmpeg_dec/TESTING.md b/src/audio/ffmpeg_dec/TESTING.md index 3d50ed8d84f6..866cd359db39 100644 --- a/src/audio/ffmpeg_dec/TESTING.md +++ b/src/audio/ffmpeg_dec/TESTING.md @@ -35,7 +35,7 @@ out. Two paths: hardware. 2. **Direct raw-data injection** (bring-up shortcut): a minimal pipeline where a host copier delivers `stream.raw` as an opaque byte buffer into the module's - `process_raw_data`, capturing PCM on the other side. + `process()`, capturing PCM on the other side. ## Verification paths @@ -52,7 +52,7 @@ out. Two paths: ### B. Native testbench (no hardware) — decode-only check The module builds native (built-in, real libc — the LLEXT-only shims/alloc are excluded automatically, see `CMakeLists.txt`). Linking the **host** libavcodec -and driving `process_raw_data` over `stream.raw` with `ref_s32le.raw` as the +and driving `process()` over `stream.raw` with `ref_s32le.raw` as the oracle gives a bit-exact check without a DSP. This harness is not yet wired (the testbench file component is PCM-oriented; feeding compressed bytes needs a small adapter) and is the recommended next step for CI-friendly verification. diff --git a/src/audio/module_adapter/README.md b/src/audio/module_adapter/README.md index 56923304116f..416ee73628b8 100644 --- a/src/audio/module_adapter/README.md +++ b/src/audio/module_adapter/README.md @@ -65,7 +65,7 @@ sequenceDiagram Pipe->>ModAd: comp_prepare() activate ModAd - ModAd->>ModAd: Calculate chunks (period bytes, deep_buff_bytes) + ModAd->>ModAd: Calculate period bytes ModAd->>Mod: module_prepare() Mod-->>ModAd: External DSP prepared internal states ModAd-->>Pipe: Prepared (Buffer formats synced) diff --git a/src/audio/module_adapter/module/README.md b/src/audio/module_adapter/module/README.md index 4586f060f37d..2cb64db5ce01 100644 --- a/src/audio/module_adapter/module/README.md +++ b/src/audio/module_adapter/module/README.md @@ -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` and `process_raw_data` calls to verify the module is in either `MODULE_IDLE` or `MODULE_PROCESSING` states before execution. +* **State Machine Enforcement**: It wraps `process_audio_stream` calls to verify the module is in either `MODULE_IDLE` or `MODULE_PROCESSING` states before execution. ## 2. Modules (IADK Shim) Adapter (`modules.c`) diff --git a/src/audio/module_adapter/module/generic.c b/src/audio/module_adapter/module/generic.c index 137767480e1d..c53102c0f906 100644 --- a/src/audio/module_adapter/module/generic.c +++ b/src/audio/module_adapter/module/generic.c @@ -117,8 +117,7 @@ int module_init(struct processing_module *mod) /* check interface, there must be one and only one of processing procedure */ if (!interface->init || - (!!interface->process + !!interface->process_audio_stream + - !!interface->process_raw_data < 1)) { + (!!interface->process + !!interface->process_audio_stream < 1)) { comp_err(dev, "comp is missing mandatory interfaces"); return -EIO; } @@ -701,9 +700,6 @@ int module_process_legacy(struct processing_module *mod, if (IS_PROCESSING_MODE_AUDIO_STREAM(mod)) ret = ops->process_audio_stream(mod, input_buffers, num_input_buffers, output_buffers, num_output_buffers); - else if (IS_PROCESSING_MODE_RAW_DATA(mod)) - ret = ops->process_raw_data(mod, input_buffers, num_input_buffers, - output_buffers, num_output_buffers); else ret = -EOPNOTSUPP; diff --git a/src/audio/module_adapter/module_adapter.c b/src/audio/module_adapter/module_adapter.c index 3ccae18cbe09..2735f6763e97 100644 --- a/src/audio/module_adapter/module_adapter.c +++ b/src/audio/module_adapter/module_adapter.c @@ -285,7 +285,6 @@ struct comp_dev *module_adapter_new_ext(const struct comp_driver *drv, return NULL; module_set_private_data(mod, mod_priv); - list_init(&mod->raw_data_buffers_list); #if CONFIG_USERSPACE mod->user_ctx = user_ctx; #endif /* CONFIG_USERSPACE */ @@ -347,8 +346,6 @@ struct comp_dev *module_adapter_new_ext(const struct comp_driver *drv, mod->proc_type = MODULE_PROCESS_TYPE_SOURCE_SINK; else if (interface->process_audio_stream) mod->proc_type = MODULE_PROCESS_TYPE_STREAM; - else if (interface->process_raw_data) - mod->proc_type = MODULE_PROCESS_TYPE_RAW; else goto err; @@ -458,13 +455,9 @@ int module_adapter_prepare(struct comp_dev *dev) { int ret; struct processing_module *mod = comp_mod(dev); - struct module_data *md = &mod->priv; struct comp_buffer *sink; - struct list_item *blist, *_blist; - uint32_t buff_periods; - uint32_t buff_size; /* size of local buffer */ + struct list_item *blist; int memory_flags; - int i = 0; comp_dbg(dev, "start"); #if CONFIG_IPC_MAJOR_4 @@ -483,7 +476,7 @@ int module_adapter_prepare(struct comp_dev *dev) if (IS_PROCESSING_MODE_SINK_SOURCE(mod)) ret = module_adapter_sink_src_prepare(dev); - else if ((IS_PROCESSING_MODE_RAW_DATA(mod) || IS_PROCESSING_MODE_AUDIO_STREAM(mod)) && + else if (IS_PROCESSING_MODE_AUDIO_STREAM(mod) && mod->dev->ipc_config.proc_domain == COMP_PROCESSING_DOMAIN_LL) ret = module_prepare(mod, NULL, 0, NULL, 0); @@ -542,8 +535,6 @@ int module_adapter_prepare(struct comp_dev *dev) if (dev->ipc_config.type == SOF_COMP_HOST || dev->ipc_config.type == SOF_COMP_DAI) return 0; - mod->deep_buff_bytes = 0; - /* Get period_bytes first on prepare(). At this point the stream parameter from sink buffer * shall be settled, provided that the pipeline is built correctly (bind IPC received). * Hence check for NULL. @@ -634,146 +625,10 @@ int module_adapter_prepare(struct comp_dev *dev) mod->output_buffers = NULL; } - /* - * no need to allocate intermediate sink buffers if the module produces only period bytes - * every period and has only 1 input and 1 output buffer - */ - if (!IS_PROCESSING_MODE_RAW_DATA(mod)) - return 0; - - /* Module is prepared, now we need to configure processing settings. - * If module internal buffer is not equal to natural multiple of pipeline - * buffer we have a situation where module adapter have to deep buffer certain amount - * of samples on its start (typically few periods) in order to regularly - * generate output once started (same situation happens for compress streams - * as well). - */ - if (md->mpd.in_buff_size > mod->period_bytes) { - buff_periods = (md->mpd.in_buff_size % mod->period_bytes) ? - (md->mpd.in_buff_size / mod->period_bytes) + 2 : - (md->mpd.in_buff_size / mod->period_bytes) + 1; - } else { - buff_periods = (mod->period_bytes % md->mpd.in_buff_size) ? - (mod->period_bytes / md->mpd.in_buff_size) + 2 : - (mod->period_bytes / md->mpd.in_buff_size) + 1; - } - - /* - * deep_buffer_bytes is a measure of how many bytes we need to send to the DAI before - * the module starts producing samples. In a normal copy() walk it might be possible that - * the first period_bytes copied to input_buffer might not be enough for the processing - * to begin. So, in order to prevent the DAI from starving, it needs to be fed zeroes until - * the module starts processing and generating output samples. - */ - if (md->mpd.in_buff_size != mod->period_bytes) - mod->deep_buff_bytes = MIN(mod->period_bytes, md->mpd.in_buff_size) * buff_periods; - - if (md->mpd.out_buff_size > mod->period_bytes) { - buff_periods = (md->mpd.out_buff_size % mod->period_bytes) ? - (md->mpd.out_buff_size / mod->period_bytes) + 2 : - (md->mpd.out_buff_size / mod->period_bytes) + 1; - } else { - buff_periods = (mod->period_bytes % md->mpd.out_buff_size) ? - (mod->period_bytes / md->mpd.out_buff_size) + 2 : - (mod->period_bytes / md->mpd.out_buff_size) + 1; - } - - /* - * It is possible that the module process() will produce more data than period_bytes but - * the DAI can consume only period_bytes every period. So, the local buffer needs to be - * large enough to save the produced output samples. - */ - buff_size = MAX(mod->period_bytes, md->mpd.out_buff_size) * buff_periods; - mod->output_buffer_size = buff_size; - - /* allocate memory for input buffer data */ - size_t size = MAX(mod->deep_buff_bytes, mod->period_bytes); - - list_for_item(blist, &dev->bsource_list) { - mod->input_buffers[i].data = sof_heap_alloc(sof_sys_user_heap_get(), - memory_flags, size, 0); - if (!mod->input_buffers[i].data) { - comp_err(mod->dev, "Failed to alloc input buffer data"); - ret = -ENOMEM; - goto in_data_free; - } - i++; - } - - /* allocate memory for output buffer data */ - i = 0; - list_for_item(blist, &dev->bsink_list) { - mod->output_buffers[i].data = sof_heap_alloc(sof_sys_user_heap_get(), - memory_flags, - md->mpd.out_buff_size, 0); - if (!mod->output_buffers[i].data) { - comp_err(mod->dev, "Failed to alloc output buffer data"); - ret = -ENOMEM; - goto out_data_free; - } - i++; - } - - /* allocate buffer for all sinks */ - if (list_is_empty(&mod->raw_data_buffers_list)) { - for (i = 0; i < mod->num_of_sinks; i++) { - /* allocate not shared buffer */ - struct comp_buffer *buffer = buffer_alloc(md->resources.alloc, - buff_size, memory_flags, - PLATFORM_DCACHE_ALIGN, - BUFFER_USAGE_NOT_SHARED); - - if (!buffer) { - comp_err(dev, "failed to allocate local buffer"); - ret = -ENOMEM; - goto free; - } - - vregion_get(md->resources.alloc->vreg); - - list_item_prepend(&buffer->buffers_list, &mod->raw_data_buffers_list); - - buffer_set_params(buffer, mod->stream_params, BUFFER_UPDATE_FORCE); - audio_buffer_reset(&buffer->audio_buffer); - } - } else { - list_for_item(blist, &mod->raw_data_buffers_list) { - struct comp_buffer *buffer = container_of(blist, struct comp_buffer, - buffers_list); - - ret = buffer_set_size(buffer, buff_size, 0); - if (ret < 0) { - comp_err(dev, "buffer_set_size() failed, buff_size = %u", - buff_size); - goto free; - } - - buffer_set_params(buffer, mod->stream_params, BUFFER_UPDATE_FORCE); - audio_buffer_reset(&buffer->audio_buffer); - } - } - comp_dbg(dev, "done"); - + return 0; -free: - list_for_item_safe(blist, _blist, &mod->raw_data_buffers_list) { - struct comp_buffer *buffer = container_of(blist, struct comp_buffer, - buffers_list); - - list_item_del(&buffer->buffers_list); - buffer_free(buffer); - } - -out_data_free: - for (i = 0; i < mod->num_of_sinks; i++) - sof_heap_free(sof_sys_user_heap_get(), mod->output_buffers[i].data); - -in_data_free: - for (i = 0; i < mod->num_of_sources; i++) - sof_heap_free(sof_sys_user_heap_get(), mod->input_buffers[i].data); - in_out_free: sof_heap_free(sof_sys_user_heap_get(), mod->output_buffers); mod->output_buffers = NULL; @@ -821,170 +676,6 @@ int module_adapter_params(struct comp_dev *dev, struct sof_ipc_stream_params *pa return 0; } -/* - * Function to copy from source buffer to the module buffer - * @source: source audio buffer stream - * @buff: pointer to the module input buffer - * @buff_size: size of the module input buffer - * @bytes: number of bytes available in the source buffer - */ -static void ca_copy_from_source_to_module(const struct audio_stream *source, - void *buff, uint32_t buff_size, size_t bytes) -{ - /* head_size - available data until end of source buffer */ - const int without_wrap = audio_stream_bytes_without_wrap(source, - audio_stream_get_rptr(source)); - uint32_t head_size = MIN(bytes, without_wrap); - /* tail_size - residual data to be copied starting from the beginning of the buffer */ - uint32_t tail_size = bytes - head_size; - - /* copy head_size to module buffer */ - memcpy((__sparse_force void *)buff, audio_stream_get_rptr(source), - MIN(buff_size, head_size)); - - /* copy residual samples after wrap */ - if (tail_size) - memcpy((__sparse_force char *)buff + head_size, - audio_stream_wrap(source, (char *)audio_stream_get_rptr(source) + head_size), - MIN(buff_size, tail_size)); -} - -/* - * Function to copy processed samples from the module buffer to sink buffer - * @sink: sink audio buffer stream - * @buff: pointer to the module output buffer - * @bytes: number of bytes available in the module output buffer - */ -static void ca_copy_from_module_to_sink(const struct audio_stream *sink, - void *buff, size_t bytes) -{ - /* head_size - free space until end of sink buffer */ - const int without_wrap = audio_stream_bytes_without_wrap(sink, audio_stream_get_wptr(sink)); - uint32_t head_size = MIN(bytes, without_wrap); - /* tail_size - rest of the bytes that needs to be written - * starting from the beginning of the buffer - */ - uint32_t tail_size = bytes - head_size; - - /* copy "head_size" samples to sink buffer */ - memcpy(audio_stream_get_wptr(sink), (__sparse_force void *)buff, - MIN(audio_stream_get_size(sink), head_size)); - - /* copy rest of the samples after buffer wrap */ - if (tail_size) - memcpy(audio_stream_wrap(sink, (char *)audio_stream_get_wptr(sink) + head_size), - (__sparse_force char *)buff + head_size, - MIN(audio_stream_get_size(sink), tail_size)); -} - -/** - * \brief Generate zero samples of "bytes" size for the sink. - * \param[in] sink - a pointer to sink buffer. - * \param[in] bytes - number of zero bytes to produce. - * - * \return: none. - */ -static void generate_zeroes(struct comp_buffer *sink, uint32_t bytes) -{ - uint32_t tmp, copy_bytes = bytes; - void *ptr; - - while (copy_bytes) { - ptr = audio_stream_wrap(&sink->stream, audio_stream_get_wptr(&sink->stream)); - tmp = audio_stream_bytes_without_wrap(&sink->stream, ptr); - tmp = MIN(tmp, copy_bytes); - ptr = (char *)ptr + tmp; - copy_bytes -= tmp; - } - comp_update_buffer_produce(sink, bytes); -} - -static void module_copy_samples(struct comp_dev *dev, struct comp_buffer *src_buffer, - struct comp_buffer *sink_buffer, uint32_t produced) -{ - struct processing_module *mod = comp_mod(dev); - struct comp_copy_limits cl; - uint32_t copy_bytes; - - if (mod->deep_buff_bytes) { - if (mod->deep_buff_bytes >= audio_stream_get_avail_bytes(&src_buffer->stream)) { - generate_zeroes(sink_buffer, mod->period_bytes); - return; - } - - comp_dbg(dev, "deep buffering has ended after gathering %d bytes of processed data", - audio_stream_get_avail_bytes(&src_buffer->stream)); - mod->deep_buff_bytes = 0; - } else if (!produced) { - comp_dbg(dev, "nothing processed in this call"); - /* - * No data produced anything in this period but there still be data in the buffer - * to copy to sink - */ - if (audio_stream_get_avail_bytes(&src_buffer->stream) < mod->period_bytes) - return; - } - - comp_get_copy_limits(src_buffer, sink_buffer, &cl); - copy_bytes = cl.frames * cl.source_frame_bytes; - if (!copy_bytes) - return; - audio_stream_copy(&src_buffer->stream, 0, &sink_buffer->stream, 0, - copy_bytes / mod->stream_params->sample_container_bytes); - buffer_stream_writeback(sink_buffer, copy_bytes); - - comp_update_buffer_produce(sink_buffer, copy_bytes); - comp_update_buffer_consume(src_buffer, copy_bytes); -} - -static void module_adapter_process_output(struct comp_dev *dev) -{ - struct processing_module *mod = comp_mod(dev); - struct comp_buffer *sink; - struct list_item *blist; - int i = 0; - - /* - * copy all produced output samples to output buffers. This loop will do nothing when - * there are no samples produced. - */ - list_for_item(blist, &mod->raw_data_buffers_list) { - if (mod->output_buffers[i].size > 0) { - struct comp_buffer *buffer; - - buffer = container_of(blist, struct comp_buffer, buffers_list); - - ca_copy_from_module_to_sink(&buffer->stream, mod->output_buffers[i].data, - mod->output_buffers[i].size); - audio_stream_produce(&buffer->stream, mod->output_buffers[i].size); - } - i++; - } - - /* copy from all output local buffers to sink buffers */ - i = 0; - comp_dev_for_each_consumer(dev, sink) { - int j = 0; - - list_for_item(blist, &mod->raw_data_buffers_list) { - if (i == j) { - struct comp_buffer *source; - - source = container_of(blist, struct comp_buffer, buffers_list); - module_copy_samples(dev, source, sink, - mod->output_buffers[i].size); - - mod->output_buffers[i].size = 0; - break; - } - j++; - } - i++; - } - - mod->total_data_produced += mod->output_buffers[0].size; -} - static uint32_t module_single_sink_setup(struct comp_dev *dev, struct comp_buffer **source, struct comp_buffer **sinks) @@ -1324,93 +1015,6 @@ static int module_adapter_sink_source_copy(struct comp_dev *dev) return ret; } -static int module_adapter_raw_data_type_copy(struct comp_dev *dev) -{ - struct processing_module *mod = comp_mod(dev); - struct module_data *md = &mod->priv; - struct comp_buffer *source, *sink; - struct list_item *blist; - size_t size = MAX(mod->deep_buff_bytes, mod->period_bytes); - uint32_t min_free_frames = UINT_MAX; - int ret, i = 0; - - comp_dbg(dev, "start"); - - list_for_item(blist, &mod->raw_data_buffers_list) { - sink = container_of(blist, struct comp_buffer, buffers_list); - - min_free_frames = MIN(min_free_frames, - audio_stream_get_free_frames(&sink->stream)); - } - - /* copy source samples into input buffer */ - comp_dev_for_each_producer(dev, source) { - uint32_t bytes_to_process; - int frames, source_frame_bytes; - - /* check if the source dev is in the same state as the dev */ - if (comp_buffer_get_source_state(source) != dev->state) - continue; - - frames = MIN(min_free_frames, - audio_stream_get_avail_frames(&source->stream)); - source_frame_bytes = audio_stream_frame_bytes(&source->stream); - - bytes_to_process = MIN(frames * source_frame_bytes, md->mpd.in_buff_size); - - buffer_stream_invalidate(source, bytes_to_process); - mod->input_buffers[i].size = bytes_to_process; - mod->input_buffers[i].consumed = 0; - - ca_copy_from_source_to_module(&source->stream, mod->input_buffers[i].data, - md->mpd.in_buff_size, bytes_to_process); - i++; - } - - ret = module_process_legacy(mod, mod->input_buffers, mod->num_of_sources, - mod->output_buffers, mod->num_of_sinks); - if (ret) { - if (ret != -ENOSPC && ret != -ENODATA) { - comp_err(dev, "%d: module processing failed", ret); - goto out; - } - - ret = 0; - } - - i = 0; - /* consume from all input buffers */ - comp_dev_for_each_producer(dev, source) { - comp_update_buffer_consume(source, mod->input_buffers[i].consumed); - - bzero((__sparse_force void *)mod->input_buffers[i].data, size); - mod->input_buffers[i].size = 0; - mod->input_buffers[i].consumed = 0; - - i++; - } - - mod->total_data_consumed += mod->input_buffers[0].consumed; - - module_adapter_process_output(dev); - - comp_dbg(dev, "done"); - - return 0; - -out: - for (i = 0; i < mod->num_of_sinks; i++) - mod->output_buffers[i].size = 0; - - for (i = 0; i < mod->num_of_sources; i++) { - bzero((__sparse_force void *)mod->input_buffers[i].data, size); - mod->input_buffers[i].size = 0; - mod->input_buffers[i].consumed = 0; - } - comp_dbg(dev, "error %x", ret); - return ret; -} - int module_adapter_copy(struct comp_dev *dev) { comp_dbg(dev, "start"); @@ -1420,9 +1024,6 @@ int module_adapter_copy(struct comp_dev *dev) if (IS_PROCESSING_MODE_AUDIO_STREAM(mod)) return module_adapter_audio_stream_type_copy(dev); - if (IS_PROCESSING_MODE_RAW_DATA(mod)) - return module_adapter_raw_data_type_copy(dev); - if (IS_PROCESSING_MODE_SINK_SOURCE(mod)) { if (mod->dev->ipc_config.proc_domain == COMP_PROCESSING_DOMAIN_DP) return module_adapter_copy_ring_buffers(dev); @@ -1476,9 +1077,8 @@ int module_adapter_trigger(struct comp_dev *dev, int cmd) int module_adapter_reset(struct comp_dev *dev) { - int ret, i; + int ret; struct processing_module *mod = comp_mod(dev); - struct list_item *blist; comp_dbg(dev, "resetting"); @@ -1489,16 +1089,7 @@ int module_adapter_reset(struct comp_dev *dev) return ret; } - if (IS_PROCESSING_MODE_RAW_DATA(mod)) { - for (i = 0; i < mod->num_of_sinks; i++) - sof_heap_free(sof_sys_user_heap_get(), - (__sparse_force void *)mod->output_buffers[i].data); - for (i = 0; i < mod->num_of_sources; i++) - sof_heap_free(sof_sys_user_heap_get(), - (__sparse_force void *)mod->input_buffers[i].data); - } - - if (IS_PROCESSING_MODE_RAW_DATA(mod) || IS_PROCESSING_MODE_AUDIO_STREAM(mod)) { + if (IS_PROCESSING_MODE_AUDIO_STREAM(mod)) { sof_heap_free(sof_sys_user_heap_get(), mod->output_buffers); sof_heap_free(sof_sys_user_heap_get(), mod->input_buffers); @@ -1509,12 +1100,6 @@ int module_adapter_reset(struct comp_dev *dev) mod->total_data_consumed = 0; mod->total_data_produced = 0; - list_for_item(blist, &mod->raw_data_buffers_list) { - struct comp_buffer *buffer = container_of(blist, struct comp_buffer, - buffers_list); - buffer_zero(buffer); - } - mod_free(mod, mod->stream_params); mod->stream_params = NULL; @@ -1527,7 +1112,6 @@ void module_adapter_free(struct comp_dev *dev) { int ret; struct processing_module *mod = comp_mod(dev); - struct list_item *blist, *_blist; comp_dbg(dev, "start"); @@ -1538,13 +1122,6 @@ void module_adapter_free(struct comp_dev *dev) if (dev->task) schedule_task_free(dev->task); - list_for_item_safe(blist, _blist, &mod->raw_data_buffers_list) { - struct comp_buffer *buffer = container_of(blist, struct comp_buffer, - buffers_list); - list_item_del(&buffer->buffers_list); - buffer_free(buffer); - } - mod_free(mod, mod->stream_params); mod_free_all(mod); diff --git a/src/include/module/module/api_ver.h b/src/include/module/module/api_ver.h index 35aedb0305d7..99ddae1aa2d4 100644 --- a/src/include/module/module/api_ver.h +++ b/src/include/module/module/api_ver.h @@ -21,7 +21,7 @@ #define SOF_MODULE_API_MAJOR_VERSION 5 #define SOF_MODULE_API_MIDDLE_VERSION 0 -#define SOF_MODULE_API_MINOR_VERSION 1 +#define SOF_MODULE_API_MINOR_VERSION 2 #define SOF_MODULE_API_CURRENT_VERSION MODULE_API_VERSION_ENCODE(SOF_MODULE_API_MAJOR_VERSION, \ SOF_MODULE_API_MIDDLE_VERSION, SOF_MODULE_API_MINOR_VERSION) diff --git a/src/include/module/module/base.h b/src/include/module/module/base.h index a1ef09337249..1e48bb2e506b 100644 --- a/src/include/module/module/base.h +++ b/src/include/module/module/base.h @@ -89,7 +89,6 @@ struct module_data { enum module_processing_type { MODULE_PROCESS_TYPE_SOURCE_SINK, MODULE_PROCESS_TYPE_STREAM, - MODULE_PROCESS_TYPE_RAW, }; struct userspace_context; @@ -111,18 +110,12 @@ struct processing_module { */ #ifdef SOF_MODULE_API_PRIVATE struct sof_ipc_stream_params *stream_params; - /* list of sink buffers to save produced output, to be used in Raw data - * processing mode - */ - struct list_item raw_data_buffers_list; /* * This is a temporary change in order to support the trace messages in the modules. This * will be removed once the trace API is updated. */ struct comp_dev *dev; - uint32_t deep_buff_bytes; /**< copy start threshold */ - uint32_t output_buffer_size; /**< size of local buffer to save produced samples */ /* number of sinks / sources and (when in use) input_buffers / input_buffers */ uint32_t num_of_sources; @@ -132,7 +125,7 @@ struct processing_module { struct sof_sink *sinks[CONFIG_MODULE_MAX_CONNECTIONS]; struct sof_source *sources[CONFIG_MODULE_MAX_CONNECTIONS]; - /* this is used in case of raw data or audio_stream mode + /* this is used in case of audio_stream mode * number of buffers described by fields: * input_buffers - num_of_sources * output_buffers - num_of_sinks diff --git a/src/include/module/module/interface.h b/src/include/module/module/interface.h index 53d58f150c87..b62b61e84dd0 100644 --- a/src/include/module/module/interface.h +++ b/src/include/module/module/interface.h @@ -139,12 +139,12 @@ struct module_interface { * samples provided by the module_adapter and produce/output the processed * ones back to module_adapter. * - * there are 3 versions of the procedure, the difference is the format of + * there are 2 versions of the procedure, the difference is the format of * input/output data * * the module MUST implement one and ONLY one of them * - * process_audio_stream and process_raw_data are depreciated and will be removed + * process_audio_stream is depreciated and will be removed * once pipeline learns to use module API directly (without module adapter) * modules that need such processing should use proper wrappers * @@ -175,21 +175,6 @@ struct module_interface { struct output_stream_buffer *output_buffers, int num_output_buffers); - /** - * process_raw_data (depreciated) - * - sources are input_stream_buffer[] - * - sources[].data is a pointer to raw audio data - * - sinks are output_stream_buffer[] - * - sinks[].data is a pointer to raw audio data - * - * Usually shouldn't be __cold - */ - int (*process_raw_data)(struct processing_module *mod, - struct input_stream_buffer *input_buffers, - int num_input_buffers, - struct output_stream_buffer *output_buffers, - int num_output_buffers); - /** * (optional) Set module configuration parameter * diff --git a/src/include/sof/audio/buffer.h b/src/include/sof/audio/buffer.h index 9f9f7df672b5..9b353c341912 100644 --- a/src/include/sof/audio/buffer.h +++ b/src/include/sof/audio/buffer.h @@ -169,9 +169,6 @@ struct comp_buffer { struct list_item source_list; /**< List node in source component's buffer list */ struct list_item sink_list; /**< List node in sink component's buffer list */ - /* list of buffers, to be used i.e. in raw data processing mode*/ - struct list_item buffers_list; /**< List of buffers used in raw data processing */ - #if CONFIG_PROBE /** probe produce callback, called on buffer produce */ void (*probe_cb_produce)(void *arg, struct buffer_cb_transact *cb_data); diff --git a/src/include/sof/audio/module_adapter/module/generic.h b/src/include/sof/audio/module_adapter/module/generic.h index 1e0d82d23380..49437640effd 100644 --- a/src/include/sof/audio/module_adapter/module/generic.h +++ b/src/include/sof/audio/module_adapter/module/generic.h @@ -29,7 +29,6 @@ * Needed till all the modules use PROCESSING_MODE_SINK_SOURCE */ #define IS_PROCESSING_MODE_AUDIO_STREAM(mod) ((mod)->proc_type == MODULE_PROCESS_TYPE_STREAM) -#define IS_PROCESSING_MODE_RAW_DATA(mod) ((mod)->proc_type == MODULE_PROCESS_TYPE_RAW) #define IS_PROCESSING_MODE_SINK_SOURCE(mod) ((mod)->proc_type == MODULE_PROCESS_TYPE_SOURCE_SINK) #if CONFIG_IPC_MAJOR_4