Commit Graph

10346 Commits

Author SHA1 Message Date
Ranjani Sridharan bdd3bf2409 topology2: cavs-nocodec-bt: Replace audio_format objects
Use the input_audio_format/output_audio_format objects instead.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2023-06-21 12:10:02 +03:00
Kwasowiec, Fabiola 55a352a549 Copier: fix format in attenuation function
Format for validation in the attenuation
function is taken from base_audio_fmt
instead of out_fmt

Signed-off-by: Kwasowiec, Fabiola <fabiola.kwasowiec@intel.com>
2023-06-21 12:08:59 +03:00
Jaroslaw Stelter fc03df754c lib_manager: Fix library unload flow
Cache invalidation after memory unmap is not required and
could trigger exceptions depending on memory protection
configuration.

Signed-off-by: Jaroslaw Stelter <Jaroslaw.Stelter@intel.com>
2023-06-21 12:03:41 +03:00
Piotr Makaruk 2c9ad7caf5 cadence: enable processing with ipc4 protocol
Maintain codec configuration initialization for ipc4 protocol in cadence
module by separation critical functions into ipc3/ipc4 versions

Changes affect:
- different size of init/runtime config allocation
- resolving codec id from configuration from configuration params for ipc4

Signed-off-by: Piotr Makaruk <piotr.makaruk@intel.com>
2023-06-21 10:40:39 +02:00
Liam Girdwood 89660c6160 module_adapter: optimize buffer updates for consume and produce
Direct call for buffer updates and avoid notify usage.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Signed-off-by: Baofeng Tian <baofeng.tian@intel.com>
2023-06-20 16:24:34 +03:00
Liam Girdwood bd45a7e15a module_adapter: optimize simple copy
Simple copy does not need full buffer info for every iteration.
Only calculate what we need.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Signed-off-by: Baofeng Tian <baofeng.tian@intel.com>
2023-06-20 16:24:34 +03:00
Przemyslaw Blaszkowski 3ebfe2e3f3 platform: Kconfig: config INCOHERENT by default for all ACE and CAVS
All available ACE and CAVS platforms use INCOHERENT config, so set it by
default.

Signed-off-by: Przemyslaw Blaszkowski <przemyslaw.blaszkowski@intel.com>
2023-06-20 14:18:20 +03:00
Yong Zhi 83ff81984a topology2: deepbuffer-playback: increase default buffer_size_max
buffer_size_max of PCM cap for deepbuf is configured for 65536.
Quadruple the buffer_size/period_size to allow aplay to use larger
buffer size.

Signed-off-by: Yong Zhi <yong.zhi@intel.com>
2023-06-20 14:09:33 +03:00
Marcin Szkudlinski 46e326f239 src: POC - change src module to use sink/source API
This is a porting of SRC module to use sink/src API
To have src fully ported there's a need to get 100%
independent of audio_stream and buffer.c
This step is necessary because other implementations of
sink/src, like DP Queue, may not be based on buffer
implementation

Signed-off-by: Marcin Szkudlinski <marcin.szkudlinski@intel.com>
2023-06-19 16:26:08 +02:00
Marcin Szkudlinski fa77edf9a4 pipeline2.0: change module prepare API to use sink/src.c
Module prepare is an operation that needs to set up sink
and source according to needs.
Therefore it must have access to sink/source handlers
This commit adds handlers to API. In case the module uses
legacy audio stream sink/source pointers will be NULLs
and number of sinks/sources will be zero

Signed-off-by: Marcin Szkudlinski <marcin.szkudlinski@intel.com>
2023-06-19 16:26:08 +02:00
Marcin Szkudlinski 002d4a3f66 Pipeline2.0: change module API to use various data
Target is to make all modules use sink/source API as
data source and destination.
However, current implementation of module adapter
allows 2 other completely different interfaces to be used:

"simple_copy"
  modules receive output_stream_buffer and
  input_stream_buffer table. void * data pointers
  from both structures point to audio_stream
  other fields in the structures are in fact not needed
  but are used

"! simple_copy"
  modules receive output_stream_buffer and
  input_stream_buffer table. void * data pointers
  from both structures point to raw linear data

to make transition smooth and easy, both
legacy ways have been kept, just to make the code
more clear - put at separate module API calls,

Signed-off-by: Marcin Szkudlinski <marcin.szkudlinski@intel.com>
2023-06-19 16:26:08 +02:00
Marcin Szkudlinski 05871a16de pipeline2.0: add source/sink api to audio_stream
Make audio_stream capable of using pipeline2.0
sink and source API
This change makes integration of sink/src api
possible in incremental way

