Commit Graph

9623 Commits

Author SHA1 Message Date
Jyri Sarha 3ad30d576c topology2: pipeline: Add "kcps" attribute
Adds kcps attribute to pipeline class with 0 default value.

The default can be overrided with KCPS_PIPELINE_DEFAULT define.

Signed-off-by: Jyri Sarha <jyri.sarha@intel.com>
2023-03-03 15:46:03 +00:00
Paul Olaru 43696239d3 audio: eq_fir: Use a data blob validator to ensure invalid blobs don't stop playback
The validator is intended to verify everything that the regular
algorithm checks without changing the actual component state. If it
receives an invalid data blob, it is discarded and an error returned
from the set_config function (which propagates to sof-ctl tool in the
userspace, assuming the set_config function was called from there).

The validator is only called during playback, to avoid invalid
configuration in the topology preventing the topology from loading in
the first place.

Signed-off-by: Paul Olaru <paul.olaru@nxp.com>
2023-03-03 16:59:18 +02:00
Paul Olaru d9644bc6bb audio: data_blob: Add support for custom validators for data blobs
Whenever a new data blob arrives via IPC it used to be the case that we
just trust it. Here we add the possibility to validate it before it is
actually active. If the data blob is invalid, an error is reported to
the tool and the old data is kept.

Signed-off-by: Paul Olaru <paul.olaru@nxp.com>
2023-03-03 16:59:18 +02:00
Jyri Sarha 5b5ed42720 Revert "hda: chain dma: cancel task before freeing it"
This was not the correct fix for the ll timer free crash issue. Now
that the correct fix[1] is found and merged, this workaround can be
removed.

[1] b3a808afa8 "chain-dma: fix scheduling exception"

This reverts commit 60e9e97e0d.

Signed-off-by: Jyri Sarha <jyri.sarha@intel.com>
2023-03-03 13:28:43 +02:00
Iuliana Prodan 9c3bba8210 scripts: qemu-check.sh: update READY_IPC for imx8
Update READY_IPC value based on changes regarding
interrupt initialization.

Signed-off-by: Iuliana Prodan <iuliana.prodan@nxp.com>
2023-03-03 09:09:25 +02:00
Iuliana Prodan e6845e69e5 imx: fix GIP bits clear method
mx_mu_xsr_rmw() doesn't work correctly for w1c bits
because it reads the register and writes it back fully.
So, use imx_mu_write to clear pending interrupts from MU,
instead of imx_mu_xsr_rmw.

Using imx_mu_xsr_rmw might clear a pending interrupt that
was triggered while handling the current interrupt.

This fixes the case when fw boot confirmation and first
command are sent, from kernel, close to each other and
the command is missed.

Signed-off-by: Iuliana Prodan <iuliana.prodan@nxp.com>
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
2023-03-03 09:09:25 +02:00
Iuliana Prodan 388d69fb9a imx: fix interrupt initialization
Fix interrupt initialization by:
- disable interrupt for DSP Core;
- disable interrupt from MU;
- clear pending interrupt from MU;
- clear pending interrupt for DSP Core;
- configure interrupt for DSP Core;
- enable interrupt from MU.

Signed-off-by: Iuliana Prodan <iuliana.prodan@nxp.com>
2023-03-03 09:09:25 +02:00
Guennadi Liakhovetski dc9ba281d7 platform: remove support for cAVS 1.8 platforms
Remove all support for cAVS 1.8 platformsm including Cannon Lake,
Comet Lake, Whiskey Lake and Coffee Lake, they aren't supported
any more.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2023-03-02 23:02:37 +00:00
Seppo Ingalsuo d371135a63 Tools: Topology2: Add IIR high-pass with gain to DMIC capture
This patch replaces in DMIC0 capture the gain.N.1 component with IIR
high-pass. The gain has been a placeholder
dai-copier-gain-module-copier-capture.conf while the EQ component has
not been available. The pipeline is replaced by
otherwise similar dai-copier-eqiir-module-copier-capture.conf.

The dmic-default.conf sets the default IIR response to 40 Hz
high-pass with 0 dB gain. The topologies will get only the high-pass
filter but no amplification.  The default is changed in
sof-hda-generic.conf to 20 dB gain to address the too silent capture
because these topologies for generic Linux end users do not contain
any other capture enhancements.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2023-03-02 22:56:00 +00:00
Seppo Ingalsuo 7564e5fc8c Tools: Topology2: Add high-pass IIR to HDA headset capture
This patch includes to sof-hda-generic.conf the new
highpass-capture-be.conf as passthrough-capture-be.conf replacement
that adds to DAI copier pipeline the IIR high-pass filter. The
response is hard coded to 0 dB amplification and 40 Hz cut-off.

