Commit Graph

6292 Commits

Author SHA1 Message Date
Liam Girdwood d1c6cf168a ipc: move compact message processing to handler logic.
IPC compact messages are ABI specific. Move to ABI handler.
No code changes.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2021-04-19 14:29:37 +01:00
Kai Vehmanen be065e55a8 topology: ssp: fix a bug in passing SSP_MULTI_CONFIG_DATA args
The m4 ifelse parameters using defn() are not working as expected.
If more than 3 parameters are passed to SSP_MULTI_CONFIG_DATA(),
the values are not correctly passed.

Fix this by removing defn() and correctly quoting the whole
ifelse section.

Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
2021-04-16 16:12:43 +01:00
Kai Vehmanen 49547404e9 topology: ssp: fix a bug in passing SSP_CONFIG_DATA args
The m4 ifelse check on macro parameters is not working as expected.
If optional parameters are not passed, an empty string is written
to output conf file, instead of the "0" string specified in
the ifelse statement.

This has not caused functional errors as the empty string has
been interpreted as zero. Fix the logic despite this so that this
is not copied to other macros.

Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
2021-04-16 16:06:40 +01:00
Curtis Malainey 7f38fbb558 ip3: ignore unread var error
This code is cleverly written, any attempt to fix this error would
make the code no where near as clean. So instead we suppress.

Signed-off-by: Curtis Malainey <cujomalainey@chromium.org>
2021-04-16 14:52:23 +08:00
Curtis Malainey d7282762bc ipc3: don't declare unused variables
ifdef the whole function out if we are not going to use it.

Signed-off-by: Curtis Malainey <cujomalainey@chromium.org>
2021-04-16 14:52:23 +08:00
Curtis Malainey 34dd107300 kpb: only include variables scope in build
cppcheck complains that these variables are unused based on config flags

Signed-off-by: Curtis Malainey <cujomalainey@chromium.org>
2021-04-16 14:52:23 +08:00
Curtis Malainey 2c468a38c2 alloc: fix non-compiling debug code
unmatched brackets, found by cppcheck

Signed-off-by: Curtis Malainey <cujomalainey@chromium.org>
2021-04-16 14:52:23 +08:00
Curtis Malainey 398ddbd3f7 ipc3: avoid variable shadowing
we have a function called ipc_cmd, so lets not name any variables the
same name.

Signed-off-by: Curtis Malainey <cujomalainey@chromium.org>
2021-04-16 14:52:23 +08:00
Curtis Malainey 2736ea05c1 detect_test: avoid double write
We have the else case, lets use it so cppcheck can stop complaining.

Signed-off-by: Curtis Malainey <cujomalainey@chromium.org>
2021-04-16 14:52:23 +08:00
Curtis Malainey 3d0b2d123f detect_test: don't check unsigned for less than 0
No point in checking for something that can't happen. Found via
cppcheck.

Signed-off-by: Curtis Malainey <cujomalainey@chromium.org>
2021-04-16 14:52:23 +08:00
Keyon Jie c80350cc3b math: add config item for fft library
Add config item MATH_FFT and disable it by default at the moment.

Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
2021-04-15 17:30:48 +08:00
Keyon Jie d2cfa10f50 cmocka: add cmocka unit test for fft library
Add cmocka unit test for FFT library, including fft with size 1024/256,
fft + ifft with SNR test, fft for 2 channels.

Implement helpers to accept samples put in comp_buffer for both real and
complex FFT, the helper fft_real_2() is implemented to speed up the FFT
for dual channels inputs up to two times. All theses helpers should be
used for unit test only.

Suggested-by: Amery Song <chao.song@intel.com>
Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
2021-04-15 17:30:48 +08:00
Keyon Jie e0c745bdd5 fft: add initial fft library
Adds initial Fast Fourier Transform library version, now the maximum
supported window size is 1024, only the window size of the power of 2
and samples in Q1.31 format is supported.

Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
2021-04-15 17:30:48 +08:00
ShriramShastry 095d1d48ee Math: Added cordicsine function
cordicsine input value range is [-2*pi to 2*pi]

