Skip to content

WIP: Userspace LL ztest#10576

Draft
lgirdwood wants to merge 29 commits intothesofproject:mainfrom
lgirdwood:qemudc233c-pipe
Draft

WIP: Userspace LL ztest#10576
lgirdwood wants to merge 29 commits intothesofproject:mainfrom
lgirdwood:qemudc233c-pipe

Conversation

@lgirdwood
Copy link
Member

Very basic/simple ztest to start with user LL. For developers only, lots still todo. Includes qemu support for dc233c atm.

(.venv) lrg@moth:~/work/sof/build-qemu_xtensa_mmu$ west build -t run
-- west build: running target run
[0/27] cmake -P /home/lrg/work/sof/sof/scripts/cmake/version.cmake
-- SOF version.cmake starting at 2026-02-24T20:54:21Z UTC
-- /home/lrg/work/sof/sof/ is at git commit with parent(s):
commit 31248867b7d03507a44c4383bbfeb91993ad0254 7bee513d082b5e058f2accb3bde00c2c7907b439 (HEAD -> qemudc233c-pipe, lrg/qemudc233c, qemudc233c)
Author: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Date:   Tue Feb 24 15:38:55 2026 +0000

    boot tests: add support for running boot tests on qemu simulator
    
    Call directly here as more qemu target wont simulate IPC which is used
    as entry for testing on HW.
    
    Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
-- GIT_TAG / GIT_LOG_HASH : v2.14-pre-rc-427-g31248867b7d0-dirty / 31248867b
-- Source content hash: 412cbc68. Notes:
  - by design, source hash is broken by Kconfig changes. See #3890.
  - Source hash is also broken by _asymmetric_ autocrlf=input, see
    #5917 and reverted #5920.
-- Unchanged /home/lrg/work/sof/build-qemu_xtensa_mmu/zephyr/include/generated/sof_versions.h
[1/2] To exit from QEMU enter: 'CTRL+a, x'[QEMU] CPU: dc233c
[    0.017126] <inf> init: FW ABI 0x301d001 DBG ABI 0x5003000 tags SOF:v2.14-pre-rc-427-g31248867b7d0-dirty zephyr:v4.3.0-5654-gf6a32b27dc17 src hash 0x412cbc68 (ref hash 0x412cbc68)
[    0.022360] <inf> ipc: SOF_BOOT_TEST_STANDALONE, disabling IPC.
*** Booting Zephyr OS build v4.3.0-5654-gf6a32b27dc17 ***
[    0.022566] <inf> main: SOF on qemu_xtensa
[    0.022584] <inf> main: SOF initialized
Running TESTSUITE sof_boot
===================================================================
START - test_sys_sem
[    0.028553] <inf> sof_boot_test: SOF thread UserSpace! (qemu_xtensa/dc233c/mmu) sem 0x1aa000: 0
 PASS - test_sys_sem in 0.007 seconds
===================================================================
START - user_space
[    0.129540] <inf> sof_boot_test: SOF thread UserSpace! (qemu_xtensa/dc233c/mmu)
[    0.140062] <inf> sof_boot_test: SOF thread UserSpace! (qemu_xtensa/dc233c/mmu)
 PASS - user_space in 0.012 seconds
===================================================================
TESTSUITE sof_boot succeeded
Running TESTSUITE userspace_ipc4_pipeline
===================================================================
START - test_pipeline_create_destroy_handlers
[    0.241230] <inf> sof_boot_test: Starting IPC4 pipeline test (handlers)
[    0.241251] <inf> pipe: pipeline new pipe_id 2 priority 0
[    0.241376] <inf> sof_boot_test: IPC4 pipeline test (handlers) complete
 PASS - test_pipeline_create_destroy_handlers in 0.001 seconds
===================================================================
START - test_pipeline_create_destroy_helpers
[    0.341912] <inf> sof_boot_test: Starting IPC4 pipeline test (helpers)
[    0.341931] <inf> pipe: pipeline new pipe_id 1 priority 0
[    0.342072] <inf> sof_boot_test: IPC4 pipeline test (helpers) complete
 PASS - test_pipeline_create_destroy_helpers in 0.001 seconds
===================================================================
TESTSUITE userspace_ipc4_pipeline succeeded
Running TESTSUITE userspace_ll
===================================================================
START - ll_task_test
 SKIP - ll_task_test in 0.001 seconds
===================================================================
TESTSUITE userspace_ll succeeded
Running TESTSUITE userspace_mailbox
===================================================================
START - mailbox_test
 SKIP - mailbox_test in 0.001 seconds
===================================================================
TESTSUITE userspace_mailbox succeeded

------ TESTSUITE SUMMARY START ------

SUITE PASS - 100.00% [sof_boot]: pass = 2, fail = 0, skip = 0, total = 2 duration = 0.019 seconds
 - PASS - [sof_boot.test_sys_sem] duration = 0.007 seconds
 - PASS - [sof_boot.user_space] duration = 0.012 seconds

SUITE PASS - 100.00% [userspace_ipc4_pipeline]: pass = 2, fail = 0, skip = 0, total = 2 duration = 0.002 seconds
 - PASS - [userspace_ipc4_pipeline.test_pipeline_create_destroy_handlers] duration = 0.001 seconds
 - PASS - [userspace_ipc4_pipeline.test_pipeline_create_destroy_helpers] duration = 0.001 seconds

