Commit Graph

10197 Commits

Author SHA1 Message Date
Bard Liao 8ef4d51e68 topology2: sdw-jack-generic: add SDW_JACK_CAPTURE_CH macro
Adding SDW_JACK_CAPTURE_CH macro to specify sdw jack channels.
The default value is 2.

Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
2023-06-12 10:12:36 +03:00
Bard Liao f6f57fe82b Topology2: sdw-jack-generic: add 1 ch format support
Some codecs like cs42l42 support 1 channel capture only.

Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
2023-06-12 10:12:36 +03:00
Mengdong Lin a5c0c49707 topology2: add development tplg to test playback with 2 cores
This is to allow CI to test a simple multicore playback case on
MTL/TGL/ADL: SSP0 playback on core 0 and SSP2 playback on core 1.

Capture uses core 0 only atm. More multicore usage will be
introduced later.

Signed-off-by: Mengdong Lin <mengdong.lin@intel.com>
2023-06-12 10:09:00 +03:00
Andy Ross 65dc05a131 ipc3: Check component type in ipc_stream_pcm_params()
This handler was missing its type check and would follow comp_dev
union fields on components that might be buffers or pipelines, leading
to crashes downstream.

Found via fuzzing.

Signed-off-by: Andy Ross <andyross@google.com>
2023-06-09 08:50:20 +02:00
Andy Ross 403c33f829 ipc: Tolerate uninitialized source/sink list nodes
These list heads in the comp_dev struct are not uniformly initialized
(grepping the source, the list_init() calls for these fields seem to
be spread around the source tree in individual components).  Fuzzing
is seeing nulls here, presumably because it's possible to reach
ipc_comp_free() in "unintended lifecycle" circumstances where they
weren't initialized.  Check the fields before crashing.

Signed-off-by: Andy Ross <andyross@google.com>
2023-06-09 08:50:20 +02:00
Andy Ross d788b34749 ipc/pipeline: Check type in ipc_pipeline_complete()
This function is called based on external commands, and with an
arbitrary component ID that may not actually be a pipeline.  Check the
type before following garbage pointers and passing them down into call
trees.

Found via fuzzing.

Signed-off-by: Andy Ross <andyross@google.com>
2023-06-09 08:50:20 +02:00
Andy Ross 7511a1da15 kpb: Don't assert on memcpy overruns
The config block for the component gets provided externally and is
copied directly in using a byte count likewise provided by the host.
The use of memcpy_s() prevents overruns, but the error that was
detected was being reported via assert().  To fuzzing, that assertion
is a fatal error, when clearly this needs to be a runtime failure as
it's due to external input and not a local code bug.

Signed-off-by: Andy Ross <andyross@google.com>
2023-06-09 08:50:20 +02:00
Baofeng Tian 5f118b761b copier: use separate function for multi endpoint and module copy
Copier_copy left code is for multi endpoint and module copy,
move it to a separate function.

Signed-off-by: Baofeng Tian <baofeng.tian@intel.com>
2023-06-08 15:59:54 +03:00
Baofeng Tian 5fdecbc2eb copier-dai: rename some common function name
Those function are both needed in legacy and zephyr part, simply
with zephyr prefix is not suitable, rename it with common prefix.

Signed-off-by: Baofeng Tian <baofeng.tian@intel.com>
2023-06-08 15:59:54 +03:00
Baofeng Tian 7ea9155ea8 copier: align dai reset and trigger with host and gateway
Host and gateway case already have common function to handle
trigger and reset, add this wrap to align dai with host.

Signed-off-by: Baofeng Tian <baofeng.tian@intel.com>
2023-06-08 15:59:54 +03:00
Baofeng Tian cbba56a121 copier: move free multiple endpoint buffer to dai
Only dai have multiendpoint case, so move it to dai component.

Signed-off-by: Baofeng Tian <baofeng.tian@intel.com>
2023-06-08 15:59:54 +03:00
Baofeng Tian 1a643ca4b0 copier: refactor copier new for host, dai and gateway case
Move more code from copier to its component function.

