Commit Graph

11666 Commits

Author SHA1 Message Date
Marc Herbert d324af52bd xtensa-build-zephyr.py: add new --no-deployable-build
Everyone should use deployable builds by default.  Don't switch the
default behavior yet but add a --no-deployable-build option in case
anyone is stuck.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2024-01-23 14:16:28 +02:00
Peter Ujfalusi 65e4c1f8b5 topology2: Merge avs-tplg and sof-ace-tplg under production directory
Merge the avs-tplg and sof-ace-tplg under a common production directory.

After a successful build CMake will copy the topology files to a target
directory from where they can be copied to DUT/release:

$ tree tools/build_tools/topology/topology2/target
tools/build_tools/topology/topology2/target
├── development
│   ├── cavs-sdw-hdmi.tplg
│   ├── cavs-sdw-src-gain-mixin.tplg
        ...
│   ├── sof-tgl-nocodec-rtcaec.tplg
│   └── sof-tgl-nocodec.tplg
├── sof-ace-tplg -> sof-ipc4-tplg
└── sof-ipc4-tplg
    ├── sof-adl-rt711-4ch.tplg
    ├── sof-adl-rt711-l0-rt1316-l12-rt714-l3.tplg
        ...
    ├── sof-tgl-rt712.tplg
    └── sof-tgl-rt715-rt711-rt1308-mono.tplg

The sof-hda-generic-2/4ch.tplg will be generated without embedded NHLT as
it is not used under normal circumstance.
Two flavor of the generic topology is generated for CAVS2.5 and ACE1/2 with
included NHLT binary in case it is used by existing users, but it is
unlikely.

As noted in the documentation, on the deployed system a symlink is needed
for ACE1/2 platforms for backwards compatibility:
sof-ace-tplg -> sof-ipc4-tplg

Link: https://github.com/thesofproject/sof-docs/blob/master/getting_started/intel_debug/introduction.rst#2-topology-file
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
2024-01-22 10:38:49 +08:00
Damian Nikodem 16b53b423c audio: host: reload DMA buffer on non-zero partial_size
This patch ensures that the DMA buffer is reloaded when
partial_size is non-zero, even if copy_bytes is zero.
This condition typically occurs at the end of a stream,
where the last data chunk does not meet the condition
for reload DMA buffer, leaving a non-zero partial_size.

Signed-off-by: Damian Nikodem <damian.nikodem@intel.com>
2024-01-18 16:44:42 +00:00
Seppo Ingalsuo 7b5475b0af Tools: Rimage: Config: Add IGO NR component for TGL, MTL, LNL platforms
This patch enables to load the component in the changed platforms.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2024-01-18 16:39:29 +00:00
Seppo Ingalsuo 47425524dc Audio: IGO_NR: Convert to source sink API
The source sink API is needed for DP (data processing) scheduler
that is needed for 16 ms schedule rate.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2024-01-18 16:39:29 +00:00
Seppo Ingalsuo d47385b384 Tools: Testbench: Build IGO_NR with stub for testbench
This allows to build and load IGO NR stub version to testbench.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2024-01-18 16:39:29 +00:00
Seppo Ingalsuo 0bf04e018b Audio: IGO_NR: Set in stub handle size to prevent init error
Function igo_nr_init() expects a nonzero value for rballoc()
size so this can't be left zero. The value is just something
for stub usage that felt suitable for an unknown.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2024-01-18 16:39:29 +00:00
Seppo Ingalsuo de35a6f05b Audio: IGO_NR: Convert to module adapter
This patch converts this component to module adapter API.
- New() becomes simpler init()
- Params() is handled in module adapter, in init()
  "mod->verify_params_flags = BUFF_PARAMS_RATE;" replaces
  igo_nr_verify_params().
- Rates check in params() is placed to separate function
  igo_nr_check_params() to be called from prepare().
- cmd() handler is changed to module adapter client style with
  igo_nr_set_config() and igo_nr_get_config().