The analog microphone headsets creates a strong DC input when the bias
voltage settles. It can be even full-scale and sound very loud. The
high-pass filter suppresses such input signal.

Fixes #7116

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2023-03-02 22:55:43 +00:00
Rander Wang 8d5e3a8b52 ipc4: enable google AEC building for zephyr
Enable dummy AEC building support but still need to
enable google AEC in overlay file for chrome.

Signed-off-by: Rander Wang <rander.wang@intel.com>
2023-03-02 14:51:04 -08:00
Rander Wang 57874da1c5 ipc4: google: add ipc4 support for AEC
Add ipc4 config support and hw_params setting

Signed-off-by: Rander Wang <rander.wang@intel.com>
2023-03-02 14:51:04 -08:00
Chao Song 8d3d16c252 module_adapter: use type in abi header as config_id for IPC3
The type member in struct sof_abi_hdr is used for component's
specific blob type for IPC3, some module count on it to know
the blob is for module config or module processing algorithm
model. We should pass it to set_configuration ops.

Signed-off-by: Chao Song <chao.song@linux.intel.com>
2023-03-02 22:36:51 +00:00
Chao Song 1f4bc9f948 topology2: wov-detect: correct use of define variables
To refer to a define variable, we should use
"$DEFINE_VAR_NAME". The $ symbol is required.

Signed-off-by: Chao Song <chao.song@linux.intel.com>
2023-03-02 22:26:34 +00:00
Chao Song fd31092567 topology2: fix wov issue introduced by using array
Some minor issues introduced by using topology2 array,
fix them in this patch.

Signed-off-by: Chao Song <chao.song@linux.intel.com>
2023-03-02 22:26:34 +00:00
Andrula Song 9a83f05d97 Audio: Fix the pointer update errors while volume ramp enabled
while enable volume ramp, we may need to run the while loop in
volume_process function several times, but we only update the
read/write pointers of in/output streams in module_adapter copy
function after the whole volume_process function finished. Then
we would always get and store data from wrong address and lead to
discontinuity waveform.

Signed-off-by: Andrula Song <andrula.song@intel.com>
2023-03-02 22:22:04 +00:00
Baofeng Tian 5d210ccb69 host-zephyr: limit copy bytes to one period for capture pipeline
Limit copy bytes to period bytes for both playback and capture
to avoid high load spike.

Signed-off-by: Baofeng Tian <baofeng.tian@intel.com>
2023-03-02 09:28:27 -05:00
Yong Zhi 1a64c10306 topology2: enable EchoRef for sof-mtl-max98357a-rt5682-ssp2-ssp0
Include echo ref pipeline to Rex config.

Signed-off-by: Yong Zhi <yong.zhi@intel.com>
2023-03-02 12:45:24 +00:00
Guennadi Liakhovetski 5f066f2698 chain-dma: fix scheduling exception
Task state shouldn't be modified by client code, it is fully managed
by the scheduler. Setting task status to INIT after scheduling a task
is wrong and for chain DMA it leads to a scheduler exception. Simply
remove the offending line.

BugLink: https://github.com/thesofproject/sof/issues/7084
Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2023-03-02 11:29:10 +00:00
Guennadi Liakhovetski 2b572c7d3b ll-schedule: fix tasks removed during execution
Zephyr LL-scheduler is supposed to be able to handle tasks, removed
or added while the scheduler is executing. However, there is a bug in
that implementation. If the task, that is currently executing, is
removed, its list head, that links it into the list of tasks, is
initialised. So when trying to get a pointer to the next task we
obtain a pointer to the same task.