Signed-off-by: Baofeng Tian <baofeng.tian@intel.com>
2023-06-08 15:59:54 +03:00
Baofeng Tian 9158bab370 copier: move some common functions to generic file
Move some functions from copier.c to copier_generic.c.

Signed-off-by: Baofeng Tian <baofeng.tian@intel.com>
2023-06-08 15:59:54 +03:00
Baofeng Tian 97f78ea3f1 copier-dai: refactor copier parameters
Move dai parameter related code to copier_dai.c with new functions.

Signed-off-by: Baofeng Tian <baofeng.tian@intel.com>
2023-06-08 15:59:54 +03:00
Damian Nikodem ee318548d7 aria: data size calculation fix
This change fixes data size calculation to be copied
to aria cyclic buffer.

Signed-off-by: Damian Nikodem <damian.nikodem@intel.com>
2023-06-07 18:29:19 +03:00
Marc Herbert 212e9808a4 versions.json: bump to 2.6.99
Adopt Zephyr's (and others) .99 convention to indicate a development
branch.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2023-06-07 18:26:26 +03:00
Andrula Song b787bead93 Audio: Peak volume: Add Kconfig to select the period of reporting
peak meter value

Add kconfig to select the period of reporting peak meter value.
The default value is reporting peak meter every 10 ms.

Signed-off-by: Andrula Song <andrula.song@intel.com>
2023-06-07 18:25:19 +03:00
Ranjani Sridharan 1da18c2caa topology2: cavs-sdw: Build passthrough LNL FPGA topology
With RT711 on link 0

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2023-06-07 18:17:20 +03:00
Ranjani Sridharan f8ad12734d topology2: cavs-sdw: Add option for passthrough pipelines
Add a compile time option to build SDW topologies with passthrough
pipelines.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2023-06-07 18:17:20 +03:00
Bard Liao 6863eda168 topology2: add sof-mtl-rt712-l0-rt1712-l3.tplg
For MTL + rt712

Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
2023-06-06 18:06:10 +03:00
Ranjani Sridharan f214520b82 audio:mixin_mixout: Fix max sinks check
Allow up to the max sinks count.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2023-06-06 18:00:31 +03:00
Rander Wang cb605a44ce zephyr: enable core dump on MTL platform
Follow the setting on TGL platforms.

Signed-off-by: Rander Wang <rander.wang@intel.com>
2023-06-06 17:39:58 +03:00
Rander Wang 7a7dfb810d zephyr: enable core dump on tgl platforms
We need to enable CONFIG_DEBUG_COREDUMP_MEMORY_DUMP_MIN according to
comments in coredump_core.c: When dumping minimum information, the
current thread struct and stack need to be dumped so debugger can
examine them.

Signed-off-by: Rander Wang <rander.wang@intel.com>
2023-06-06 17:39:58 +03:00
Rander Wang 2c757064b1 zephyr: wrapper: halt the system in fatal error handler
Follow the k_sys_fatal_error_handler implementation in fatal.c in
zephyr framework. Without this halt, our k_sys_fatal_error_handler
will be called copules time and result to many useless IPC messages
to host.

Signed-off-by: Rander Wang <rander.wang@intel.com>
2023-06-06 17:39:58 +03:00
Seppo Ingalsuo 869666061b Tools: Test: Audio: Fix syntax error in test_run.m
The fprintf() command prints only "#!/bin/sh". For some reason
this has been ignored by interpreter but as clear error it is
better to fix.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2023-06-06 15:32:45 +03:00
Seppo Ingalsuo 0cb752d362 Tools: Test: Audio: Valgrind run related fixes
The changes to scripts/host-testbench.sh and earlier to process_test.m
have unintentionally dropped valgrind run from test.