- igo_nr_process() and igo_nr_copy() are merged to module API
  style igo_nr_process() function.
- igo_nr_prepare() sets source and sink align constraints for
  processing.
- igo_nr_trigger() is removed, handled by module adapter.
- Changes to support IPC4.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2024-01-18 16:39:29 +00:00
Seppo Ingalsuo 14237ed126 Tools: Rimage: Add RTNR component to TGL, MTL, and LNL platforms
This patch allows load of RTNR component with these platforms.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2024-01-17 13:19:40 +00:00
Seppo Ingalsuo 2f71ce04f2 Audio: RTNR stub: Add audio_stream_copy() to stub functions
This change avoids with stub library version annoying playback
sound from non-updated sink buffer when the processing ALSA
switch control is enabled. The audio is passed through from
source to sink.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2024-01-17 13:19:40 +00:00
Seppo Ingalsuo 491b29f7bb Audio: RTNR stub: Avoid error in rtnr_init() with null pointer
The init code checks for NULL and errors, so need to return
from RTKMA_API_Context_Create() a valid allocated address. The
free is added to RTKMA_API_Context_Free().

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2024-01-17 13:19:40 +00:00
Seppo Ingalsuo ac900459b3 Tools: Testbench: Add build of RTNR component to testbench
This patch enables RTNR (with stubs) to be built and loaded
to testbench.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2024-01-17 13:19:40 +00:00
Seppo Ingalsuo 8124dfb17b Audio: RTNR: Avoid build fail with library stub functions
The "sof," as local sources list is not correct. It causes
build fail with x86 testbench when CONFIG_COMP_RTNR_STUB
is set.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2024-01-17 13:19:40 +00:00
Seppo Ingalsuo 296af86f4c Audio: RTNR: Convert to module API
This patch updates the RTNR component to module adapter API
and IPC4.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2024-01-17 13:19:40 +00:00
Yong Zhi 40f6de58da sof_ri_info: fix imr size for cnl
Fix the typo for 8MB imr size.

Signed-off-by: Yong Zhi <yong.zhi@intel.com>
2024-01-17 11:57:45 +02:00
Yonatan Schachter 0a3b816c03 common.h: Guard definition of IS_ALIGNED for Zephyr builds
common.h defines the IS_ALIGNED macro, which conflicts with
a Zephyr macro of the same name. Add guards to define it only
if it is not already defined by Zephyr.

Signed-off-by: Yonatan Schachter <yonatan.schachter@gmail.com>
2024-01-16 21:18:12 +02:00
Marc Herbert f4ce8b537b xtensa-build-zephyr.py: fail on --deployable-build + older options
From experience, no one scrolls up and looks at warnings that are not in
the current screen.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2024-01-15 15:33:25 +02:00
Marc Herbert e24ccd2c19 xtensa-build-zephyr.py: fix --help text for --fw-naming=AVS
Better late than never... zero functional change.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2024-01-15 15:33:25 +02:00
Daniel Baluta c4bfdc6a7d audio: dai-zephyr: Fix unused variable warning
Move sink_list under CONFIG_IPC_MAJOR_4 in order to avoid the following variable unused warning:

$ sof/src/audio/dai-zephyr.c: In function 'dai_dma_cb':
$ sof_dir/sof/src/audio/dai-zephyr.c:259:35: warning: unused variable 'sink_list' [-Wunused-variable]
  259 |                 struct list_item *sink_list;
      |                                   ^~~~~~~~~

Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
2024-01-15 14:28:09 +02:00
Marc Herbert c8eb21621a xtensa-build-zephyr.py: show symbolic links at the end
Not sure why I thought it would be complicated; I should have done this
much sooner.

Before:

```
build-sof-staging
|-- sof
|   +-- intel
|       +-- sof-ipc4
|           |-- adl
|           |   +-- community
|           |       +-- sof-adl.ri
|           |-- adl-n
|           |   +-- community
|           |       +-- sof-adl-n.ri
|           |-- arl
|           |   +-- community
|           |       +-- sof-arl.ri

```

