Commit Graph

10610 Commits

Author SHA1 Message Date
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
Baofeng Tian 190babffe8 copier: inline host common copy to save one more function call.
Save one more wrapper time for host copier.

Signed-off-by: Baofeng Tian <baofeng.tian@intel.com>
2023-08-25 11:41:02 +03:00
Baofeng Tian 4cd928007e audio: module adapter: create new module process for host and dai
create new module process stream function for host and dai
audio stream handling.

Signed-off-by: Baofeng Tian <baofeng.tian@intel.com>
2023-08-25 11:41:02 +03:00
Seppo Ingalsuo 6cebb327a2 Tools: Topology1: Add IIR and IIR+FIR HDA generic playback topologies
This patch removes non-practical sof-hda-generic-loud topologies and
generates instead IIR and IIR+FIR topologies for headphone/speaker
path for no-DMIC/2ch-DMIC/4ch-DMIC platforms. The IIR and FIR are
by default programmed for pass-through without any processing.

sof-hda-generic-iir.tplg
sof-hda-generic-iir-2ch.tplg
sof-hda-generic-iir-4ch.tplg
sof-hda-generic-iir-fir.tplg
sof-hda-generic-iir-fir-2ch.tplg
sof-hda-generic-iir-fir-4ch.tplg

The custom topologies can be used e.g. copying them to
/lib/firmware/intel/sof-tplg-custom/ and by adding
to /etc/modprobe.d/sof.conf the following lines with desired
configuration un-commmented.

#options snd_sof_pci tplg_filename="sof-hda-generic-iir.tplg" tplg_path="intel/sof-tplg-custom"
#options snd_sof_pci tplg_filename="sof-hda-generic-iir-fir.tplg" tplg_path="intel/sof-tplg-custom"
#options snd_sof_pci tplg_filename="sof-hda-generic-iir-2ch.tplg" tplg_path="intel/sof-tplg-custom"
#options snd_sof_pci tplg_filename="sof-hda-generic-iir-fir-2ch.tplg" tplg_path="intel/sof-tplg-custom"
#options snd_sof_pci tplg_filename="sof-hda-generic-iir-4ch.tplg" tplg_path="intel/sof-tplg-custom"
#options snd_sof_pci tplg_filename="sof-hda-generic-iir-fir-4ch.tplg" tplg_path="intel/sof-tplg-custom"

The patch contains a fix for pipeline with FIR to undefine the
related macros to avoid them to possibly impact another FIR instance.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2023-08-25 09:15:18 +03:00
Jaroslaw Stelter 0d15fa4d29 lib-manager: Support for two stage library loading
The hardware programming flow dictates that the DSP side should set the
GEN bit first followed by the host setting the EN bit.
We cannot assume that the GEN bit is already enabled (and it would in fact
will leave the DMA on the DSP side wrongly configured at best).

To support the currently used flow (single step) and add support for the
correct programming flow, the proposed solution is to use the lib_id as
indication of the method the host software is going to use.

Two stage flow:
The first LOAD_LIBRARY_PREPARE with valid dma_id
 - just allocate and set the GEN bit
Second LOAD_LIBRARY with valid lib_id and dma_id
 - proceed to the loading of the library via host DMA to local buffer

Single stage flow (currently supported)
LOAD_LIBRARY with valid lib_id and dma_id
 - allocate, set GEN bit and proceed to loading the library

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Signed-off-by: Jaroslaw Stelter <Jaroslaw.Stelter@intel.com>
2023-08-25 08:13:14 +03:00
Seppo Ingalsuo e887eb0ade Audio: Crossover: Avoid issue with __sparse_cache address spaces
The issue with __sparse_cache in sinks[] array seems quite
complicated to change so avoiding it with further module API
conversion seems like better approach.

The processing functions in crossover_generic.c are changed to
use struct output_stream_buffer pointer array from module API.

