Commit Graph

924 Commits

Author SHA1 Message Date
Seppo Ingalsuo 3c073b478f Tools: Test: Fix for sine vector orientations mismatch
The generation of multiple tone frequencies failed due accidental
square matrix generation when mixed row and column vectors were added.
The new version uses only vectors in first dimension and avoids the
problem.

The license text format also is changed to current.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2020-10-05 15:25:00 +01:00
Seppo Ingalsuo b804ccb7c4 Tools: Test: Audio: Add license and help text for TDFB test script
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2020-10-03 10:24:52 +01:00
Seppo Ingalsuo 43923e1fc9 Tools: Test: Audio: Add exist check for array configuration files
The added check and print helps the user to generate the array
configuration data and other beam pattern test related binary files
to carry out this test for TDFB (beamformer) component.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2020-10-03 10:24:52 +01:00
Seppo Ingalsuo ae70f19092 Tools: Test: Audio: Suppress variable prints from TDFB test script
Due to the missing semicolons the variable config_fn got printed
to screen unnecessarily.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2020-10-03 10:24:52 +01:00
Seppo Ingalsuo 51fc4e1220 Tools: Test: Audio: Add missing test utility function
The script to load back to Matlab or Octave the test input data
was missing from previous patch that introduced TDFB (beamformer)
component.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2020-10-03 10:24:52 +01:00
Karol Trzcinski 7f2767ca5e logger: Fix uuid formatting
'p + 2' should be smaller than end pointer, bigger value may leads
to undefined memory region read.
Memmove should include last '\0' char.
Without this fix output looks like:
  task add 0xbe070600 pipe-task 0x1fffa0f0U
After changes:
  task add 0xbe070600 pipe-task <f11818eb-e92e-4082-82a3-dc54c604ebb3>

Fixes: 12f2d9b2c8 logger: Refactor UUID parsing

Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
2020-10-02 11:30:37 +01:00
Karol Trzcinski e3b0aa7103 logger: Fix uuid_dict memory leak
config->uids_dict has never been freed before.
`out` label has been added to perform `uuid_dict`
free before function return.

Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
2020-10-01 10:01:14 +01:00
Karol Trzcinski 5b0b1a3db5 logger: Skip %s from formatting string
Passing %s with random address leads to logger crash.
It's especially important right now, after changing
print formatter for UUID from %s to %pU. It's why
DBG_ABI patch number has been updated.

Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
2020-10-01 10:01:14 +01:00
Karol Trzcinski 12f2d9b2c8 logger: Refactor UUID parsing
Split UUID formatter parsing from general formatter parser,
to make functions shorter and less complicated.
By the way reduce number of loops.

Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
2020-10-01 10:01:14 +01:00
Karol Trzcinski a76d74534a logger: Disable ldc compatibility check for ldc dump operation
LDC with FW compatibility check has no sens for ldc dump operation,
because ldc dump reads only information provided in ldc file,
without engaging any information from FW - can be done offline as well.
Logger and ldc file DBG_ABI compatibility check is still active.

Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
2020-09-30 16:23:35 +01:00
Seppo Ingalsuo 24c2c15f9f Tools: Test: Fix for dBFS level measure for muted audio
The log() function returns -Inf for level measure for stream of
digital zeros. It is correct but requires extra handling in the
upper level functions to avoid unnecessary tests fails. Adding of
offset 1e-20 results to -196.99 dBFS be the smallest possible
reported value. The function remains sufficient for all audio
measurements with 16 - 32 bit formats.

The license text is also updated to current version.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2020-09-30 16:22:39 +01:00
Bard Liao e7adcf5bca topoplgy: add tgl rt715-rt711-rt1308 support
Add tgl rt715-rt711-rt1308 support. But keep the PCM order as
Headphone, Headset mic, Speakers, Microphones.

Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
2020-09-30 16:22:12 +01:00
Yong Zhi d9ce1cb48f tools: sof-ri-info: define memory layout for JSL platform
Add jsl entry to DSP_MEM_SPACE_EXT[].