After:

```
build-sof-staging
|-- sof
|   +-- intel
|       +-- sof-ipc4
|           |-- adl
|           |   +-- community
|           |       +-- sof-adl.ri  -> ../../tgl/community/sof-tgl.ri
|           |-- adl-n
|           |   +-- community
|           |       +-- sof-adl-n.ri  -> ../../tgl/community/sof-tgl.ri
|           |-- arl
|           |   +-- community
|           |       +-- sof-arl.ri  -> ../../mtl/community/sof-mtl.ri

```

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2024-01-15 13:27:56 +02:00
Adrian Warecki 6c188298b9 rimage: loadable_modules: Set correct image type
The image header contains a bitfield with flags specifying a image type.
This commit sets correct image type depending on whether firmware or
a loadable module is being signed.

Signed-off-by: Adrian Warecki <adrian.warecki@intel.com>
2024-01-12 17:52:53 +02:00
Rander Wang 705c614a27 dai: add error log for failed path
The error log is convenient for developer to check failed case in stress
test.

Signed-off-by: Rander Wang <rander.wang@intel.com>
2024-01-12 12:06:03 +00:00
Seppo Ingalsuo 8d2fb32fa5 Audio: DRC: Change DRC to use lookup table based sine function
This change saves in TGL platform about 13 MPCS, from 83
to 70 MCPS. In MTL platform the saving is 12 MCPS, from 46
to 34 MCPS. The .bss RAM usage increases by 1 kB from
selecting CONFIG_MATH_LUT_SINE_FIXED.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2024-01-11 15:33:52 +00:00
Seppo Ingalsuo 3a1cdedf01 Test: Cmocka: Add test case for lookup table sine function
The test function is based on test function for the cordic
sine function. The error tolerance is adjusted to just pass.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2024-01-11 15:33:52 +00:00
Seppo Ingalsuo c1e5a21156 Math: Restore fast look-up table based sine function
This patch adds function sofm_lut_sin_fixed_16b(). It was
used earlier in SOF with name sin_fixed() but was remove
at add of Cordic trigonometric library. This sine function
can be used in hot code parts. Due to look-up table usage it
consumes more .bss RAM than cordic version.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2024-01-11 15:33:52 +00:00
Chao Song 16d788efed Topology2: Add sof-lnl-rt722-l0
This patch adds the topology for LNL RVP with rt722
multiple function codec.

Signed-off-by: Chao Song <chao.song@linux.intel.com>
2024-01-11 12:38:28 +00:00
Baofeng Tian 214456d525 Trace: remove unused META definition
Remove unused META definition, below work is done:
1. removed META definition.
2. removed cmocka preproc module.
3. removed cmocka strcheck and debugability module.

With this change, cmocka does not have any dependency on
META programming.

Signed-off-by: Baofeng Tian <baofeng.tian@intel.com>
2024-01-11 12:34:26 +00:00
Baofeng Tian 2df16fed84 Dai: fix an type error in dai legacy header file
It is typo, fix it with correct format.

Signed-off-by: Baofeng Tian <baofeng.tian@intel.com>
2024-01-11 12:34:26 +00:00
Fabiola Kwasowiec 1cc7a4c5b1 aria: change to S24_LE format processing
After the following change:
"copier: add support for windows driver
(383d17a19e)"
aria stopped working properly.
It is necessary to adapt the module
S24_LE format processing

Signed-off-by: Fabiola Kwasowiec <fabiola.kwasowiec@intel.com>
2024-01-10 15:08:29 +01:00
Marcin Szkudlinski 5059614c64 dp: look at all sinks and sources in default "is ready"
The default "is ready to process" implementation used to look
at a first sink and first source only.

This change makes it to look at all sinks and sources.

