Commit Graph

5144 Commits

Author SHA1 Message Date
Seppo Ingalsuo 33e642795f Topology: Add EQ IIR presets bundle coefficients blob data and tool
This patch adds for EQ tests and presets switch development a
bundle with five presets: flat, loudness, bass-boost, band-pass,
and high-pass. The m4 file is used by including to topologies. The
text format file is for sof-ctl.

The added code to script example_iir_eq.m is included. The blob is
also useful for testing multi-part IPC for EQ component. The existing
examples were not large enough to exercise the feature.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2020-05-18 14:42:46 +01:00
Pan Xiuli a2de860f42 cmake: fix tools build with submodules
Tool build will fail without git submodule init and update.
Add the submodlue support also in tool CMake file.

Signed-off-by: Pan Xiuli <xiuli.pan@linux.intel.com>
2020-05-18 14:39:40 +01:00
Pan Xiuli 4ce5ed477a cmake: use SOF_ROOT_SOURCE_DIRECTORY for git submodule
In SOF, there is another project in tools folder. It also need riamge
submodule support.

Signed-off-by: Pan Xiuli <xiuli.pan@linux.intel.com>
2020-05-18 14:39:40 +01:00
randerwang 9f8d4b3724 topology: tgl-max98373-rt5682: add support for 98373 & 5682 in sdw mode
On sdw platforms the pipeline layout is:

 PCM0 <---> volume <----> playback (Headset - ALC5682)
 PCM1 <---> volume <----> capture  (Headset - ALC5682)
 PCM2 ----> smart_amp ----> ALH0x102 (Speaker -max98373)
              ^
              |
 PCM3 <---- demux  <----- ALH0x103 (Speaker -max98373)
 PCM4 <---- volume <---- DMIC01
 PCM5 <---- volume <---- DMIC16k
 PCM6 ----> volume -----> iDisp1
 PCM7 ----> volume -----> iDisp2
 PCM8 ----> volume -----> iDisp3
 PCM9 ----> volume -----> iDisp4

Signed-off-by: randerwang <rander.wang@linux.intel.com>
2020-05-18 13:45:39 +01:00
randerwang 3aa8b5668c topology: sof-smart-amplifier: add smart amplifier support on sdw platforms
This patch is based on smart amplifier support on I2S platform and the
differences are pipeline layout and DAI config. On sdw platforms, the
pipeline layout is:

 PCMX ----> smart_amp ----> ALH0xX02 (Speaker -max98373)
              ^
              |
              |
 PCM(X+1) <---- demux  <----- ALH0xX03 (Speaker -max98373)