This patch enables valgrind for process_test.m runs and fixes
issue in test run octave side function to silently ignore
error about failed shell command. Normally test fail when there
is no data or incorrect data, but a valgrind failure with correct
test output was passed.

Valgrind output becomes visible if testbench run trace stderr
redirection to file is disabled. If not done valgrind error would
stop the test but the analysis would not be printed to console.

Fixes: 6b744bcc63 ("host-testbench.sh: use process_test.m for 8 components")

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2023-06-06 15:32:45 +03:00
Kai Vehmanen 07ed14b6fd platform: cavs: do not program GPDMA/ALH ownership in Zephyr builds
If SOF is built with Zephyr, the GPDMA/ALH ownership programming
should happen in Zephyr platform code, not on SOF side.

Link: https://github.com/zephyrproject-rtos/zephyr/pull/55738
Closes: https://github.com/thesofproject/sof/issues/7249
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
2023-06-06 10:32:58 +03:00
Kai Vehmanen bf6ae6dfa4 west.yml: update Zephyr to 3.4.0-rc2
Forward Zephyr to commit 2ad1a24fd60d0df8cb45fb6ed6acf7b0d3820754 .

Contains 566 commits, including following:

dd09b04dc33e boards: xtensa: update rimage and west sign documentation
d98a7c2f8ddb soc: xtensa: cmake: add new WEST_SIGN_OPTS variable
794dff37754f boards: xtensa: mention the $HOME/.flexlmrc file alternative
ac3cafa2edd8 boards: xtensa: remove UP2 from README file
aa5b66be5f1f intel_adsp: cavs25: configure access to ALH
8e3437461d78 soc: intel_adsp: remove obsolete headers for cAVS platforms
44415eb881c8 intel_adsp: Initialize threadptr register
1c130d006099 arch: xtensa: Enable builds without the multithreading
f0b7c275bba9 boards: xtensa: intel_adsp_generic.rst: fix cAVS meaning
49c7aa56fa0c soc: intel_adsp: undefine NOP32
445f4e887712 arch/xtensa: undefine NOP32

Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
2023-06-06 10:32:58 +03:00
Baofeng Tian 1dd1939f05 copier-dai: Add copier_dai_prepare in copier dai source file
Add this function to integrate copier dai prepare code.

Signed-off-by: Baofeng Tian <baofeng.tian@intel.com>
2023-06-02 10:30:52 -07:00
Baofeng Tian f3e9f73e96 copier-dai: add copier_dai_free in copier dai file
Add this function in copier_dai source file, in order to
keep same usage, there is no need to inline this function,
althrough it is short.

Signed-off-by: Baofeng Tian <baofeng.tian@intel.com>
2023-06-02 10:30:52 -07:00
Baofeng Tian e4e5d0344e copier-dai: move create_dai function to copier dai file
Move it and its dependency from copier.c to copier_dai.c file.

Signed-off-by: Baofeng Tian <baofeng.tian@intel.com>
2023-06-02 10:30:52 -07:00
Baofeng Tian 63b1264a74 copier-dai: create new file for dai specific code
Move copier.c dai specific code to copier_dai.c

Signed-off-by: Baofeng Tian <baofeng.tian@intel.com>
2023-06-02 10:30:52 -07:00
Jyri Sarha b9b030757f topology2: dmic-generic.conf: Rename "DMIC" PCM name to "DMIC Raw"
Rename "DMIC" PCM name to "DMIC Raw" in the generic dmic topology fragment.
The PCM is on the DMIC patch without any processing beyond gain and IIR EQ,
thus the "Raw" extension.

Signed-off-by: Jyri Sarha <jyri.sarha@linux.intel.com>
2023-06-02 13:13:45 +03:00
Jyri Sarha 08acbe4b6f topology2: cavs-nocodec.conf: Rename ssp-capture and DMIC0 Raw PCMs
Rename cavs-nocodec capture PCMs. The current PCM names are confusing. These
should be better names for them. The former