Signed-off-by: Marcin Szkudlinski <marcin.szkudlinski@intel.com>
2024-01-10 13:02:10 +02:00
Guennadi Liakhovetski b07d6e9161 IPC4: print leading zeros in UUID
When printing a missing module UUID, include leading zeros for
easier matching.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2024-01-09 19:01:13 +02:00
Guennadi Liakhovetski 23de2de53b module-adapter: (cosmetic) use an existing error label
Use goto to just to an existing error handling label instead of
freeing memory in place and returning.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2024-01-09 19:01:13 +02:00
Guennadi Liakhovetski 916f36ba28 lib-manager: (cosmetic) clean up memory allocation
- Use rzalloc() instead of rmalloc() + memset()
- Don't check for NULL before freeing

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2024-01-09 19:01:13 +02:00
Guennadi Liakhovetski 800ef08b27 modules: fix a name conflict with Zephyr
Zephyr has a logging module, named "modules" too, use "sof_modules"
to avoid a conflict.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2024-01-09 19:01:13 +02:00
Guennadi Liakhovetski 0d430ab489 modules: remove superfluous initialisation
Remove unneeded initialisation and move a variable definition closer
to where it's used.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2024-01-09 19:01:13 +02:00
Guennadi Liakhovetski 2e4999ae0f module: add missing methods
The loadable module API needs to support all module-adapter methods,
add all the missing ones.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2024-01-09 19:01:13 +02:00
Guennadi Liakhovetski 12d958a2eb module: export symbols for loadable modules
Export a number of symbols, commonly used by loadable modules.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2024-01-09 19:01:13 +02:00
Guennadi Liakhovetski 76926dacdd library-manager: allocate DMA buffer uncached
The library manager uses a DMA buffer only to receive data via DMA
from the host and to copy it from it once completely to a destination
buffer. With that flow using cached access to the DMA buffer doesn't
accelerate IO but adds complexity and can slow it down instead.
Switch over to using uncached access.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2024-01-09 19:01:13 +02:00
Andy Ross 4bafdee66d ipc4: Use saved base_cfg_ext data in ipc_comp_connect()
The code here never really worked right.  The module base config
values weren't saved by the core layers, so querying the attribute
returned nothing.  A few components have been modified with a whitebox
workaround where they write directly to the basecfg_ext field in the
module_config, but that's not really an API we should want to support.

Get the values from the now-correctly-saved-and-parsed fields the
module init layer has left for us, with considerable code savings and
much less heap thrashing for the temporary copy.

Signed-off-by: Andy Ross <andyross@google.com>
2024-01-09 16:31:44 +00:00
Andy Ross 7046004384 module_adapter_ipc4: Save and pre-parse base_cfg_ext data
The kernel-provided "base_cfg_ext" data wasn't being handled correctly
by the module adapter layer.  These structs (packed wire formats) only
ever lived in the IPC memory.  The module would set them on an
"init_data" before calling into driver init, and then clear that
pointer afterwards.  That's a critical problem, because the values in
that struct need to be used at pipeline setup time to configure buffer
formats!

Save the data correctly.  Also pre-parse it so users don't need to do
byte math on raw buffers and can just use "in/output_pins[]" arrays on
the module_config struct.

Signed-off-by: Andy Ross <andyross@google.com>
2024-01-09 16:31:44 +00:00
Andrula Song 3a78701fb0 Tools: Topology2: Add sof-hda-benchmark-src_lite16/24/32-<platform>
This patch adds build of hda-generic development topologies to
test SRC LITE component with all s16/s24/s32 formats

Signed-off-by: Andrula Song <andrula.song@intel.com>
2024-01-09 15:09:37 +00:00
Andrula Song 04a0553d67 Tools: Topology2: Add widget class SRC LITE
This patch allows to build topologies to use the SRC LITE
component.

Signed-off-by: Andrula Song <andrula.song@intel.com>
2024-01-09 15:09:37 +00:00
Andy Ross 9ac160b879 audio_stream: Rename/redocument audio_stream_set_align
After recent changes, the audio_stream_init_alignment_constants()
routine isn't an "init" step anymore, it sets requirements and can be
called at any time.  Rename it to "audio_stream_set_align()" to better
capture its behavior, and rework the documentation to make it clearer
how it works.

