Skip to content

Commit 279b652

Browse files
committed
WIP: ipc: implement creation of user audio thread
1 parent d574f22 commit 279b652

3 files changed

Lines changed: 17 additions & 1 deletion

File tree

src/include/sof/ipc/common.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ struct ipc_user {
6464
/** @brief Result code from user thread processing */
6565
int result;
6666
struct ipc *ipc;
67+
struct k_thread *audio_thread;
6768
};
6869

6970
struct ipc {

src/ipc/ipc-common.c

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@
2424
#include <sof/lib/memory.h>
2525
#include <sof/list.h>
2626
#include <sof/platform.h>
27+
#include <sof/schedule/ll_schedule.h>
28+
#include <sof/schedule/ll_schedule_domain.h>
2729
#include <rtos/sof.h>
2830
#include <rtos/spinlock.h>
2931
#include <ipc/dai.h>
@@ -278,7 +280,7 @@ void ipc_msg_send(struct ipc_msg *msg, void *data, bool high_priority)
278280
list_item_append(&msg->list, &ipc->msg_list);
279281
}
280282

281-
#ifdef CONFIG_SOF_USERSPACE_LL
283+
#if 0 /*def CONFIG_SOF_USERSPACE_LL */
282284
LOG_WRN("Skipping IPC worker schedule. TODO to fix\n");
283285
#else
284286
schedule_ipc_worker();
@@ -460,6 +462,11 @@ __cold int ipc_user_init(void)
460462

461463
k_thread_start(&ipc_user_thread);
462464

465+
struct task *task = zephyr_ll_task_alloc();
466+
schedule_task_init_ll(task, SOF_UUID(ipc_uuid), SOF_SCHEDULE_LL_TIMER,
467+
0, NULL, NULL, cpu_get_id(), 0);
468+
ipc_user->audio_thread = scheduler_init_context(task);
469+
463470
/* Wait for user thread startup — consumes the initial k_sem_give from thread */
464471
k_sem_take(ipc->ipc_user_pdata->sem, K_FOREVER);
465472

src/ipc/ipc4/helper.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -726,6 +726,14 @@ __cold int ipc_comp_connect(struct ipc *ipc, ipc_pipe_comp_connect *_connect)
726726
#else
727727
dp_heap = NULL;
728728
#endif /* CONFIG_ZEPHYR_DP_SCHEDULER */
729+
730+
#ifdef CONFIG_SOF_USERSPACE_LL
731+
if (!dp_heap) {
732+
/* use system user heap for non-DP module buffers */
733+
dp_heap = sof_sys_user_heap_get();
734+
}
735+
#endif
736+
729737
bool cross_core_bind = source->ipc_config.core != sink->ipc_config.core;
730738

731739
/* If both components are on same core -- process IPC on that core,

0 commit comments

Comments
 (0)