Commit Graph

646 Commits

Author SHA1 Message Date
Karol Trzcinski 6cfd3e5a5e logger: Increment uuid name during ldc dump
Name and UUID value of component should be aligned with their address.

Output before change:
           ADDRESS                                    UUID NAME
        0x1FFFA000  <8b9d100c-6d78-418f-90a3-e0e805d0852b> host
        0x1FFFA01C  <8b9d100c-6d78-418f-90a3-e0e805d0852b> host
        0x1FFFA03C  <8b9d100c-6d78-418f-90a3-e0e805d0852b> host
and after:
           ADDRESS                                    UUID NAME
        0x1FFFA000  <8b9d100c-6d78-418f-90a3-e0e805d0852b> host
        0x1FFFA01C  <f11818eb-e92e-4082-82a3-dc54c604ebb3> pipe-task
        0x1FFFA03C  <34dc0385-fc2f-4f7f-82d2-6cee444533e0> volume-task
        0x1FFFA05C  <b77e677e-5ff4-4188-af14-fba8bdbf8682> volume

Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
2020-05-26 18:33:53 +03:00
Seppo Ingalsuo 66a78a2d8c Topology: HDA-generic: Use +20 dB EQ gain for 16 kHz DMIC capture
This patch replaces the default 0 dB gain with +20 dB gain in 16 kHz
DMIC pipelines in hda-generic based topologies. It is done to have
same capture sensitivity in both 16 kHz and 48 kHz capture pipelines.

The impacted topologies are:

sof-hda-generic-2ch.tplg
sof-hda-generic-4ch.tplg
sof-hda-generic-eq-2ch.tplg
sof-hda-generic-eq-4ch.tplg
sof-hda-generic-idisp-2ch.tplg
sof-hda-generic-idisp-4ch.tplg

Note: The 0 dB high-pass version is preferred after all the needed
development is available.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2020-05-21 10:01:37 +01:00
Seppo Ingalsuo efbfa2c4dd Tools: Tune: Add generation for SRC profile small int32
This patch adds script src_small_int32.m to generate the intermediate
size SRC coefficients set. The export functions are updated for
short BSD copyright and to output licence text and needed header
files inclusions.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2020-05-21 09:37:36 +01:00
Marc Herbert 11ee3b872b tplg-build.sh: invoke m4 with --fatal-warnings
Also use || exit 255 to stop xargs from burying the error message(s).

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2020-05-20 22:16:52 +01:00
Marc Herbert cff1bb62b0 tplg-build.sh: add NO_PROCESSORS, use VERBOSE more.
Zero functional change and 100% identical outputs.

Also add some comments.

Interestingly, -P$(nproc) is a tiny bit faster than -P0 on my
system. Thrashing?

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2020-05-20 22:16:52 +01:00
Marc Herbert d4e508cf86 topology: invoke with m4 --fatal-warnings
As seen in PR #2954, no one ever notices m4 warnings. As PR #2954 will
remove sof-tgl-rt711-i2s-rt1308-nohdmi.conf and the only m4 warning
currently, this is a great opportunity to upgrade m4 warnings to
errors.

Note neither Travis nor github have the concept of a "warning", they can
only report success or failure.

This fix can be considered part of the "green failures" family.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2020-05-20 22:16:27 +01:00
Pierre-Louis Bossart 96623e6038 topology: remove sof-tgl-rt711-i2s-rt1308-nohdmi.conf
No one seems to be using this topology or they would have seen the
error below that DMICs are required on this platform.

[  8%] Generating sof-tgl-rt711-i2s-rt1308-nohdmi.conf

m4:tools/topology/sof/pipe-volume-capture-16khz.m4:54: bad expression
in eval (bad input): 2 * 2 * CHANNELS * 16
m4:tools/topology/sof/pipe-volume-capture-16khz.m4:57: bad expression
in eval (bad input): 2 * 2 * CHANNELS * 16

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
2020-05-20 14:08:19 +01:00
Seppo Ingalsuo 68da4d7024 Topology: HDA-generic: Use +20 dB EQ gain for DMIC capture pipelines
This patch replaces the default EQ 0 dB gain with +20 dB gain in
DMIC pipelines in hda-generic based topologies. It fixes the issues with
too silent capture level.