Signed-off-by: Marcin Szkudlinski <marcin.szkudlinski@intel.com>
2023-06-19 16:26:08 +02:00
Marcin Szkudlinski 305f8a2088 pipeline2.0: introduce sink/source utilities
There are many operations on sink/source that may be put into a
common library. This is the place for it.

Signed-off-by: Marcin Szkudlinski <marcin.szkudlinski@intel.com>
2023-06-19 16:26:08 +02:00
Marcin Szkudlinski 7462552f12 pipeline2.0: introduce a sink API
this is a definition of API to sink of audio data

THE SINK is any component that can store data somehow
and provide a buffer to be filled with data at request.
The sink API does not define how the data will be processed/used

 The user - a module - sees this API as a destination
            it must send data to
 The IMPLEMENTATION - audio_stream, DP Queue -
            sees this as a producer that PROVIDES data for processing

Examples of components that should expose SINK api
 - /dev/null
     all the data stored in sink buffer are just simply discarded
 - I2S sender
     Data stored in sink buffer will be sent to the external world
 - a memory ring buffer
     data stored in the buffer will be sent to another module
     (usually using source API, but it does not matter in fact).

Signed-off-by: Marcin Szkudlinski <marcin.szkudlinski@intel.com>
2023-06-19 16:26:08 +02:00
Marcin Szkudlinski ff6ca2b78f pipeline2.0: introduce a source API
this is a definition of API to source of audio data

THE SOURCE is any component in the system that have data
stored somehow and can give the data outside at request.
The source API does not define who and how has produced
the data
  The user - a module - sees this as a producer that
             PROVIDES data for processing
  The IMPLEMENTATION - audio_stream, DP Queue - sees
             this API as a destination it must send data to

Examples of components that should expose source API:
  - DMIC. Data are coming from the outside world,
          stores in tmp buffer and can be presented
	  to the rest of the system using source_api
  - a memory ring buffer
	Data are coming from other module
        (usually using sink_api, but it does not matter in fact)

Signed-off-by: Marcin Szkudlinski <marcin.szkudlinski@intel.com>
2023-06-19 16:26:08 +02:00
Marcin Szkudlinski 90828e2305 buffer: external modules use API to access buffer_fmt
As no internals of audio_stream nor comp_buffer should be
accessible directly, move all calls to buffer_fmt to API
In addition, to let sink/source interface working,
move the parameter to audio_stream structure

Signed-off-by: Marcin Szkudlinski <marcin.szkudlinski@intel.com>
2023-06-19 16:26:08 +02:00
Marcin Szkudlinski 1799531a4d stream: move all stream runtime parameters to a structure
All stream parameters are now available as a single
structure

Signed-off-by: Marcin Szkudlinski <marcin.szkudlinski@intel.com>
2023-06-19 16:26:08 +02:00
Marcin Szkudlinski 589df2aea4 buffer: don't access stream internals
add more functions to audio_stream internals

Signed-off-by: Marcin Szkudlinski <marcin.szkudlinski@intel.com>
2023-06-19 16:26:08 +02:00
Damian Nikodem 031491f691 src: copier_generic: update apply_attenuation function
The function applying the attenuation should be based
on write pointer and the current number of copied data in
the current systick.

Signed-off-by: Damian Nikodem <damian.nikodem@intel.com>
2023-06-19 13:53:24 +03:00
Damian Nikodem a6834da4fa src: copier_hifi: update apply_attenuation function
The function applying the attenuation should be based
on write pointer and the current number of copied data in
the current systick.

Signed-off-by: Damian Nikodem <damian.nikodem@intel.com>
2023-06-19 13:53:24 +03:00
Yong Zhi 77e3e92157 topology2: cavs-rt5682: Add 2ch DMIC topology
Rex SKU1 variant has only 2xDMIC enabled on PDM1, use 2xch
capture for power saving.

Signed-off-by: Yong Zhi <yong.zhi@intel.com>
2023-06-19 10:18:12 +03:00
Jaska Uimonen f0f5bddd7b topology2: fix dai index in nocodec multicore
Dai index in one copier is set to 1 even though it should be 0, thus
change it.

Signed-off-by: Jaska Uimonen <jaska.uimonen@intel.com>
2023-06-16 18:24:37 +03:00
Jaska Uimonen f5df5097c8 topology2: fix nhlt debug binary names
Some topologies have the same file name specified as nhlt debug output
so they will override others. Change the names to be unique.