BugLink: https://github.com/thesofproject/sof/issues/7084
Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2023-03-02 11:29:10 +00:00
Guennadi Liakhovetski 0f0acaae94 platform: remove support for cAVS 1.5 platforms
Remove all support for cAVS 1.5 platformsm including Apollo Lake,
Sky Lake, Kaby Lake, Broxton and Gemini Lake, they aren't supported
any more.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2023-03-02 11:28:23 +00:00
Laurentiu Mihalcea 039ccee564 zephyr: Introduce Zephyr version of sof/lib/io.h
The purpose of this commit is to get rid of the dependency
on xtos/include/sof/lib/io.h when building SOF for Zephyr.
Apart from that, this commit solves or gets us closer to
solving the following issues:
	1) Compiling SOF for arm64 architecture results
	in warnings such as the following:

	"warning: cast to pointer from integer
	of different size [-Wint-to-pointer-cast]"

	2) Enabling CONFIG_SOF_ZEPHYR_STRICT_HEADERS will
	result in a compilation error. One of the causes
	for this is the fact that sof/lib/io.h doesn't
	exist.

Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
2023-03-01 16:03:40 +00:00
Laurentiu Mihalcea d4c573401b xtos: include: sof: lib: io.h Fix naming inconsistency for 64-bit functions
The naming scheme used for the 64-bit read/write function is
not consistent with the naming scheme used for the other
read/write functions. This commit fixes this.

Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
2023-03-01 16:03:40 +00:00
Guennadi Liakhovetski 1b934e9d6c IDC: set IDC task priority equal to that of the IPC task
One of the functions of the IDC thread is to execute IPCs on
secondary cores, those have to be executed with the same priority as
when they're run on the primary core, i.e. with the priority of the
IPC thread. Set IDC thread priority equal to the IPC thread.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2023-03-01 15:30:05 +00:00
Marc Herbert 37f27092be xtensa-build-platforms.py: build_rimage() only once at start
This will be required when signing is transferred to `west build`, see
https://github.com/zephyrproject-rtos/zephyr/pull/54700

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2023-03-01 15:22:13 +00:00
Marc Herbert a9680388e5 xtensa-build-zephyr.py: extract new build_rimage() function
Zero functional change. Next commit will build rimage _before_ building
the firmware which will be required when `west build` starts signing by
default (https://github.com/zephyrproject-rtos/zephyr/pull/54700)

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2023-03-01 15:22:13 +00:00
Andrey Borisovich b2073f1f26 west.yml: upgrade Zephyr to e3ae110a05d
Includes:
- rename of xcc-clang compiler to xt-clang
- updates in C++ headers in zephyr/sys/util.h that require C++14
standard now.

Signed-off-by: Andrey Borisovich <andrey.borisovich@intel.com>
2023-02-28 14:59:41 +00:00
Andrey Borisovich 33d95bc723 Set SOF C++ language standard to C++17 for Zephyr builds
Recent changes to Zephyr header files written in C++
use templates and features provided by the C++14 standard.
Meteorlake board that is built with Zephyr has some C++ code
that uses those headers.
We upgrade straight to C++17 since it is newest standard currently
supported by xt-clang toolchain.
This change does not affect any other boards since the do not
have any C++ code as the time of writing.

Signed-off-by: Andrey Borisovich <andrey.borisovich@intel.com>
2023-02-28 14:59:41 +00:00
Andrey Borisovich 309fa264e2 xtensa-build-zephyr.py: upgraded Xtensa toolchain for MTL
Intel Meteorlake release toolchain is Xtensa RI-2022.10 version.
New toolchain does not support xt-xcc driver anymore so we are
forced to switch to new xt-clang driver.
To distinguish between default driver for the platform built,
(Xtensa GCC or Clang) added new field to script platform list
containing a toolchain name "xcc" or "xcc-clang" expected by
Zephyr project.

Signed-off-by: Andrey Borisovich <andrey.borisovich@intel.com>
2023-02-28 14:59:41 +00:00
Krzysztof Frydryk ec974a881f platform: tgl: Enable AMS
Set config to enable AMS for CAVS25 platform.

Signed-off-by: Krzysztof Frydryk <krzysztofx.frydryk@intel.com>
2023-02-28 09:10:29 +01:00
Krzysztof Frydryk 201a12c940 platform: mtl: Enable AMS
Set config to enable AMS for ACE1x platform and add mtl specific values.

Signed-off-by: Krzysztof Frydryk <krzysztofx.frydryk@intel.com>
2023-02-28 09:10:29 +01:00
Krzysztof Frydryk 10e1172ea5 ams: Add initial AMS implementation
Add Asynchronous Messaging Service. This can be used to communicate between
modules.
Asynchronous Messages are one-way messages from one producer to one or
multiple registered consumers. Messages between modules on different
cores are sent through IDC. All inter-core communication must be proxied
by the main core.

Signed-off-by: Krzysztof Frydryk <krzysztofx.frydryk@intel.com>
2023-02-28 09:10:29 +01:00
Seppo Ingalsuo a639604dbb Tools: Topology2: Change PGA widget curve_duration to 20 ms
The previous value 10 is only 0.1 us that disables the gain
ramp totally and causes harsh sounding volume transitions.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2023-02-24 17:00:08 +00:00
Michal Wasko e40cf6d7d1 CODEOWNERS: more intel code owners added
Intel code owners added based on latest contribution
and expertise.

Signed-off-by: Michal Wasko <michal.wasko@intel.com>
2023-02-24 16:08:39 +00:00
Laurentiu Mihalcea cb72ee08a5 sof: lib: Remove unused #include from cpu.h
All arch/ files should be only used by XTOS. Since the
include statement from cpu.h is not used at all we can safely
remove it. With this, we can make the split between Zephyr
and XTOS more clean.

Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
2023-02-24 14:28:49 +02:00
Laurentiu Mihalcea 7ed1159e48 Switch to using rtos/idc.h instead of sof/drivers/idc.h
The purpose of this commit is to separate the XTOS-specifc
code from the Zephyr-specifc code found in sof/drivers/idc.h.

Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
2023-02-24 14:28:49 +02:00
Laurentiu Mihalcea 0a5c049ac0 Switch to using rtos/task.h instead of sof/schedule/task.h
The purpose of this commit is to separate XTOS-specific code
from the Zephyr-specific code found in sof/schedule/task.h.

Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
2023-02-24 14:28:49 +02:00
Jaska Uimonen 1e21a5d2fc zephyr: lib: move cpu.c from lib-zephyr
Move zephyr cpu.c from "unnecessary" lib-zephyr to lib/zephyr.

Signed-off-by: Jaska Uimonen <jaska.uimonen@intel.com>
2023-02-23 22:17:07 +00:00
Kai Vehmanen a74ad93270 audio: chain_dma: do not hold spinlock when calling schedule_task_free
schedule_task_free() might be a blocking call. E.g. the Zephyr
LL-scheduler implementation can call k_sem_take(). Do not call
this function with a spinlock held.

Link: https://github.com/thesofproject/sof/issues/7156
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
2023-02-22 16:42:18 +02:00
Andrula Song 8bc97c1e13 Audio: Fix the volume change doesn't take effect issue
If the initial_ramp is zero, the ramp_finished would always be true,
that means we will never copy gain to circular buffer except we reset
state.

Signed-off-by: Andrula Song <andrula.song@intel.com>
2023-02-22 15:27:07 +02:00
Marc Herbert 7975c266a4 CODEOWNERS: restore dropped comment
Fix minor misunderstanding in review of git commit 430893f18a
("CODEOWNERS: refer to github documentation on file syntax")

Signed-off-by: Marc Herbert <marc.herbert@gmail.com>
2023-02-22 15:19:29 +02:00
Laurentiu Mihalcea 2115a7bfea Switch to using rtos/sof.h instead of sof/sof.h
The purpose of this commit is to separate the XTOS-specifc
code from the Zephyr-specifc code found in sof/sof.h.

Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
2023-02-22 13:15:06 +00:00
Bard Liao 0235673845 topology2: add sof-adl-rt711-l0-rt1316-l12-rt714-l3 support
sof-adl-rt711-l0-rt1316-l12-rt714-l3.tplg is the same as
sof-tgl-rt711-rt1316-rt714.tplg

Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
2023-02-21 23:30:06 +00:00
Bard Liao 0f6cf837c7 topology2: use a macro to config if a sdw amplifier support feedback
Not all amplifiers support feedback. We should not add feedback support
on topology to shch amplifiers.

Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
2023-02-21 23:30:06 +00:00
Bard Liao b407a1aab9 topology2: follow the same rule as pipeline and route id to assign ALH
index

We use the "pcm id * 10 + N" formula where N is from 0 to 9 to assign
pipeline and route id in f0a010052b ("topology2: cavs-sdw: group route
and pipeline index"). Now apply to ALH dai index.

Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
2023-02-21 23:30:06 +00:00
Jyri Sarha d08b894945 Revert "topology2: avs-tplg: disable USE_CHAIN_DMA"
The known issues with the pipeline-free chain DMA implementation has
now been solved, so we can re-enable chain DMA usage.

This reverts commit c3807ae4a7.

Signed-off-by: Jyri Sarha <jyri.sarha@intel.com>
2023-02-21 23:23:59 +00:00
Jyri Sarha 60e9e97e0d hda: chain dma: cancel task before freeing it
When schedule_task_free() is called to a scheduled zephyr_ll task it
sometimes causes a crash. Canceling the task before freeing appears to
fix the problem.

Signed-off-by: Jyri Sarha <jyri.sarha@intel.com>
2023-02-21 23:23:59 +00:00
Kai Vehmanen 4d67d2f416 app: zephyr: enable CONFIG_ASSERT in debug overlay
Enable CONFIG_ASSERT=y in SOF debug overlay.

Also add a commented out list of additional useful Zephyr debugging
tools to the overlay. These incur a higher runtime cost, so are left
disabled by default. These are all debug tools that have been tested to
work with SOF and found useful.

Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
2023-02-21 23:17:49 +00:00
Andrula Song 6b91a55328 Audio: Fix the peak volume calculation error in volume component
Fix the peak volume calculation error in volume component, calculate
the maximum absolute value of input as peak volume as close source
firmware did.

Signed-off-by: Andrula Song <andrula.song@intel.com>
2023-02-21 15:51:33 +00:00
Jaska Uimonen 5efc08d5aa dai: change to use new version of dai_config_get
Start using new version of dai_config_get where config struct is given
as pointer argument.

Update west.yaml to point to correct zephyr version for this change.

Signed-off-by: Jaska Uimonen <jaska.uimonen@intel.com>
2023-02-21 15:45:17 +00:00