Commit Graph

12407 Commits

Author SHA1 Message Date
Marc Herbert 43912a70ed native_sim_libfuzzer.conf: override some incompatible hardware options
Override incompatible options CONFIG_SMP_BOOT_DELAY and
CONFIG_SCHED_CPU_MASK_PIN_ONLY found in `sof/app/prj.conf` to silence
build time warnings. Strange why these are in `app/prj.conf` but not our
problem here.

```
warning: SCHED_CPU_MASK_PIN_ONLY (defined at kernel/Kconfig:139) was
assigned the value 'y' but got the value 'n'. Check these unsatisfied
dependencies: SMP (=n).

warning: SMP_BOOT_DELAY (defined at kernel/Kconfig.smp:32) was assigned
the value 'y' but got the value 'n'. Check these unsatisfied
dependencies: SMP (=n).
```

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2024-09-02 11:25:14 +01:00
Ranjani Sridharan 847b2ae7a7 tools: plugin: noise_suppression: Fix build error
Recent changes to UUID naming dropped the _comp in the UUID declaration.
Fix the noise suppression module to adhere to the new naming while
declaring the module interface and trace.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2024-09-02 11:24:53 +01:00
Seppo Ingalsuo b55cb64ac1 Audio: EQIIR: Tune: Prefix top level functions with sof_
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2024-09-02 11:21:20 +01:00
Seppo Ingalsuo 73de9de524 Audio: EQ: Tune: Move equalizer setup scripts to module directory
The scripts are moved to consolidate the audio modules.

The setup tool is common for IIR and FIR where IIR is more
commonly used so the destination directory is eq_iir. The
equalizers with both IIR and FIR part are also designed in
the same run so the design is not split.

The paths are fixed in code for new location. There are no
other changes.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2024-09-02 11:21:20 +01:00
Seppo Ingalsuo e1e26b5eb4 Audio: MFCC: Remove unnecessary space from HiFi4 code
Only cosmetic change, no functionality changed. Noticed while
comparing hifi3 and hifi4 code versions. Now one difference
less.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2024-09-02 13:03:14 +03:00
Seppo Ingalsuo c232feb19c Audio: MFCC: Fix mistake with HiFi4 circular buffer index
The instruction AE_L16_XC() uses circular buffer0, so the
buffer setup instruction need to be changed. The proper
instruction for buffer 1 would have been AE_L16_XC1().

Due to this error the MFCC output became incorrect after
wrong circular buffer wrap.

Fixes: 5c92bddcf4 ("Audio: MFCC: Add HiFi4 implementation of MFCC")

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2024-09-02 13:03:14 +03:00
Grzegorz Bernat 39ace344cf Audio: Volume: Fix problem with Hifi4
This patch fixes an issue with gain and peakvolume processing
with s16 sample format and with sample rates where period is not
multiple of four samples SIMD processing assumption. With 44.1 kHz
rate the period is normally 44 frames but every 10th is 45. However,
the value of 45 was not handled correctly. A Glitch appeared to
output when this happened.

The fixed code adds sample-by-sample volume process code for the
remaining amount of up to 3 samples to process.