Signed-off-by: Jaska Uimonen <jaska.uimonen@intel.com>
2023-06-16 18:24:37 +03:00
Seppo Ingalsuo afd86e0808 Audio: Mux: Fix mistake in frames count handling
The source frames count need to be checked from every
active input_buffers[n].size). Similarly in consuming the
source buffers it needs to be updated to every
mod->input_buffers[n].consumed.

Fixes: #7308
Fixes: c399624 ("Audio: Mux: Convert mux and demux to module adapter")

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2023-06-16 12:46:35 +01:00
ShriramShastry c069197b63 Math: Library: Add the hifi4 exponential function
The 32-bit HiFi4 exponential library function has an accuracy of 1e-4,
a unit in last place error of 5.60032793, and output ranges from
0.0067379470 to 148.4131591026 for inputs from -5 to +5 (Q4.28) (Q9.23).

Signed-off-by: ShriramShastry <malladi.sastry@intel.com>
2023-06-16 12:17:09 +03:00
Ranjani Sridharan 75e8f4b63c topology2: cavs-nocodec: Introduce macros for PCM IDs
And fix the erroneous PCM ID for SSP0 capture.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2023-06-15 19:50:03 +03:00
Bard Liao f0b44b4854 Topology2: sdw-jack-generic: add 24 bit format support for sdw jack
Somehow s24_le format is missed.

Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
2023-06-15 16:35:03 +03:00
Chao Song 249f9dc68f app: configs: fix inconsistent logging config
The config CONFIG_LOG_FUNC_NAME_PREFIX_xxx is only
enabled for ACE platforms and INF log level, and the
timestamp used is different on TGL and MTL, which
is not quite consistent.

This patch make sure the log format is consistent
among platforms and log levels.

Signed-off-by: Chao Song <chao.song@linux.intel.com>
2023-06-15 16:32:52 +03:00
Andrula Song 41996216af Audio: Aria: optimize the implementation of aria processing
Remove the internal linear buffer to get/store data from source
and sink. And use the index table to reduce the mod operation.

Signed-off-by: Andrula Song <andrula.song@intel.com>
2023-06-15 16:30:02 +03:00
Andrula Song a00dae1bce Audio: Aria: Use the aligned function to avoid division
use the audio_stream_avail_frames_aligned to get processing
frames and then can reduce the division of comp_get_copy_limits.

Signed-off-by: Andrula Song <andrula.song@intel.com>
2023-06-15 16:30:02 +03:00
Yong Zhi b75a94bfd3 topology2: cavs-nocodec: run DMIC pipelines on core1
There is pinmux on MTL platform to optionally enable DMIC,
add this config to the build and run the pipeline on core 1.

Signed-off-by: Yong Zhi <yong.zhi@intel.com>
2023-06-15 11:10:45 +03:00
Seppo Ingalsuo 6d127964e5 Coherent: Do not calculate cache_to_uncache for non-shared
The address translation is needed only for shared in functions
coherent_release() and coherent_release_thread().

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2023-06-14 21:54:19 +03:00
Ranjani Sridharan 561f4b036c topology2: sdw-jack-generic: Fix the number of input pins
This was missed earlier.

Fixes: f8ad12734d ("topology2: cavs-sdw: Add option for passthrough pipelines")
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2023-06-14 21:45:23 +03:00
Kai Vehmanen cefd4252ab host: zephyr: zero dma_block_config before use
As host_common_params() only sets a subset of the fields,
initialize the Zephyr DMA interface struct "dma_block_config"
with zeroes before use.

Issue found in code review.

Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
2023-06-14 21:39:53 +03:00
Ranjani Sridharan 9798a1a7aa src: dai_zephyr: Remove unnecessary init
No need to init avail_bytes, free_bytes or copy_bytes.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2023-06-14 10:33:35 -07:00
Kai Vehmanen a209cbd31f audio: buffer: do not mix cached and non-cached access in buffer_alloc
No reason to mix cached and noncached operations when
initializing the buffer in buffer_alloc(). We take a cached
reference, so let's use that to initialize the object.

Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
2023-06-14 19:19:49 +03:00
Przemyslaw Blaszkowski 0c298e82b0 aria: remove internal buffer writeback
Removing writebacks of internal buffers: buf_in and buf_out.
Aria instance has exclusive access to this memory, so they are always
used at the same core.