The gain was changed to 0 dB in a recent change to let UCM set it.
However this change remains needed for a while since the UCM initial gain
patch and remaining development of ALSA/ASoC 4ch capture for devices with
more than two microphones will take longer time to become available.

The impacted topologies are:

sof-hda-generic-2ch.tplg
sof-hda-generic-4ch.tplg
sof-hda-generic-eq-2ch.tplg
sof-hda-generic-eq-4ch.tplg
sof-hda-generic-idisp-2ch.tplg
sof-hda-generic-idisp-4ch.tplg

Note: The 0 dB high-pass version is preferred after all the needed
development is available.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2020-05-20 14:05:14 +01:00
Pierre-Louis Bossart e1876f35b4 topology: add support for rt5682 on link2 in SoundWire mode
The UpExtreme provides access to link2 in 2 of the 3 modes. This is
useful to test rt5682 configurations.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
2020-05-19 09:08:24 +01:00
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
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 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
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
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 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
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
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 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
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
Pan Xiuli de2dcbbc26 topology: fix a typo for SCHEDULE_CORE
With define for W_PCM_CAPTURE only need 5 arguments
W_PCM_CAPTURE(pcm, stream, periods_sink, periods_source, core)
Fix the wrong parameter in pipe-kfbm-capture.m4

Signed-off-by: Pan Xiuli <xiuli.pan@linux.intel.com>
2020-04-27 15:24:47 +02:00
Karol Trzcinski 4b8593322e tools: ext_manifest: Read manifest from sof_ri_info script
This tool must be able to read extended manifest content
and move to next manifest in proper way.

Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
2020-04-21 20:36:14 +01:00
Karol Trzcinski 24ecd41e29 tools: Reformat extended manifest parsing
After reformat it will be easier to add new data of supported
extended manifest.

Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
2020-04-21 20:36:14 +01:00
Pan Xiuli 7d9ea989d7 topology: fix conflict PIPE_VOLUME_PLAYBACK defination
in bxt.m4 and sof-hda-generic.m4, they both define the
PIPE_VOLUME_PLAYBACK, this will cause wrong tplg result.

Refine the them in sof-hda-generic.m4 to PIPE_HEADSET_PLAYBACK
to fix the issue.

Signed-off-by: Pan Xiuli <xiuli.pan@linux.intel.com>
2020-04-21 10:58:42 +01:00
Keyon Jie 504ec438a9 topology: add sample platform .m4 file for smart amplifier usage
Add an example platform usage for smart amplifier feature, where it will
use nocodec SSP LBM(Looback Mode) for data verification.

Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
2020-04-19 20:21:54 +01:00
Keyon Jie 341286796e topology: add smart amplifier unified implementation
This is the unified implementation for smart amplifier feature,
including both playback and capture pipelines.

The upper layer platform topology should include this unified
implementation and define specific macros to use it.

Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
2020-04-19 20:21:54 +01:00
Keyon Jie 864e7e8221 topology: add smart amplifier playback pipeline
Add the playback pipeline for smart amplifier use case, it will be used
with the reference capture pipeline together in the upper layer .m4
file.

Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
2020-04-19 20:21:54 +01:00
Keyon Jie 02fb00d628 topology: add amplifier reference capture pipeline
This is for smart amplifier use case only, to get the amplifier
reference samples captured to the host user space.

Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
2020-04-19 20:21:54 +01:00
Keyon Jie 3564b7dcdb topology: m4: add smart_amp component for smart amplifier usage
Add the initial version of smart_amp component for smart amplifier
widget, which will be use in the smart amplifier use case.

Todo: add blob kcontrol for it.

Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
2020-04-19 20:21:54 +01:00
Keyon Jie 6569b345f5 Topology: utils: add Decimal to Hexadecimal converting macro
Add macro DEC2HEX marcro to convert 2-digit decimal number to
hexadecimal one that prefixed with '0x'.

Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
2020-04-19 20:21:54 +01:00
Keyon Jie 79f97a6a0c Topology: utils: add macros to get format values
Add macros to get format values from strings.

Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
2020-04-19 20:21:54 +01:00