Compared to git hub, proposed solution has following advantage
-  Proposed implementation takes  approx. ¼ [One fourth ] execution time
-  Lookup table size is reduced from 513 to 31 with sizeof(int32) with
   a saving of 481 int32 bytes

Mean and maximum value for the difference between floating to fixed point
output is 3.2136e-09 and 0.0000000596

Signed-off-by: ShriramShastry <malladi.sastry@intel.com>
2021-04-14 15:01:50 +01:00
Marc Herbert 6297dc165b Revert "installer: change default destination to /lib/firmware/updates"
This reverts the main change in commit
65ade5a4f9.

There are too many test changes required first, see a tentative list in
https://github.com/thesofproject/sof-test/pull/645

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2021-04-14 14:59:21 +01:00
Liam Girdwood 6678b4022f testbench: align IPC structures on 4 bytes.
IPC is aligned on at least 4 bytes, removes compiler warning about packed
data being aligned on 1 bytes.

In file included from /home/lrg/work/sof/sof/tools/testbench/file.c:23:
/home/lrg/work/sof/sof/tools/testbench/include/testbench/file.h:59:1: error: alignment 1 of ‘struct sof_ipc_comp_file’ is less than 4 [-Werror=packed-not-aligned]
   59 | } __attribute__((packed));
      | ^

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2021-04-14 10:51:13 +01:00
Marc Herbert 5e11467ea5 xtensa/CMakeLists.txt: split very long CFLAGS line
Will also make git commands (blame, merge, revert, rebase,
cherry-pick,...) much less likely to fail.

Also more readable and more obvious that -imacros is not nested.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2021-04-14 10:49:57 +01:00
Marc Herbert e3c68211c7 smex: log versions with a dot (3.18.1) instead of a colon (3:18:1)
Logging versions like "3:18:1" deceive Emacs (and maybe others) because
they look like an error location produced by a compiler. When compiling
Emacs wrongly believes this an error location and offers to jump to it.

The colon ':' is also a reserved character in most filesystems and an
unusual version separator.

Before:

fw abi main version:	3:18:1
fw abi main version:	3:18:1

After:

fw abi main version:	3.18.1
fw abi main version:	3.18.1

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2021-04-13 21:26:24 +01:00
Keyon Jie cd2444adbf topology: sof-tgl-nocodec-ci: change to run smart_amp on core 1
Change to run smart_amp pipelines on DSP core 1, this will help reduce
the core 0 usage and add multi-core to the CI coverage.

Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
2021-04-13 21:16:56 +01:00
Viorel Suman b8ec30a01b imx8m: add support for SDMA2 and SAI1
Add SDMA2 and SAI1 related info.

Signed-off-by: Viorel Suman <viorel.suman@nxp.com>
2021-04-13 21:05:32 +01:00
Liam Girdwood c80270e7e4 ipc: structures should all be aligned on 4 bytes
Give the compiler a chance to further optimise IPC data access since it's
all on a 4 byte alignment.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2021-04-13 15:32:26 +01:00
Pierre-Louis Bossart fbdc330263 topology: add ADL SoundWire topologies
This is based on early hardware information and subject to change.

The ADL topologies use the link information to avoid confusions on
configurations. The kernel tables will use the same conventions.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
2021-04-13 10:43:03 +01:00
Pierre-Louis Bossart 8af787ae2b topology: add adl.m4
copy/pasted from tgl.m4, will need to differentiate later

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
2021-04-13 10:43:03 +01:00
Pierre-Louis Bossart 8673f92feb topology: align SoundWire topologies with the use of macros
No need for a dedicated topology just to deal with swapped links

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
2021-04-13 10:43:03 +01:00
Pierre-Louis Bossart 2ce64f914f topology: soundwire: use macros for dailink names
use eval w/ macros instead of hard-coded values

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
2021-04-13 10:43:03 +01:00
Pierre-Louis Bossart 7070c1b2d6 topology: soundwire: add macros for link numbers
remove hard-coded link numbers and make them configurable, this will
allow for reuse of the same topology when the devices are swapped

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
2021-04-13 10:43:03 +01:00
Pierre-Louis Bossart 2d66939c37 topology: soundwire: add 'NOJACK' option
Some devices are starting to remove the 3.5mm jack, we need a topology
for these cases.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
2021-04-13 10:43:03 +01:00
Pierre-Louis Bossart 375481c442 topology: soundwire: remove hard-coded hex values
replaces with regular base10 indices that are easier to correlate with
kernel/DAPM logs

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
2021-04-13 10:43:03 +01:00
Liam Girdwood e79d5d1f8e fuzzer: fix build as with header order and ARRAY_SIZE redefinition
ARRAY_SIZE was being redefined, simplest option is to remove, but I think
this code has to additionally be compiled with external Fuzzer. Fix build.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2021-04-12 15:57:23 -07:00
Liam Girdwood 517ad95d51 ipc: split ipc headers per function.
Split IPC APIs out by feature so that the IPC layer to help future
IPC infrastructure changes support more than one IPC ABI MAJOR version.

