Commit Graph

10505 Commits

Author SHA1 Message Date
Tomasz Leman 968027b6c2 base_fw: replace of ipc4_tuple structure with sof_tlv
ipc4_tuple and sof_tlv represent the same data type. The new structure
is globally available and can be used elsewhere.

Signed-off-by: Tomasz Leman <tomasz.m.leman@intel.com>
2023-07-06 17:12:16 +01:00
Tomasz Leman e80af3330f header: sof: add header with tlv struct
Adding a header file containing definitions of the TLV structure and
related functions.

Most of the code is a copy of the functionality added for the BaseFw
module in the 3efd78048d commit. The only difference are the names change
of the base structure, functions and field in the structure.

A new feature is a function that allows to find TLV value of the
indicated type.

Co-developed-by: Rander Wang <rander.wang@intel.com>
Signed-off-by: Rander Wang <rander.wang@intel.com>
Signed-off-by: Tomasz Leman <tomasz.m.leman@intel.com>
2023-07-06 17:12:16 +01:00
Ranjani Sridharan 867ada28fe audio: module_adapter: Allocate max number of input/output buffers
Allocate input/output buffers based on the maximum number of
sources/sinks supported by the module. The current logic would only
allocate 1 input/output buffer if the module prepare is invoked before
all its sinks/sources are bound.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2023-07-06 17:10:06 +01:00
Ranjani Sridharan 99ac62566d audio: module_adapter: Add new fields in struct processing_module
Add a couple of new fields for setting the max number of sources/sinks
supported by each module. Set the max sources/sinks for all modules.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2023-07-06 17:10:06 +01:00
Baofeng Tian 8adbb85044 perf_cnt: simplify the difference calculation for cycles
Previously, due to cycle get max is UINT32_MAX, so check
and wrap cycles based on INT32_MAX, however, unsigned int can wrap
automatically with minus, remove the check and make
perf difference calculation more simple.

Signed-off-by: Baofeng Tian <baofeng.tian@intel.com>
2023-07-05 19:59:08 -07:00
Seppo Ingalsuo 2fb0c1d811 Tools: Topology2: Add a development HDA generic MCPS benchmark topology
This patch builds new development topologies
sof-hda-benchmark-generic-<tgl/mtl/lnl>.tplg to evaluate performance
of a set of playback components.

The topology for PCM0P playback is

host-copier.0 --> gain.1.1 --> mixin.1.1 -->
	mixout.2.1 --> aria.2.1 --> gain.2.1  --> mixin
	mixout.3.1 --> dai-copier.HDA

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2023-07-04 16:09:57 +01:00
Jaska Uimonen 8380946137 topology1: test topology for tgl nocodec mux
Add test topology for muxing 2 pipelines into 1 with SSP dai and
capturing the result from loopback.

Signed-off-by: Jaska Uimonen <jaska.uimonen@intel.com>
2023-07-04 15:37:21 +01:00
MARUTHI MACHANI 22c013a381 platform:amd:increase runtime memory for simultaneous usecases
increase runtime memory for simultaneous usecases

Signed-off-by: MARUTHI MACHANI <maruthi.machani@amd.com>
2023-07-04 15:18:52 +01:00
MARUTHI MACHANI 388075ec82 topology1:amd: comments update
topology comments update

Signed-off-by: MARUTHI MACHANI <maruthi.machani@amd.com>
2023-07-04 15:18:52 +01:00
MARUTHI MACHANI 3fa5085a4e topology1:amd: topology changes to support virtual playback passthrough for mux
Topology changes to support virtual playback passthrough for mux

Signed-off-by: MARUTHI MACHANI <maruthi.machani@amd.com>
2023-07-04 15:18:52 +01:00
Bard Liao a6fa09cca7 Topology2: add sof-tgl-rt711-rt1308-rt715 topology
Add sof-tgl-rt711-rt1308-rt715 topology for topology2.

Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
2023-07-04 15:18:27 +01:00
Bard Liao 4fa2ad4261 Topology2: sdw-amp-generic: add 2nd amp feedback when SDW_AMP_FEEDBACK
is true

