Commit Graph

10725 Commits

Author SHA1 Message Date
Rander Wang 6bd69e63a7 ipc4: msg: simplify ipc message check for notification
Use list_is_empty to check the message is queued or not. The notify
message is initialized to empty after deleting from the ipc msg list.
We use the same idea in ipc_msg_send.

Signed-off-by: Rander Wang <rander.wang@intel.com>
2023-09-05 15:55:52 +01:00
Rander Wang 2cbae587bb ipc4: msg: avoid sending duplicated reply message
In multicore case, IPC message is dispatched from primary core to
secondary core which send reply message to host. Primary core will
do nothing if IPC_TASK_SECONDARY_CORE is set. But in rare case, the
secondary code finish the reply message and clear this flag before
the ipc thread in primary core check this flag, then primary core
also send reply message again. This results to the reply message being
inserted two times in ipc message list and infinite loop when visiting
the list.

This patch will check msg_reply state and do nothing if it is prepared
. We don't need to init reply message since it is initialized after
deleting from the ipc list.

Signed-off-by: Rander Wang <rander.wang@intel.com>
2023-09-05 15:55:52 +01:00
Seppo Ingalsuo d964b7bf51 Math: Use HiFi3 IIR_DF2T version for HiFi4
The HiFi3 code is faster and compatible so it should be used
instead of generic version for HiFi4.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2023-09-01 21:18:49 +01:00
Seppo Ingalsuo fd535f0a9b Math: Cleanup FIR and IIR build type select
The normally undefined SOF_FIR_FORCEARCH or SOF_IIR_DF2T_FORCEARCH
can be defined at command line to force the build of other code
optimized version for any compiler. The usage is only for
debugging, e.g. build generic FIR version with xcc.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2023-09-01 21:18:49 +01:00
Kai Vehmanen 38faea7ec3 west.yml: update Zephyr to 5689916a70ad
Contains 450+ commits, including following directly affecting
SOF targets:

5689916a70ad soc: xtensa: intel_adsp: cavs: fix assert on L3_MEM_BASE_ADDR
34ea488da91c intel_adsp: ace20_lnl: add ALH DAI support
b7e181c2708b soc: intel_adsp: add HDA buffer interrupt functions
d68a58d6cd26 dts: xtensa: intel: add HDA DMA interrupt defs for ACE2.0
62c7729b3e1a dts: xtensa: intel: add HDA DMA interrupt defs for cAVS platforms
c6c6c5a5ed64 soc: intel_adsp: ace shim: add force L1 defines
0fead68e2b8e Revert "llvm: use proper syntax for --config option"
cd97eae73b4b soc: xtensa: intel_adsp: common: s/device.h/init.h
6cdabb4dff5e soc: xtensa: intel_adsp: common: add missing section_tags.h
c360284c6e14 soc: xtensa: intel_adsp: add missing init.h
ffd2121c65d3 soc: xtensa: intel_adsp: cavs: fix power_down_cavs() signature
a1d7ffdc374d soc: xtensa: intel_adsp: cavs: fix incorrect cached/uncached cast
ce7c30c12978 soc: intel_adsp/ace: use WAIT_FOR for core power transitions
3f0ee7f6db7a power_domain: intel_adsp: initialize after DMA
ca23a5f0cf75 xtensa: mmu: allow SoC to do additional MMU init steps
088a31e2bffa xtensa: mmu: preload ITLB for VECBASE before restoring...
40f2486b685c xtensa: mmu: rename MMU_KERNEL_RING to Z_XTENSA_KERNEL_RING...
18eb17f4cd69 xtensa: mmu: add arch_reserved_pages_update
4778c13bbeab xtensa: mmu: handle all data TLB misses in double exception
c723d8b8d3ac xtensa: Add missing synchronization
24148718fc6e xtensa: mmu: cache common data and heap if !XTENSA_RPO_CACHE
b6ccbae58dc4 xtensa: mmu: use _image_ram_start/end for data region
257404a14327 xtensa: mmu: init: only clear enough entries in way 6
614e64325d48 xtensa: mmu: no longer identity map the first 512MB
b5016714b082 xtensa: mmu: handle TLB misses during user exception
98ffd1addd6a xtensa: crt1: call z_xtensa_mmu_init
38d4b7872401 xtensa: mmu: remove printing vaddr registers during exception
3d63e2060edf dts: cpu: add cdns,tensilica-xtensa-lx3

Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
2023-09-01 12:05:50 +03:00
Kai Vehmanen 7c013b27e5 CODEOWNERS: add kv2019i to the list of default owners
Add myself to the list of default owners that get added to
all pull requests if no other entries match.

Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
2023-09-01 09:23:17 +01:00
Seppo Ingalsuo 176aec773c Tools: Tune: DRC: Export ascii and binary IPC4 blobs for sof-ctl
The passthrough and enabled blobs are exported to tools/ctl/ipc4/drc.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2023-08-31 21:04:17 +01:00
Baofeng Tian 7d41360f22 audio: perf: add core information into performance log
print out core ID in each core performance log tracing.