No code changes here, only code partitioning and Doxygen comments.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2021-04-12 19:30:11 +01:00
Liam Girdwood 0f2c9d1230 cleanup: remove double blanks lines.
Several files had multiple blank lines even before the removal of
platform_shared_commit(). Fix them with "cat -s"

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2021-04-12 16:58:51 +01:00
Liam Girdwood 580b9cf005 memory: remove platform_shared_commit() as it's a NOP on all platforms.
platform_shared_commit() was intended to provide a managed approach to
cache coherency between all cores on Intel CAVS platforms. However this
approach was never completed and its far simpler to use uncached pointers
globally and convert to local cacheable pointer when needed. i.e. all data
is uncacheable by default on Intel platforms and cacheable only when
requested.

This PR is mostly a result of running:

find . -name "*.c" -type f | xargs sed -i -e '/platform_shared_commit/d'
find . -name "*.h" -type f | xargs sed -i -e '/platform_shared_commit/d'

But this does not catch everything so manual build testing also required.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2021-04-12 16:58:51 +01:00
Zhang Peng efd051e2fa drivers: imx: interrupt: Rename interrupt.c to interrupt-irqsteer.c
Rename to interrupt-irqsteer.c for preparing support 8ulp platform that
is no irqsteer.
Add select IMX_INTERRUPT_IRQSTEER by default for imx8/8x/8m.

Signed-off-by: Zhang Peng <peng.zhang_8@nxp.com>
2021-04-12 14:34:54 +03:00
Bud Liviu-Alexandru b834353fb4 codec_adapter: Remove braces around single statement
This fixes checkpatch.pl warning:

WARNING: braces {} are not necessary for single statement blocks
172: FILE: src/audio/codec_adapter/codec/generic.c:172:

Signed-off-by: Bud Liviu-Alexandru <budliviu@gmail.com>
2021-04-12 14:33:45 +03:00
Daniel Baluta 3127503a60 LICENSE: Add Cadence license
We already have cadence license snippet in SOF project LICENSE
file but this one has new Copyright years.

// Copyright (c) 2003-2014 Cadence Design Systems, Inc.

vs

// Copyright (c) 2006-2020 Cadence Design Systems, Inc.

Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
2021-04-12 10:22:15 +01:00
Daniel Baluta c352ff8b53 cadence: Add Cadence mp3/aac headers
This files provide the interface for interacting with
Cadence binaries in order to set specific parameters
or decode API errors.

These files were received from Cadence after they kindly agreed
to release them with a permissive license.

Do not edit this by hand! Only update this when Cadence
releases a new version!

Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
2021-04-12 10:22:15 +01:00
Daniel Baluta fa010e31bb audio: codec_adapter: Fix processing loop
Processing loop inside codec_adapter copy() function will take
the input buffer and try to process all the data available.

We need to 'consume' the source bytes and 'produce' the bytes
to local_buffer after each iteration not just at the end.

Failing to do so, will put wrong data for processing function
starting with second iteration.

Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
2021-04-11 12:51:50 +01:00
Daniel Baluta 4e6d457618 audio: codec_adapter: Fix sink bytes copy
With compress audio the number of output bytes is usually greater
then the number of the input bytes.

Because of this, local buffer might have "valid" bytes even if the
current process operation didn't produce anything.