Currently, we add the 2nd sdw amp feedback unconditionally. It will lead
to an issue when aggregated apms don't support feedback function.

Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
2023-07-04 15:18:27 +01:00
Bard Liao cc3b75665f Topology2: hdmi: use macro to set HDMI BE name
HDMI BE name may not be iDispx.

Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
2023-07-04 15:13:56 +01:00
Ranjani Sridharan b1ce311540 topology2: pipelines: dai-copier-eqiir-module-copier-capture: Replace audio_format object
Use the input_audio_format/output_audio_format objects explicitly.
Also, add the 4ch audio format in the class definition as this is only
instantiated once in dmic-generic.conf and needs support for both
formats.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2023-07-04 15:10:35 +01:00
Ranjani Sridharan 511f680b02 topology2: pipelines: io-gateway: Replace audio_format object
Use the input_audio_format/output_audio_format objects explicitly.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2023-07-04 15:10:35 +01:00
Ranjani Sridharan 914b855d72 topology2: components: mixout: Replace audio_format object
Use the input_audio_format/output_audio_format objects explicitly.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2023-07-04 15:10:35 +01:00
Ranjani Sridharan 7ad6659b9e topology2: components: mixin: Replace audio_format object
Use the input_audio_format/output_audio_format objects explicitly.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2023-07-04 15:10:35 +01:00
Seppo Ingalsuo 7458312a76 Tools: Testbench: Remove unnecessary scheduling component find
The pcm_dev is no more used in the code. It also causes a
problem with "error: ipc get comp" with some topologies, where
p->sched_id is missing. This fix helps testbech to parse a
topology like

pcm0p --> buf2.0 --> muxdemux --> buf1.0 --> ssp0.out
                        ^
pcm1p --> buf3.0 -------|

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2023-07-03 17:13:45 +01:00
Jyri Sarha 593563b69e topology2: cavs-mixin-mixout-efx-hda.conf: Uppercase IIR and FIR
Make these last IIR and FIR acronyms in the kcontrol names uppercase.

Signed-off-by: Jyri Sarha <jyri.sarha@linux.intel.com>
2023-07-03 16:13:37 +01:00
Kai Vehmanen 3fef488d8f app: add logging_mipisystcat_overlay.conf overlay config
Add an overlay config to build SOF with MIPI Sys-T Catalog
logging enabled.

Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
2023-07-03 16:11:22 +01:00
Curtis Malainey f43bb81949 volume: fix log message to match caller
Likely artifact from module adapter conversion

Signed-off-by: Curtis Malainey <cujomalainey@chromium.org>
2023-06-30 12:09:42 -07:00
Jyri Sarha 50f5c8fbdc topology2: Rename remaining non mixer kcontrols to follow new naming scheme
Rename all remaining kcontrols to follow the new naming scheme that is
already used for all mixers.

This commit changes kcontrol names as follows:

cavs-nocodec.conf:
'smart_amp_init' -> 'Main Playback and Port0 smart_amp_init'

cavs-mixin-mixout-hda.conf:
'4 Main capture Iir Eq' -> 'Analog Capture IIR Eq'

dmic-generic.conf:
'DMIC0 capture Iir Eq' -> 'DMIC0 Capture IIR Eq'

sdw-jack-generic.conf:
'4 Main capture Iir Eq' -> 'Jack In Capture IIR Eq'

Signed-off-by: Jyri Sarha <jyri.sarha@linux.intel.com>
2023-06-30 13:24:56 +03:00
Guennadi Liakhovetski 3e3d0cdeab buffer: prevent cache corruption
Recent research discovered a set of potential issues related with
cache prefetch. Specifically it seems like uncached access to memory
can cause cache prefetch. This can cause problems in buffer_attach()
and buffer_detach() where buffers are added to or removed from lists
respectively via uncached addresses, after which they can be used via
cached addresses. Add proper cache synchronisation and interrupt
locking to protect against such memory corruption.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2023-06-30 10:53:43 +03:00
Seppo Ingalsuo 4bdbe3bf7b Audio: Fix IPC4 sink component buffer parameters set for S24_LE
The frame_fmt from
audio_stream_fmt_conversion(32, 24, &frame_fmt, &valid_fmt) is
SOF_IPC_FRAME_S32_LE (2). valid_fmt is SOF_IPC_FRAME_S24_4LE (1).

Set of member frame_fmt from struct sof_ipc_stream_params should
be done with valid_fmt instead to get the components to handle
the S24_LE stream correctly.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2023-06-30 09:58:56 +03:00
Chao Song 98a70f6f05 lib_manager: lib_manager_dma_init: remove duplicated code
The code to get buffer address alignment is duplicated
in lib_manager_dma_init() and its caller. As the code
is useless in lib_manager_dma_init(), thus remove it
in this patch.

Signed-off-by: Chao Song <chao.song@linux.intel.com>
2023-06-29 17:30:22 +03:00
Marc Herbert b8a38072bc xtensa-build-zephyr.py: add support for aliases (ADL-->TGL etc.)
This restores parity with the installer/GNUmakefile in the stable-v2.2
branch and simplifies CI deployment.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2023-06-29 12:38:42 +03:00
Jyri Sarha a3814c58b9 topology2: sdw-jack-generic.conf: Rename mixers
Rename mixers according to the new naming convention by referring to
the associated PCM name and the position in the topology. Create
defines for PCM names so the name is only in one place. Adds a define
for the capture PCM too. The commit also updates the PCM names while
adding the defines.