Signed-off-by: Baofeng Tian <baofeng.tian@intel.com>
2023-08-31 20:48:05 +01:00
Baofeng Tian 0573f9ad51 audio: volume: move peak volume header to volume folder
move peak volume header from ipc4 include path to volume folder.

Signed-off-by: Baofeng Tian <baofeng.tian@intel.com>
2023-08-31 20:29:48 +01:00
Baofeng Tian 651791045a audio: volume: move volume header to volume folder
move them from include path to volume folder.

Signed-off-by: Baofeng Tian <baofeng.tian@intel.com>
2023-08-31 20:29:48 +01:00
Fabio Baltieri f78d759f89 zephyr: edf-schedule: fix CONTAINER_OF type
The z_delayed_work field in struct task is a delayed work, so to go from
k_work to it safely there's an extra step. Add a
k_work_delayable_from_work to fix that.

This is harmless right now because k_work is the first field in
k_work_delayable but the extra step is the safe way of doing it.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2023-08-31 22:14:37 +03:00
ShriramShastry 31453ceca3 Math: Library: Add the HiFi3, HiFi4, HiFi5 exponential function
This check in change eliminates the extra include isa.h header file
from the exp_fcn_hifi.c file, as it does in the exp_fcn.h file.

Signed-off-by: ShriramShastry <malladi.sastry@intel.com>
2023-08-31 15:22:43 +01:00
ShriramShastry 7a7198dfd3 Math: Library: Add the hifi4 exponential function
This patch adds a single h-file include and other cosmetic
blanks/tabs changes.

Signed-off-by: ShriramShastry <malladi.sastry@intel.com>
2023-08-31 15:22:43 +01:00
Yong Zhi 107043f978 topology2: cavs-rt5682: use macros for all PCM IDs
Make it less error-prone for maintenance.

Signed-off-by: Yong Zhi <yong.zhi@intel.com>
2023-08-31 15:22:05 +01:00
Marc Herbert 178f561b6e Revert "app/prj.conf: restore CONFIG_CLEANUP_INTERMEDIATE_FILES=n default"
This reverts commit 80c6738b89.