Signed-off-by: Przemyslaw Blaszkowski <przemyslaw.blaszkowski@intel.com>
2023-06-14 18:04:02 +03:00
Przemyslaw Blaszkowski 2776042ce5 aria: fix in/out buffer overflow
In specific cases, Aria could get more than 1ms of data in input buffer
and more than 1ms free space in output buffer. In such case, Aria tried
to process more than 1ms, while internal buffers and algorithm are
prepared only for 1ms of data. In result buffer overflow was observed
and other module data was overwritten.

Limiting Aria processing size to IBS.

Signed-off-by: Przemyslaw Blaszkowski <przemyslaw.blaszkowski@intel.com>
2023-06-14 18:04:02 +03:00
Marc Herbert d0f59a7cb3 .github: add first LP64 compilation
A ton of (valid!) warnings but this will make sure the code at least
compiles.

For more context see #7192

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2023-06-14 13:19:22 +03:00
Marc Herbert e9f1531b50 west.yml: add hal_nxp
This is small and required to automated the very first LP64 compilation.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2023-06-14 13:19:22 +03:00
Ievgen Ganakov 8fb011df6c copier: fix attenuation stream frames calculation
When calculating number of frames to be attenuated in HOST copier
source stream frame bytes should be used instead of sink frame bytes.

E.g. in case of 24/24 bit to 24/32 bit PCM conversion using sink
container size will reduce frames number by 1/4 which will lead to
multiple glitches.

Also attenuation has to be applied in HOST copier in playback scenario
only, thus remove from do_conversion_copy()

Signed-off-by: Ievgen Ganakov <ievgen.ganakov@intel.com>
2023-06-13 19:47:13 +03:00
Yong Zhi d3f8bdc304 topology2: add sof-mtl-cs42l42-l0-max98363-l2-4ch support
cs42l42 headset codec on link0 & 2xmax98363 on link 2.

Co-developed-by: Uday M Bhat <uday.m.bhat@intel.com>
Co-developed-by: Jairaj Arava <jairaj.arava@intel.com>
Signed-off-by: Yong Zhi <yong.zhi@intel.com>
2023-06-13 18:24:13 +03:00
Ranjani Sridharan 8d5e624d03 topology2: intel: hdmi-generic: Replace audio_format objects
Use the input_audio_format and output_audio_format objects instead.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2023-06-13 11:16:10 +03:00
Ranjani Sridharan 8cb7bf1baf topology2: cavs-mixin-mixout: Replace audio_format instance
Use the input_audio_format and output_audio_format objects instead
and fix the number of input/output formats to 1.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2023-06-13 11:16:10 +03:00
Marc Herbert c7af3c5b3b Kconfig: don't fall back on CONFIG_TIGERLAKE
There's really no reason to fall back on a default "platform" and pick
up a bunch of other, totally random settings.

Now the following command fails immediately with a useful `platform not
defined` error message instead of stopping with a cryptic
`platform/trace/trace.h: No such file or directory` after successfully
compiling half the .c files in a Frankenstein CONFIG_uration.

```
  west build -p --board mimx8mm_evk_a53 modules/audio/sof/app
```

More context in #7192.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2023-06-13 11:11:14 +03:00
Marc Herbert 5a9dc8a0b5 scripts/fuzz.sh: add -DCONFIG_ZEPHYR_POSIX
Don't rely on some semi-random default value.

The final `zephyr/.config` and binaries are strictly identical.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2023-06-13 11:11:14 +03:00
Marc Herbert 1621a95f01 scripts/fuzz.sh: cosmetic move list of CONFIG_s to a bash array
This saves a lot of backslashes and is easier to read. Zero change.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2023-06-13 11:11:14 +03:00
Marc Herbert 820fadae39 xtensa/CMakeLists.txt: simplify CONFIG_RENOIR/REMBRANDT logic
Use get_filename_component() to get the basename and remove the
$platform_folder special case for CONFIG_RENOIR and
CONFIG_REMBRANDT. Zero change, binaries are identical.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2023-06-13 11:11:14 +03:00
Kai Vehmanen 0e75d84b49 rimage: align west.yml and rimage submodule
The rimage submodule was accidentally changed to a difference
version. Change back to the version in west.yml.

Fixes: 7511a1da15 ("kpb: Don't assert on memcpy overruns")
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
2023-06-12 09:43:54 -07:00
Bard Liao 8ef4d51e68 topology2: sdw-jack-generic: add SDW_JACK_CAPTURE_CH macro
Adding SDW_JACK_CAPTURE_CH macro to specify sdw jack channels.
The default value is 2.

Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
2023-06-12 10:12:36 +03:00