This produces following changes, on PCM names:
'Jack in' -> 'Jack In'
'Jack out' -> 'Jack Out'

and on mixer names:
'1 Playback Volume 0' -> 'Pre Mixer Jack Out Playback Volume'
'2 Main Playback Volume' -> 'Post Mixer Jack Out Playback Volume'

Signed-off-by: Jyri Sarha <jyri.sarha@linux.intel.com>
2023-06-28 17:17:15 +03:00
Jyri Sarha 2af91434b5 topology2: cavs-sdw-src-gain-mixin.conf: Rename mixers
Rename mixers according to the new naming convention by referring to
the associated PCM name and the position in the topology. Create
defines for PCM names so the name is only in one place. The commit
also updates the PCM names while adding the defines.

This produces following changes, on PCM names:
'Jack in' -> 'Jack In'
'Jack Out' -> 'Jack Out'

and on mixer names:
'Src Playback Volume' -> 'Pre Mixer Jack Out Playback Volume'
'Main Playback Volume' -> 'Post Mixer Jack Out Playback Volume'

Signed-off-by: Jyri Sarha <jyri.sarha@linux.intel.com>
2023-06-28 17:17:15 +03:00
Jyri Sarha bda1bcd5bc topology2: cavs-rt5682.conf: Rename mixers
Rename mixers according to the new naming convention by referring to
the associated PCM name and the position in the topology. Create defines
for PCM names so the name is only in one place.

This produces following changes:

'Playback Volume 1' -> 'Pre Mixer Headset Playback Volume'
'Playback Volume 3' -> 'Pre Mixer Speaker Playback Volume'
'Main Playback Volume 2' -> 'Post Mixer Headset Playback Volume'
'Main Playback Volume 4' -> 'Post Mixer Speaker Playback Volume'

Signed-off-by: Jyri Sarha <jyri.sarha@linux.intel.com>
2023-06-28 17:17:15 +03:00
Andrey Borisovich 53d471b566 ipc4: notify Host on the failed IPC Device power transition
During IPC Device power transition errors may be encountered related to
invalid system state or IPC messages waiting to be send.
In this case we are going to send an IPC response to Host bypassing
schedulers. IPC Device will not change power state when errors occur
preventing whole system from the suspend.

Signed-off-by: Andrey Borisovich <andrey.borisovich@intel.com>
2023-06-28 15:32:16 +03:00
Andrey Borisovich 965e1c1bf0 board: intel_adsp_ace15_mtpm: Enabled MTL IMR context save
Enabled CONFIG_ADSP_IMR_CONTEXT_SAVE option in Kconfig
in the board configuration.

Signed-off-by: Andrey Borisovich <andrey.borisovich@intel.com>
2023-06-28 15:32:16 +03:00
Andrey Borisovich 015488b4e1 ipc4: added D3 support using Zephyr Power Manager API
Added IPC4 callbacks 'suspend_handler' and 'resume_handler'
to control Zephyr IPC driver.

Co-developed-by: Tomasz Leman <tomasz.m.leman@intel.com>
Signed-off-by: Tomasz Leman <tomasz.m.leman@intel.com>
Signed-off-by: Andrey Borisovich <andrey.borisovich@intel.com>
2023-06-28 15:32:16 +03:00
Andrey Borisovich 80f27b2f7e board: intel_adsp_ace15_mtpm: disabled CONFIG_PM_DEVICE_RUNTIME_EXCLUSIVE
Zephyr turns on by default CONFIG_PM_DEVICE_RUNTIME_EXCLUSIVE option
what causes Devices using Zephyr Device System Power Manager to
be ignored during SoC power transition. Disabled this option so we
can use default Zephyr kernel behavior to shut down Devices.

Signed-off-by: Andrey Borisovich <andrey.borisovich@intel.com>
2023-06-28 15:32:16 +03:00
Marcin Szkudlinski 4e8040c232 platform: ace: Add pm notifiers to support Zephyr's D3 transition
During PowerOff (D3) transition Zephyr Power Manager must have
a pointer in IMR to save the LP/HPSRAM memory before
powering off.

As zephyr has no access to IMR heap, the memory must
be allocated by SOF