Signed-off-by: randerwang <rander.wang@linux.intel.com>
2020-05-18 13:45:39 +01:00
Marc Herbert 3606629f7e scripts/build-tools.sh: let user override NO_PROCESSORS
When there's a failure like for instance SOF issue #2543, fixed in
alsa-utils commit caf77a93cef5 ("topology: add back asrc to widget_map
in dapm.c"), it's finally possible to remove all the noise around the
failure and see the failed command:

   NO_PROCESSORS=1 VEBOSE=1 ./scripts/build-tools.sh

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2020-05-18 13:43:29 +01:00
Marc Herbert 19745de6e3 scripts/testbench: add set -e
Let's stop ignoring build and test failures. Start gradually with the
scripts involved in testbench, more files later.

Follow-up to to bug #2752 "host-testbench.sh ignores errors" and commit
ab421466af ("CI: Travis: enable host testbnech again") and
ab421466aff826~1

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2020-05-18 13:41:01 +01:00
Seppo Ingalsuo 4b8cb6edc7 Tools: Topology: Fix mistake in IIR pipeline macros undefine()
This pipeline macro defined macros for IIR so the clear of
FIR related macros is not correct.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2020-05-18 13:39:54 +01:00
Seppo Ingalsuo e081ba8e01 Tools: Topology: Set FIR EQ control max size to 4096 bytes
The FIR bytes control size is 4096 bytes. This topology contained the
old 304 bytes size that was the limit for single IPC configuration.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2020-05-18 13:39:54 +01:00
Seppo Ingalsuo b1e201cfb8 Tools: Topology: Align all IIR pipelines to 1024 bytes control max size
Some of the pipelines but not all contained for IIR the old 304
bytes (single IPC max size) control size. It can be set to 1024
bytes for all IIR instances.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2020-05-18 13:39:54 +01:00
Seppo Ingalsuo 227f70103b Audio: EQ IIR: Change error trace to information trace
The information about setting EQ to bypass configuration is not an
error. The comp_cl_info() is a suitable trace type to use for it.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2020-05-18 13:39:54 +01:00
Seppo Ingalsuo 0348a51f62 Audio: EQ IIR: Add support for large configuration IPC
This patch adds the missing multiple parts configuration data IPC to
iir_cmd_set_data() and iir_cmd_get_data(). Without this this support
an attempt by kernel driver to send such IPC to a processing component
leaves the EQ to failed state.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2020-05-18 13:39:54 +01:00
Adrian Bonislawski dad6b192f6 cmake: fix smex dependencies
This will allow to build FW with traces disabled

Signed-off-by: Adrian Bonislawski <adrian.bonislawski@linux.intel.com>
2020-05-18 13:25:28 +01:00
Adrian Bonislawski 4bc054faa6 trace: fix platform include
Platform tracepoints are used in IDC power_up check so it needs
to be included even with traces disabled

Signed-off-by: Adrian Bonislawski <adrian.bonislawski@linux.intel.com>
2020-05-18 13:25:28 +01:00
Adrian Bonislawski 8f0e4d858b cmake: testbench compile options fix
This will provide CONFIG_LIBRARY variable for testbench build

Signed-off-by: Adrian Bonislawski <adrian.bonislawski@linux.intel.com>
2020-05-18 13:25:28 +01:00
Adrian Bonislawski 863eb0a072 cmake: merge BUILD_LIBRARY and CONFIG_LIBRARY
There is only one valid CONFIG_LIBRARY which can be
configured via kconfig

Signed-off-by: Adrian Bonislawski <adrian.bonislawski@linux.intel.com>
2020-05-18 13:25:28 +01:00
Karol Trzcinski 97fd4837a2 uuid: Make entries monosized
It make code dealing with entries simpler, and allow to create
UUID entries dictionary with constant access time to any entry.
As long as struct definition is fixed, then can passed as pointer
with correct type to function call, instead of void pointer.
UUID entries aren't storred in flash memory, so entry size is not
important.
Explicit add zero at the end of entity_name to trigger string overflow
warning for shortest incorrect string length.
Resolve problem with cutted UUID info in logger output.

Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
2020-05-18 12:08:24 +01:00
Karol Trzcinski d7b535e282 logger: Add option to set timestamp precision
Shorten timestamp makes logger output more compact, it change:
$ ./sof-logger -l sof-cnl.ldc -i dma_trace_1.bin
         TIMESTAMP              DELTA C# COMPONENT          LOCATION                      CONTENT
[   497588.489583] (   497588.500000) c0 DMA                .../intel/cavs/hda-dma.c:407  hda-dmac: 4 channel 6 -> get
to:
$ sof-logger -l sof-cnl.ldc -i dma_trace_1.bin -f0
   TIMESTAMP        DELTA C# COMPONENT          LOCATION                      CONTENT
[    497588] (    497588) c0 DMA                .../intel/cavs/hda-dma.c:407  hda-dmac: 4 channel 6 -> get

Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
2020-05-18 12:06:51 +01:00
Karol Trzcinski 5469b1a070 logger: Add option to cutout trace location
It allows to make logs output more compact, it change:
$ ./sof-logger -l sof-cnl.ldc -i dma_trace_1.bin
         TIMESTAMP              DELTA C# COMPONENT          LOCATION                      CONTENT
[   497588.489583] (   497588.500000) c0 DMA                .../intel/cavs/hda-dma.c:407  hda-dmac: 4 channel 6 -> get
to:
$ ./sof-logger -l sof-cnl.ldc -i dma_trace_1.bin -L
         TIMESTAMP              DELTA C# COMPONENT          CONTENT
[   497588.489583] (   497588.500000) c0 DMA                hda-dmac: 4 channel 6 -> get

Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
2020-05-18 12:06:51 +01:00
Pan Xiuli 96b6e6ca39 topology: add echo reference with DEMUX for tgl max98357a
Add echo reference pipeline for the tgl speaker max98357a
with demux.

Signed-off-by: Pan Xiuli <xiuli.pan@linux.intel.com>
2020-05-18 11:53:56 +01:00
Seppo Ingalsuo 83cecc9515 Audio: SRC: Fix build fail when only CONFIG_FORMAT_S16LE is set
The SOF supported formats options are configurable via Kconfig. The
build can fail to this error when the data formats are changed from
default:

sof/src/audio/src/src.c: In function 'src_copy_s32':
sof/src/audio/src/src.c:431:2: error: implicit declaration of function 'audio_stream_copy_s32'; did you mean 'audio_stream_copy_s16'? [-Werror=implicit-function-declaration]
  audio_stream_copy_s32(source, 0, sink, 0, frames * source->channels);
  ^~~~~~~~~~~~~~~~~~~~~
  audio_stream_copy_s16

The common same rate copy function for S16/S24/S32 formats also
simplifies the code.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2020-05-13 14:23:05 +01:00
Janusz Jankowski 4fe398e85b xtensa: ADL-S defconfig
Add default config for Alderlake-S platform.

Signed-off-by: Janusz Jankowski <janusz.jankowski@linux.intel.com>
2020-05-13 10:41:46 +01:00
Janusz Jankowski 70b291006f cmake: meu offset argument
Add possibility to specify MEU offset.

Signed-off-by: Janusz Jankowski <janusz.jankowski@linux.intel.com>
2020-05-13 11:39:07 +02:00
Janusz Jankowski 0d0844b051 cmake: add option to build unsigned FW
Add MEU_NO_SIGN cmake flag that can be used to build unsigned FW binary,
that may be later used with MEU for signing.

Signed-off-by: Janusz Jankowski <janusz.jankowski@linux.intel.com>
2020-05-13 11:39:07 +02:00
Pan Xiuli ab421466af CI: Travis: enable host testbnech again
After fix the host-testbench.sh issues, re-enable the testbench
test in Travis.

Signed-off-by: Pan Xiuli <xiuli.pan@linux.intel.com>
2020-05-13 10:38:12 +01:00
Pan Xiuli 1fbdc7f788 scripts: fix testbench with more check
add status check for the host testbench
also fix file size check

Signed-off-by: Pan Xiuli <xiuli.pan@linux.intel.com>
2020-05-13 10:38:12 +01:00
Daniel Leung f6f748b89f cmake: use fw.h and manifest.h from rimage/
Since both fw.h and manifest.h are being used in the main SOF
repo, and also the standalone rimage repo, to prevent them
getting out of sync, use the ones coming from the rimage repo
instead.

Also, git submodule update is being executed when cmake is
run so there is no need to update when building rimage.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2020-05-13 10:16:04 +01:00
Daniel Leung d53778f372 cmake: update git submodules when cmake is run
This adds the necessary bits to update git submodules when
cmake is run, with the option to turn this behavior off if
needed. This is in preparation to use fw.h and manifest.h
from the rimage repo to prevent having two copies of each
file in two different repos. Obviously, the files in
the submodules must exist before building the firmware,
so run git submodule update to checkout the files.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2020-05-13 10:16:04 +01:00
Daniel Leung c00d39c71b Add rimage as a git submodule
This adds rimage as a git submodule by running:
  git submodule add https://github.com/thesofproject/rimage.git rimage
  git submodule set-branch --branch master rimage

This also modifies the build script to build the tool.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2020-05-13 10:16:04 +01:00
Daniel Leung 94956778b0 Remove rimage from source tree
Since rimage is now a standalone tool in a separate repo,
remove the rimage directory in preparation to import it
back as a submodule.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2020-05-13 10:16:04 +01:00
Daniel Leung bf795c5b24 Move signing key pair from rimage/ up one level
This is in preparation to make rimage as a standalone tool
outside of the SOF source tree.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2020-05-13 10:16:04 +01:00
Shreeya Patel 782066e0aa docker_build: Use shallow clones
We don't need history for building qemu or sof. Using shallow clones
will save time spent on downloading unnecessary history which is
significant for bigger repos like qemu.

Signed-off-by: Shreeya Patel <shreeya.patel23498@gmail.com>
2020-05-08 11:39:48 +01:00
Keyon Jie 70c1778512 topology: sof-smart-amplifier: change to use s24_le dai
Looks the usuage of M/N divider with 12.288MHz bclk leading to noise,
change to use s24_le and 9.6MHz bclk, playback works fine on max98373
with it.

Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
2020-05-08 11:28:45 +01:00
Keyon Jie b3d71fbbd3 topology: add blob tlv kcontrols to smart_amp
Add 2 tlv kontrols to smart_amp playback pipeline, the one matched with
struct sof_smart_amp_config is for the component configuration, the
other one is for algorithm blob configuration.

Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
2020-05-08 11:28:45 +01:00
Keyon Jie 26468a7756 topology: sof-tgl-max98373-rt5682: add smart amplifier support
Add initial smart amplifier support to tgl + maxim98373 amplifier.

Todo: to refine the demux channel map to get the correct feedback and
capture them to user space.

Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
2020-05-08 11:28:45 +01:00
Daniel Baluta 5d5d676813 topology: Introduce COMPR_PLAYBACK_ADD
This allows PCM card to support compressed data API. In order
to do this we need to set "compress" property to true. Thus,
the .conf topology file should look like this:

SectionPCM {
	/* ... */
	compress "true"
}

Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
2020-05-08 10:47:39 +01:00
Tomasz Lauda 2c9bb6372e cavs: platform: fix debug region size in FW ready
Fixes debug region size passed in FW ready message.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2020-05-07 17:49:12 +01:00
Seppo Ingalsuo 374a1d6af4 Testbench: Check tplg_read_array() error codes in topology parsing
This patch adds the missing error codes check to avoid the parsing
to continue after a possible file I/O fail.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2020-05-07 17:33:07 +01:00
Seppo Ingalsuo 578d698e5e Testbench: Return -errno values from malloc and fseek functions
This patch replaces the manually set error codes with errno that
is set to exact fail reason like ENOMEM etc. by these functions. The
missing return code checks for fseek() calls are added.

Include of header errno.h is added to topology.c. The order of
include statements is fixed.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2020-05-07 17:33:07 +01:00
Seppo Ingalsuo c614ed38bb Testbench: Parse all buffer widget vendor arrays
In some topologies there is a component tokens array after buffer
tokens array for buffer widget. Since the earlier code version was
able to handle only single array and did not skip the remaining it
caused the remaining topology parsing to go out of sync and fail.

This patch changes the vendor array parsing to be similar as for PCM
widget that already had capability to handle several arrays. The core
id is retrieved if present in topology and passed via IPC.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2020-05-07 17:33:07 +01:00
Seppo Ingalsuo fed3d2f3a9 Testbench: Add definition for token SOF_TKN_COMP_CORE_ID
This patch adds the token into header file tokens.h. It is used for
topology parsing for testbench and fuzzer. The same token has been
already defined in topology m4 macros.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2020-05-07 17:33:07 +01:00
Seppo Ingalsuo 167d0a0667 Tools: Test: Improve processing components objective quality tests
The main change in this patch is to allow process_test to use
frequency dependent masks for frequency response and THD+N. It
allows tests with pass/fail criteria for components like EQs
and DCblock. SRC test not really changed but the small changes
in passing test controls are updated there as well.

In EQs tests the process test can decode the theoretical response
from setup blob. The measured frequency response is compared to
that.

The test print and plot output look is improved for nicer reports.
The runtime plots opening is disabled for batch mode operation
but the plots now appear to test output directory in png format.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2020-05-07 17:30:40 +01:00
Seppo Ingalsuo 31a6a27ece Tools: Test: Relax signal level pass criteria in quick chirp test
The criteria of overall -3 dB RMS attenuation was too tight
for sample EQ responses to pass. With new -6 dB criteria the
used EQ loudness responses do not trigger error.

The chirp test is only a quick generic component health check so this
is not critical. The other AES17 tests will catch minor characteristic
changes.

The other changes are cosmetic and improve result print and plot
output look.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2020-05-07 17:30:40 +01:00
Seppo Ingalsuo 6f8a15bcfd Tools: Test: Fix mistake with multi-channel gain result print
This fixes a messy looking print line in the test output.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2020-05-07 17:30:40 +01:00
Seppo Ingalsuo 509a906426 Tools: Test: Improve Matlab compatibility
The function getpid() is only available in Octave. Instead use
a random integer number as identification to avoid conflict with
possible several simultaneous simulations with temporary files.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2020-05-07 17:30:40 +01:00
Seppo Ingalsuo 3e7edf4e02 Tools: Tune: Fix mistake in EQ blob plot function
The case where blob decoding is requested for single frequency,
e.g. 1 kHz the magnitude and group delay vectors did not have
size of one frequency. This patch fixes the issue.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2020-05-07 17:30:40 +01:00
Seppo Ingalsuo 0f878a7312 Tools: Test: Change IIR and FIR response in playback test topologies
This patch changes the response for both EQ types into loudness
shape (bass boost, mid attenuate, high boost) that is a useful
in validating EQs functionality. The previous flat response does
not exercise thoroughly the processing functions.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2020-05-07 17:30:40 +01:00
Seppo Ingalsuo aded79d417 Audio: Set default SRC coefficients to 16 bits for APL platform
This patch adds for SRC component rate conversion filters coefficients
set selection to Kconfig. The menu entry allows to select a 16 bit or
32 bit set.

The default for Apollolake is changed to 16 bits to free up .bss for
other development. There's no known critical usage for SRC so the
lower quality and less conversions available should be acceptable.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2020-05-07 17:13:18 +01:00
Daniel Baluta ba883515b7 lib: imx8m: Switch to SDMA3
Both SDMA2/SDMA3 can move data from SDRAM to Peripherals. Anyhow, SDMA2
is traditionally used by non-DSP use case, so switch to SDMA3 to allow
for future use cases where we could have a scenario with multiple Audio
perhipherals running in parallel.

This also aligns the code with legacy firmware.

Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
2020-05-07 13:36:49 +01:00
Marcin Maka 6ce635aa82 trace: replace TRACE_CLASS_ by uuids
All trace entries are identified by uuids only now.
Previous TRACE_CLASS_ identification removed completely.

UUIDs are passed to the tracing subsystem inside a trace
context. Each trace context defines run-time log level.
The level is initialized to LOG_LEVEL_INFO (this may be
change per instance is needed) and may be re-configured
at run-time.

Signed-off-by: Marcin Maka <marcin.maka@linux.intel.com>
2020-04-30 11:39:37 +02:00