The Zephyr default changed in commit 385ad46a39ca so this is not needed
anymore.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2023-08-31 11:37:01 +03:00
Seppo Ingalsuo 8d01ad69a7 Kconfig: Enable crossover and multiband-DRC by default
This patch enables for TGL and MTL platforms as default
to enable CI build tests, etc.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2023-08-30 16:01:59 +01:00
Seppo Ingalsuo 0f5cee0064 Audio: Multiband-DRC: Convert to module adapter
This patch replaces legacy component API with new module adapter
API. There are no changes to functionality.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2023-08-30 16:01:59 +01:00
Marc Herbert 23284780d7 .github/zephyr.yml: fix tags missing from `git -C zephyr/ describe`
Fixes commit 4286bb3ee1 (".github/zephyr: west update with new, faster
git --filter-tree:0") that accidentally dropped git tags from `git
describe` in Zephyr since April and made the build different from
everyone else.

See detailed explanation added to the source.

To find the output of `git -C zephyr/ describe`, search for
`generated/version.h` in the build logs.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2023-08-30 14:11:11 +01:00
Brent Lu dca9085047 topology1: adl-max98360a-da7219: support DA7219 headphone codec
Add an new topology adl-max98360a-da7219.tplg for DA7219 headphone
codec with MAX98360A speaker amplifier on ADL boards. The MCLK
frequency is set to 24.576MHz to use PLL bypass mode and avoid the
WCLK locking problem on earlier platforms.

Signed-off-by: Brent Lu <brent.lu@intel.com>
2023-08-30 14:10:23 +01:00
Baofeng Tian 7d9a3ca030 audio: volume: move volume out from module adapter
move volume from module adapter to src/audio directory, it is a
critical audio component.

Signed-off-by: Baofeng Tian <baofeng.tian@intel.com>
2023-08-30 13:49:48 +01:00
Baofeng Tian 550968b169 audio: volume: create ipc3 and ipc4 specific file
create ipc3 and ipc4 specific files and used to cover specific
functions.

Signed-off-by: Baofeng Tian <baofeng.tian@intel.com>
2023-08-30 13:49:48 +01:00
Baofeng Tian bcc263be66 audio: volume: add volume_uuid header file
this header file used to move out volume uuid.

Signed-off-by: Baofeng Tian <baofeng.tian@intel.com>
2023-08-30 13:49:48 +01:00
Baofeng Tian 5397ea8015 audio: remove config: CONFIG_COMP_LEGACY_INTERFACE
This config is used for old intel cavs 1.x platform, now, those
platform are removed from sof, this config also need remove,
related code got removed as well.

Signed-off-by: Baofeng Tian <baofeng.tian@intel.com>
2023-08-30 13:49:48 +01:00
Daniel Baluta 0b78bd742b imx: sdma: Add support for loading RAM script
SDMA support loading firmware RAM scripts in order to enhance
functionality. We will need this for supporting multi-fifo
with upcoming MICFIL PDM driver.

Allow SDMA to load such scripts selected via CONFIG_HAVE_SDMA_FIRMWARE
config.

A RAM script interface guarantees that there will be the following
information provided:
- sdma_code, an array of bytes containting the actual script binary
- RAM_CODE_START_ADDR, location in RAM where to load the script
- RAM_CODE_SIZE, size of the sdma_code array.

Because RAM scripts are NXP proprietary binaries we won't make them
public but offer the interface to integrate them with SOF in private
builds.

We use for now sdma_script_code_imx7d_4_5.h header file which must be
present in location indicated by CONFIG_SDMA_SCRIPT_CODE.

Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
2023-08-30 15:04:57 +03:00
Marc Herbert 29b3033484 .github/zephyr.yml: remove spurious `zephyr_revsion` matrix variable
Fixes commit 6f9f2ee28e (".github/zephyr: build with the debug overlay
and CONFIG_ASSERT")

Remove misspelled `zephyr_revsion` matrix variable. It was a hasty
copy/paste in that commit.

It's a harmless no-op because build-windows does not play any git tricks
and always builds from the manifest. However it makes the list of
configurations confusing in the Github interface.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2023-08-30 15:03:14 +03:00
Chao Song 45ca3d430d include: ipc4: module: fix component ID macros
The existing component ID is composed with
'module_id << 16 | instance_id', it doesn't
comply to the initial instance IPC structure:

struct {
    uint32_t module_id   : 16;
    uint32_t instance_id : 8;
    ...
};

When the ID is logged through mtrace, it is
hard to use the ID to find the related linux
kernel message.

This patch fixes component ID composition macros,
thus helps to eliminate component ID inconsistency
between firmware and linux kernel.

Link: https://github.com/thesofproject/sof/issues/8051

Signed-off-by: Chao Song <chao.song@linux.intel.com>
2023-08-30 11:53:16 +01:00
Kai Vehmanen 434466e373 ipc4: helper: adhere to cached/uncached interface
source_set_ibs() and source_set_obs() take a cached pointer.
Fix code in ipc_comp_connect() to adhere to the prototype.

Fixes sparse warnings:

ipc4/helper.c:389:49: warning: incorrect type in argument 1 (different address spaces)
ipc4/helper.c:390:45: warning: incorrect type in argument 1 (different address spaces)

Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
2023-08-30 11:48:43 +01:00
Marc Herbert ed8dd91654 CODEOWNERS: remove @aborisovich
Andrey is not at Intel any more.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2023-08-30 11:33:27 +01:00
Seppo Ingalsuo 77a41bebeb Tools: Topology1: Multiband-DRC: Update setup blobs
The multiband_drc_coef_default.m4 is updated to what the current
setup tool example_multiband_drc() exports.

Another blob for pass-through is added with emphasis and all bands
processing disabled. Such blob is useful when headphone and
speaker paths are shared. Headphone mode should use pass-through.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2023-08-29 18:51:00 +03:00
Chao Song 82b7f6869f topology2: align benchmark hda topology with other hda topology
In this patch, audio_format is deprecated, and use
input_audio_format/output_audio_format instead.

Correct the IIR control bytes naming, and make it the
same with other HDA topology.

Signed-off-by: Chao Song <chao.song@linux.intel.com>
2023-08-29 18:48:12 +03:00
Peter Ujfalusi 068f143810 ipc4: handler: Use separate loops for pipeline state phases
Currently the pipeline state change flow handles the phases at the same
time for each pipeline (for two pipelines):
pipeline1 prepare
Pipeline1 trigger
pipeline0 prepare
Pipeline0 trigger

This can open a race condition when pipeline1 is already triggered and is
in active state while pipeline0 is not yet prepared, configured.
The process function of a component from pipeline1 might query information
from pipeline0 at this point, which can lead to errors.

With the separate loops the flow will be changed to:
pipeline1 prepare
pipeline0 prepare
Pipeline1 trigger
Pipeline0 trigger

It will make sure that all pipelines and components have been prepared
before the triggering is going to happen.
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>

# Conflicts:
#	src/include/sof/ipc/topology.h
#	src/ipc/ipc4/handler.c
2023-08-29 18:29:05 +03:00
Peter Ujfalusi fe988ea161 ipc4: idc: Handle the phase parameter in idc_ppl_state()
Execute the requested phases of the pipeline state change specified by
the phase parameter.
If no phase has been specified then run both phases as oneshot.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
2023-08-29 18:29:05 +03:00
Peter Ujfalusi cf2aad7613 ipc4: handler: Export ipc4_pipeline_prepare and ipc4_pipeline_trigger
Make the ipc4_pipeline_prepare and ipc4_pipeline_trigger available outside
of handler.c to be used to implement staged pipeline state phases.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
2023-08-29 18:29:05 +03:00
Peter Ujfalusi 4a27f3bce0 idc: Add phase definition to IDC_MSG_PPL_STATE extension
Add definitions for pipeline state change phases to be executed when a
PPL_STATE message is handled by a remote core.
The phase can be a combination of:
PREPARE and TRIGGER.
PREPARE will run a configuration (state change preparations) phase on the
	pipeline
TRIGGER will run a a trigger on the pipeline

Set ONESHOT in ipc4_set_pipeline_state() to have both phases to be run in
order to avoid regression.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
2023-08-29 18:29:05 +03:00
Peter Ujfalusi fd60858a4c idc: Add pipeline ID mask definition to IDC_MSG_PPL_STATE extension
In preparation to share the extension with an action, first introduce a
mask so that the idc code is prepared for a shared use of the extension.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
2023-08-29 18:29:05 +03:00
Peter Ujfalusi d61d732314 ipc4: handler: Split the set_pipeline_state()
Separate the set_pipeline_state() function into two distinct phase:
ipc4_pipeline_prepare() and ipc4_pipeline_trigger()

The two phase will be used later directly to avoid race conditions when
a pipeline is already set to run while the connected pipeline is not yet
prepared.

With the split also clean up the debug prints to be unified and clear.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
2023-08-29 18:29:05 +03:00
Kwasowiec, Fabiola 7b1820d51d host_common_params: adjust the values to the format 24/24
Currently DMA buffer size is aligned to 32. It should be:
rec_buff_size = ROUND_UP(rec_buff_size, min_buffer_size);
rec_buff_size = ROUND_UP(rec_buff_size, round_up_size);

Period_bytes should also not be aligned to 32 for 24/24 format

Change resolves timeout problem during offload
of playback with 44.1 format

Signed-off-by: Kwasowiec, Fabiola <fabiola.kwasowiec@intel.com>
2023-08-29 15:03:53 +02:00
Daniel Baluta 4d2e9b1edf Audio: MFCC: Fix compilation error
/home/bamboo/sof_dir/sof/src/audio/mfcc/mfcc_hifi4.c: In function
‘mfcc_source_copy_s16’:
/home/bamboo/sof_dir/sof/src/audio/mfcc/mfcc_hifi4.c:86: warning:
assignment from incompatible pointer type
/home/bamboo/sof_dir/sof/src/audio/mfcc/mfcc_hifi4.c: In function
‘mfcc_fill_prev_samples’:
/home/bamboo/sof_dir/sof/src/audio/mfcc/mfcc_hifi4.c:119: warning:
assignment from incompatible pointer type

Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
2023-08-29 11:20:54 +03:00
Marc Herbert c0fd911396 xtensa-build-zephyr.py: re-enable sof_ri_info.py on MTL and LNL
Now we can avoid bitrot again thanks to recent rimage fix
https://github.com/thesofproject/rimage/commit/4fb9fe00575bc

Also update outdated comments.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2023-08-28 16:16:44 +01:00
Andrula Song d0cb478007 Audio: MFCC: Add HiFi3 implementation of MFCC
Add HiFi3 implementation of MFCC.

Signed-off-by: Andrula Song <andrula.song@intel.com>
2023-08-28 10:55:16 +01:00
Andrula Song 5c92bddcf4 Audio: MFCC: Add HiFi4 implementation of MFCC
Add HiFi4 implementation of MFCC.

Signed-off-by: Andrula Song <andrula.song@intel.com>
2023-08-28 10:55:16 +01:00
Andrula Song 9b9c683cc6 Audio: MFCC: Split the implementation of mfcc into 2 files
Split the implementation code of mfcc from mfcc_generic.c
into mfcc_generic,c and mfcc_common.c.

Signed-off-by: Andrula Song <andrula.song@intel.com>
2023-08-28 10:55:16 +01:00
Andrula Song bd35cebc0e Audio: MFCC: Remove the debug file operations from C code
Remove the debug file operations from C code, and will add
a similar matlab script in the future.

Signed-off-by: Andrula Song <andrula.song@intel.com>
2023-08-28 10:55:16 +01:00
Seppo Ingalsuo 17ccaf51e5 Audio: Crossover: Adjust error message for pin index usage in config
In IPC4 system the output sinks of crossover are not defined by
pipeline identifiers but by pin indices. The error message is
updated to be IPC version agnostic to avoid confusion.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2023-08-28 11:47:55 +03:00
Seppo Ingalsuo 356988e7ca Tools: Tune: Multiband-DRC: Changes for Matlab syntax
The code contains some m-language syntax that is not supported
by Matlab. The code lines are changed to compatible with both
Octave and Matlab. The blobs computation is not changed.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2023-08-28 09:42:36 +01:00
Seppo Ingalsuo 3d1275dc0d Tools: Tune: Multiband-DRC: Add support for tplg2 config files generation
This patch re-structures function example_multiband_drc() to
let it generate multiple differentiated configurations. The
computation of blob is moved to new function export_multiband_drc().
The script now generates default (same as before) and pass-through
blobs.

Inside the function the paths for tplg1 and tplg2 are updated as
well as locations of data blobs for sof-ctl. The run of export
function creates blobs for both tplg1 and tplg2 with SOF IPC
versions three and four.

check_create_dir() common function is added to avoid error with
missing directory for export and for warning message about
already existing directory that just using mkdir() would do.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2023-08-28 09:42:36 +01:00
Kai Vehmanen d05588e115 west.yml: Update rimage revision to 4fb9fe0057
Includes following rimage commits:
4fb9fe0057 config: lnl+mtl: fix length of ADSP.man CSE manifest
c809af8168 Config: Add crossover component for TGL and TGL-H cAVS platforms
8c8440070a style: trailing whitespace is the root of all evil
d20f1d8a85 actions: remove travis
af9a2fe58f Config: Fix comment typo for EQ FIR module
b8ee1aa8f6 Config: Add DRC component to TGL, TGL-H, MTL, LNL

Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
2023-08-28 10:43:31 +03:00
Andrey Borisovich 619cf4ac92 ipc4: fixed possible null dereference
Result of the function call ipc_get_comp_by_id() had been dereferenced
without checking whether the pointer may be null.
Returned pointer may be null when component does not exist on the
list.

Signed-off-by: Andrey Borisovich <andrey.borisovich@intel.com>
2023-08-28 10:19:31 +03:00
Seppo Ingalsuo 7b52664a6a Scripts: run-mocks.sh: Change default config to avoid error
The script runs the unit tests natively as gcc compiled.  The
tgph_defconfig is no more available, so use another configuration
that is available in src/arch/xtensa/configs.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2023-08-25 16:55:18 +01:00
Baofeng Tian 7a77c50c06 copier-dai: optimize dai copy part
Use small tricks to make dai have better performance, with
this patch, dai single playback performance back to origin
state(before convert to module interface).

Signed-off-by: Baofeng Tian <baofeng.tian@intel.com>
2023-08-25 11:41:02 +03:00