Commit Graph

1001 Commits

Author SHA1 Message Date
Sathyanarayana Nujella 4893e7018f topology: Update number of feeback reference channel on max98373
This patch modifies the number of reference feedback channels from the
Demux component to the host capture stream in sof-tgl-max98373-rt5682.

Signed-off-by: Dharageswari R <dharageswari.r@intel.com>
2020-09-16 14:59:14 +01:00
Dharageswari R 399b97afe6 topology: Modify init params for the Demux Config
This patch creates macros for the channel map of Feedback
and reference streams. Also, modifies the feedback channels and channel map
of the Demux configuration to send voltage and current data to the
smart amplifier component and only voltage data to the host as Feedback
stream.

Signed-off-by: Dharageswari R <dharageswari.r@intel.com>
2020-09-16 14:59:14 +01:00
Sathyanarayana Nujella 7f74440c51 topology: Update tplg file name for tgl system with max98373-rt5682
Changed the tplg file name in kernel driver according to Maintainers
feedback. So, topology file name here needs the corresponding change.

Signed-off-by: Sathyanarayana Nujella <sathyanarayana.nujella@intel.com>
2020-09-16 10:12:11 +01:00
Karol Trzcinski 7722365264 logger: Fix memory leak at first filter append
For first run, allocated memory pointer has been written twice to
config->filter_config but freed only once - memory leak.

Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
2020-09-15 11:17:21 +01:00
Marc Herbert 1240a8bea3 logger: stop ignoring return value of ‘freopen’
Reported by VERBOSE=1 CMAKE_BUILD_TYPE=Release ./scripts/build-tools.sh -l
and gcc version 9.3.0-10ubuntu2:

 tools/logger/convert.c:630:5: error: ignoring return value of ‘freopen’,
   declared with attribute warn_unused_result [-Werror=unused-result]

Tested with sof-test/test-case/check-suspend-resume-with-audio.sh

Fixes commit 6a84b4e945 ("sof: logger: reopen trace file upon EOF")

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2020-09-15 10:03:04 +01:00
Marc Herbert 53bda51b99 logger: fix uninitialized FILE *out_fd in filter_update_firmware()
Reported by VERBOSE=1 CMAKE_BUILD_TYPE=Release ./scripts/build-tools.sh -l
and gcc version 9.3.0-10ubuntu2.

out_fd is not initialized on the first "goto err:" and this can result in
trying to close a random file descriptor.