Signed-off-by: Yong Zhi <yong.zhi@intel.com>
2020-09-30 10:44:45 +01:00
Curtis Malainey fd398c9d5e cmake: allow testbench to build with clang
We need clang support for the testbench therefore the following changes
are needed

remove -ftree-vectorizer-verbose since its deprecated in gcc and not
supported in clang

remove =3 from -Wimplicit-fallthrough=3 since 3 is the default level
anyways

Signed-off-by: Curtis Malainey <cujomalainey@chromium.org>
2020-09-28 10:37:26 +01:00
Karol Trzcinski 52e82f4c66 logger: Refactor fread() error check in logger_read()
fread() returns number of readed blocks, 0 when nothing read.
Comparison fread return value with "!ret" is quite misleading -
may suggests that negative value is returrned after fail.

Swapping if content makes flow easier, then first is error check,
and eventyally return statement, next try to reopen file.
It allows to check error condition only in one place, so there
won't be possibility to use different error checks in subsequent
stages (like ferror() and errno).

in_file alignment with trace entry size check has been added,
to warn about corrupted file.

Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
2020-09-25 13:47:47 +01:00
Karol Trzcinski 1e26ff4dc7 logger: Use 'rb' mode for freopen
Windows platform needs "rb" mode to read binary file,
otherwise after read 0x1A EOF will be. See:
https://stackoverflow.com/questions/11717120/unexpected-return-value-from-fread

Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
2020-09-25 13:47:47 +01:00
Karol Trzcinski adc447e8e4 logger: Check fprintf return value for trace format text
log format text comes from ldc file (may be invalid),
so error check is needed. Don't treat it as fatal error,
because this error may not impact following logs, when
formatting text is root cause of the issue.

Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
2020-09-25 13:47:47 +01:00
Karol Trzcinski 5eb9c49258 logger: Log fread error only when it happened
fread may return 0 when some error occurred or nothig has been reded.
Moreover errno may not be set on Windows plaform, use ferror
instead. See:
https://www.gnu.org/software/gnulib/manual/html_node/fread.html

Fixes: 337afc4f3809: ("logger: add error message when reading sof/etrace instead of sof/trace")

Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
2020-09-25 13:47:47 +01:00
Naveen Manohar 2b54bacdb2 topology: add KWD component into sof-tgl-sdw-max98373-rt5682
Add KWD pipelines with vol-kfpm pipe using intel-generic-dmic-kwd template.
- 48K DMIC still uses PCM-4
- Add 16K DMIC KWD on PCM-5
- Correct few minor pipeline numbers in comments

Signed-off-by: Naveen Manohar <naveen.m@intel.com>
2020-09-23 15:20:10 +01:00
Yong Zhi 4c78e94a08 topology: fix playback & capture pipelines to be timer driven
The patch fixes two SSP pipelines to be scheduled in timer domain.

Signed-off-by: Yong Zhi <yong.zhi@intel.com>
2020-09-23 15:19:35 +01:00
Keyon Jie 20fbbe77e4 topology: pipe-amp-ref-capture: correct the setting of ref channels
The naming should be SMART_REF_CH_NUM and value should be 4 for 4
speakers, correct it.

Fixes: 399b97afe6 ("topology: Modify init params for the Demux Config")
Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
2020-09-23 10:25:17 +08:00
Keyon Jie 739554defa topology: sof-tgl-nocodec-ci: remove KWD pipelines as not available
We can't test KWD on nocodec machines due to the DAPM issues reported
here: https://github.com/thesofproject/linux/issues/1987

Remove KWD pipelines from sof-tgl-nocodec-ci to avoid performing invalid
test on it.

Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
2020-09-22 09:54:22 +01:00
Zhang Keqiao 1336cac019 topology: add s32_le format support to kwd pipeline
KWD pipeline only supports S16_LE and S24_LE formats, S32_LE also
need to be included.

Signed-off-by: Zhang Keqiao <keqiao.zhang@linux.intel.com>
2020-09-17 13:42:31 +01:00
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