The earlier workaround (87571f337c "audio: volume: disable HIFI4
optimizations") is reverted.

Signed-off-by: Grzegorz Bernat <grzegorzx.bernat@intel.com>
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2024-09-02 10:34:14 +01:00
Seppo Ingalsuo 298687c016 Tools: Rimage: Config: Add mfcc.toml include for MTL, LNL, PTL
The MFCC component is not loading in these platforms due to
missing edit to <platform>.toml.h.

As editorial change the missing newline in the end of
ptl.toml.h is fixed.

Fixes: f7715b814b
       ("Audio: MFCC: Fix build of component for current SOF")

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2024-09-02 10:30:34 +01:00
Guennadi Liakhovetski 728fb98d81 Zephyr: update to include LLEXT logging protection
Zephyr PR 77289 fixed deferred logging with LLEXT objects, update to
a Zephyr version, containing it.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2024-08-30 16:03:28 +03:00
Guennadi Liakhovetski 8b48c563ce drc: move logging context to the base image
Logging context can be accessed from the deferred logging
thread. Therefore it must be always available to avoid
access to unmapped memory when an LLEXT module is unloaded.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2024-08-30 16:03:28 +03:00
Guennadi Liakhovetski 0ddf797dc6 uuid: add a missing header
uuid.h uses uint32_t, uint16_t and uint8_t types, it must include
stdint.h or inttypes.h.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2024-08-30 16:03:28 +03:00
Guennadi Liakhovetski 3db820d9d4 clock: only update clock frequency if actually changing it
No need to set clock frequency if the new one is equal to the current
one.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2024-08-30 16:03:28 +03:00
Guennadi Liakhovetski cada215ee5 lib_manager: disable on TGL
The library manager isn't supported on TGL, disable it there.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2024-08-30 16:03:28 +03:00
Guennadi Liakhovetski f2a0bf8acb pipeline: rebalance KCPS instead of adding or subtracting
Adding or subtracting module CPC when starting and stopping pipelines
is brittle. Particularly it's prone to mistakes with modules, not
specifying their CPC explicitly. Instead recalculate CPC every time
a pipeline is started or stopped.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2024-08-30 16:03:28 +03:00
Guennadi Liakhovetski b1df683c91 lib-manager: add a function to identify component type
Extract the module_is_llext() macro into a header and add a function
to identify a loadable module type of a component.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2024-08-30 16:03:28 +03:00
Guennadi Liakhovetski 86b5c322a3 pipeline: (cosmetic) extract code fragment into a function
Extract code to obtain a pointer to the module base configuration,
depending on its type, into a separate function.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2024-08-30 16:03:28 +03:00
Marc Herbert 945af87124 CODEOWNERS: remove invalid libinyang and makarukp
Both are reported by Github as "Unknown owner on line 31: make sure
@makarukp exists and has write access to the repository"

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2024-08-29 20:05:31 +01:00
Marc Herbert 077187d500 CODEOWNERS: remove marc-hb
New assignment.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2024-08-29 20:05:31 +01:00
Curtis Malainey 0f4a246df1 module_adapter: fix switch case for spec parsing
This switch case is non exhaustive and has not guards on config types
which means assuming all types that are default are process types is
false. The fuzzer found a way to utilize a DAI to bypass IPC layer
checks but break the module adapter.

Signed-off-by: Curtis Malainey <cujomalainey@chromium.org>
2024-08-29 15:39:46 +03:00
Curtis Malainey 94b3d2c9bd ipc3: fix subsize check
The ext size is counted as part of the ipc header size. The process size
and header size need to be less than the ipc max size.

Signed-off-by: Curtis Malainey <cujomalainey@chromium.org>
2024-08-28 16:46:55 +03:00
Pierre-Louis Bossart 8b8c842c78 topology2: add simple passthrough for HDA tests
Long overdue, I don't know why we keep adding complicated stuff
without having a simpler baseline.

Two configurations are provided, one with default copiers and another
with CHAIN_DMA.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
2024-08-27 14:35:32 +03:00
Seppo Ingalsuo ad85184af0 Tools: Test: Audio: Mitigate trace flood in process_test.m
The verbose test trace flood slows down the test to near
unusable test times due to a lot of text printed to Octave
console. As result also the SOF CI logs become large.

This patch adds redirect of testbench trace into a temporary
file instead of standard output in process_test.m. The trace
content is printed in comp_run.sh to console only if there has
been an error. To prevent growing /tmp the trace file is
deleted after test run and possible print to console.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2024-08-27 13:39:53 +03:00
Curtis Malainey 876a371ba9 audio: mfcc: fix signed 1-bit field
Sparse complained about this since signed fields should be >=2 bits
minimum.

Signed-off-by: Curtis Malainey <cujomalainey@chromium.org>
2024-08-27 13:37:17 +03:00
Seppo Ingalsuo 6f61e8ab32 IPC: Increase SOF_IPC_MSG_MAX_SIZE for testbench and unit test
The testbench and unit tests use a simplified simulated IPC that
currently doesn't support messages split to multiple parts. As
workaround to unblock other SOF development the size is increased
from 384 bytes to 8192 bytes.

This allows run of current test set with scripts/host-testbench.sh
that is also used in SOF CI. The change can be reverted after the
capability is added to testbench.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2024-08-27 13:30:22 +03:00
Shriram Shastry b381f55833 Audio: Add comments to crossover_s32_default function
Add Doxygen comments to describe the parameters and functionality of
the crossover_s32_default function. This helps in understanding the
function's flow and the purpose of each section.

Signed-off-by: Shriram Shastry <malladi.sastry@intel.com>
2024-08-26 11:10:51 -07:00
Shriram Shastry 91aecce862 Audio: Optimize crossover_s32_default function for performance
Optimize the function by pre-initializing active sinks and adjusting loops
for better performance and readability.

Signed-off-by: Shriram Shastry <malladi.sastry@intel.com>
2024-08-26 11:10:51 -07:00
Curtis Malainey 10bffa799c selector: fix memcpy parameters
We should be using the trusted max size passed in via the framework
rather than the scratch memory we are passing into the host.

Signed-off-by: Curtis Malainey <cujomalainey@chromium.org>
2024-08-26 08:33:48 -07:00
Curtis Malainey 501b961554 selector: add a minimum size check for get_data
Check to make sure we actually have enough space to copy the config, if
we don't we will assert and crash when we could have handled this
gracefully.

Signed-off-by: Curtis Malainey <cujomalainey@chromium.org>
2024-08-26 08:33:48 -07:00
Peter Ujfalusi 7b021f6e20 src: host-zephyr: Drop function name from comp_* prints
The comp_* macros will print the function name from where they are called,
there is no need to print them twice.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
2024-08-23 14:12:16 +01:00
Peter Ujfalusi a419509606 src: dai-zephyr: Print out the src/sink frames along with 'nothing to copy'
The 'nothing to copy' without context does not help in debugging, print
out the number of frames on src and sink side to give some context.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
2024-08-23 14:12:16 +01:00
Peter Ujfalusi dedb75368b src: dai-zephyr: Drop function name from comp_* prints
The comp_* macros will print the function name from where they are called,
there is no need to print them twice.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
2024-08-23 14:12:16 +01:00
Curtis Malainey a3b1436b46 zephyr: don't build host targets with xtos headers
Posix is for posix

Signed-off-by: Curtis Malainey <cujomalainey@chromium.org>
2024-08-23 13:36:17 +01:00
Curtis Malainey 2f64bdefa1 smart_amp: fix return errors
If 0 is a error then override it so the outer function doesn't think we ran
successfully and then hit a null ptr after we freed everything.

Signed-off-by: Curtis Malainey <cujomalainey@chromium.org>
2024-08-23 13:35:21 +01:00
Jyri Sarha 67683d5191 performance measurements: Fix SOF_TELEMETRY_PERFORMANCE_MEASUREMENTS=n build
Without this change turning the performance measurements off, by setting
CONFIG_SOF_TELEMETRY_PERFORMANCE_MEASUREMENTS=n, causes a number of
"undefined reference to" linker errors.

Signed-off-by: Jyri Sarha <jyri.sarha@linux.intel.com>
2024-08-23 13:33:26 +01:00
Marc Herbert 577c9ae3e7 fuzz.sh: add new boards/native_sim_libfuzzer.conf
Extract -DCONFIG_* definitions hardcoded inside the script and move them
to a new .conf file where they belong.

This is a first, baby-step towards addressing the more general lack of
.config control described in #9386

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2024-08-23 13:28:23 +01:00
Seppo Ingalsuo 371245bb94 Tools: Topology2: Fix cavs-nocodec.conf SSP2 PCM rates
The rate_min and rate_max no more work with IPC4 topologies. The
SSP2 PCM host pipeline contains a sample rate converter so it can
support multiple rates. With attempt to play (or capture) with
other than 48 kHz the error is printed and resulting playback has
wrong pitch:

Warning: rate is not accurate (requested = 44100Hz, got = 48000Hz)
         please, try the plug plugin

Use of rates with list of all rates in topology fixes the issue.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2024-08-22 21:53:35 +03:00
Seppo Ingalsuo 66da07cd6a Audio: MFCC: Fix 64 bit build issue
The comp_err() trace in mfcc_init() causes an error:

sof/src/audio/mfcc/mfcc.c: In function 'mfcc_init':
sof/src/include/sof/audio/component.h:160:20:
  error: format '%u' expects argument of type 'unsigned int',
  but argument 4 has type 'size_t' {aka 'long unsigned int'}
  [-Werror=format=]

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2024-08-22 21:53:07 +03:00
Curtis Malainey 8090624c56 module_adapter: clean up module_load_config
Now that validate_config has been deleted we can clean up some of the
error handling logic here.

Signed-off-by: Curtis Malainey <cujomalainey@chromium.org>
2024-08-22 16:27:15 +01:00
Curtis Malainey 5c6af78905 module_adapter: remove validate_config
empty TODO for 4 years, no point in keeping it around. Also if you are
doing validation after trusting the data enough to do a memcpy you have
already lost.

Signed-off-by: Curtis Malainey <cujomalainey@chromium.org>
2024-08-22 16:27:15 +01:00
Curtis Malainey ae2bcb6862 module_adapter: fix a log string typo
Incorrect function context

Signed-off-by: Curtis Malainey <cujomalainey@chromium.org>
2024-08-22 16:27:15 +01:00
Shriram Shastry 5e1e05de13 Audio Format: Add vec_sat_int8x2 function
- Added to pack two 32-bit integers in an 8x2 vector.

Signed-off-by: Shriram Shastry <malladi.sastry@intel.com>
2024-08-22 16:22:20 +01:00
Shriram Shastry 4ebb35c9b0 Audio Format: Improve sat_int8 function
- Added detailed function documentation.
- Changed from if-else checks to bitwise operations for efficiency:
  - Shifted left by 24 bits to prepare for saturation.
  - Shifted right by 24 bits to sign-extend the value.
  - Extracted the 8-bit value using AE_MOVAD32_L.
- No performance degradation observed.

This check-in refines the sat_int8 function by improving its logic
and documentation to ensure a more efficient and accurate 32-bit to
8-bit conversion process.

Signed-off-by: Shriram Shastry <malladi.sastry@intel.com>
2024-08-22 16:22:20 +01:00
Shriram Shastry 7288ed005a Audio Format: Add vec_sat_int16x4 function
- Added to saturate and pack four 32-bit integers into 16x4 vector.

Signed-off-by: Shriram Shastry <malladi.sastry@intel.com>
2024-08-22 16:22:20 +01:00
Shriram Shastry b4c439051b Audio Format: Improve sat_int16 function
- Added detailed function documentation.
- Changed from AE_SAT16X4(x, x) to a more descriptive process:
  - Moved the 32-bit value to ae_int32x2 type for accurate input
   handling.
  - Used AE_SAT16X4 to saturate and pack values.
  - Extracted the first 16-bit value with AE_MOVAD16_0.
- No performance degradation observed.

This check-in enhances the sat_int16 function by improving its logic
and documentation to ensure more accurate 32-bit to 16-bit conversion.

Signed-off-by: Shriram Shastry <malladi.sastry@intel.com>
2024-08-22 16:22:20 +01:00
Shriram Shastry 63bbcaa68c Audio Format: Add vec_sat_int24x2 function
- Added to saturate and pack two 32-bit integers into a 32x2 vector.

Signed-off-by: Shriram Shastry <malladi.sastry@intel.com>
2024-08-22 16:22:20 +01:00
Shriram Shastry 94412f8116 Audio Format: Improve sat_int24 function
- Added detailed function documentation.
- Changed from AE_SRAI32(AE_SLAI32S(x, 8), 8) to AE_SAT24S for
  more accurate 24-bit saturation.
- Used ae_f32x2 type to ensure correct input handling.
- No performance degradation observed.

This check-in enhances the sat_int24 function by improving its logic
and documentation to ensure more accurate 32-bit to 24-bit conversion.

Signed-off-by: Shriram Shastry <malladi.sastry@intel.com>
2024-08-22 16:22:20 +01:00
Shriram Shastry c5e73a8402 Audio Format: Add vec_sat_int32x2 function
- Added to saturate and pack two 64-bit integers into 32x2 vector.

Signed-off-by: Shriram Shastry <malladi.sastry@intel.com>
2024-08-22 16:22:20 +01:00
Shriram Shastry 2d38f7ce11 Audio Format: Improve sat_int32 function
- Enhanced function documentation.
- Replaced AE_SLAI64 with AE_SLAI64S for better saturation control.
- Added intermediary shift left by 32 bits with saturation.
- Final shift right by 32 bits for accurate rounding and conversion.
- No performance degradation observed.

This check-in ensures more accurate and reliable results by using more
appropriate intrinsic functions and thorough step-by-step operations.

Signed-off-by: Shriram Shastry <malladi.sastry@intel.com>
2024-08-22 16:22:20 +01:00
Shriram Shastry 02c7b67fe2 Audio Format: Include required libraries
- Reshuffle standard headers order.

Signed-off-by: Shriram Shastry <malladi.sastry@intel.com>
2024-08-22 16:22:20 +01:00
Shriram Shastry 53f6bfa9e9 Audio Format: Update SPDX-License and copyright
- Changed year to 2024 and added author information.
- Updated the license identifier to BSD-3-Clause.

Signed-off-by: Shriram Shastry <malladi.sastry@intel.com>
2024-08-22 16:22:20 +01:00