Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tools: Testbench: Add IPC4 support #9483

Merged
merged 18 commits into from
Oct 1, 2024
Merged
Changes from 1 commit
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
3292b73
platform: library: Add missing include task.h to ll_schedule
singalsu Feb 20, 2024
be9f075
Lib: Dai-legacy: Add chmap and channel_copy members to struct dai_data
singalsu Sep 10, 2024
21b5571
IPC4: Add missing header include to alh.h
singalsu Sep 10, 2024
7bf5d3d
IPC: IPC4: Skip ipc_wait_for_compound_msg() for CONFIG_LIBRARY
singalsu Feb 19, 2024
bbd3865
IPC: IPC4: Initialize IPC reply to zero ipc_cmd()
singalsu Sep 16, 2024
634d192
IPC: IPC4: Remove unused function process_dma_index()
singalsu Sep 17, 2024
77616b6
IPC: IPC4: Add File and dcblock to UUID map
singalsu Sep 17, 2024
3c3ebc4
Audio: Component: Add module headers to component.h for testbench
singalsu Sep 17, 2024
3645e6d
Audio: Crossover: Fix IPC4 testbench build
singalsu Apr 10, 2024
fe6b8d8
Audio: TDFB: Fix flexible array members in control notification
singalsu Sep 18, 2024
ea2fdda
Audio: Volume: Remove two unused variables from peakvolume
singalsu Sep 18, 2024
e3f13a8
Tools: Testbench: Rename files with IPC3
singalsu Sep 17, 2024
c7b090a
Tools: Testbench: Clean up header files
singalsu Sep 17, 2024
8129566
Tools: Testbench: Cleanup and move common and IPC3 specific functions
singalsu Sep 17, 2024
8db545f
Tools: Testbench: Error if filename is empty in file component
singalsu Sep 24, 2024
5b3f6ec
Tools: Testbench: Add IPC4 support
singalsu Sep 17, 2024
088893e
Tools: Testbench: Rename common_test C source files to utils
singalsu Sep 19, 2024
2a0284f
Tools: Testbench: Add README.md text
singalsu Sep 19, 2024
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
41 changes: 21 additions & 20 deletions src/audio/tdfb/tdfb_ipc4.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,6 @@
#include "tdfb.h"
#include "tdfb_comp.h"

struct tdfb_notification_payload {
struct sof_ipc4_notify_module_data module_data;
struct sof_ipc4_control_msg_payload control_msg;
struct sof_ipc4_ctrl_value_chan control_value; /* One channel value */
};

LOG_MODULE_DECLARE(tdfb, CONFIG_SOF_LOG_LEVEL);

static struct ipc_msg *tdfb_notification_init(struct processing_module *mod,
Expand All @@ -44,8 +38,9 @@ static struct ipc_msg *tdfb_notification_init(struct processing_module *mod,
struct comp_ipc_config *ipc_config = &dev->ipc_config;
union ipc4_notification_header *primary =
(union ipc4_notification_header *)&msg_proto.header;
struct sof_ipc4_notify_module_data *msg_module_data;
struct sof_ipc4_control_msg_payload *msg_payload;
struct ipc_msg *msg;
struct tdfb_notification_payload *payload;

/* Clear header, extension, and other ipc_msg members */
memset_s(&msg_proto, sizeof(msg_proto), 0, sizeof(msg_proto));
Expand All @@ -54,32 +49,38 @@ static struct ipc_msg *tdfb_notification_init(struct processing_module *mod,
primary->r.rsp = SOF_IPC4_MESSAGE_DIR_MSG_REQUEST;
primary->r.msg_tgt = SOF_IPC4_MESSAGE_TARGET_FW_GEN_MSG;
msg = ipc_msg_w_ext_init(msg_proto.header, msg_proto.extension,
sizeof(struct tdfb_notification_payload));
sizeof(struct sof_ipc4_notify_module_data) +
sizeof(struct sof_ipc4_control_msg_payload) +
sizeof(struct sof_ipc4_ctrl_value_chan));
if (!msg)
return NULL;

payload = (struct tdfb_notification_payload *)msg->tx_data;
payload->module_data.instance_id = IPC4_INST_ID(ipc_config->id);
payload->module_data.module_id = IPC4_MOD_ID(ipc_config->id);
payload->module_data.event_id = SOF_IPC4_NOTIFY_MODULE_EVENTID_ALSA_MAGIC_VAL |
msg_module_data = (struct sof_ipc4_notify_module_data *)msg->tx_data;
msg_module_data->instance_id = IPC4_INST_ID(ipc_config->id);
msg_module_data->module_id = IPC4_MOD_ID(ipc_config->id);
msg_module_data->event_id = SOF_IPC4_NOTIFY_MODULE_EVENTID_ALSA_MAGIC_VAL |
control_type_param_id;
payload->module_data.event_data_size = sizeof(struct sof_ipc4_control_msg_payload) +
msg_module_data->event_data_size = sizeof(struct sof_ipc4_control_msg_payload) +
sizeof(struct sof_ipc4_ctrl_value_chan);
payload->control_msg.id = control_id;
payload->control_msg.num_elems = 1;
payload->control_value.channel = 0;

msg_payload = (struct sof_ipc4_control_msg_payload *)msg_module_data->event_data;
lgirdwood marked this conversation as resolved.
Show resolved Hide resolved
msg_payload->id = control_id;
msg_payload->num_elems = 1;
msg_payload->chanv[0].channel = 0;

comp_dbg(dev, "instance_id = 0x%08x, module_id = 0x%08x",
payload->module_data.instance_id, payload->module_data.module_id);
msg_module_data->instance_id, msg_module_data->module_id);
return msg;
}

static void tdfb_send_notification(struct ipc_msg *msg, uint32_t val)
{
struct tdfb_notification_payload *ipc_payload;
struct sof_ipc4_notify_module_data *msg_module_data;
struct sof_ipc4_control_msg_payload *msg_payload;

ipc_payload = (struct tdfb_notification_payload *)msg->tx_data;
ipc_payload->control_value.value = val;
msg_module_data = (struct sof_ipc4_notify_module_data *)msg->tx_data;
msg_payload = (struct sof_ipc4_control_msg_payload *)msg_module_data->event_data;
msg_payload->chanv[0].value = val;
ipc_msg_send(msg, NULL, false);
}

Expand Down