So, in this period we did not produce anything but we can still copy
some bytes from local_buffer to sink buffer.

Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
2021-04-11 12:51:50 +01:00
Marc Herbert 65ade5a4f9 installer: change default destination to /lib/firmware/updates
Kudos to Pierre-Louis for advertising this cool feature

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2021-04-11 12:48:55 +01:00
Liam R Girdwood fa639cf307 doxygen: codecs: exclude 3rd party codec headers from Doxygen
Lets try and keep 3rd party codec headers as-is without any modifications.
This include doxygen as some references may be in closed headers.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2021-04-10 21:53:32 +01:00
Liam Girdwood 9c2c27f4e3 waves: move API headers to correct place.
Move the waves headers to the correct directory.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2021-04-09 09:01:54 -07:00
Iuliana Prodan d660742d41 topology: imx8: add src component with cs42888 codec
This topology works on i.MX8QM and i.MX8QXP with cs42888 codec.
It adds the Sample Rate Converter component for both playback
and capture.

The SRC topology can be used for test bench and real device usage.

Signed-off-by: Iuliana Prodan <iuliana.prodan@nxp.com>
2021-04-09 13:54:34 +01:00
Iuliana Prodan ec2fcf3e34 topology: imx8: add src component with wm8960 codec
This topology works on i.MX8QM and i.MX8QXP with wm8960 codec.
It adds the Sample Rate Converter component for both playback
and capture.

The SRC topology can be used for test bench and real device usage.

Signed-off-by: Iuliana Prodan <iuliana.prodan@nxp.com>
2021-04-09 13:54:34 +01:00
Iuliana Prodan 6a59154bf2 topology: imx8m: add src component with wm8960 codec
This topology works on i.MX8MP with wm8960 codec.
It adds the Sample Rate Converter component for both playback
and capture.

The SRC topology can be used for test bench and real device usage.

Signed-off-by: Iuliana Prodan <iuliana.prodan@nxp.com>
2021-04-09 13:54:34 +01:00
Iuliana Prodan be6ff59ecb src: update coefficients for tiny profile, add 96 kHz support
This patch adds 48 <-> 96 kHz rate conversion for tiny profile.

The tiny coefficients are trimmed down in computational complexity
to just run on some platforms as gcc compiled to allow
debugging and validation of the most complex conversions.

I believe this should also include 48 <-> 96 kHz rate conversion.

The files are generated with Octave, using src_tiny_int16.m and
the instructions from
https://thesofproject.github.io/latest/algos/src/sample_rate_conversion.html

Signed-off-by: Iuliana Prodan <iuliana.prodan@nxp.com>
2021-04-09 13:54:34 +01:00
Iuliana Prodan 3472ae1d6e tools: update SRC tool for 96 kHz mode, for tiny profile
This patch adds 96 kHz into SRC generator script for tiny
profile.

I've added 96 kHz in src_tiny_int16.m and follow the steps
from https://thesofproject.github.io/latest/algos/src/sample_rate_conversion.html
to generate the coefficients.

Signed-off-by: Iuliana Prodan <iuliana.prodan@nxp.com>
2021-04-09 13:54:34 +01:00
Daniel Baluta 615f408df9 drivers: Create imx drivers Kconfig file
This will be the home of IMX drivers config option
definitions.

This moves IMX_DMA config option to imx/Kconfig.

Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
2021-04-09 13:37:30 +01:00
Keyon Jie 2db847b7b2 tools: test: mix_sweep: correct the start index
The i0 is already the start index, so no need the '+1' for i1
calculation, correct it.

Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
2021-04-09 13:27:45 +08:00
Keyon Jie be6777006e Tools: Test: thdnf_test_input: correct the noct calculation
To make sure we are using max 1 octave step, we need to use noct+1 to
get noct sections from logspace.

Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
2021-04-09 13:27:45 +08:00
Oleksandr Strelchenko 72121fb06c topology: Add topology for Waves codec
Add pipe for Waves codec playback
Add pipe for Waves codec demux playback
Modify sof-tgl-max98357a-rt5682 topology so Waves codec can be added
to playback and headphones in case 'WAVES' is defined

Signed-off-by: Oleksandr Strelchenko <oleksandr.strelchenko@waves.com>
2021-04-08 15:39:21 +01:00