Signed-off-by: Marcin Szkudlinski <marcin.szkudlinski@intel.com>
2023-06-28 15:32:16 +03:00
Seppo Ingalsuo ee6eb1b169 Audio: Module adapter: Add simplified one source to one sink copy
This patch adds a simplified version of audio stream copy for
module adapter clients with one source and one sink. The overhead
of discovering multiple source and sink buffers is avoided.

The module_adapter_bind() and module_adapter_unbind() functions
are changed to detect multiple sources or sinks condition
to control the used simple copy function. The mod->source and
mod->sink pointers to buffers are updated when there's only
one source and sink.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2023-06-28 13:59:29 +03:00
Laurentiu Mihalcea 4e4018a434 sof-ci-jenkins: zephyr-override-template: Whitelist nxp_hal
This commit allows the CI to make use of the nxp_hal which
is required by i.MX8M. Without it, the build would fail.

Fixes: e9f1531

Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
2023-06-28 13:38:59 +03:00
Jyri Sarha 2cef521c36 topology2: cavs-nocodec-multicore.conf: Rename playback volumes
Rename SSP0, SSP1, and SSP2 playback volumes according to PCM names
they are connected to. Define the PCM names as variables so the name
can be changed in a single place.

This is how the change will look like:

'gain.1.1 Playback Volume 1' to
'gain.1.1 Pre Mixer Port0 Playback Volume'

'gain.14.1 Main Playback Volume 14' to
'gain.14.1 Post Mixer Port0 Playback Volume'

'gain.3.1 Playback Volume 3' to
'gain.3.1 Pre Mixer Port1 Playback Volume'

'gain.4.1 Main Playback Volume 4' to
'gain.4.1 Post Mixer Port1 Playback Volume'

'gain.5.1 Playback Volume 5' to
'gain.5.1 Pre Mixer Port2 Playback Volume'

'gain.6.1 Main Playback Volume 6' to
'gain.6.1 Post Mixer Port2 Playback Volume'

Signed-off-by: Jyri Sarha <jyri.sarha@linux.intel.com>
2023-06-28 12:33:10 +03:00
Jyri Sarha a0b1a391b8 topology2: cavs-mixin-mixout-efx-hda.conf: Rename Iir and Fir Eqs
Rename mixin and mixout EFX Analog Playback Eqs to follow the same
naming scheme as the mixers.

As a result of this commit Eqs are renamed in sof-hda-efx-generic.tplg
as follows:

'eqfir.2.1 2 Main playback Fir Eq' to
'eqfir.2.1 Post Mixer Analog Playback Fir Eq'

and

'eqiir.2.1 2 Main playback Iir Eq' to
'eqiir.2.1 Post Mixer Analog Playback Iir Eq'

Signed-off-by: Jyri Sarha <jyri.sarha@linux.intel.com>
2023-06-28 12:33:10 +03:00
Jyri Sarha ecff8a1d3d topology2: cavs-mixin-mixout-efx-hda.conf: Improve mixer names
Rename mixin and mixout EFX Analog Playback volumes. Rewrite the names
of the mixers to better reflect their position in the topology.

As a result of this commit mixers are renamed in sof-hda-efx-generic.tplg
as follows:

'gain.1.1 1 2nd Playback Volume' to 'gain.1.1 Pre Mixer Analog Playback Volume'

and

'gain.2.1 2 Main Playback Volume' to
'gain.2.1 Post Mixer Analog Playback Volume'

Signed-off-by: Jyri Sarha <jyri.sarha@linux.intel.com>
2023-06-28 12:33:10 +03:00
Andrula Song db8da43845 Audio: TDFB: Share the functions code for HiFi3 and HiFi4
Since there is not any intrinsic on HiFi4 can get better
performance, thus share the implementation code for HiFi3
and HiFi4.

Signed-off-by: Andrula Song <andrula.song@intel.com>
2023-06-27 13:44:35 +03:00
Andrula Song 7d98a0b594 Audio: TDFB: Optimize the circular buffer usage
Optimize the tdfb_fir_sx functions by remove the duplicated
usage of circular buffer.

Fixes: #5273.

Signed-off-by: Andrula Song <andrula.song@intel.com>
2023-06-27 13:44:35 +03:00
Uday M Bhat 3de4a6e5d7 topology2: cavs-sdw : Update BT offload SSP for MTL chromebook
For MTL chromebook, SSP 1 is used for BT offload with
cavs-sdw configuration

