Skip to content
Merged
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
32 changes: 16 additions & 16 deletions src/audio/mixin_mixout/mixin_mixout.c
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ static int mixin_init(struct processing_module *mod)
struct mixin_data *md;
int i;

comp_dbg(dev, "mixin_init()");
comp_dbg(dev, "entry");

md = rzalloc(SOF_MEM_FLAG_USER, sizeof(*md));
if (!md)
Expand All @@ -166,7 +166,7 @@ static int mixout_init(struct processing_module *mod)
struct comp_dev *dev = mod->dev;
struct mixout_data *mo_data;

comp_dbg(dev, "mixout_new()");
comp_dbg(dev, "entry");

mo_data = rzalloc(SOF_MEM_FLAG_USER, sizeof(*mo_data));
if (!mo_data)
Expand Down Expand Up @@ -320,7 +320,7 @@ static int mixin_process(struct processing_module *mod,
int i, ret;
struct cir_buf_ptr source_ptr;

comp_dbg(dev, "mixin_process()");
comp_dbg(dev, "entry");

source_avail_frames = source_get_data_frames_available(sources[0]);
sinks_free_frames = INT32_MAX;
Expand Down Expand Up @@ -526,7 +526,7 @@ static int mixout_process(struct processing_module *mod,
struct pending_frames *pending_frames;
int i;

comp_dbg(dev, "mixout_process()");
comp_dbg(dev, "entry");

md = module_get_private_data(mod);

Expand Down Expand Up @@ -650,7 +650,7 @@ static int mixin_params(struct processing_module *mod)
int i;
int ret;

comp_dbg(dev, "mixin_params()");
comp_dbg(dev, "entry");

ipc4_base_module_cfg_to_stream_params(&mod->priv.cfg.base_cfg, params);

Expand Down Expand Up @@ -717,7 +717,7 @@ static int mixin_prepare(struct processing_module *mod,
enum sof_ipc_frame fmt;
int ret;

comp_info(dev, "mixin_prepare()");
comp_info(dev, "entry");
md->eos_delay_configured = false;

ret = mixin_params(mod);
Expand Down Expand Up @@ -753,7 +753,7 @@ static int mixout_params(struct processing_module *mod)
enum sof_ipc_frame frame_fmt, valid_fmt;
int ret;

comp_dbg(dev, "mixout_params()");
comp_dbg(dev, "entry");

ipc4_base_module_cfg_to_stream_params(&mod->priv.cfg.base_cfg, params);

Expand Down Expand Up @@ -790,7 +790,7 @@ static int mixout_prepare(struct processing_module *mod,
if (ret < 0)
return ret;

comp_dbg(dev, "mixout_prepare()");
comp_dbg(dev, "entry");

/*
* Since mixout sink buffer stream is reset on .prepare(), let's
Expand Down Expand Up @@ -822,7 +822,7 @@ static int mixout_bind(struct processing_module *mod, struct bind_info *bind_dat

mixin = ipc4_get_comp_dev(src_id);
if (!mixin) {
comp_err(mod->dev, "mixout_bind: no mixin with ID %d found", src_id);
comp_err(mod->dev, "no mixin with ID %d found", src_id);
return -EINVAL;
}

Expand Down Expand Up @@ -860,7 +860,7 @@ static int mixout_unbind(struct processing_module *mod, struct bind_info *unbind
int src_id;
struct mixout_data *mixout_data;

comp_dbg(mod->dev, "mixout_unbind()");
comp_dbg(mod->dev, "entry");

bu = unbind_data->ipc4_data;
src_id = IPC4_COMP_ID(bu->primary.r.module_id, bu->primary.r.instance_id);
Expand All @@ -871,7 +871,7 @@ static int mixout_unbind(struct processing_module *mod, struct bind_info *unbind

mixin = ipc4_get_comp_dev(src_id);
if (!mixin) {
comp_err(mod->dev, "mixout_bind: no mixin with ID %d found", src_id);
comp_err(mod->dev, "no mixin with ID %d found", src_id);
return -EINVAL;
}

Expand Down Expand Up @@ -900,30 +900,30 @@ static int mixin_set_config(struct processing_module *mod, uint32_t config_id,
uint16_t gain;

if (config_id != IPC4_MIXER_MODE) {
comp_err(dev, "mixin_set_config() unsupported param ID: %u", config_id);
comp_err(dev, "unsupported param ID: %u", config_id);
return -EINVAL;
}

if (!(pos & MODULE_CFG_FRAGMENT_SINGLE)) {
comp_err(dev, "mixin_set_config() data is expected to be sent as one chunk");
comp_err(dev, "data is expected to be sent as one chunk");
return -EINVAL;
}

/* for a single chunk data, data_offset_size is size */
if (data_offset_size < sizeof(struct ipc4_mixer_mode_config)) {
comp_err(dev, "mixin_set_config() too small data size: %u", data_offset_size);
comp_err(dev, "too small data size: %u", data_offset_size);
return -EINVAL;
}

if (data_offset_size > SOF_IPC_MSG_MAX_SIZE) {
comp_err(dev, "mixin_set_config() too large data size: %u", data_offset_size);
comp_err(dev, "too large data size: %u", data_offset_size);
return -EINVAL;
}

cfg = (const struct ipc4_mixer_mode_config *)fragment;

if (cfg->mixer_mode_config_count < 1 || cfg->mixer_mode_config_count > MIXIN_MAX_SINKS) {
comp_err(dev, "mixin_set_config() invalid mixer_mode_config_count: %u",
comp_err(dev, "invalid mixer_mode_config_count: %u",
cfg->mixer_mode_config_count);
return -EINVAL;
}
Expand Down
61 changes: 24 additions & 37 deletions src/audio/module_adapter/module/generic.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ int module_load_config(struct comp_dev *dev, const void *cfg, size_t size)
struct processing_module *mod = comp_mod(dev);
struct module_data *md = &mod->priv;

comp_dbg(dev, "module_load_config() start");
comp_dbg(dev, "entry");

if (!cfg || !size) {
comp_err(dev, "wrong input params! dev %zx, cfg %zx size %zu",
Expand Down Expand Up @@ -67,7 +67,7 @@ int module_load_config(struct comp_dev *dev, const void *cfg, size_t size)
dst->size = size;
dst->avail = true;

comp_dbg(dev, "module_load_config() done");
comp_dbg(dev, "done");
return ret;
}

Expand All @@ -78,7 +78,7 @@ int module_init(struct processing_module *mod)
struct comp_dev *dev = mod->dev;
const struct module_interface *const interface = dev->drv->adapter_ops;

comp_dbg(dev, "module_init() start");
comp_dbg(dev, "entry");

#if CONFIG_IPC_MAJOR_3
if (mod->priv.state == MODULE_INITIALIZED)
Expand All @@ -87,17 +87,15 @@ int module_init(struct processing_module *mod)
return -EPERM;
#endif
if (!interface) {
comp_err(dev, "module interface not defined for comp id %#x",
dev_comp_id(dev));
comp_err(dev, "module interface not defined");
return -EIO;
}

/* 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)) {
comp_err(dev, "comp %#x is missing mandatory interfaces",
dev_comp_id(dev));
comp_err(dev, "comp is missing mandatory interfaces");
return -EIO;
}

Expand All @@ -113,12 +111,11 @@ int module_init(struct processing_module *mod)
/* Now we can proceed with module specific initialization */
ret = interface->init(mod);
if (ret) {
comp_err(dev, "module_init() error %d: module specific init failed, comp id %#x",
ret, dev_comp_id(dev));
comp_err(dev, "error %d: module specific init failed", ret);
return ret;
}

comp_dbg(dev, "module_init() done");
comp_dbg(dev, "done");
#if CONFIG_IPC_MAJOR_3
md->state = MODULE_INITIALIZED;
#endif
Expand Down Expand Up @@ -182,7 +179,7 @@ void *mod_alloc_align(struct processing_module *mod, uint32_t size, uint32_t ali
return NULL;

if (!size) {
comp_err(mod->dev, "mod_alloc: requested allocation of 0 bytes.");
comp_err(mod->dev, "requested allocation of 0 bytes.");
container_put(mod, container);
return NULL;
}
Expand All @@ -194,8 +191,7 @@ void *mod_alloc_align(struct processing_module *mod, uint32_t size, uint32_t ali
ptr = rballoc(SOF_MEM_FLAG_USER, size);

if (!ptr) {
comp_err(mod->dev, "mod_alloc: failed to allocate memory for comp %x.",
dev_comp_id(mod->dev));
comp_err(mod->dev, "failed to allocate memory.");
container_put(mod, container);
return NULL;
}
Expand Down Expand Up @@ -368,8 +364,7 @@ int mod_free(struct processing_module *mod, const void *ptr)
}
}

comp_err(mod->dev, "mod_free: error: could not find memory pointed by %p",
ptr);
comp_err(mod->dev, "error: could not find memory pointed by %p", ptr);

return -EINVAL;
}
Expand Down Expand Up @@ -399,7 +394,7 @@ int module_prepare(struct processing_module *mod,
struct comp_dev *dev = mod->dev;
const struct module_interface *const ops = dev->drv->adapter_ops;

comp_dbg(dev, "module_prepare() start");
comp_dbg(dev, "entry");

#if CONFIG_IPC_MAJOR_3
if (mod->priv.state == MODULE_IDLE)
Expand All @@ -411,8 +406,7 @@ int module_prepare(struct processing_module *mod,
int ret = ops->prepare(mod, sources, num_of_sources, sinks, num_of_sinks);

if (ret) {
comp_err(dev, "module_prepare() error %d: module specific prepare failed, comp_id %d",
ret, dev_comp_id(dev));
comp_err(dev, "error %d: module specific prepare failed", ret);
return ret;
}
}
Expand All @@ -429,7 +423,7 @@ int module_prepare(struct processing_module *mod,
#if CONFIG_IPC_MAJOR_3
md->state = MODULE_IDLE;
#endif
comp_dbg(dev, "module_prepare() done");
comp_dbg(dev, "done");

return 0;
}
Expand All @@ -443,14 +437,13 @@ int module_process_legacy(struct processing_module *mod,
const struct module_interface *const ops = dev->drv->adapter_ops;
int ret;

comp_dbg(dev, "module_process_legacy() start");
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 of comp_id %x, state %d",
dev_comp_id(dev), md->state);
comp_err(dev, "wrong state %d", md->state);
return -EPERM;
}

Expand All @@ -467,12 +460,11 @@ int module_process_legacy(struct processing_module *mod,
ret = -EOPNOTSUPP;

if (ret && ret != -ENOSPC && ret != -ENODATA) {
comp_err(dev, "module_process() error %d: for comp %#x",
ret, dev_comp_id(dev));
comp_err(dev, "error %d", ret);
return ret;
}

comp_dbg(dev, "module_process_legacy() done");
comp_dbg(dev, "done");

#if CONFIG_IPC_MAJOR_3
/* reset state to idle */
Expand All @@ -490,13 +482,12 @@ int module_process_sink_src(struct processing_module *mod,
const struct module_interface *const ops = dev->drv->adapter_ops;
int ret;

comp_dbg(dev, "module_process sink src() start");
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 of comp_id %x, state %d",
dev_comp_id(dev), md->state);
comp_err(dev, "wrong state %d", md->state);
return -EPERM;
}

Expand All @@ -507,12 +498,11 @@ int module_process_sink_src(struct processing_module *mod,
ret = ops->process(mod, sources, num_of_sources, sinks, num_of_sinks);

if (ret && ret != -ENOSPC && ret != -ENODATA) {
comp_err(dev, "module_process() error %d: for comp %#x",
ret, dev_comp_id(dev));
comp_err(dev, "error %d", ret);
return ret;
}

comp_dbg(dev, "module_process sink src() done");
comp_dbg(dev, "done");

#if CONFIG_IPC_MAJOR_3
/* reset state to idle */
Expand Down Expand Up @@ -540,8 +530,7 @@ int module_reset(struct processing_module *mod)
if (ret) {
if (ret != PPL_STATUS_PATH_STOP)
comp_err(mod->dev,
"module_reset() error %d: module specific reset() failed for comp %#xd",
ret, dev_comp_id(mod->dev));
"error %d: module specific reset() failed", ret);
return ret;
}
}
Expand Down Expand Up @@ -602,8 +591,7 @@ int module_free(struct processing_module *mod)
if (ops->free) {
ret = ops->free(mod);
if (ret)
comp_warn(mod->dev, "error: %d for %d",
ret, dev_comp_id(mod->dev));
comp_warn(mod->dev, "error: %d", ret);
}

/* Free all memory shared by module_adapter & module */
Expand Down Expand Up @@ -702,8 +690,7 @@ int module_set_configuration(struct processing_module *mod,

ret = memcpy_s(dst, md->new_cfg_size - offset, fragment, fragment_size);
if (ret < 0) {
comp_err(dev, "error: %d failed to copy fragment",
ret);
comp_err(dev, "error: %d failed to copy fragment", ret);
return ret;
}

Expand Down
6 changes: 3 additions & 3 deletions src/audio/module_adapter/module/modules.c
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ static int modules_init(struct processing_module *mod)
const struct ipc4_base_module_cfg *src_cfg = &md->cfg.base_cfg;

/* At this point module resources are allocated and it is moved to L2 memory. */
comp_info(dev, "modules_init() start");
comp_info(dev, "entry");

md->mpd.in_buff_size = src_cfg->ibs;
md->mpd.out_buff_size = src_cfg->obs;
Expand All @@ -84,7 +84,7 @@ static int modules_prepare(struct processing_module *mod,
{
struct comp_dev *dev = mod->dev;

comp_info(dev, "modules_prepare()");
comp_info(dev, "entry");

return iadk_wrapper_prepare(module_get_private_data(mod));
}
Expand All @@ -109,7 +109,7 @@ static int modules_free(struct processing_module *mod)
struct comp_dev *dev = mod->dev;
int ret;

comp_info(dev, "modules_free()");
comp_info(dev, "entry");
ret = iadk_wrapper_free(module_get_private_data(mod));
if (ret)
comp_err(dev, "iadk_wrapper_free failed with error: %d", ret);
Expand Down
Loading
Loading