SUITE SKIP -   0.00% [userspace_ll]: pass = 0, fail = 0, skip = 1, total = 1 duration = 0.001 seconds
 - SKIP - [userspace_ll.ll_task_test] duration = 0.001 seconds

SUITE SKIP -   0.00% [userspace_mailbox]: pass = 0, fail = 0, skip = 1, total = 1 duration = 0.001 seconds
 - SKIP - [userspace_mailbox.mailbox_test] duration = 0.001 seconds

------ TESTSUITE SUMMARY END ------

===================================================================
PROJECT EXECUTION SUCCESSFUL
QEMU: Terminated

@lgirdwood lgirdwood force-pushed the qemudc233c-pipe branch 2 times, most recently from 5c7af85 to 9eb49af Compare March 11, 2026 20:23
lrgirdwo added 28 commits March 12, 2026 19:59
checkpatch flags too many false positives in the SOF codebase to be
considered useful. Notwithstanding it does not cope with assembler,
matlab and topology very well.

Remove and use clang-format instead which is understood by modern editors
and agents.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Move the initialization of `bsource_list`, `bsink_list`, and performance
tracking telemetry data from `comp_new_ipc4()` directly into
`ipc4_add_comp_dev()`.

This refactoring centralizes core component setup logic deeper into the
device addition routine, allowing it to be directly leveraged by mock
component setups (like the Zephyr usermode IPC pipeline tests). This
ensures manual test components correctly initialize their data structures
via core infrastructure APIs instead of relying on redundant manual list
tracking, promoting better API safety and reusability.

As a result, `ipc4_add_comp_dev()` is now defined in `component_ext.h`
as a globally accessible symbol, dropping its static scope.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Add the ztest framework test cases for the aria module, validating
component instantiation and evaluation configuration structs bindings.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Add the ztest framework test cases for the asrc module, validating
component instantiation and evaluation configuration structs bindings.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Add the ztest framework test cases for the codec module, validating
component instantiation and evaluation configuration structs bindings.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Add the ztest framework test cases for the copier module, validating
component instantiation and evaluation configuration structs bindings.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Add the ztest framework test cases for the crossover module, validating
component instantiation and evaluation configuration structs bindings.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Add the ztest framework test cases for the dcblock module, validating
component instantiation and evaluation configuration structs bindings.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Add the ztest framework test cases for the google module, validating
component instantiation and evaluation configuration structs bindings.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Add the ztest framework test cases for the igo_nr module, validating
component instantiation and evaluation configuration structs bindings.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Add the ztest framework test cases for the level_multiplier module, validating
component instantiation and evaluation configuration structs bindings.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Add the ztest framework test cases for the mfcc module, validating
component instantiation and evaluation configuration structs bindings.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Add the ztest framework test cases for the mic_privacy_manager module, validating
component instantiation and evaluation configuration structs bindings.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Add the ztest framework test cases for the mixin_mixout module, validating
component instantiation and evaluation configuration structs bindings.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Add the ztest framework test cases for the multiband_drc module, validating
component instantiation and evaluation configuration structs bindings.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Add the ztest framework test cases for the nxp module, validating
component instantiation and evaluation configuration structs bindings. Contains
fixes to eap_stub.c mitigating uninitialized trace string pointer dereference.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Add the ztest framework test cases for the rtnr module, validating
component instantiation and evaluation configuration structs bindings.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Add the ztest framework test cases for the smart_amp module, validating
component instantiation and evaluation configuration structs bindings.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Add the ztest framework test cases for the sound_dose module, validating
component instantiation and evaluation configuration structs bindings.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Add the ztest framework test cases for the src module, validating
component instantiation and evaluation configuration structs bindings.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Add the ztest framework test cases for the stft_process module, validating
component instantiation and evaluation configuration structs bindings.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Add the ztest framework test cases for the tdfb module, validating
component instantiation and evaluation configuration structs bindings.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Add the ztest framework test cases for the tensorflow module, validating
component instantiation and evaluation configuration structs bindings.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Add the ztest framework test cases for the tone module, validating
component instantiation and evaluation configuration structs bindings.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Add the ztest framework test cases for the up_down_mixer module, validating
component instantiation and evaluation configuration structs bindings.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Define new connector node ID types for QEMU test input and output
classes, and add a QEMU gateway type. Also expose pipeline creation
and deletion functions globally to support testing in userspace.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Add a new QEMU gateway implementation to the copier component to
facilitate userspace pipeline testing. This allows the copier to
interface directly with the QEMU test environment, handling input and
output classes specific to QEMU.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Add zassert_not_null checks to userspace tests for Intel HDA DMA and SSP
DAI. This verifies that the retrieved DMA and DAI device pointers are valid
and not null before attempting to use them in the test cases.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Refactor test_ipc4_pipeline.c by splitting it into a common utility header
and source file, alongside dedicated test files for native and user space.
This improves code organization and separates test execution environments.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
@lgirdwood
Copy link
Member Author

@kv2019i @jsarha @lyakh fyi - still WIP but can run pipelines on qemu, will be splitting up to upstream.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants