Commit Graph

9796 Commits

Author SHA1 Message Date
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
Kwasowiec, Fabiola ebdb41a759 kpb: update UUID
uuid distinction for IPC4 and IPC3
regarding Windows compatibility

Signed-off-by: Kwasowiec, Fabiola <fabiola.kwasowiec@intel.com>
2023-04-04 15:20:30 +02:00
Kai Vehmanen afb2d913ca sof_ri_info: add ADL-N product key information
Add ability to recognize the ADL-N product key.

Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
2023-04-04 14:56:04 +03:00
Paul Olaru 5f26af9494 audio: module_adapter: Ensure prepare always runs on modules
Some components like mixer have special handling of the prepare function
whenever they are already active. Ensure said handling has a chance to
run.

With the old code, that code doesn't run, mixer doesn't have a chance to
return PPL_STATUS_PATH_STOP and the DAI then receives a second prepare
request, which is invalid given that it's already active.

Signed-off-by: Paul Olaru <paul.olaru@nxp.com>
2023-04-04 10:06:59 +03:00
Paul Olaru 908876cc5f audio: mixer: Improve handling of inactive input streams
The old code does not deal correctly with input streams going away
without everything stopping. This commit ensures only active streams are
considered as mixer input, and the other streams are ignored (considered
zeroed out).

Signed-off-by: Paul Olaru <paul.olaru@nxp.com>
2023-04-04 10:06:59 +03:00
Ranjani Sridharan 362a0781f2 topology2: Remove dma_buffer_size attribute
There's been a recent kernel change to compute the DMA buffer size using
the ibs/obs. So this attribute no longer needs to be set in the
topology.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2023-03-31 20:41:07 +03:00
Fred Oh 2de0b86ac3 topology2: cavs-nocodec: set dmic 4 channels for MTL
MTL nocodec devices have been configured with DMIC 4 channels.
The topology should be aligned with it.

Signed-off-by: Fred Oh <fred.oh@linux.intel.com>
2023-03-30 10:41:26 -07:00
Seppo Ingalsuo 5b3c350d73 Platform: Library: Remove dummy function dai_assign_group()
This should avoid error in tools/oss-fuzz build:

sof_ep/install/lib/libsof.a(dai.c.o):
in function `dai_assign_group':
dai.c:(.text.dai_assign_group[dai_assign_group]+0x0):
multiple definition of `dai_assign_group';
/usr/bin/ld: DWARF error: invalid or unhandled FORM value: 0x25
sof_ep/install/lib/libsof.a(dai-legacy.c.o):dai-legacy.c:
(.text.dai_assign_group[dai_assign_group]+0x0): first defined here

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2023-03-30 11:42:42 +01:00
Seppo Ingalsuo fade78d895 Drivers: Host: Timer: Add dummy platform_dai_wallclock() function
This avoids tools/oss-fuzz build fail to issue

dai-legacy.c:
(.text.dai_comp_trigger_internal[dai_comp_trigger_internal]+0xaca):
undefined reference to `platform_dai_wallclock'

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2023-03-30 11:42:42 +01:00
Liam Girdwood 97c7f59906 host: cmake: fix module adapter builds for host
Currently host build of module adapter builds the module adapter core
for each module. Lets only build it once on host.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2023-03-30 11:42:42 +01:00
Liam Girdwood b5aaf6d068 testbench: strip out threading for pure xt-run usage.
Strip out all the threading and cache debug to become a pure xt-run
application. This removes a lot of code, including in the host LL
scheduler.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2023-03-30 11:42:42 +01:00
Liam Girdwood 3eb03b9982 host: add support to build SOF as a static library.
Support a static library target for SOF.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2023-03-30 11:42:42 +01:00
Liam Girdwood 968e0404ed tools: tplg_parser: abstract topology APIs in preparation for IPC4
Abstract the topology APIs to provide support for other IPC ABIs and
further simplify the codebase. Makse sure all public APIs have the tplg
prefix and make sure private APIs are in the correct places.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2023-03-30 11:42:42 +01:00
Liam Girdwood 2d4d11d050 gitignore: ignore testbench test results files
Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2023-03-30 11:42:42 +01:00
Kwasowiec, Fabiola 694dd4d4a5 peakvol: prevent division by zero
When calculating the time_ratio, a situation may occur
where cd->initial_ramp is equal to zero. To avoid dividing
by zero it is necessary to insert an additional condition

Signed-off-by: Kwasowiec, Fabiola <fabiola.kwasowiec@intel.com>
2023-03-30 10:08:11 +01:00
Baofeng Tian 13d5800424 dai-zephyr: remove callback notifier, call callback directly
This is a follow up with #7330, remove dai zephyr part callback
register/unregister, call callback function directly at notifier
event place.

Signed-off-by: Baofeng Tian <baofeng.tian@intel.com>
2023-03-29 15:22:58 +03:00
Chao Song 843fd70e91 topology2: cavs-nocodec: include SSP1 pipelines conditionally
There is pinmux conflict between SSP1 and DMIC
on MTL RVP, add a new nocodec topology target
for MTL, on which only SSP0 and SSP2 are enabled.

Signed-off-by: Chao Song <chao.song@linux.intel.com>
2023-03-29 15:17:48 +03:00
Fred Oh 7bc3bde203 west.yml: update zephyr revision to fix MTL pause-resume
There is a merged MTL dmic fix.
https://github.com/zephyrproject-rtos/zephyr/pull/56209

Signed-off-by: Fred Oh <fred.oh@linux.intel.com>
2023-03-29 15:09:23 +03:00