The function crossover_assign_sinks() is changed to pick the
output stream buffers from module API in the order that is
defined in configuration blob.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2023-08-24 10:15:52 -07:00
Seppo Ingalsuo 6403e6274a Audio: Crossover: Fix mistake in check for number of bands
The check needs to be for or, the and condition is never met.
With e.g. num_sinks = 1 the index to function map became -1
that returned an invalid function.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2023-08-24 10:15:52 -07:00
Marcin Szkudlinski 9359f57808 Revert "audio: add fixup for S24_3LE"
This reverts commit 6efab4a7ab.
2023-08-24 18:03:19 +03:00
Marcin Szkudlinski d3884977cd Revert "ipc4: add S24_4LE_MSB format support"
This reverts commit 784630f80b.
2023-08-24 18:03:19 +03:00
Marcin Szkudlinski afd585331e Revert "pcm:_converter: simplify the pcm conversion algorithm"
This reverts commit 87856a73d7.
2023-08-24 18:03:19 +03:00
Marcin Szkudlinski 5de6d098d7 Revert "topology2: change the sample type for Linux audio system"
This reverts commit 196f86cde4.
2023-08-24 18:03:19 +03:00
Marcin Szkudlinski fe131dc7df Revert "copier: adjust valid format based on sample type"
This reverts commit 5e1a9c05b5.
2023-08-24 18:03:19 +03:00
Kai Vehmanen b81f1309e8 west.yml: update Zephyr to ef6486170786
Contains 2211 commits, including following directly affecting
SOF targets:

ab0ed577111b mm: intel_adsp_tlb: Handle address space conversion warnings
823e6b70d240 arch: xtensa: Implement arch_float_enable&disable
be779f2a6195 intel_adsp: hda: fix usage of FIFORDY bit
498f294b2720 west: update sof ref in manifest
42ca64d60cd2 tests: dma_sg: intel_adsp_ace15 specific config
0e373019d65e dma: intel_adsp_gpdma: Unmask interrupt on ACE
6e66efa08871 soc: intel_adsp_ace15: Include stdint.h
250748bfe671 intel_adsp: Add option about switch off hpsram
b4293ec026c4 dts: xtensa: nxp: add nodes for IPC
1295283a8a72 soc: xtensa: nxp: add resource_table section in linker script
e6d89268572d xtensa: set no optimization for arch_cpu_idle() with xt-clang
a458d0443a91 xtensa: allow arch-specific arch_spin_relax() with more NOPs
f60306193844 soc: xtensa: intel_adsp: cavs: fix PM hooks guards
385ad46a39ca boards/xtensa: Skip cleaning intermediate binaries up
1c0c2a095b48 drivers: intel_adsp_gpdma: Fix release ownership
e55fb88bcbe7 soc: intel_adsp/ace: update clock rate
35e8e6fa03fa soc/xtensa/nxp_adsp/CMakeLists.txt: use new WEST_SIGN_OPTS variable
c35d97534fd1 include: util_internal: add Z_SPARSE_LIST_{ODD|EVEN}_NUMBERS
25c6553edde5 soc: intel_adsp/ace: use functions to do CPU power control
3764814831a7 intel_adsp: boot: d3: hp sram reinit

Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
2023-08-23 19:34:26 +03:00
Seppo Ingalsuo ad7918106d Audio: Crossover: Fix build error
The component build fails if it is enabled in Kconfig. The variable
pipeline_id is not defined, it should be sink_id.

Fixes: 5bcbcf19f7 ("Audio: Crossover: Convert to module adapter")

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2023-08-23 13:02:06 +01:00
Chao Song bc28b924d9 cmocka: fix cmocka build issue
Fix the cmocka build issue after adding functions
for explicitly get ipc device for component, buffer
and pipeline.

Signed-off-by: Chao Song <chao.song@linux.intel.com>
2023-08-23 11:22:42 +01:00
Chao Song ba07a1474e ipc4: remove get_comp()
This function is not used anymore, remove it.

Signed-off-by: Chao Song <chao.song@linux.intel.com>
2023-08-23 11:22:42 +01:00