Commit Graph

10379 Commits

Author SHA1 Message Date
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
Bard Liao f6f57fe82b Topology2: sdw-jack-generic: add 1 ch format support
Some codecs like cs42l42 support 1 channel capture only.

Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
2023-06-12 10:12:36 +03:00
Mengdong Lin a5c0c49707 topology2: add development tplg to test playback with 2 cores
This is to allow CI to test a simple multicore playback case on
MTL/TGL/ADL: SSP0 playback on core 0 and SSP2 playback on core 1.

Capture uses core 0 only atm. More multicore usage will be
introduced later.

Signed-off-by: Mengdong Lin <mengdong.lin@intel.com>
2023-06-12 10:09:00 +03:00
Andy Ross 65dc05a131 ipc3: Check component type in ipc_stream_pcm_params()
This handler was missing its type check and would follow comp_dev
union fields on components that might be buffers or pipelines, leading
to crashes downstream.

Found via fuzzing.

Signed-off-by: Andy Ross <andyross@google.com>
2023-06-09 08:50:20 +02:00
Andy Ross 403c33f829 ipc: Tolerate uninitialized source/sink list nodes
These list heads in the comp_dev struct are not uniformly initialized
(grepping the source, the list_init() calls for these fields seem to
be spread around the source tree in individual components).  Fuzzing
is seeing nulls here, presumably because it's possible to reach
ipc_comp_free() in "unintended lifecycle" circumstances where they
weren't initialized.  Check the fields before crashing.

Signed-off-by: Andy Ross <andyross@google.com>
2023-06-09 08:50:20 +02:00
Andy Ross d788b34749 ipc/pipeline: Check type in ipc_pipeline_complete()
This function is called based on external commands, and with an
arbitrary component ID that may not actually be a pipeline.  Check the
type before following garbage pointers and passing them down into call
trees.

Found via fuzzing.

Signed-off-by: Andy Ross <andyross@google.com>
2023-06-09 08:50:20 +02:00
Andy Ross 7511a1da15 kpb: Don't assert on memcpy overruns
The config block for the component gets provided externally and is
copied directly in using a byte count likewise provided by the host.
The use of memcpy_s() prevents overruns, but the error that was
detected was being reported via assert().  To fuzzing, that assertion
is a fatal error, when clearly this needs to be a runtime failure as
it's due to external input and not a local code bug.

Signed-off-by: Andy Ross <andyross@google.com>
2023-06-09 08:50:20 +02:00
Baofeng Tian 5f118b761b copier: use separate function for multi endpoint and module copy
Copier_copy left code is for multi endpoint and module copy,
move it to a separate function.

Signed-off-by: Baofeng Tian <baofeng.tian@intel.com>
2023-06-08 15:59:54 +03:00
Baofeng Tian 5fdecbc2eb copier-dai: rename some common function name
Those function are both needed in legacy and zephyr part, simply
with zephyr prefix is not suitable, rename it with common prefix.

Signed-off-by: Baofeng Tian <baofeng.tian@intel.com>
2023-06-08 15:59:54 +03:00
Baofeng Tian 7ea9155ea8 copier: align dai reset and trigger with host and gateway
Host and gateway case already have common function to handle
trigger and reset, add this wrap to align dai with host.

Signed-off-by: Baofeng Tian <baofeng.tian@intel.com>
2023-06-08 15:59:54 +03:00
Baofeng Tian cbba56a121 copier: move free multiple endpoint buffer to dai
Only dai have multiendpoint case, so move it to dai component.

Signed-off-by: Baofeng Tian <baofeng.tian@intel.com>
2023-06-08 15:59:54 +03:00
Baofeng Tian 1a643ca4b0 copier: refactor copier new for host, dai and gateway case
Move more code from copier to its component function.

Signed-off-by: Baofeng Tian <baofeng.tian@intel.com>
2023-06-08 15:59:54 +03:00
Baofeng Tian 9158bab370 copier: move some common functions to generic file
Move some functions from copier.c to copier_generic.c.

Signed-off-by: Baofeng Tian <baofeng.tian@intel.com>
2023-06-08 15:59:54 +03:00
Baofeng Tian 97f78ea3f1 copier-dai: refactor copier parameters
Move dai parameter related code to copier_dai.c with new functions.

Signed-off-by: Baofeng Tian <baofeng.tian@intel.com>
2023-06-08 15:59:54 +03:00
Damian Nikodem ee318548d7 aria: data size calculation fix
This change fixes data size calculation to be copied
to aria cyclic buffer.

Signed-off-by: Damian Nikodem <damian.nikodem@intel.com>
2023-06-07 18:29:19 +03:00
Marc Herbert 212e9808a4 versions.json: bump to 2.6.99
Adopt Zephyr's (and others) .99 convention to indicate a development
branch.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2023-06-07 18:26:26 +03:00
Andrula Song b787bead93 Audio: Peak volume: Add Kconfig to select the period of reporting
peak meter value

Add kconfig to select the period of reporting peak meter value.
The default value is reporting peak meter every 10 ms.

Signed-off-by: Andrula Song <andrula.song@intel.com>
2023-06-07 18:25:19 +03:00
Ranjani Sridharan 1da18c2caa topology2: cavs-sdw: Build passthrough LNL FPGA topology
With RT711 on link 0

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2023-06-07 18:17:20 +03:00