Fixes commit 126060ae63 ("logger: Send parsed runtime log levels to FW
via debugFS")

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2020-09-15 10:03:04 +01:00
Marc Herbert 7d2cb097c2 logger: fix potential time_fmt truncation in print_entry_params()
As reported by gcc 9.3.0-10ubuntu2 and
 VERBOSE=1 CMAKE_BUILD_TYPE=Release ./scripts/build-tools.sh -l

  ‘__builtin___snprintf_chk’ output between 23 and 57 bytes
   into a time_fmt destination of size 32

Fixes commit d7b535e282 ("logger: Add option to set timestamp
precision")

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2020-09-15 10:03:04 +01:00
Guennadi Liakhovetski 047f08f20e uuid: use a pointer instead of casting it to an integer
UUID objects are represented by struct sof_uuid_entry instances in SOF.
Instead of casting pointers to them to integers for passing around,
carry them as pointers until they have to be cast to integers for
packing into data structures. This also fixes printing UUID, using a
"%pU" format.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2020-09-15 09:33:29 +01:00
Dharageswari R cd3689498b topology: Update number of smart_amp_feedback channel on max98373
This patch modifies the number of feedback channels from the
smart amplifier on max98373 codec in sof-tgl-max98373-rt5682.

Signed-off-by: Dharageswari R <dharageswari.r@intel.com>
2020-09-14 11:46:14 +01:00
Dharageswari R 6e3b9ea6e4 topology: Modify init params for the Smart_amp Config
This patch modifies the feedback channels and channel map
of the smart_amp configuration based on the number of feedback
channels from the codec.

Signed-off-by: Dharageswari R <dharageswari.r@intel.com>
2020-09-14 11:46:14 +01:00
Marc Herbert 337afc4f38 logger: add error message when reading sof/etrace instead of sof/trace
Failing silently is not nice. Now prints instead:

  TIMESTAMP   DELTA C# COMPONENT   LOCATION   CONTENT
  error: in logger_read(), fread(..., /sys/kernel/debug/sof/etrace) \
    failed: Invalid argument(22)

Also make logger_read() and the process return [-]errno which can have
different values and some information instead of -ferror() which has
only one value (non-zero in theory, 1 in practice) hence no information.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2020-09-14 10:43:54 +01:00
Marc Herbert 742cbb8af6 logger: use __attribute__((format(printf, 1, 2))) in misc.h
Also works with clang.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2020-09-14 10:43:54 +01:00
Marc Herbert f7f9d5f42e tools: support standard CMAKE_BUILD_TYPE and default to Debug
To produce the exact same binaries than before this commit:

  CMAKE_BUILD_TYPE='  ' ./scripts/build-tools.sh

To observe which CFLAGS are being used:

   CMAKE_BUILD_TYPE=Release VERBOSE=1 ./scripts/build-tools.sh

Off topic: the logger fails to build with: -O3 -DNDEBUG -Wall -Werror
(all other tools build fine with these flags)

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2020-09-14 10:41:14 +01:00
Seppo Ingalsuo 46e49cc3b4 Tools: Testbench: Fix mistake in topology component load by UUID
The if test needs to be done for comp_type. The index does not refer
to comp types but items in lib_table that is not correct. As result
testbench loads crossover for all UUID based components. The load of
beamformer works correctly with this change.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2020-09-13 15:52:24 +01:00
Seppo Ingalsuo 1ad7503299 Tools: Testbench: Add TDFB component UUID information
This patch adds the needed information to testbench to load the
TDFB component.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2020-09-13 15:52:24 +01:00
Seppo Ingalsuo ba3539b5f8 Tools: Test: Add TDFB tests scripts for testbench runs
The script adds tdfb_test.m to check the TDFB beam pattern
versus theoretical. It also measures the noise suppression
capability of the test beamformer in simulated diffuse and
random noise field.

As simple quick test this patch adds TDFB to cell array of
accepted components for process test.

Note: There tests can't be used until load of UUID based non-legacy
components is added to testbench. The scripts were used with earlier
legacy mode version of the component.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2020-09-13 15:52:24 +01:00
Seppo Ingalsuo 72b91631b5 Tools: Test: Create TDFB component test topologies
The patch adds the playback and capture test pipelines. The
configuration is set to `tdfb_coef_line2_50mm_pm90deg_16khz.m4'.

A mistake in PIPELINE_FILTERx macro defining is fixed for IIR and
FIR. The pipeline macros expect it to contain an include file or
no macro defined at all. Defining it for empty string caused fail
in topologies build when PIPELINE_FILTER1 is used for TDFB.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2020-09-13 15:52:24 +01:00
Seppo Ingalsuo 10c6f46f2f Topology: Add pipelines and topologies build for TDFB component
This patch adds the playback (for test only) and capture pipelines
with Time Domain Fixed Beamformer (TDFB) component.

Topologies variants to test capture with beamformer are built for
sof-hda-generic and sof-apl-pcm512x platforms. The beam direction
is +/- 10 degrees as compromise between notebook camera and stereo
capture. The dual beams preserve the stereo characteristic. The
beamformers are added to both 48 kHz and 16 kHz DMIC capture
pipelines.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2020-09-13 15:52:24 +01:00
Seppo Ingalsuo d802fd7471 Topology: Add TDFB setup m4 data blobs for mic arrays
These are data files created by the example scripts in
tools/tune/tdfb. The generation is time consuming and requires
Octave or Matlab.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2020-09-13 15:52:24 +01:00
Seppo Ingalsuo 242cc0ebcb Topology: Add support for DMICPROC macro to intel-generic-dmic.m4
This patch adds support to define from CMakeLists.txt or a
higher level platform topology file the definition of DMICPROC and
DMIC16KPROC to select desired capture processing algorithms pipeline
from pipe-x-capture.m4 and pipe-x-capture-16khz.m4 macros instead
of hard coded processing eq-iir-volume. It is preparation to add
support for beamformer processing for microphones.

The impacted platforms are sof-hda-generic, sof-cml-rt5682, and
sof-apl-pcm512x. This patch does not change built topologies.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2020-09-13 15:52:24 +01:00
Seppo Ingalsuo d9de74b231 Tools: Tune: Add TDFB configuration tool
This patch adds the tool for creating beamformer configurations. The
microphone array geometry and beam angle (azimuth, elevation) need
to be specified. See the example scripts and sample array helper
functions.

The FIR blob quantize function needed a minor change to prevent strip
of trailing zero coefficients. The beamformer filter bank needs to use
equal length filters.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2020-09-13 15:52:24 +01:00
Dharageswari R 808dfac9ae topology: Add UUID for Maxim DSM component
This patch adds UUID for Maxim DSM component in sof-tgl-max98373-rt5682.

Signed-off-by: Dharageswari R <dharageswari.r@intel.com>
2020-09-09 12:08:44 +01:00
Dharageswari R 7bf3f8e99b topology: smart_amp: Pass uuid token to the smart_amp widget
This patch adds the uuid argument to smart_amp widget, uuid
parameter can be configured by the topology files while
integrating any new component. If not configured, uuid will
be assigned with the UUID of the smart_amp_test component as
default value.

Signed-off-by: Dharageswari R <dharageswari.r@intel.com>
2020-09-09 12:08:44 +01:00
Artur Kloniecki 79be1ce827 logger: Extract reading entry from ldc file to separate function.
In case we ever needed to load the entry from ldc file, without params
processing and printing.

Signed-off-by: Artur Kloniecki <arturx.kloniecki@linux.intel.com>
2020-09-08 12:40:08 +02:00
Jaska Uimonen de514ca0ff tools: testbench: add crossover loading with uuid parsing
Add crossover library loading with new uuid method.

Signed-off-by: Jaska Uimonen <jaska.uimonen@intel.com>
2020-09-07 12:04:28 +01:00
Jaska Uimonen a40bb45be8 tools: testbench: add uuid based library loading
Add methods to load process libraries based on uuid. Testbench will
first search the old process enums and if match isn't found the same
search is done with uuid. Hence old process components should get loaded
with enums and new uuid based components should get loaded with uuids if
the uuid definition is declared and added to the library table.

Signed-off-by: Jaska Uimonen <jaska.uimonen@intel.com>
2020-09-07 12:04:28 +01:00
Jaska Uimonen a44946b8ba tools: tplg_parser: add uuid token parsing
Add parsing methods for UUID tokens.

Signed-off-by: Jaska Uimonen <jaska.uimonen@intel.com>
2020-09-07 12:04:28 +01:00
Karol Trzcinski 7650398d01 logger: Add option to disable firmware compatibility check
It may be needed for situation when user have firmware after
small fixes without updated ldc file or fw_ready file is not
accessible. Option dedicated for advanced users.

Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
2020-09-02 14:32:03 +01:00
Karol Trzcinski 7da08bed48 logger: Enable LDC and FW compatibility check by default
By default user should use compatible files.

Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
2020-09-02 14:32:03 +01:00
Pin-chih Lin bb6565d317 tools: testbench: add Crossover component tests
Crossover component is added as multi-output playback tests for testbench.

Signed-off-by: Pin-chih Lin <johnylin@google.com>
2020-09-02 14:31:25 +01:00
Pin-chih Lin 92761cf7bc tools: tplg_parser: Add Crossover component
Add Crossover component for tplg_parser.

Signed-off-by: Pin-chih Lin <johnylin@google.com>
2020-09-02 14:31:25 +01:00
Sebastiano Carlucci 408d735068 tools: tune: Add tools to generate ctrl bytes for Crossover
This commit adds the tools to generate the control bytes for the
crossover component. To generate the control bytes, run the
example_crossover.m script.

The parameters of the crossover components are:
- number of outputs
- sink assignments (routing crossover output to different pipelines)
- frequency cutoffs

To tweak the parameters modify the values in example_crossover.m and run
it.

Refer to sof/src/include/user/crossover.h for more information on how
the crossover config is structured and how sink assignments are done.

Signed-off-by: Sebastiano Carlucci <scarlucci@google.com>
2020-09-02 14:31:25 +01:00
Sebastiano Carlucci 3bea8a7b3e tools: topology: Add crossover topology files
This commit adds the topology files for the crossover component.
The control bytes are generated by the tools in tune/crossover.

Signed-off-by: Sebastiano Carlucci <scarlucci@google.com>
2020-09-02 14:31:25 +01:00
Guennadi Liakhovetski 03f4a1704e logger: support kernel-style UUID formats
Implement "%pUb", "%pUB", "%pUl", and "%pUL" UUID formats.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2020-09-02 14:13:15 +01:00
Pan Xiuli 41e7d65e3a topology: add jsl nocodec topology
Add sof-jsl-nocodec topology from sof-icl-nocodec.

Signed-off-by: Pan Xiuli <xiuli.pan@linux.intel.com>
2020-09-01 10:14:20 +01:00
Artur Kloniecki 5b29dae9c8 logger: Create global convert_config variable to avoid spaghetti code.
Most functions in logger depend on values stored in conver_config struct
which are passed to almost all function calls. This patch moves pointer
to the config to global context and allows each function to derive
necessary values from there. This reduces needless parameters passed
to function calls and allows for more flexible access to data in nested
functions.

Signed-off-by: Artur Kloniecki <arturx.kloniecki@linux.intel.com>
2020-09-01 10:11:55 +01:00
Pan Xiuli a0fc1de515 topology: add development folder for test and validation
Add development folder for topologies that not for production.
First add sof-tgl-nocodec-ci as a validation topology.

Signed-off-by: Pan Xiuli <xiuli.pan@linux.intel.com>
2020-09-01 15:02:17 +08:00
Pan Xiuli 41ca1d8827 topology: add keyword detect pipeline into sof-tgl-nocodec-ci
Add KPB pipeline into the sof-tgl-nocodec-ci topology.
This topology will be a reference test topology for all features used
on TGL.

Signed-off-by: Pan Xiuli <xiuli.pan@linux.intel.com>
2020-09-01 15:02:17 +08:00
Pan Xiuli fe6e88c871 topology: intel: make dmic dai name configurable
Add default dai name for dmic dai, we can override them in
if dai name in machine driver is different.

Signed-off-by: Pan Xiuli <xiuli.pan@linux.intel.com>
2020-09-01 15:02:17 +08:00
Pan Xiuli 54a0cc8e5a topology: add test topology sof-tgl-nocodec-ci
Add FW echo reference to nocodec TPLG on SSP0.
Add internal loopback on SSP0. We can compare echo reference and
loopback capture stream.
Add smart amplifier for nocodec on SSP2

Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
Signed-off-by: Pan Xiuli <xiuli.pan@linux.intel.com>
2020-09-01 15:02:17 +08:00
Pan Xiuli 73cf4c0bc7 topology: sof: use pipeline ID in demux control name
To make multiple DEMUX comp can work in same topology. Add pipeline
ID into the DEMUX control name.

Signed-off-by: Pan Xiuli <xiuli.pan@linux.intel.com>
2020-09-01 15:02:17 +08:00
Seppo Ingalsuo f430addec7 Tools: Fuzzer: Do not use illegal BUILD_COMMAND in CMakeLists.txt
This patch removes the incorrect usage of BUILD_COMMAND. Having it set
to "cmake" caused the cmake usage help text output to be shown only and
caused the ExternalProject_Add command to believe the
libsof_tplg_parser.so was built. The build for the library happened only
because the next install step performed the compilation. With this fix
the default build command is used instead. There's no need to define
it here.

Fixes #2656

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2020-08-31 11:30:26 +01:00
Marcin Rajwa 31949d0669 detector, kpb: change buffering and draining constants
This fix compensates host wakeup time.
Here we limit max draining request to 2 seconds.
History buffer size if one second bigger than max draining
request allowed.

Signed-off-by: Marcin Rajwa <marcin.rajwa@linux.intel.com>
2020-08-28 13:48:07 +01:00
Marcin Rajwa fec09e0b87 topology: schedule two KWD pipelines on 5 ms period
This patch changes the KWD pipelines perriod from 20 ms
to 5 ms to improve performance.

Signed-off-by: Marcin Rajwa <marcin.rajwa@linux.intel.com>
2020-08-28 13:48:07 +01:00
Karol Trzcinski 31a3aacc1a logger: Terminate parsed log levels with new line
Text saved to FILTER_KERNEL_PATH should be terminated with
new line, to indicate end of input and mark it redy to send
to FW in IPC message.

Fixes: 126060ae (logger: Send parsed runtime log levels to FW via debugFS)

Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
2020-08-27 14:25:14 +01:00
Karol Trzcinski 60141f2074 logger: Fix log level parsing
Usage of strstr for short version of logs level definitions
(for example 'e') leads to invalid level parsing, because first
log level with defined string (or letter) will be returned
(in this example 'verbose').
After change, log level will be returned only when name is
exactly as given one.

Fixes: b1fc9220 (logger: Parse runtime filter levels)

Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
2020-08-27 14:25:14 +01:00
Seppo Ingalsuo 40fd801c29 Tools: Testbench: Add system agent initialization
This patch fixes a segfault with null sof->sa pointer in
pipeline_schedule_copy() function. The bug has not been observed
with test topologies for processing pipelines but with other
topologies with fuzzer varied parameters.

The sa_init() is added to tb_pipeline_setup(). The scheduler_init_edf()
is a dependency. The two dummy functions platform_timer_get() and
clock_ms_to_ticks() are also added as dependency. The CMakelist for
library is edited to include agent.c build for testbench.

Fixes #3247

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2020-08-27 11:59:04 +01:00
Guennadi Liakhovetski d697516c32 topology: apl: use the generic DMIC topology template
Use a generic DMIC topology template instead of defining a private
one.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2020-08-27 11:48:00 +01:00
Guennadi Liakhovetski 2db42dda5c topology: dmic: support non-standard DAI link IDs
Some platforms, e.g. UP2 (APL+PCM512x) use non-standard DAI link
IDs. Let those platforms specify their IDs and still use the
generic DMIC topology template.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2020-08-27 11:48:00 +01:00
Dharageswari R 49d432dded sof-ctl: Add support for read-only, write-only and read-write kcontrol
This patch checks for the access type of kcontrol and returns error
only when the access type is not read or write.

Signed-off-by: Dharageswari R <dharageswari.r@intel.com>
2020-08-27 11:19:28 +01:00
Dharageswari R d77655059e topology: Add Smart-amp get parameter byte kcontrol
This patch adds the smart amplifier get parameter byte kcontrol
to read the actual algorithm parameters from DSP during runtime.

Signed-off-by: Dharageswari R <dharageswari.r@intel.com>
2020-08-27 11:19:28 +01:00
Dharageswari R 333036f097 topology: Add support for RO_volatile, WO and RW_volatile byte kcontrol
This patch adds the support for read-only volatile byte kcontrol with
access type as read and volatile to read the actual values from DSP,
write-only byte kcontrol with access type as just write and read-write
volatile byte control with access type as read, write and volatile.

Signed-off-by: Dharageswari R <dharageswari.r@intel.com>
2020-08-27 11:19:28 +01:00
Ryan Lee 420ef1b6d2 Topology: modified initial config for the smart amp
Modified initial configuration param for the smart amp.
Total number of feedback channels was changed from 8 to 4.
Assigned 4ch feedback to 0 ~ 3 slots.

Signed-off-by: Ryan Lee <ryans.lee@maximintegrated.com>
2020-08-26 22:02:34 +01:00
Pierre-Louis Bossart 3286bfa7bf topology: sof-cht-max98090: temporarily remove S24/S32_LE support
The mixer doesn't seem to work with these two formats, limit support
to S16_LE until the mixed is fixed.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
2020-08-26 21:45:17 +01:00
Keyon Jie ea4ba64bd0 topology: pipe: fix and export supported formats correctly
Switch to use CAPABILITY_FORMAT_NAME(PIPELINE_FORMAT) for all pipelines,
no matter there is PGA in it or not, the dai format is not important
here, as the pcm_converter will help.

This will help fix issue where we are claiming the wrong supported
formats in the PCM capability, e.g. our host buffer is allocated as
S16_LE so we can support S16_LE only, but with today's code it is
`S32_LE,S24_LE,S16_LE' in the pcm capability, so end user can run with
S24_LE or S32_LE and eventually end up to FW internal errors.

BugLink: https://github.com/thesofproject/sof/issues/3318
Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
2020-08-26 17:57:45 +01:00
Keyon Jie e4fa878606 topology: utils: add helper to generate PCM capability
Add a helper to generate supported formats of the PCM capability, it is
up to the pipeline format:

for s16_le pipeline, only S16_LE is supported.
for s24_le pipeline, both S16_LE and S24_LE are supported.
for s32_le pipeline, all S16_LE, S24_LE and S32_LE are supported.

For each pipeline, we should use CAPABILITY_FORMAT_NAME(PIPELINE_FORMAT)
in the PCM_CAPABILITIES definition.

Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
2020-08-26 17:57:45 +01:00
Mohana Datta Yelugoti c0b969d784 tools: testbench: initialize local variable before accessing it
If user fails to provide a topology file, the tplg_file member
of structure tp is left uninitialized. This member is used to
check again if the file was provided, which won't be possible
unless this has been initialized to NULL and checked for NULL
after parsing arguments.

Signed-off-by: Mohana Datta Yelugoti <ymdatta.work@gmail.com>
2020-08-25 13:13:30 +01:00
Karol Trzcinski 126060ae63 logger: Send parsed runtime log levels to FW via debugFS
"/sys/kernel/debug/sof/filter" file is responsible for updating
trace log levels. IPC message contain list of new trace threshold,
it is represented as single line in file where entries are separated
with ";". Single entry has form of:
"<uuid_id> <pipe_id> <comp_id> <log_level>"

Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
2020-08-25 13:09:38 +01:00
Karol Trzcinski b1fc922079 logger: Parse runtime filter levels
Parse arguments given in -F flag, in form where each -F argument
is given as separate line. Format of single -F entry is
`<log_level>=<component_list>`. <log_level> must corresponds with
.name field from log_level_dict. List of component are build from
elements separated with `,` and single element may have one of the
following forms:
"<name> <pipe_id>.<comp_id>" - single component instance
"<name> <pipe_id>.*" - components with given name on piepeline with pipe_id
"<name>*" - each component instance with given name or global component
"<name>" - as above
"* <pipe_id>.<comp_id>" - component on selected pipe_id with given comp_id
"* <pipe_id>.*" - each component on pipeline with pipe_id
"*" - each component in firmware
<name> must correspond values of uuid entries from ldc file.

Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
2020-08-25 13:09:38 +01:00
Karol Trzcinski 97a8c685f8 logger: Implement whitespace trimming functions
They will be needed during trace filering command parsing,
to skip whitespaces. As generic functions, their are placed
in misc file instead of any feature-related file.

Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
2020-08-25 13:09:38 +01:00
Karol Trzcinski bd0e10d133 logger: Store filter config given in command line
To parse filter configuration given by user, uuid dictionary
must be readed first from ldc file. Otherwise it's impossible
to validate given components names. This is reason why filter
configuration must be buffered and parsed in later steps.

Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
2020-08-25 13:09:38 +01:00
Karol Trzcinski 4db4d0d86f logger: Exclude misc functions from convert file
A few, general usage functions where implemented in converter file.
They should be moved to separate file, to make it easily accessible
form any source file. Moreover removing it from converter file, is a
part of this file cleanup.

Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
2020-08-25 13:09:38 +01:00
Karol Trzcinski 7e7829d26f logger: Extract function for conversion between UUID value and UUID key
This conversion should be done in function, because of future usage
in different places, outside converter.c file.

Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
2020-08-25 13:09:38 +01:00
Mohana Datta Yelugoti 2e07bb9d89 tools: testbench: send valid pointer to free system call
free() system call frees the memory space pointed to by
ptr, which must have been returned by previous call to
malloc(), calloc() or realloc().

Now, when incrementing the array pointer, we may have
exceeded the actual allocated size. If we do pointer arithmetic
and subtract size from the array pointer, we may not point to
the actual location returned by malloc().

This patch makes sure that when we do pointer arithmetic on array,
the array's value at the end would be same as the one returned
by malloc.

Signed-off-by: Mohana Datta Yelugoti <ymdatta.work@gmail.com>
2020-08-21 10:50:23 +01:00
Mohana Datta Yelugoti 96a474897a tools: testbench: check for array size mismatch for components
This patch uses the functionality added by the c9e090ccf3 commit
to check for array size mismatch in various components.

Not doing so may result in cases, where we try to write into the
space not allocated leading to segmentation fault.

Signed-off-by: Mohana Datta Yelugoti <ymdatta.work@gmail.com>
2020-08-18 10:36:41 +01:00
Mohana Datta Yelugoti 782d4ce3fd testbench: check array size mismatch while loading topology buffer
This patch uses the functionality added by the c9e090c commit
to check for array size mismatch while loading topology
buffer.

Signed-off-by: Mohana Datta Yelugoti <ymdatta.work@gmail.com>
2020-08-18 10:36:41 +01:00
Mohana Datta Yelugoti d9712ef671 testbench: topology:check array size mismatch in filewrite component
This patch uses the functionality added by the c9e090ccf3 commit
to check for array size mismatch in components.

Since, the components are in places other than tplg_parser, the
function which checks for the mismatch has been made an external
function from a static one. The function declaration has been
added to the tplg_parser header files, so that the function can
be used by any code which needs array size checks in components.

Signed-off-by: Mohana Datta Yelugoti <ymdatta.work@gmail.com>
2020-08-18 10:36:41 +01:00
Karol Trzcinski 901f991eee logger: Validate by src_hash instead of abi version from fw_ready
ABI version saved in fw_ready doesn't match with DBG_ABI version
saved in ldc file even for proper pair of fw and ldc file.
Moreover ldc file content changes at any log modyfication, what
is not related with DBG_ABI change, so this way of solving this
problem is incorrect.
Introduced src_hash value change solves both problems.

Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
2020-08-18 10:35:29 +01:00
Mohana Datta Yelugoti 4758413fda testbench: check array size in component parsing
There may be a situation where size of all elements of the
snd_tplg_vendor_array is greater than the private data size.

If we take a look at array structure
struct snd_soc_tplg_vendor_array {
	__le32 size;	/* size in bytes of the array, including all elements */
	__le32 type;	/* SND_SOC_TPLG_TUPLE_TYPE_ */
	__le32 num_elems;	/* number of elements in array */
	union {
		struct snd_soc_tplg_vendor_uuid_elem uuid[0];
		struct snd_soc_tplg_vendor_value_elem value[0];
		struct snd_soc_tplg_vendor_string_elem string[0];
	};
} __attribute__((packed));

and assume of private data size is size.

If num_elems * sizeof(..._elem) > size occurs, this is bad
because, we first try to allocate _size_ bytes via malloc to array
pointer. Since the num_elems * sizeof(..._elem) is greater than
size, we get a segmentation fault when we try to memcpy the
remaining size in the subsequent functions (read tplg_read_array()).

We fix this problem by checking for whether array size falls
within the bounds of private data size.

Signed-off-by: Mohana Datta Yelugoti <ymdatta.work@gmail.com>
2020-08-14 15:13:12 +01:00
Keyon Jie 624faa9dd5 topology: tone: add uuid token support
Add the uuid token to tone widget for the future use.

Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
2020-08-13 20:58:38 +08:00
Keyon Jie ad415fa2e3 topology: src: add uuid token support
Add the uuid token to src widget for the future use.

Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
2020-08-13 20:58:38 +08:00
Keyon Jie 33c3663114 topology: pga: add uuid token support
Add the uuid token to volume widget for the future use.

Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
2020-08-13 20:58:38 +08:00
Keyon Jie c2098a1225 topology: pcm: add uuid token support
Add the uuid token to host widget for the future use.

Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
2020-08-13 20:58:38 +08:00
Keyon Jie 8a438296ed topology: mixer: add uuid token support
Add the uuid token to mixer widget for the future use.

Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
2020-08-13 20:58:38 +08:00
Keyon Jie 179a6d1842 topology: eq_iir: add uuid token support
Add the uuid token to eq_iir widget for the future use.

Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
2020-08-13 20:58:38 +08:00
Keyon Jie a2e69b873b topology: eq_fir: add uuid token support
Add the uuid token to eq_fir widget for the future use.

Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
2020-08-13 20:58:38 +08:00
Keyon Jie a730f70cc0 topology: dcblock: add uuid token support
Add the uuid token to dcblock widget for the future use.

Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
2020-08-13 20:58:38 +08:00
Keyon Jie 236a055041 topology: dai: add uuid token support
Add the uuid token to dai widget for the future use.

Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
2020-08-13 20:58:38 +08:00
Keyon Jie 3e64d47620 topology: asrc: add uuid token support
Add the uuid token to asrc widget for the future use.

Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
2020-08-13 20:58:38 +08:00
Keyon Jie 6f0b68f3fd topology: kpbm: add uuid token support
Add the uuid token to kpb widget for the future use.

Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
2020-08-13 20:58:38 +08:00
Keyon Jie 55a93348b5 topology: ch_sel: add uuid token support
Add the uuid token to ch_sel widget for the future use.

Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
2020-08-13 20:58:38 +08:00
Keyon Jie 2da0638db4 topology: detect: add uuid token support
Add the uuid token to detect widget for the future use.

Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
2020-08-13 20:58:38 +08:00
Keyon Jie 9f5173ce6e topology: muxdemux: add uuid token support
Add the uuid token to muxdemux widgets for the future use.

Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
2020-08-13 20:58:38 +08:00
Keyon Jie ec6b210d8c topology: smart_amp: add uuid token to the widget
Add the uuid token to smart_amp widget for the future use.

Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
2020-08-13 20:58:38 +08:00
Keyon Jie 4572a5a59d test: topology: includes utils.m4 first
Move the including of utils.m4 to first as it is needed by other
component m4 files.

Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
2020-08-13 20:58:38 +08:00
Keyon Jie 98f5de8d56 topology: utils: add DECLARE_SOF_RT_UUID() helper
Add a helper DECLARE_SOF_RT_UUID() to generate the 16 Bytes UUID string.

The input string in this format (copied from the FW source directly):
DECLARE_SOF_RT_UUID(name, uuid_macro, a, b, c,
		 d0, d1, d2, d3, d4, d5, d6, d7);

The output string should be in this format:
a6a7:a4a5:a2a3:a0a1:b2b3:b0b1:c2c3:c0c1:d00d01:d10d11:d20d21:d30d31:
d40d41:d50d51:d60d61:d70d71

e.g. for demux component, the macro usage is:
DECLARE_SOF_RT_UUID("demux", demux_uuid, 0xc4b26868, 0x1430, 0x470e,
		 0xa0, 0x89, 0x15, 0xd1, 0xc7, 0x7f, 0x85, 0x1a);

while the output will be:
68:68:b2:c4:30:14:0e:47:a0:89:15:d1:c7:7f:85:1a

Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
2020-08-13 20:58:38 +08:00
Keyon Jie 7811c963f5 topology: tokens: add token for component UUID
Add the definition SOF_TKN_COMP_UUID for the component UUID token, this
could be used for process components as subtype/flavor soon.

Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
2020-08-13 20:58:38 +08:00
Seppo Ingalsuo ae12907dd7 Topology: Create 1ch and 3ch microphones sof-hda-generic topologies
This patch adds to CMakeLists.txt build of duplicate one and three
channels dmic capture topologies. They are needed to match the driver
that loads a topology that matches the number of microphones based on
configured microphones count in device BIOS.

This is an intermediate solution to enable microphones on such
devices. The mono audio will appear as double mono for user space. A
true mono topology and firmware will be created later.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2020-08-12 14:58:26 +01:00
Guennadi Liakhovetski 5d99a4fb0a topology: apl-pcm512x: fix scheduler domain
The conditional definition in sof-apl-pcm512x.m4 is supposed to
select the DMA scheduler if the codec is the bclk source and the
timer scheduler otherwise, but the conditional definition is
broken which leads to the DMA scheduler being selected always.
Fix the definition.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2020-08-12 14:36:25 +01:00
Mohana Datta Yelugoti 108912bba8 tools: testbench:add null pointer variable check before accessing it
When the realloc() function fails, a NULL pointer is returned. But,
if the size argument is zero, then also NULL is returned. So, to
differentiate that, we also check if size is non zero. Only if
pointer is NULL and size is non-zero, we come to the conclusion that
realloc() failed and the allocated memory till now is freed and
appropriate error is returned.

If realloc is called on a pointer and fails, the memory pointed by
the pointer isn't freed. When realloc() fails, even this memory
is freed.

Signed-off-by: Mohana Datta Yelugoti <ymdatta.work@gmail.com>
2020-08-10 11:10:20 +01:00
Diana Cretu 3b3d0ae2eb fuzzer: Add initial support for i.MX8 platform
Implement the fuzzer API for the i.MX8 platform. The difference
between other platforms and i.MX8 is the Messaging Unit(MU). We have
emulated the hardware functionality of MU by using SHMs to represent
Side A and Side B of the MU and the registers they each have. Both
qemu(VM) and fuzzer's write functions write to both sides of the MU to
successfully emulate it's functionality.

Signed-off-by: Diana Cretu <diana.cretu@nxp.com>
Signed-off-by: Shreeya Patel <shreeya.patel23498@gmail.com>
2020-08-10 10:44:30 +01:00
Pin-chih Lin b63c3a3723 tools: testbench: Support channels specification
Support channel specification by argument "-c" on testbench

Signed-off-by: Pin-chih Lin <johnylin@google.com>
2020-08-06 12:25:14 +01:00
Pin-chih Lin d38d5892f6 tools: testbench: Support multiple output files
In order to run multi-output component playback by testbench, this patch
supports multiple output file mode on running testbench. Argument "-o" is
modified to accept specifying up to 4 filenames delimited by comma,
e.g. "-o output1,output2,..."

Moreover, debug messages in tplg_parser/tplg_parser.c is refined for
demonstrating multiple pipelines better.

Signed-off-by: Pin-chih Lin <johnylin@google.com>
2020-08-06 12:25:14 +01:00
Pin-chih Lin 3b5447b379 tools: topology: Support multi-output playback topology
Support up to 4 output pipelines for test/topology/test-playback.m4, where
argument TEST_PIPE_AMOUNT is added for identifying the number of pipelines
while generating test topologies.

Multi-output component should be added in ALG_MULTI_MODE_TESTS and
ALG_MULTI_SIMPLE_TESTS to generate test topologies with multiple output
pipelines in the future.

Signed-off-by: Pin-chih Lin <johnylin@google.com>
2020-08-06 12:25:14 +01:00
Keyon Jie 639154e35b testbench: topology: initial the sof_ipc_comp_file with 0s
Initial the struct sof_ipc_comp_file to make sure all no updated flags
are 0s.

Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
2020-08-05 14:53:31 +01:00
Mohana Datta Yelugoti bc1d785b4d tools: tplg_parser: check if parameter is valid before using it
Before accessing the contents of the parameter pointer of the
function, check if the pointer is NULL. Else, it may lead to
segmentation fault.

Signed-off-by: Mohana Datta Yelugoti <ymdatta.work@gmail.com>
2020-08-04 21:41:05 +01:00
Pierre-Louis Bossart 4a6eea6c9a topology: bytcht: reduce deep-buffer to 5ms
Somehow a 10ms buffer for the deep-buffer pipe generates write errors
on the kernel side with S24 and S32_LE.

Reducing the memory footprint seems to fix the problem.

This may hide a more fundamental problem with either scheduling or
memory allocation, but for now let's solve CI and daily tests.

BugLink: https://github.com/thesofproject/sof/issues/3171
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
2020-08-04 11:39:55 +01:00
Karol Trzcinski d07035d981 logger: Align g flag description in help message
Help message, near -g flags looks like:

sof-logger:      -f precision           Set timestamp precision
sof-logger:      -g             Hide timestamp
sof-logger:      -d *.ldc_file          Dump ldc_file information

before changes, and after apply this patch, descriptions are aligned.

Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
2020-08-04 11:26:19 +01:00
Seppo Ingalsuo fa4a7bda4e Testbench: Check num_elems in tokens parsing
This patch adds check for sane num_elems value. If the calculated
array size exceeds the value size an error is returned and topology
parsing is aborted.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2020-08-04 11:25:35 +01:00
Mohana Datta Yelugoti d9fea08a24 tools: testbench: check if pointer is null before accessing it
Check if a pointer is NULL before accessing it, else, it leads
to segmentation fault.

Signed-off-by: Mohana Datta Yelugoti <ymdatta.work@gmail.com>
2020-08-04 11:10:24 +01:00
Mohana Datta Yelugoti 8737e0b726 tools: tplg_parser: free allocated memory to avoid memory leaks
When an error is occurred when loading the widget, the memory
allocated is not freed properly. This results in memory leaks.
Avoid these memory leaks by freeing the allocated memory before
exiting the function by returning error value.

Signed-off-by: Mohana Datta Yelugoti <ymdatta.work@gmail.com>
2020-08-04 11:10:24 +01:00
Mohana Datta Yelugoti b1dec44124 tools: testbench: initialize pointer before freeing it
When we try to free a pointer which is not initialized, we are
using a value in the program which is undefined. So, initialize
the pointer variable, so that in future, when we free the pointer
it won't cause a problem.

Signed-off-by: Mohana Datta Yelugoti <ymdatta.work@gmail.com>
2020-08-04 11:10:24 +01:00
Marcin Rajwa ae7b911956 topology: fix playback & capture pipelines to be timer driven
This patch fixes several pipelines which are DMA driven by default
but should be driven in timer domain.

Signed-off-by: Marcin Rajwa <marcin.rajwa@linux.intel.com>
2020-08-03 21:57:27 +01:00
Artur Kloniecki 238cd1457d treewide: Remove references to .free and .avail members of audio_stream.
All audio_stream clients should use provided audio_stream_get_avail*/free*
API, instead of directly accessing .avail and .free member fields.

Signed-off-by: Artur Kloniecki <arturx.kloniecki@linux.intel.com>
2020-08-03 21:53:14 +01:00
Bard Liao 7b8eec9f4f topology: add tgl-rt711-rt1316-rt714 support
tgl-rt711-rt1316-rt714 is almost the same as tgl-rt711-rt1308-rt715 and
can use the same topology file.

Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
2020-08-03 21:11:51 +01:00
Sathyanarayana Nujella 091daf65c6 topology: Update sof-tgl-max98373-rt5682 to take amp SSP ID
Update sof-tgl-max98373-rt5682 to take speaker amp's SSP ID as input.
This is to accommodate DUT's which has amp connected on SSP2.

Signed-off-by: Sathyanarayana Nujella <sathyanarayana.nujella@intel.com>
Signed-off-by: Mac Chiang <mac.chiang@intel.com>
Signed-off-by: Jairaj Arava <jairaj.arava@intel.com>
2020-08-03 21:11:04 +01:00
Mohana Datta Yelugoti 9f1106d8a5 testbench: add null pointer check for function argument
tb_pipeline_params() function takes an argument called ipc_pipe,
which is a pointer and is derefernced in the function to access
a member of structure that pointer is pointing to.

If this pointer is NULL, this leads to Segmentation fault. A
null pointer check is added before the argument is dereferenced.

Signed-off-by: Mohana Datta Yelugoti <ymdatta.work@gmail.com>
2020-07-23 14:28:26 +01:00
Bartosz Kokoszko 97377c3757 smart_amp: fix smart amplifier tplg
This commit changes SSP bclk rate from 9600000 to
12288000 ind ssp container to 32 bits order to fix
glitch issue.

Signed-off-by: Bartosz Kokoszko <bartoszx.kokoszko@linux.intel.com>
2020-07-21 15:44:28 +01:00
Kai-Chuan Hsieh 8675d4cb9f tools: add TGL key signature to sof_ri_info
Provide output info if evaluated FW image was signed with
TGL production key.

Signed-off-by: Kai-Chuan Hsieh <kaichuan.hsieh@canonical.com>
2020-07-16 13:39:45 +01:00
Pierre-Louis Bossart 1a8ed6dfd0 topology: mirror CML topologies for TGL
Some TGL devices use the same devices and hardware layout and on CML,
reuse.  Also remove cml-mono.m4 definition and directly add the define
in the CMakeLists.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
2020-07-15 15:22:50 +01:00
Pierre-Louis Bossart 4a32011bfd topology: remove sof-icl-rt711-rt1308-rt715.m4
This file is no longer maintained and does not work with the SoundWire
drivers, remove.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
2020-07-14 11:44:35 -05:00
Uday M Bhat d2a75ad038 topology: jsl-rt1015: PLL input at 50fs is no longer supported
The new recommended settings at 48Khz rate are:

PLL input       SSP bclk
------------------------
64fs            3.073Mhz
100fs           4.8Mhz

Modifying topology to 64fs
2020-07-08 14:40:54 +01:00
Karol Trzcinski adc8cc22cc sof: Unify hex dixplay style
Consistency should be kept so usage the same HEX case throughout the FW
is advised.

Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
2020-07-07 15:48:43 +01:00
Pierre-Louis Bossart aef421ac4a topology: cht-max98090: align with byt-nocodec
Only the SSP settings need to be different.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
2020-07-07 09:23:15 +01:00
Pierre-Louis Bossart b51cb9113a topology: remove cht-src-50kHz-pcm512x
No one uses this topology so let's remove it.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
2020-07-07 09:23:15 +01:00
Pierre-Louis Bossart 1a8c123511 topology: cht-rt5682: align with byt-codec topology
Same parameters, so let's use the same template

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
2020-07-07 09:23:15 +01:00
Pierre-Louis Bossart 1a56804ff7 topology: align cht-nocodec and byt-codec topologies
Additional work needed to make the BE name and index configuration, as
well as LBM quirk.
We should be using a single topology here.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
2020-07-07 09:23:15 +01:00
Pierre-Louis Bossart ec47eefa13 topology: sof-byt-codec: connect pipe-host-volume-playback to mixer-dai
remove the low-latency pipeline and pcm-media.

Instead, we use 2 two pipe-host-volume-playback with different periods
connected to the same mixer-dai.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
2020-07-07 09:23:15 +01:00
Pierre-Louis Bossart 7189916c53 topology: introduce pipe-host-volume-playback
Add a new pipeline definition to avoid mucking with either
pipe-low-latency or pipe-media.

The code is 90% similar to pipeline-volume-playback but includes a
scheduling component.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
2020-07-07 09:23:15 +01:00
Pierre-Louis Bossart b971f2b753 topology: add pipe-mixer-dai-playback
Add separate pipeline starting with a mixer (similar to Baytrail
switch matrix and SKL closed-source firmware)

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
2020-07-07 09:23:15 +01:00
Rander Wang 7b532d3712 topology: tgl-sdw-max98373: change DMIC16k format to 32LE
For original DMIC16k only S16_LE is supported in pcm capability.
Now this patch enables S24_LE and S32_LE for applications like
DMIC01.

Signed-off-by: Rander Wang <rander.wang@intel.com>
2020-07-01 09:56:51 +01:00
Keyon Jie 77e42657c6 topology: sof-hda-generic-kwd: switch to use vol-kfbm mode
We need PGA to tune the volume for the KWD pipeline, switch to use
vol-kfbm mode to get it done.

Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
2020-06-30 11:13:48 +01:00
Seppo Ingalsuo 673e335a7a Tools: Topology: Change playback volume ramp duration to 20 ms
This patch shortens the ramp duration to 20 ms from 250 ms in all
topologies with volume playback. In addition the zero crossings detector
mode is enabled to mitigate zipper noise.

The change includes for the not yet updated pipeline macros a rename
of macro for tokens data with pipeline number suffix to ensure no
undesired volume instances are impacted by this change.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2020-06-29 21:55:44 +01:00
Keyon Jie 20ab16c36e topology: sof-smart-amplifier: change the mclk to fix the noise issue
Since we are sharing the same mclk_id among SSP interfaces, we should
use the fixed frequency for the mclk. Here add a macro for it to make
sure it is aligned with the SSP configure in the upper layer.

Change to use 19.2MHz as the default mclk for smart_amp SSP.

Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
2020-06-24 20:04:03 +01:00
Keyon Jie fc2b8d14a6 topology: sof-smart-amplifier: configure ssp quirk to 0 by default
We should make sure SMART_SSP_QUIRK is set, if it is not defined from
the upper layer, let's set it to explicit 0.

Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
2020-06-24 20:04:03 +01:00
Rander Wang 642ac57ed3 topology: tgl-max98373-rt5682: adjust channel usage for sdw DSM support
For original design, there are 4 channels 24bit stream for playback
and 8 channels 24bit IV feedback for capture stream. This requirement
exhausts all resource on single link. Now adjust it to a 2 channels stream
for playback and a 4 channels stream for capture

Signed-off-by: Rander Wang <rander.wang@intel.com>
2020-06-24 20:02:50 +01:00
Marc Herbert a3a9eb3a2b cmake: no space after -imacros to avoid de-duplication
This is not needed yet as we use only one -imacros at a time but could
save someone a lot of time in the future; including the author of this
patch who will have forgotten about it in a few weeks.

For more details see
https://github.com/zephyrproject-rtos/zephyr/commit/e53c0d0ec7640b
and links from there.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2020-06-24 11:29:27 +01:00
Karol Trzcinski cb10221109 logger: Rename float_precision to time_precision
New name better describes variable functionality.

Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
2020-06-24 09:30:26 +01:00
Karol Trzcinski d97e9291e1 logger: Add possibility to hide timestamps
After removing timestamps it is possible to compare output logs
with tools like diff or similar. Moreover then output logs are
in more compact form.

Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
2020-06-24 09:30:26 +01:00
Pan Xiuli 19c3ff9924 topology: fix wrong parameter for HDMI in sof-jsl-da7219
Remove the wrong one more 0 in the DAI config for HDMI.

Signed-off-by: Pan Xiuli <xiuli.pan@linux.intel.com>
2020-06-23 12:13:49 +01:00
Jaska Uimonen d76622a967 topology: fix dmic names (again)
We broke the upstream UCM configs by introducing pipeline id's to dmic
names. This differentiation is mandatory for reasons in alsaconf parsing
and ASoC layer combining the control names to pga's. However, the
differentiator can't be pipeline id as it can change depending on the
topology. So let Dmic0 have the old "Capture Volume" control name and
prefix Dmic1 control name with "2nd". This should not break the UCM's as
Dmic1 is not currently referenced.

Signed-off-by: Jaska Uimonen <jaska.uimonen@intel.com>
2020-06-23 12:05:05 +01:00
Marc Herbert 1002899b95 Use '-imacros config.h' instead of explicit #include <config.h>
Using -imacros on the compiler command line instead of explicitly
including config.h is not just less tedious in the future:
- it also makes sure configuration always comes first and is never
  accidentally missed by an earlier #include
- it makes sure all translation units get the (same) configuration
- it lets parent projects like Zephyr override the config.h name

To test this I ran ./scripts/xtensa-build-all.sh -a -r, compared
binaries before and after this change and found no output difference.

Full disclosure: this required a few unrelated tricks not submitted here
like a .tarball-version file, commenting out __DATE__ and __TIME__ in a
few places, running strip-determinism on the .a files because our
crosstool-ng reference is not cutting-edge, etc.

As Tigerlake is not built by default it required a couple more hacks to
compile.

Blank lines are left instead of the former #include lines so even debug
objects are the same.

Only defconfigs were tested. On the other hand, this commit was _not_
performed by a script but by changing the name of the generated file and
clicking on and fixing every build failure. This proves that every
removed #include was actually required by one or more tested defconfigs
and that the added -imacros flag does affect the compilation of all the
modified files.

There is no #include config.h left: they were all in use in at least
one _defconfig.

I think comparing all binaries produced by ./scripts/xtensa-build-all.sh
-r -a provides extensive enough coverage but note this was tested only
with the crosstool-ng toolchain described in the SOF documentation.

The obsolete[*] xt-xcc front-end is gcc-based and the newer xt-clang
front-end is (surprise) clang-based. clang (copies many gcc options and)
does support -imacros so I don't expect any issue with either xt-xcc or
xt-clang. In the worst case, I do not expect any compiler front end to
_silently_ discard any unknown command line flag nor to ignore a missing
or misnamed config.h file.

[*] https://github.com/zephyrproject-rtos/zephyr/issues/3165

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2020-06-22 13:01:26 +01:00
Bartosz Kokoszko a2d1e1efdc component: add set of helper functions for large config configuration
This commit rewrites functions responsible for large config configuration
from detect_test component and puts them in component.c file as
generic ones - as a result they can be used by other components.

Signed-off-by: Bartosz Kokoszko <bartoszx.kokoszko@linux.intel.com>
2020-06-17 11:33:23 +02:00
Uday M Bhat 4d005a0554 topology: Add jsl+ MX98360a amp with ALC5682 Headset codec
Topology is modified to include another JSL+ product variant with
MX98360a AMP + ALC5682 Headset codec. Created a platform specific
for RT1015, included this and already existing MX98360a in
sof-jsl-rt5682.m4

Signed-off-by: Uday M Bhat <uday.m.bhat@intel.com>
2020-06-12 11:00:28 +01:00
Yong Zhi 52c1174c18 topology: Add jsl+ tplg for RT1015 amp and ALC5682 Headset codec
The topology is cloned from sof-tgl-max98357a-rt5682.m4 with
changes on ssp config, iDisp and DMIC pipeline pcm number etc.

The dai_index matches the order defined in sof-rt5682.c machine driver.

Signed-off-by: Yong Zhi <yong.zhi@intel.com>
2020-06-10 12:03:33 +01:00
Seppo Ingalsuo f269d0c732 Topology: Add ASRC capture pipe for WM8804 SPDIF input
This patch adds capture PCM with ASRC for capturing from SPDIF
input of WM8804 codec. This topology is used mainly for testing
of a bi-directional ASRC connected slave-DAI.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2020-06-10 12:01:02 +01:00
Karol Trzcinski 27d4c943f3 testbench: Add UUID for file component
Each component driver should have assigned UUID value and trace
contecxt, to allow generic component creation routine usage.
It's espiecially important for trace context, because it's
accessed by pointer so dereferencing NULL pointer will lead to
segmentation fault.

Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
2020-06-04 15:42:52 +01:00
Slawomir Blauciak 9b2b031da7 topology: fix pipeline parameters mismatched with hardware configuration
The stream parameters set in the pipeline were mismatched with
the DMIC hardware configuration, which resulted in failures.

Signed-off-by: Slawomir Blauciak <slawomir.blauciak@linux.intel.com>
2020-06-04 14:22:36 +01:00
Rander Wang 30e801c4d4 topology: sdw: fix dmic issue on tgl sdw platforms
Port commit a716056c4b ("tgl: use additional CHANNEL
define in rt711 + rts1308 tplg") to all tgl sdw platforms

Signed-off-by: Rander Wang <rander.wang@intel.com>
2020-06-01 10:55:36 +01:00
Seppo Ingalsuo 145d9aa09f Tools: Tune: Improve robustness of remote audio measure
Frequency response measure script mls_freq_resp.m could fail due to
network or ssh execution delays. This patch increases the recording
time by 3 seconds to ensure that remote device playback via ssh for
the relevant parts is within the local capture window.

Also the start marker search is done for first 5 seconds of captured
test signal. The script exits cleanly if the start and end markers
were not found and the captured waveform is shown to help understand
the possible network delays caused issue.

The BSD-3-Clause text is updated to short version.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2020-05-29 15:59:33 +01:00
Karol Trzcinski bebdbca87b rimage: Update to version with changed headers location
In new version of rimage software, headers are located in
rimage/src/include/rimage directory to make it easily accessible
from another source code without include path collision.

Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
2020-05-29 11:15:22 +01:00
Marcin Maka caae629f79 tools: sof-ri-info: make cse mft parsing optional
It is a special --no_cse mode useful in case the cse part is
unparsable for any reason. Cse manifest parsing is skipped and
Adsp part is parsed only.

Signed-off-by: Marcin Maka <marcin.maka@linux.intel.com>
2020-05-28 20:25:48 +02:00
Marcin Maka 58e244ee88 tools: sof-ri-info: add more verbose info about parsing progress
Running with -v option now gives more information about
the parsing progress which makes debug easier.

Signed-off-by: Marcin Maka <marcin.maka@linux.intel.com>
2020-05-28 20:25:48 +02:00
Marcin Maka a28525b23b tools: sof-ri-info: fix css mft parsing for bin with ext mft
CSS Manifest header must be created with file offset adjusted
by extended manifest size to loop through extensions correctly.

Signed-off-by: Marcin Maka <marcin.maka@linux.intel.com>
2020-05-28 20:25:48 +02:00
Marcin Maka 3f39319549 tools: sof-ri-info: remove trailing zeroes from strings
Strings are padded with zeroes in the binary input file,
so rstrip used after decode removes them, otherwise such
a string cuts the output if inserted as argument in the
middle.

Signed-off-by: Marcin Maka <marcin.maka@linux.intel.com>
2020-05-28 20:25:48 +02:00
Marcin Maka 5c3d0225a9 tools: sof-ri-info: display memory map
Information about modules memory occupation is displayed
when memory layout of the target platform is known
(determined by the fw binary name).

Signed-off-by: Marcin Maka <marcin.maka@linux.intel.com>
2020-05-28 20:25:48 +02:00
Marcin Maka ebf381658f tools: sof-ri-info: compact layout of module entry info
More compact output is better for binaries containing
many module entries.

Signed-off-by: Marcin Maka <marcin.maka@linux.intel.com>
2020-05-28 20:25:48 +02:00
Marcin Maka ec13b0828f tools: sof-ri-info: add modules only mode
Additional parameters added:

no_modules - works like previous 'headers' option where
modules are excluded from output

no_headers - excludes cse manifest headers from output
and dumps info about the adsp modules only

Signed-off-by: Marcin Maka <marcin.maka@linux.intel.com>
2020-05-28 20:25:48 +02:00
Marcin Maka 8885b465df tools: sof-ri-info: move parsing adsp mft outside cse mft
There might be binaries where cse mft is not included.
And adsp mft begins at std offset 0x2000 from the optional
extended manifest.

Signed-off-by: Marcin Maka <marcin.maka@linux.intel.com>
2020-05-28 20:25:48 +02:00
Marcin Maka dcefb7f753 tools: sof-ri-info: log via info method only
All logging dispatched via Reader info method is more
consistent and better controlable.

Signed-off-by: Marcin Maka <marcin.maka@linux.intel.com>
2020-05-28 20:25:48 +02:00
Marcin Maka 4b7523c8c9 tools: sof-ri-info: use colors for terminal output only
Do not use colors if stdout is not a tty.

Signed-off-by: Marcin Maka <marcin.maka@linux.intel.com>
2020-05-28 20:25:48 +02:00
Karol Trzcinski 0596f5b71c logger: Pass input file in -d flag
Such an approach is more logical, user add flag to dump information
and specify what to dump just after it. Using separate argument
with file path and flag to dump is less natural. So after change
`./sof-logger -l file.ldc -d`
will be replaced with
`./sof-logger -d file.ldc`

Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
2020-05-27 13:24:10 +01:00
Karol Trzcinski 44a25a1a64 logger: Do not open input file for ldc_dump
Input file is not needed for these functionalities, so shouldn't be
opened.

Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
2020-05-27 13:24:10 +01:00
Karol Trzcinski fe3dfe4007 logger: Fix help message consistency
Before this patch output message was misaligned and one flag
description start from small letter:
sof-logger:      -L                     Hide log location in source code
sof-logger:      -f precision                   set timestamp precision
sof-logger:      -d                     Dump ldc information

After change, it's fixed:
sof-logger:      -L                     Hide log location in source code
sof-logger:      -f precision           Set timestamp precision
sof-logger:      -d                     Dump ldc information

Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
2020-05-27 12:15:29 +01:00
Karol Trzcinski 1535738355 logger: Move optstring from getopt function to separate variable
Such a change is provoked by getting close to maximal line length
in line with getopt line call. Moving format string to separate
variable is more logical solution than splitting function arguments
on separate lines.

Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
2020-05-27 11:31:59 +03:00
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
Bard Liao aeaddf3af8 Topology: Add HDA config
We need to config HDA rate and channels.

Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
2020-04-17 10:27:03 +01:00
Pierre-Louis Bossart 0de9dfeeee topology: sof-apl-wm8804: add capture support
Add duplex capture - tested w/ HifiBerry Digi+

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
2020-04-17 09:59:58 +01:00
Bartosz Kokoszko 26733a3cf4 apl: change dmic format to s32_le in sof-glk-da7219.tplg
In order to allow record s16_le/s24_le/s32_le format this
commit changes DAI component's and DMIC's format to s32_le
on PCM99.
In case recording s16_le/s24_le DAI component makes pcm
conversion from s16_le/s24_le to s32_le.

Signed-off-by: Bartosz Kokoszko <bartoszx.kokoszko@linux.intel.com>
2020-04-16 15:52:25 +01:00
Yong Zhi 7aeb252264 WIP: topology: sof-jsl-da7219: Add KWD support
Add KWD pipelines with vol-kfpm pipe using intel-generic-dmic-kwd template.

DMIC01 on PCM 5 is renamed to DMIC48kHz, 16K DMIC KWD added on PCM 6.

Signed-off-by: Yong Zhi <yong.zhi@intel.com>
2020-04-16 12:01:07 +01:00
Seppo Ingalsuo 80f6e0698f Tools: Test: Add objective quality tests for processing components
This patch adds an Octave test script process_test.m to audio processing
components like FIR and IIR EQ.

Parts of src_test.m are moved to common functions to ease printing of
test results matrix.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2020-04-16 11:48:22 +01:00
Seppo Ingalsuo 594e031b6e Tools: Tune: Improve EQ blob decode scripts
This patch adds user friendly function eq_blob_plot(file) to
plot the IIR or FIR equalizer response that will be applied for
each channel.

The IIR and FIR decoders are modified to better support the higher
level script.

The copyright texts in impacted scripts are are updated to short
BSD-3-Clause style.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2020-04-16 11:48:22 +01:00
Seppo Ingalsuo 365ffbd02f Tools: Tune: Suppress sof-ctl text output when getting ABI header
This patch reduces amount of printed text to screen when Matlab/Octave
EQ tool needs configuration blob header information. The output is
redicted to /dev/null.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2020-04-16 11:48:22 +01:00
Mac Chiang 21b64c051f topology: add cml support with da7219 and max98357a
Reuse sof-glk-da7219-kwd by included cml.m4
for sof-cml-da7219-max98357a topology with KWD pipeline enabling

Signed-off-by: Mac Chiang <mac.chiang@intel.com>
2020-04-16 11:47:02 +01:00
Marcin Maka 245f5aa8a8 alloc: remove unused rrealloc
rrealloc function is no longer in use, so it is better
to remove it. Unused code is no longer tested so its
quality is unknown.

The current implementation is simple but expensive since
extra calls to malloc/free requires time and risky since
at some point requires double allocation of potentially
large object. Please consider re-implementation instead
of restoring.

Signed-off-by: Marcin Maka <marcin.maka@linux.intel.com>
2020-04-10 20:00:05 +03:00
Tomasz Lauda 1c2f3c0ce5 schedule: return status of operations
Changes schedule operations to return error in case
chosen scheduler is not found or scheduler doesn't
support mandatory operation.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2020-04-10 14:45:49 +02:00
Bartosz Kokoszko a716056c4b tgl: use additional CHANNEL define in rt711 + rts1308 tplg
This commit adds CHANNELS define in sof-tgl-rt711-i2s-rt1308.m4
topology in order to properly set pipeline pcm channels and dmic
configuration (STEREO_PDM0 or FOUR_CH_PDM0_PDM1 mode).

Signed-off-by: Bartosz Kokoszko <bartoszx.kokoszko@linux.intel.com>
2020-04-08 19:32:14 +01:00
Marcin Maka e306d1293e alloc: fix potential oob in rbrealloc
Previous memcpy of bytes is unsafe if new object is larger
then old one.

Typically realloc retrieves the old size internally and does
not need this information passed as argument but sof heap
implementation does not store the exact size of the allocated
memory buffer.

Signed-off-by: Marcin Maka <marcin.maka@linux.intel.com>
2020-04-08 10:51:37 +01:00
Marcin Maka 75b8c1e8f8 alloc: fix potential oob in rrealloc
Previous memcpy of bytes is unsafe if new object is larger
then old one (which is probably most popular realloc use).

Typically realloc retrieves the old size internally and does
not need this information passed as argument but sof heap
implementation does not store the exact size of the allocated
memory buffer.

Signed-off-by: Marcin Maka <marcin.maka@linux.intel.com>
2020-04-08 10:51:37 +01:00
Marc Herbert 5e3bc9c11c tools/test: silence alsatplg in tlpg-build.sh unless VERBOSE=1
With this commit:
                  ./scripts/build-tools.sh -t -f | wc -l
     525
VERBOSE=anything  ./scripts/build-tools.sh -t -f | wc -l
  137030

This a followup to commit aa6c0f2ad1 ("topology: cmake: silence super
chatty alsatplg unless VERBOSE=1")

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2020-04-08 10:02:27 +01:00
Guennadi Liakhovetski 49dbfdaf54 topology: add a "core" parameter to the W_TONE() macro
This places all SectionWidget.TONE* topology widgets, created by
the W_TONE() macro on the same core, on which the respective pipeline
is scheduled.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2020-04-08 09:30:02 +01:00
Guennadi Liakhovetski 6522872c92 topology: add a "core" parameter to the W_MUXDEMUX() macro
This places all SectionWidget.MUXDEMUX* topology widgets, created by
the W_MUXDEMUX() macro on the same core, on which the respective
pipeline is scheduled.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2020-04-08 09:30:02 +01:00
Guennadi Liakhovetski ce5ed2d322 topology: add a "core" parameter to the W_MIXER() macro
This places all SectionWidget.MIXER* topology widgets, created by
the W_MIXER() macro on the same core, on which the respective
pipeline is scheduled.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2020-04-08 09:30:02 +01:00
Guennadi Liakhovetski 90dd7909c7 topology: add a "core" parameter to the W_KPBM() macro
This places all SectionWidget.KPBM* topology widgets, created by
the W_KPBM() macro on the same core, on which the respective pipeline
is scheduled.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2020-04-08 09:30:02 +01:00
Guennadi Liakhovetski b735047b91 topology: add a "core" parameter to the W_DETECT() macro
This places all SectionWidget.DETECT* topology widgets, created by
the W_DETECT() macro on the same core, on which the respective
pipeline is scheduled.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2020-04-08 09:30:02 +01:00
Guennadi Liakhovetski 6fe1f343fc topology: add a "core" parameter to the W_DCBLOCK() macro
This places all SectionWidget.DCBLOCK* topology widgets, created by
the W_DCBLOCK() macro on the same core, on which the respective
pipeline is scheduled.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2020-04-08 09:30:02 +01:00
Guennadi Liakhovetski ce2291470e topology: add a "core" parameter to the W_SELECTOR() macro
This places all SectionWidget.SELECTOR* topology widgets, created by
the W_SELECTOR() macro on the same core, on which the respective
pipeline is scheduled.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2020-04-08 09:30:02 +01:00
Guennadi Liakhovetski fac1c79610 topology: add a "core" parameter to the W_EQ_FIR() macro
This places all SectionWidget.EQFIR* topology widgets, created by
the W_EQ_FIR() macro on the same core, on which the respective pipeline
is scheduled.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2020-04-08 09:30:02 +01:00
Guennadi Liakhovetski 2cee9fd3cb topology: add a "core" parameter to the W_DAI_IN() macro
This places all SectionWidget.<DAI type><DAI index>.IN topology
widgets, created by the W_DAI_IN() macro on the same core, on which
the respective pipeline is scheduled.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2020-04-08 09:30:02 +01:00
Guennadi Liakhovetski 8821c1c412 topology: add a "core" parameter to the W_EQ_IIR() macro
This places all SectionWidget.EQIIR* topology widgets, created by
the W_EQ_IIR() macro on the same core, on which the respective pipeline
is scheduled.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2020-04-08 09:30:02 +01:00
Guennadi Liakhovetski 40e68e21dc topology: add a "core" parameter to the W_PCM_CAPTURE() macro
This places all SectionWidget.PCM*C topology widgets, created by
the W_PCM_CAPTURE macro on the same core, on which the respective
pipeline is scheduled.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2020-04-08 09:30:02 +01:00
Guennadi Liakhovetski 7282958c4a topology: add a "core" parameter to the W_DAI_OUT() macro
This places all SectionWidget.<DAI type><DAI index>.OUT topology
widgets, created by the W_DAI_OUT() macro on the same core, on which
the respective pipeline is scheduled.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2020-04-08 09:30:02 +01:00
Guennadi Liakhovetski 787f67e701 topology: add a "core" parameter to the W_BUFFER() macro
This adds an optional "core" parameter to the W_BUFFER() macro, which
then allows buffers to be placed on the same core as the rest of the
pipeline. So far we only modify pipe-volume-playback.m4 to do that,
other pipelines can be modified later as needed.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2020-04-08 09:30:02 +01:00
Guennadi Liakhovetski a31308a1ab topology: add a "core" parameter to the W_PGA() macro
This places all SectionWidget.PGA* topology widgets, created by
the W_PGA() macro on the same core, on which the respective pipeline
is scheduled.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2020-04-08 09:30:02 +01:00
Guennadi Liakhovetski 318d5cb71c topology: add a "core" parameter to the W_PCM_PLAYBACK() macro
This places all SectionWidget.PCM*P topology widgets, created by
the W_PCM_PLAYBACK macro on the same core, on which the respective
pipeline is scheduled.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2020-04-08 09:30:02 +01:00
Guennadi Liakhovetski 714556e59f topology: add a new SOF_TKN_COMP_CORE_ID token
We need a way to explicitly place components on specific DSP cores.
Add a SOF_TKN_COMP_CORE_ID word token for that.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2020-04-08 09:30:02 +01:00
Dharageswari R 5b99262f64 topology: Enable WoV on TGL tplg for tgl-max98357a-rt5682
This patch adds the changes to enable WoV for tgl-max98357a-rt5682.

Signed-off-by: Dharageswari R <dharageswari.r@inetl.com>
2020-04-07 14:46:32 +01:00
Marc Herbert 0b80998bb1 Revert __builtin_assume_aligned(4) probe packet, replace with aligned(4)
This reverts and replaces commit 2765b22049 ("probe-app: assume probe
packet aligned"). That commit applied a __builtin_assume_aligned(4) to
every pointer assignment of the following type:

  uint32_t *ptr = struct probe_data_packet *packet;

Instead of using __builtin_assume_aligned(4) every time a
probe_data_packet is used like this, the probe_data_packet type
definition is now 32 bits aligned in only one place thanks to (packed,
aligned(4)).

struct probe_data_packet is made entirely of uint32_t members. It
is (packed) to avoid a 64 bits compiler hypothetically padding and
aligning these 32 bits members to 64 bits. However, (packed) alone is
roughly equivalent to aligned(1) (neither is part of the C standard)
which causes some gcc versions to warn about this:

  sof/tools/probes/probes_main.c:228:5: error: converting a packed
  ‘struct probe_data_packet’ pointer (alignment 1) to a ‘uint32_t’
  {aka ‘unsigned int’} pointer (alignment 4) may result in an
  unaligned pointer value [-Werror=address-of-packed-member]

  228 |     w_ptr = (uint32_t *)packet;
      |     ^~~~~

Unlike "assuming" with __builtin_assume_aligned, (packed, aligned(4))
makes sure probe_data_packet are _actually_ 4 bytes aligned. As a
demontration, it stops the following _Static_assert() from failing:

modified   src/probe/probe.c
@ -64,9 +64,12 @ struct probe_pdata {
 	struct probe_dma_ext ext_dma;
 	struct probe_dma_ext inject_dma[CONFIG_PROBE_DMA_MAX];
 	struct probe_point probe_points[CONFIG_PROBE_POINTS_MAX];
+	uint8_t dummy;
 	struct probe_data_packet header; // aligned(4)?
 	struct task dmap_work;
 };
+_Static_assert(offsetof(struct probe_pdata, header) % 4 == 0 ,
+               "probe_data_packet is not 4 aligned");

In addition to gcc version 8 and 9, I tested and confirmed with
_Static_assert and pahole that the same attributes behave the same with
clang 9.0.1-2.fc31.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2020-04-07 14:45:48 +01:00
Fred Oh d65495e984 topology: set DMIC pipe with eq-iir with 40 Hz highpass
For headset playback or capture, default pipe is volume. If The high pass
filter is required to prevent HDA codec headset glitches, it can be set by
HSMICPROC=eq-iir-volume. It use use 40 Hz high pass filter with +0 db
boost. If there is DMIC, this set default pipe as eq-iir, which use
the same 40 Hz high-pass filter too. For DMIC16K, 40 Hz high-pass for 16khz
version filter is used.

Default coefficient for FIR/IIR is changed fr m coef flat to coef pass.
Pass configuration has the advantage of low system load.
    eq_fir_coef_flat.m4 to eq_fir_coef_pass.m4
    eq_iir_coef_flat.m4 to eq_iir_coef_pass.m4

Below pipe files are renamed for naming convention,
    pipe-eq-volume-playback.m4 -> pipe-eq-iir-eq-fir-volume-playback.m4
    pipe-eq-capture-16khz.m4 -> pipe-eq-iir-volume-capture-16khz.m4
    pipe-eq-capture.m4 -> pipe-eq-iir-volume-capture.m4

Signed-off-by: Fred Oh <fred.oh@linux.intel.com>
2020-04-07 14:37:37 +01:00
Fred Oh 8b49743a20 topology: add macro to support eq filters for sof-cml-rt5682
The patch shows a proposal how to propagate pipeline filter
coefficients data definition at topology top level. It is an
useful way to avoid to create different new pipeline macros for
different filter. Define filter coefficients data with macro
DEF_EQFIR_PRIV and DEF_EQFIR_COEF, which will be replaced
unique name by adding PIPELINE number. For IIR filter, equivalent macro
is DEF_EQIIR_PRIV and DEF_EQIIR_COEF.

Makefile define each pipeline processing HSEARPROC, HSMICRPOC, SPKPROC,
DMICPROC etc. Each variable should support default value to minimize
current topologies. When new filter blob is required, define
PIPELINE_FILTERx in makefile. This method provides more flexible way
to support variable number of filters in the pipeline.

The other clean up for topology macros include definions for unique
volume tokens and unique filter coefficient definitions.

Signed-off-by: Fred Oh <fred.oh@linux.intel.com>
2020-04-07 14:37:37 +01:00
Jaska Uimonen 5672896ba4 topology: remove unused demux pipeline
pipe-demux-playback.m4 is not used by any topology, so remove it.

Signed-off-by: Jaska Uimonen <jaska.uimonen@intel.com>
2020-04-07 14:36:21 +01:00
Jaska Uimonen cc2d08dafd topology: remove unused demux default coeffs
Demux default coeffs has been replaced by top level demux configuration,
so remove it.

Signed-off-by: Jaska Uimonen <jaska.uimonen@intel.com>
2020-04-07 14:36:21 +01:00
Jaska Uimonen a32ad75e90 topology: remove default demux config from pipe-volume-demux-playback
Remove default demux parameters and start using blob defined in top
level topology.

Signed-off-by: Jaska Uimonen <jaska.uimonen@intel.com>
2020-04-07 14:36:21 +01:00
Jaska Uimonen d418c051d1 topology: add mux config to sof-icl-rt711-rt1308-rt715-hdmi.m4
Add mux config to top level topology.

Signed-off-by: Jaska Uimonen <jaska.uimonen@intel.com>
2020-04-07 14:36:21 +01:00
Jaska Uimonen 4f29f7ba18 topology: add mux config to sof-cml-demux-rt5682.m4
Add mux config to top level topology.

Signed-off-by: Jaska Uimonen <jaska.uimonen@intel.com>
2020-04-07 14:36:21 +01:00
Jaska Uimonen 5f6c678180 topology: add mux config to sof-apl-demux-pcm512x.m4
Add mux config to top level topology.

Signed-off-by: Jaska Uimonen <jaska.uimonen@intel.com>
2020-04-07 14:36:21 +01:00
Jaska Uimonen 874393cbeb topology: add binary blob macro for muxdemux
Add macro for binary blob generation for muxdemux. With this macro the
stream routing matrix will be easier to visualize and manipulate.

Signed-off-by: Jaska Uimonen <jaska.uimonen@intel.com>
2020-04-07 14:36:21 +01:00
Jaska Uimonen 82aab68b3e topology: add bit, byte and abi_version macros to utils
Bit and byte manipulation macros are needed for building binary blobs,
so add them. Add also macro to generate sof_abi_version.

Signed-off-by: Jaska Uimonen <jaska.uimonen@intel.com>
2020-04-07 14:36:21 +01:00
Marcin Rajwa 94b235c164 topology: update min host buffer size for KWD
This updates the minimal host buffer size to the
minimum value which enables sefe draining for all
pcm parameters.

Signed-off-by: Marcin Rajwa <marcin.rajwa@linux.intel.com>
2020-04-07 14:26:13 +01:00
Marcin Maka 5f24796630 comp: use comp_alloc in existing components
Replaces the common, required part of the initialization
copied by every implementation.

Signed-off-by: Marcin Maka <marcin.maka@linux.intel.com>
2020-04-07 13:51:04 +03:00
Fred Oh 8d03efe701 topology: apl: share asymmetrical dmic pipe setting
apl dmic asymmetrical topologies are shared most of common codes. Share
one m4 macro for all.

Signed-off-by: Fred Oh <fred.oh@linux.intel.com>
2020-04-03 21:11:21 +01:00