Signed-off-by: Andy Ross <andyross@google.com>
2024-01-09 14:51:55 +00:00
Andy Ross fec9e990e5 various components: Remove default/stub init_alignment_constants usage
Traditionally audio_stream has failed to initialize its computed
alignment fields, forcing components to do this themselves even when
they don't actually have special alignment requirements.

Remove all the code that was merely setting default values, leaving
only a handful of spots with specialr equirements (e.g. eq/area need
to treat pairs of samples, a few others have HiFi-optimized variants
which need SIMD alignment).

Signed-off-by: Andy Ross <andyross@google.com>
2024-01-09 14:51:55 +00:00
Andy Ross 4175ac7ad0 audio_stream: Persist requirements and lazy-recalculate alignment
As specified, this function was a bit of a booby trap: it has to be
called exactly once, after all other setup that modifies frame size
has been done.  If it is called in the wrong order, or not at all, any
consumers of the frame alignment API on this stream will see garbage
data in the computed fields.  That's way too much complexity for the
component code that needs to use this tool, especially as the impact
is not in the component itself (e.g. it's a downstream copier widget
with SIMD code that fails).

Instead, preserve the two requirements set by this function in the
audio_stream struct and recompute them any time any of the upstream
values change.  That allows this to be safely used from any context.

There's a mild complexity with audio_sink/source layer, which is
written to directly modify the format (it keeps a pointer into
audio_stream of its own) without going through the audio_stream API
itself.  There, the framework gives us "on_audio_format_set()"
callbacks on source and sink, so implement it there.

This is a partial fix for Issue #8639

Signed-off-by: Andy Ross <andyross@google.com>
2024-01-09 14:51:55 +00:00
Andy Ross d8edb5e566 audio_stream: refactor: Move init_alignment_constants to C file
audio_stream_init_alignment_constants() isn't a particularly small
function, isn't used in performance-sensitive contexts, and doesn't
really belong in a header.  Move to audio_stream.c for hygiene, and
because it's about to be modified.

Also move the depended-on function audio_stream_frame_align_get(), and
(as it has no consumers outside of audio_stream) remove its
declaration from the header.

Signed-off-by: Andy Ross <andyross@google.com>
2024-01-09 14:51:55 +00:00
Tomasz Leman 2cc63f239e west.yml: update zephyr to d7af6f37103
Total of 366 commits.

Changes include:

d7af6f37103 intel_adsp: ipc: pm action in busy state
61cb7d43580 adsp: hda: accept 16 byte alignment for HDA buffer size
4ae558c505b kernel: work: Fix race in workqueue thread
debb9f63523 xtensa: dc233c: force invalidating TLBs during page table swap
fa25c0b0b88 xtensa: mmu: invalidate mem domain TLBs during page table swap
d1f3f863f14 soc/xtensa/intel_adsp: fix interrupts typo

Signed-off-by: Tomasz Leman <tomasz.m.leman@intel.com>
2024-01-09 15:10:48 +02:00
Rander Wang e89f21e181 board: enable 64 bits timestamp support on intel platforms
TGL, TGL-H and ACE platforms will use 64 bits timestamp.

Signed-off-by: Rander Wang <rander.wang@intel.com>
2024-01-08 14:23:15 +00:00
Rander Wang 76b0979c64 base_fw: sync time between host and fw for logging
It is a general implementation for logging and it doesn't use intel
audio hardware feature like ART counter. 64bits timestamp is needed
for accuracy since the timestamp used by host is beyond 32bits in most
cases.

Signed-off-by: Rander Wang <rander.wang@intel.com>
2024-01-08 14:23:15 +00:00
Rander Wang 09ac2f01e9 base_fw: convert dsp hw cycle to dsp time
Dsp time is in format of micro second, not hw cycle.

Signed-off-by: Rander Wang <rander.wang@intel.com>
2024-01-08 14:23:15 +00:00