"ssp-capture" is now "Port0 2nd Capture",
"DMIC0 Raw" is now "DMIC SFX1", and
"DMIC0 Raw 2" is now "DMIC SFX2".

The PCMs in question have extra gains in the path to simulate processing.
Also the mixer name is changed to compensate for the matching "Capture"
substring in the end of the PCM name, that is part of the mixer name,
to avoid "Capture Capture" tautology.

Signed-off-by: Jyri Sarha <jyri.sarha@linux.intel.com>
2023-06-02 13:13:45 +03:00
Pierre-Louis Bossart 058e6571a5 topology1: add support for Dell SKU 0934
Yet another permutation. This needs to be back-ported to 2.2 releases

Closes: https://github.com/thesofproject/linux/issues/4399
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
2023-06-02 13:12:06 +03:00
Marc Herbert 80c6738b89 app/prj.conf: restore the CONFIG_CLEANUP_INTERMEDIATE_FILES=n default
Zephyr has hardcoded this to 'y' because it saves CI some disk space
when compiling hundreds of different zephyr/tests/, each in a separate
build directory. But when compiling just one "sof/app" it saves
practically no space, breaks the incremental build and can make it more
difficult to troubleshoot some build issues. So, reset it to the default
value.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2023-06-02 13:07:34 +03:00
Marc Herbert 231c4e36de xtensa-build-zephyr.py: remove `default_rimage_key` dead code
We used to provide the `default_rimage_key` in two places:
1) as a default `RIMAGE_KEY` attribute (newer `otc_private_key_3k`)
2) as an explicit `else` clause that was never run because of 1) (older
   `otc_private_key`)

