Commit Graph

9913 Commits

Author SHA1 Message Date
Bard Liao 6f96d0f37e topology2: rename NUM_SDW_AMPS to NUM_SDW_AMP_LINKS
NUM_SDW_AMPS refers to how many sdw links are used by the amp pcm.
Rename to NUM_SDW_AMP_LINKS for less confusing.

Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
2023-04-21 20:48:09 +03:00
Serhiy Katsyuba e79b6343b8 host-zephyr: Fix glitches
Fixes glitches when host copier has different container size on
source and sink.

Signed-off-by: Serhiy Katsyuba <serhiy.katsyuba@intel.com>
2023-04-21 20:45:12 +03:00
Ranjani Sridharan 228ecf5768 topology2: hdmi-generic: Fix audio format for DAI copier
It should only support 32-bit format for input and output.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2023-04-20 23:04:38 -07:00
Ranjani Sridharan 9fa5d722b4 topology2: Remove 24-bit audio formats in mixin/mixout
The 24-bit formats defined in topologies will never be used because the
mixin/mixout only support 32-bit format. So remove these audio formats
from the component and pipelines audio format definitions.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2023-04-20 23:04:38 -07:00
Ranjani Sridharan e5eb7dfc76 topology2: tokens: Split the tokens for input/output pin index
Separate the pin index token ID for input/output pin index to avoid
collisions between the two and incorrect pin index parsing in the
kernel.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2023-04-20 12:19:35 -07:00
Baofeng Tian b77dbc3c88 dai-zephyr: remove not used pointer and its assignment
buffer_ptr is no longer valid in dai-zephyr.c, remove it.