Co-developed-by: Yong Zhi <yong.zhi@intel.com>
Signed-off-by: Yong Zhi <yong.zhi@intel.com>
Co-developed-by: Jairaj Arava <jairaj.arava@intel.com>
Signed-off-by: Jairaj Arava <jairaj.arava@intel.com>
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: Uday M Bhat <uday.m.bhat@intel.com>
2023-06-27 13:33:35 +03:00
Andrey Borisovich 73cd960e0e west.yml: upgrade Zephyr revision - update IPC4 ipc_platform_send_msg
During last changes in Zephyr that implemented power transition for the
IPC Device, signature of the intel_adsp_ipc_send_message had changed
and now returns negative int error codes (previously bool on success).
Updated single function reference in SOF ipc_platform_send_msg().
Implementation had not changed as the function may return only
-EBUSY error code until the Zephyr Device Power Management option
is disabled.

Signed-off-by: Andrey Borisovich <andrey.borisovich@intel.com>
2023-06-26 17:19:45 +03:00
Adrian Bonislawski 4a0443812b dai-zephyr: possible division-by-zero if max_block_count is zero
If the max_block_count attribute is zero, this may lead to
division by zero error. Handle this explicitly but reporting
error if max_block_count is zero.

Signed-off-by: Adrian Bonislawski <adrian.bonislawski@intel.com>
2023-06-26 14:00:06 +03:00
Marc Herbert fe83601406 iadk/array.h: do not redefine assert() to nothing in an unrelated .h
Do not unconditionally define assert() to nothing in some obscure and
unrelated array.h file.

This looks like it was a temporary hack that was missed in:
Fixes commit 6f366e2eef ("Add definition of interfaces of Intel IADK
modules."), part of PR #5848 too massive to be properly reviewed.
(docs.zephyrproject.org/latest/contribute/contributor_expectations.html)

In addition to enabling asserts when requested by a debug build (!), fix
the following messenger warning:

```
In file included
   from src/include/sof/common.h:30,
   from src/include/sof/audio/sink_api.h:10,
   from src/include/sof/audio/module_adapter/module/module_interface.h:17,
   from src/include/sof/audio/module_adapter/iadk/iadk_module_adapter.h:19,
   from src/audio/module_adapter/iadk/system_agent.cpp:22:
 zephyr/include/rtos/panic.h:19: error: "assert" redefined [-Werror]
   19 | #define assert(x) __ASSERT_NO_MSG(x)
      |

In file included from
  src/audio/module_adapter/iadk/system_agent.cpp:16:
  src/include/sof/audio/module_adapter/iadk/utilities/array.h:60:
   note:  this is the location of the previous definition
   60 | #define assert(cond)
```

This warning appeared only later in messenger commit
002d4a3f66 ("Pipeline2.0: change module API to use various data")
because it started to include audio/sink_api.h in
module_interface.h. This led to the two definitions finally clashing
with each other.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2023-06-22 10:35:06 +03:00
Marc Herbert f97183a8c4 .github/zephyr: add --cmake-args=-DEXTRA_CXXFLAGS=-Werror
We have C++ code now.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2023-06-22 10:35:06 +03:00
Andrula Song 7c85be8b3c Audio: Volume: Add passthrough functions
Add passthrough functions implementation. If the gain of all
channels equal 0dB, then we use passthrough functions to process
the volume component.

Signed-off-by: Andrula Song <andrula.song@intel.com>
2023-06-22 10:33:16 +03:00
Andrula Song 607f086638 Audio: Volume: Split the hifi files into hifi3 and hifi4 version
Split the hifi version code into hifi3 and hifi4 version files.

Signed-off-by: Andrula Song <andrula.song@intel.com>
2023-06-22 10:33:16 +03:00
Kai Vehmanen e7e5006517 west.yml: update Zephyr to 3.4.99
First Zephyr update after 3.4.0 release.

Contains 524 commits, including following directly affecting
SOF targets:

e2e3dc077118 dts: xtensa: intel: add imr entry to cavs25_tgph
6c9a360647c8 drivers: intel_adsp_gpdma: Fix typo in reg name
a8b28f13c195 soc: intel_adsp: cavs: add simple IMR functionality
339b00de11e5 soc: xtensa: intel_adsp: fix memory bank shutdown
5dfaf23f47b7 xtensa: intel_adsp: lnl: Fix dspcs struct
09085ef63c02 dts: xtensa: intel: update cavs25 sram size
b871138fae1f soc/intel_adsp: fix typo in L1EXP definition
9db44fa2813c toolchain: xtensa: enable C11 features with xt-clang
2ba7855ddf23 modules: mipi-syst: support minimal C library

Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
2023-06-21 23:19:46 +03:00
Daniel Baluta a5dcd86251 .github: Use mimx93_a55_evk board
We no longer use synthetic mimx93_a55_evk_sof board but
rather we customize already existing proper mimx93_a55_evk board.

Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
2023-06-21 13:13:11 +03:00