Remove the redundant `else` clause in 2); it became dead code. This
simplifies the code and makes the script ready for the day when the key
argument will be optional for rimage (more about this in
https://github.com/zephyrproject-rtos/zephyr/pull/58356)

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2023-06-02 13:06:35 +03:00
Marc Herbert c81efcf26a xtensa-build-zephyr.py: resolve relative --key arguments
Fixes commit a769d3941d ("xtensa-build-zephyr.py: stop calling west
sign, rely on west build")

Before that commit, `xtensa-build-zephyr.py` used to invoke `west sign`
directly and in the same current directory. This allowed relative key
paths to just work. Now that `west sign` is indirectly invoked by `west
build`, there is no possible way to make relative key paths work. So we
must resolve them before using them.

Fixes #7718

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2023-06-02 13:06:35 +03:00
Fred Oh 07b07f9bfe west.yml: Update rimage revision to 4ce79b15
Pull in following rimage changes:

4ce79b152e (HEAD, manifest-rev) kpb: update kpb uuid for lnl
649b0a6790 file_simple: Allocate correct buffer size for writing sections out
1ea1327b9c README.md: remove "install" target
8f250a99eb Config: Change indent for SRCINTC
acd8a2bc1b Config: Change SRCINTC for tgl-cavs.toml and tgl-h-cavs.toml to LL
77d4a2acd7 cmake: remove "install" target

Signed-off-by: Fred Oh <fred.oh@linux.intel.com>
2023-06-02 13:00:11 +03:00
Ranjani Sridharan 6fb22d645e topology2: intel: dmic-generic: Simplify the core ID setting
When all components of a pipeline are scheduled on the same core, use
the pipeline's core_id attribute to set the core_id for all the
components in it. Also, remove the default core_id in class definitions
so that it doesn't take priority over the value passed from the pipeline
object.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2023-06-01 13:16:56 +03:00
Adrian Warecki 8038fad532 host: zephyr: Subtract partial_size from dma avail/free size.
When the host component detects use of deep buffering it decreases
frequency of dma reloading. The number of processed data is summed up in
the partial_size variable and they are acknowledged in larger packets.
However, the size of processed data was not subtracted from the number of
available data, which could lead to a buffer underrun/overrun.

Signed-off-by: Adrian Warecki <adrian.warecki@intel.com>
2023-05-31 10:04:36 +03:00
Peter Ujfalusi 40625f0de3 ipc4: handler: chain_dma: Handle chain free when the chain_dma is not created
Do not treat as error if the chain dma is asked to be destroyed if it has
not been created yet.

The kernel might send such a request under special circumstances:
the PCM is opened, configured but never started/triggered then just closed,
freed.

This is the same way how pipelines are handled, but in case of pipelines
we use the pipe state.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
2023-05-30 15:23:56 +03:00
Andrula Song 493e2dd3e9 Audio: Fix the 24/32 bits format peak volume calculation
Left shift 8 bits the max value to put the valid 24 bits
into high 24 bits in 32 bits container.

Signed-off-by: Andrula Song <andrula.song@intel.com>
2023-05-29 19:42:37 +03:00
Seppo Ingalsuo e7fc334bda Tools: Tune: DRC: Changes for Matlab compatibility
This patch enables running example_drc.m script with Matlab.
The endifs are changed to end. And mixed usage of endfunction
and end is corrected to just end. The unnecessary
semicolons from function declarations are deleted.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2023-05-29 10:12:16 +03:00
Seppo Ingalsuo 83a2ae813c Tools: Tune: DRC: Export configurations for topology2
This patch changes a bit structure of example_drc to export
conveniently several different blobs. The changed script
exports configurations blobs for disabled and enabled mode.

Two functions for IPC4 and topology2 compatibility are
generalized from EQ to common directory. The EQ and other
tools will be updated to later to use the common get_abi()
and tplg2_write() functions.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2023-05-29 10:12:16 +03:00
Adrian Warecki 5ad5da5bc7 dai: always reload dma ll chain
A problem was observed with launching capture with dmic. Sometimes the host
starts reading data too late, so that the capture buffer becomes full.
In this case, the dma descriptors are not reloaded. This leads to stopping
the dma. When the host starts reading and reads the accumulated data the
stream is already stopped. With this patch, the descriptors are always
reloaded and the stream will not be stopped. A glitch may occur but it is
better than no data at all.

Fixes #7506.

Signed-off-by: Adrian Warecki <adrian.warecki@intel.com>
2023-05-29 10:11:21 +03:00
Przemyslaw Blaszkowski 63cba8d0dd aria: optimize in/out buffer copy
Current implementation use double for loop, copying separately every
sample between circular and linear buffers. This solution is extremely
slow and for some formats consumes even more than 10 MCPS just for data
preparation.

Replacing for-loops with generic wrapped copy functions.

Signed-off-by: Przemyslaw Blaszkowski <przemyslaw.blaszkowski@intel.com>
2023-05-29 10:05:56 +03:00
Baofeng Tian a03e9f6f3d copier-dai: change function name for better understanding
Change function name from: dai_zephyr_get_hw_params to
dai_common_get_hw_params, due to this name also exist in
dai-legacy.c, need align both legacy and zephyr part to avoid
misunderstanding.

Signed-off-by: Baofeng Tian <baofeng.tian@intel.com>
2023-05-29 10:04:08 +03:00
Baofeng Tian d81f80196d copier: remove one case in copier_get_attribute
COMP_ATTR_VDMA_INDEX is a copier internal usage case, no other
module used, so remove and replace it with direct assign. At the
same time, this keep get_attribute align with module adapter format.

Signed-off-by: Baofeng Tian <baofeng.tian@intel.com>
2023-05-29 10:04:08 +03:00
Baofeng Tian 0b0f6f9305 dai-zephyr/legacy: remove comp_dai_get_hw_params dependency
inside dai-zephyr/legacy, there is no need to call
comp_dai_get_hw_params, dai_zephyr_get_hw_params can be directly
called without wrap, remove the dpendency in dai-zephyr/legacy.

Signed-off-by: Baofeng Tian <baofeng.tian@intel.com>
2023-05-29 10:04:08 +03:00