Signed-off-by: Baofeng Tian <baofeng.tian@intel.com>
2023-04-20 21:07:55 +03:00
Laurentiu Mihalcea 0696f7eddc include: sof: debug: gdb: gdb.h: Add ifdef guard for symbol definition
GDB debug should only be used when CONFIG_DBG_DEBUG=y. On ARM64
platforms with Zephyr, including this header will cause compilation
errors due to the fact that they don't have an arch/ entry. This
commit fixes this issue by conditionally defining all symbols based
on CONFIG_GDB_DEBUG.

Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
2023-04-20 13:20:39 +03:00
Laurentiu Mihalcea 6aa71dd6f2 zephyr: lib: alloc.c: Add heap for ARM64 platforms
This commit places the heap inside the .bss section for
all ARM64 platforms.

Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
2023-04-20 12:59:24 +03:00
Daniel Baluta 9483c19f86 Audio: module adapter: Fix module_set_configuration
After commit 7d0a0c673f ("Audio: Module adapter: Pass entire cdata to
clients for all controls") md->ops->set_configuration gets the entire
cdata but module_set_configuration expects only cdata>data[0].data.

So, restore the pointer fragment to cdata->data[0].data.

With IPC4 in comp_data_blob_set() the use of
struct sof_ipc_ctrl_data pointer step is not done but the
fragment is treated as raw data payload without the header.

Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
2023-04-20 10:31:09 +03:00
Yong Zhi ffe0ce68a1 topology2: cavs-rt5682: remove 24-bit override in mixout-gain-dai-copier-playback
With 208c2049f ("topology2: deep buffer: use 32 bits to align with
other pipeline"), we can remove this override now.

Signed-off-by: Yong Zhi <yong.zhi@intel.com>
2023-04-19 21:59:41 -07:00
Guennadi Liakhovetski f772b39e4d sparse: use CONFIG_LOG_USE_VLA=n
Sparse output is spammed with "Variable length array" warnings from
Zephyr logging system. The use of VLAs there can be disabled via
Kconfig. Do that to avoid exceeding sparse's warning maximum and
losing important warnings.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2023-04-19 14:57:55 +03:00
Baofeng Tian e31f9ee7e6 copier: correct host processed data in copier
This patch followed with #7210, copier also need change to
get correct processed data.

More changes are done due to below reason:
bsource_buffer is assigned in create host/dai/gtw, however, host/dai
part are removing this flag, so this flag is no longer valid.
Also, cd->endpoint_num currently are always 1, and stream_no always 0.
Remove this contion check also.

Signed-off-by: Baofeng Tian <baofeng.tian@intel.com>
2023-04-19 14:50:04 +03:00
Marc Herbert 4311da195d .github/zephyr: move zephyr revision in first results matrix position
Recent experience has shown that upstream Zephyr regressions are much
more common than platform-specific failures. So move the Zephyr version
in first position, so this will group zephyr regressions and make them
much more obvious.

Use very short keys for the revisions because the left column in
Github's results "checks" tab is very narrow and cannot be resized.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2023-04-19 14:44:11 +03:00
Piotr Makaruk 8a1ba8e47a cadence: register module logs in Zephyr
Use LOG_MODULE_REGISTER() to register cadence in the Zephyr logger
framework.

Signed-off-by: Piotr Makaruk <piotr.makaruk@intel.com>
2023-04-18 16:03:19 +03:00
Kai Vehmanen 36fc4d6248 smart_amp_test: fix unbind implementation
Code in unbind is looking at wrong field for queue-id. This works
some of the time, but in some cases leads to access to freed
heap data and later to heap corruption.

Link: https://github.com/thesofproject/sof/issues/7191
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
2023-04-18 13:35:14 +03:00
Marc Herbert 2512698098 numbers.sh: do not (re)define ROUND_DOWN() if __ZEPHYR__
Move the ROUND_DOWN() definition to the nearby #ifndef __ZEPHYR__ block.

The previous `#ifndef ROUND_DOWN` logic depends on the #include order,
so it fails sometimes.

Fixes commit a6f8daec2a ("kpb: add micselection function")

Fixes XCC compilation failure with
```
./scripts/xtensa-build-zephyr.py  mtl --cmake-args='-DEXTRA_CFLAGS=-Werror'

 - In file included from sof/src/audio/src/src_hifi4.c:22:
zephyr/include/zephyr/sys/util.h:238:9: warning:
         'ROUND_DOWN' macro redefined [-Wmacro-redefined]
        ^
sof/zephyr/../src/include/sof/math/numbers.h:33:9:
         note: previous definition is here
```

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2023-04-17 14:08:28 +03:00
Daniel Baluta c7e98ee731 module_adapter: Propagate error from module specific callback
When module_prepare() fails we need to return to calling module the
exact specific error not just -EIO.

There is no real use for Host AP to receive an error code that doesn't
reflect the actual error.

While at it, make the code more compact as suggested by Guennadi.
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
2023-04-13 12:51:11 +03:00
Marc Herbert ebaa1429f9 xtensa-build-zephyr.py: log ALL "evil" environment differences
This is a typical example of why environment variables are (a sometimes
necessary) evil: imagine you're trying to reproduce exactly the `west
build` command run by xtensa-build-zephyr.py when building with the
`xt-xcc` toolchain. So you would typically look at the logs, feel lucky
that it shows the extra environment variables used and copy them:

```
XTENSA_TOOLCHAIN_PATH=/srv/home/jenkins/xcc/install/tools
TOOLCHAIN_VER=RG-2017.8-linux
XTENSA_SYSTEM=/home/jenkins/xcc/install/builds/RG-2017.8-linux/cavs...
In dir: workspace/sof; running: west build ...
```

Except this won't work because there's one variable currently missing:
`ZEPHYR_TOOLCHAIN_VARIANT`!

Of course there could be more in the future.

Fix this by leveraging the recent os.environ.copy() added by
commit 8aab18351f ("xtensa-build-zephyr: fix DEFAULT_TOOLCHAIN_VARIANT
spill on next platf") compare it to the current os.environ and show the
difference in a totally generic, non-hardcoded way.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2023-04-12 20:10:33 +03:00
Paul Olaru 5da0812a81 audio: mixer: Fix inactive streams handling
The previous patch 908876cc5f introduced a bug where the wrong input
buffer had the "consumed" field updated. This affected playing from
_only_ the second input stream in weird ways (specifically, sound was
slower and every other period I'd get a "no bytes to copy" message from
the active host component).

This patch fixes the indexing for that update.

Fixes: 908876cc5f "audio: mixer: Improve handling of inactive input streams"
Signed-off-by: Paul Olaru <paul.olaru@nxp.com>
2023-04-12 13:55:04 +03:00
Iuliana Prodan 1754bf97ec imx: sai: enable transmitter to output MCLK
On i.MX8MP, the SAI MCLK is bound with TX enable bit.
Therefore, in order to enable MCLK, we need to enable
the transmitter.

This fixes a "wm8962 2-001a: DC servo timed out" -
a Linux Kernel error with wm8962 codec.

Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
Signed-off-by: Iuliana Prodan <iuliana.prodan@nxp.com>
2023-04-11 16:09:07 +03:00
Ranjani Sridharan 78be251a44 topology2: Move common_definitions.conf
These are Intel-specific, so move them to the platform/intel folder

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2023-04-11 15:54:31 +03:00
Ranjani Sridharan cbe01073f6 topology2: copier: Make node_type mandatory
Introduce a new class for module-to-module copiers and make node_type
mandatory for the copier class.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2023-04-11 15:54:31 +03:00
Ranjani Sridharan b74c26b52c topology2: Rename passthrough-capture.conf
Rename it to host-gateway-capture to align it with the documentation.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2023-04-11 15:54:31 +03:00
Ranjani Sridharan 3ee2ab63a7 topology2: Rename passthrough-playback.conf
Rename it to host-gateway-playback.conf to align with the documentation.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2023-04-11 15:54:31 +03:00
Ranjani Sridharan 91a436ef7d topology2: Rename passthrough-capture-be
Rename it to io-gateway-capture.conf to align with the documentation.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2023-04-11 15:54:31 +03:00
Ranjani Sridharan a37f8f473d topology2: io-gateway: Fix a typo
Fix the typo in the pipeline name

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2023-04-11 15:54:31 +03:00
Przemyslaw Blaszkowski 7b5e5a266d platform: ace: register clock using core_kcps_adjust api
core_kcps_adjust is an API to request clock changes indirectly, by
registering KCPS per core. It should be common method for all clock
change requests, to keep KCPS on track.
Currently, in the platform_init, maximum clock is reqeuested. This is a
workaround for missing CPC management. KCPS should be registered together
with clock change.
Even though FW does not request KCPS at any place (feature not ready) so
far, OED driver sends these requests via LargeConfigSet. It is required
to have valid initial value of KCPS in cpu-clk-manager.

Signed-off-by: Przemyslaw Blaszkowski <przemyslaw.blaszkowski@intel.com>
2023-04-11 09:53:02 +02:00
Anas Nashif 9f813a3641 app: remove old cavs platforms
Remove old platforms from zephyr testcase file:

- intel_adsp_cavs15
- intel_adsp_cavs18
- intel_adsp_cavs20

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2023-04-10 16:23:59 +03:00
Iuliana Prodan ae0869fe2d topology: imx: Add topology file for i.MX8MP with wm8962 codec
Add new topology file for i.MX8MP with wm8962 codec.

Signed-off-by: Iuliana Prodan <iuliana.prodan@nxp.com>
2023-04-07 18:41:19 -05:00
Iuliana Prodan 7550fb7e35 topology: imx: Combine topology files for i.MX8MP with different options
Combine topology files for i.MX8MP with different codecs and rate, by
using CODEC and RATE variables.
Based on CODEC use the proper DAI_CONFIG.

Signed-off-by: Iuliana Prodan <iuliana.prodan@nxp.com>
2023-04-07 18:41:19 -05:00
Iuliana Prodan 6687c298f2 topology: imx: Add topology file for i.MX8QM with wm8962 codec
Add new topology file for i.MX8QM with wm8962 codec.

While here, use CODEC variable to differentiate between wm8960
and wm8962.

Signed-off-by: Iuliana Prodan <iuliana.prodan@nxp.com>
2023-04-07 18:41:19 -05:00
Iuliana Prodan 0b1d10b099 topology: imx: Rearrange topologies based on platform
Rearrange topologies based on platform type: imx8,
imx8mp and imx8ulp.

Signed-off-by: Iuliana Prodan <iuliana.prodan@nxp.com>
2023-04-07 18:41:19 -05:00
Seppo Ingalsuo 8f5ee926e2 Audio: TDFB: Fix a mistake in sound direction updates filtering
Check for four least significant bits set means that four
previous processes periods need to be high enough signal
level over ambient. The value 0x15 is an obvious mistake and
does not filter properly control events. The purpose of the filter
is to prevent too frequent or unreliable control updates.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2023-04-06 22:05:08 +01:00
Seppo Ingalsuo 22c0e235bc Audio: TDFB: Convert to module adapter
This patch converts the time domain fixed beamformer (TDFB) into
module adapter API.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2023-04-06 22:05:08 +01:00
Seppo Ingalsuo 7d0a0c673f Audio: Module adapter: Pass entire cdata to clients for all controls
This patch unifies all the control types (bytes, enum, switch).
Previously for binary control the fragment pointed to
cdata->data[0].data while for other control types the cdata
was passed via fragment. If fragment always points to cdata
the module adapter client can reliably check the control type
from cdata->cmd and handle other than binary control types.

Since the client components with binary control pass the
data to comp_data_blob_set() in data_blob.c the restore of
pointer fragment to cdata->data[0].data can be done there.

A check for SOF_CTRL_CMD_BINARY is added to comp_data_blob_set()
and comp_data_blob_get_cmd() to avoid wrong usage of controls.

With IPC4 in comp_data_blob_set() the use of
struct sof_ipc_ctrl_data pointer step is not done but the
fragment is treated as raw data payload without the header.
The generic support for other than binary control will be
solved later for IPC4.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2023-04-06 22:05:08 +01:00
Pin-chih Lin 975dc84e1e topology1: set lower priority for DMIC task in GOOGLE_RTC_AUDIO case
When GOOGLE_RTC_AUDIO is applied, Speaker and DMIC pipeline tasks are
scheduled in the same domain. The AEC function in GOOGLE_RTC_AUDIO
has the hard requirement for input sample synchronization between DMIC
input and Echo reference (sourced from Speaker).

At present, both pipelines are pri-0 so the task order in schedule
list depends on which pipeline starts first. This commit sets DMIC as
pri-1 when GOOGLE_RTC_AUDIO is applied to make sure that DMIC task
will be always put after Speaker task, which guarantees the
requirement for input sample synchronization.

Signed-off-by: Pin-chih Lin <johnylin@google.com>
2023-04-06 21:50:18 +01:00
Ranjani Sridharan 650423feb1 topology2: Move the hw_config class definition
Move and rename the hw_config class to
platform/intel/hw_config_cardinal_clk.conf.
This hw_config is specific to Intel SSP DAI that use the cardinal clock
for the mclk frequency.

Ideally, this class should have immutable mclk_frequency and link clock
source. But because the alsatplg compiler expects the name of the hw
config class to be "hw_config" without any extensions, it is left as
modifiable for now. Once the topology compiler is modified, this will be
made immutable in a follow up PR.

Also, introduce a new hw_config_simple.conf file that contains the
hw_config definition for the HDA/DMIC/SDW type DAIs with only the ID and
name attributes.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2023-04-05 13:32:30 -07:00
Ranjani Sridharan ada8950551 topology2: ssp: Add blob version
Add the SSP blob version and set it based on the platform.

Co-developed-by: Jaska Uimonen <jaska.uimonen@intel.com>
Signed-off-by: Jaska Uimonen <jaska.uimonen@intel.com>
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2023-04-05 13:32:30 -07:00
Jyri Sarha 525e7e39d1 topology2: Enable chain DMA for MTL sof-hda-generic* topologies
This change sets USE_CHAIN_DMA=true for sof-hda-generic-2ch
and sof-hda-generic-4ch mtl targets in sof-ace-tplg directory.

Signed-off-by: Jyri Sarha <jyri.sarha@linux.intel.com>
2023-04-05 19:58:48 +03:00
Daniel Baluta bdc5453db1 imx: platform: Enable tracing for Zephyr
Logger was disabled for i.MX8 platforms with Zephyr because
of problems with DMA domain.

Now that DMA domain works fine for i.MX8 platforms enable logging as
well.

Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
2023-04-05 12:31:46 +01:00
Daniel Baluta 3f3c1e5084 zephyr: Make CONFIG_DMA_DOMAIN no longer experimental
DMA domain with Zephyr works fine for i.MX platforms. So, remove
"experimental" from description and enable it by default for i.MX
platforms.

Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
2023-04-05 12:31:46 +01:00
Ranjani Sridharan 60bc228b81 topology2: mixout-gain-smart-amp-dai-copier-playback: Do not set copier node_type
It should be set based on DAI type during pipeline instantiation.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2023-04-04 18:36:19 -07:00
Ranjani Sridharan c94dca8be1 topology2: sof-hda-generic: No need to include dai-copier-gain-mixin-capture
It is not used in the topology.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2023-04-04 18:36:19 -07:00
Ranjani Sridharan de56d36240 topology2: dai-copier-be: Do not set copier node_type
It should be set based on DAI type when the pipeline is instantiated.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2023-04-04 18:36:19 -07:00
Ranjani Sridharan 0b6d4a7576 topology2: mixout-gain-efx-dai-copier-playback: Do not set default node_type
It should be set based on DAI type.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2023-04-04 18:36:19 -07:00
Ranjani Sridharan 719cb075f8 topology: mixout-gain-dai-copier-playback: Do not set default node_type
It should be set when the pipeline is instantiated based on the DAI
type.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2023-04-04 18:36:19 -07:00
Ranjani Sridharan ae7036dce2 topology2: io-gateway: Do not set copier node_type
It is wrong to set a default value when creating widgets objects within
pipelines and these must be set at the top-level based on the DAI type.
So remove the default value in be-dai.conf and set the node_type
whenever the pipeline is initialized.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2023-04-04 18:36:19 -07:00
Ranjani Sridharan afb0f73512 topology2: rename passthrough-be to io-gateway.conf
All it contains is a IO gateway copier and a pipeline widget. So rename
it accordingly.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2023-04-04 18:36:19 -07:00
Chao Song 72d4854efa smart_amp_test: process same frames from all inputs
The smart amp test module will first process feedback if
presents, and then process main input to its output.

However, minimum available frames from main input and
feedback is used in processing feedback, while available
frames from main input is used in processing main input.
The different frames of audio data could be processed from
main input buffer and feedback buffer.

This patch make sure the same number of frames are processed
from main input and feedback buffers.

Fixes: #7184

Signed-off-by: Chao Song <chao.song@linux.intel.com>
2023-04-04 19:54:09 +03:00
Kwasowiec, Fabiola 6a0db47338 kpb: update uuid in rimage
Change of uuid
regarding Windows compatibility

Signed-off-by: Kwasowiec, Fabiola <fabiola.kwasowiec@intel.com>
2023-04-04 15:20:30 +02:00