Commit Graph

5880 Commits

Author SHA1 Message Date
Pin-chih Lin 68553688f7 tools: tune: Add tools to generate ctrl bytes for DRC
This commit adds the tools to generate the control bytes for the
drc component. To generate the control bytes, run the example_drc.m
script.

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

This is still WIP. A fixed set of coefficients is temporarily used in
drc_generate_config.m

Signed-off-by: Pin-chih Lin <johnylin@google.com>
2020-10-08 11:51:16 +01:00
Pin-chih Lin 80ef3cf95e tools: topology: Add DRC topology files
This commit adds the topology files for the drc component.
The control bytes are generated by the tools in tune/drc.

Signed-off-by: Pin-chih Lin <johnylin@google.com>
2020-10-08 11:51:16 +01:00
Pin-chih Lin 568f184b49 sof: drc: Add DRC component with floating-point calculations
This commit adds Dynamic Range Compression (DRC) to the list of SOF
components. DRC in audio processing is intentional to reduce the
volume of loud sounds and amplify the silent sounds as compressing an
audio signal's dynamic range.

This is the intermediate implementation with floating-point calculations.

Signed-off-by: Pin-chih Lin <johnylin@google.com>
2020-10-08 11:51:16 +01:00
Curtis Malainey 1b17974b3b dai: include list header
dai header uses lists, lets make sure the header is properly included

Signed-off-by: Curtis Malainey <cujomalainey@chromium.org>
2020-10-07 11:18:23 +01:00
Curtis Malainey 69bded9e30 haswell: add missing header
stdbool is need to define bool types (as used in this header)

Signed-off-by: Curtis Malainey <cujomalainey@chromium.org>
2020-10-07 11:18:23 +01:00
Guennadi Liakhovetski 9e9aeadd7f compile: fix reporting compiler version when built with gcc
Properly retrieve gcc version values and unify the optimisation flag
with Zephyr to always include a '-' in the string. Before this patch
the kernel reports the firmware, built with gcc as

Firmware info: used compiler XCC 12:0:8 xtensa-cnl-elf used optimization flags O2

With this patch it reports

Firmware info: used compiler GCC 8:1:0 xtensa-cnl-elf used optimization flags -O2

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2020-10-06 15:01:00 +01:00
Karol Trzcinski b119fe2c8b ext_man: Add information about runtime memory scan possibility
This component is conditionally compiled, so passing such an
information to driver, allows to check possible scanning failure
reason.

Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
2020-10-06 11:35:04 +01:00
Karol Trzcinski 0aa3e4b4ca ipc: debug: Add KConfig to conditionally compile memory scan feature
This feature is not needed to get functional firmware,
so may be disabled for platforms with low memory space,
like baytrail and cherrytrail.

Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
2020-10-06 11:35:04 +01:00
Karol Trzcinski 64a7d67b3e ipc: debug: Add memory usage probing possibility
This feature will be needed to monitor memory utilization and
memory leaks. It may be usable also in realese builds, so removed
conditional ipc_glb_test_message compilation.

Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
2020-10-06 11:35:04 +01:00
Karol Trzcinski 897152daca ipc: Rename function handling SOF_IPC_GLB_TRACE_MSG
Function name should correspond IPC name.

Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
2020-10-06 11:35:04 +01:00
Karol Trzcinski c4c177069e alloc: Add possibility to read memory usage in runtime
Such a function may be used to monitor memory leaks and system
utilization.

Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
2020-10-06 11:35:04 +01:00
Karol Trzcinski 7c4c3c86e1 ext_manifest: Use ext manifest by default in output image
Add extended manifest at the begin of firmware image,
as a firmware metadata description.

Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
2020-10-06 11:12:35 +01:00
Curtis Malainey f601906d83 host: move drivers and libs out of testbench
In order to support more linux based testing apps lets move the drivers
for the library build into the rest of the source tree so it is easy to
develop additional apps.

Signed-off-by: Curtis Malainey <cujomalainey@chromium.org>
2020-10-06 11:04:38 +01:00
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
Karol Trzcinski 878f15b34a dai: Add warning about possible glitch
DMA should be loaded at least with data for one period
otherwise glitches are supposed to appear. Such a kind of
problem is quite difficult to track, because it may be related
with scheduling in runtime, DSP load, or used buffers size,
so log message pointing such a problem is useful.

Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
2020-10-03 10:29:36 +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
Keyon Jie 242be345ca ssp: fix the RX FIFO flushing logic
To make sure all the RX FIFO entries are read out for the flushing, we
need wait until the SSSR_RNE is cleared after the SSP is disabled (the
SSSR_BSY is cleared, otherwise, there might be obsoleted entry remained
in the FIFO which will impact the next run with the SSP RX and lead to
sample mismatched issue.

BugLink: https://github.com/thesofproject/sof/issues/3428
Cc: Bartosz Kokoszko <bartoszx.kokoszko@linux.intel.com>
Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
2020-10-02 11:35:50 +01:00
Bartosz Kokoszko 01b50b58a2 timer: check whether handler is set before its invocation
This commit adds check whether timer handler is set
in order to avoid unexpected errors.

Signed-off-by: Bartosz Kokoszko <bartoszx.kokoszko@linux.intel.com>
2020-10-02 11:31:07 +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
Guennadi Liakhovetski 94ed4ca325 zephyr: remote the platform_timer_set() wrapper
platform_timer_set() isn't called from Zephyr any more, remote it.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2020-10-01 22:06:40 +01:00
Guennadi Liakhovetski d0235a60dd zephyr: fix timer-domain scheduling
In case more than one client is using the scheduler, the SOF task
can be scheduled significantly later than requested. In such a
case using the current time as a base for re-scheduling is wrong
and leads to xruns. Use Zephyr work queue API instead to query
work schedule time.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2020-10-01 22:06:40 +01:00
Guennadi Liakhovetski b31d19b6c2 zephyr: fix build after a recent trace filter PR
Commit 0e1176d943 ("trace: Update trace level after ipc message")
broke building under Zephyr. Fix the breakage by effectively disabling
functionality, to be properly fixed later.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2020-10-01 22:05:54 +01:00
Bartosz Kokoszko 03b80eaf44 audio: move test components into the src/samples/audio dir
This commit moves all of the template components into
src/samples/audio directory in order to avoid confusion
during 3rd part IP integration process.

Building samples are set by default only from chrome
configs.

Signed-off-by: Bartosz Kokoszko <bartoszx.kokoszko@linux.intel.com>
2020-10-01 10:32:46 +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 d71cfcdca1 trace: Replace comment about log levels values to static assert
Such an assertion guarantee valid condition in filter.

Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
2020-09-30 16:23:35 +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
Janusz Jankowski 15e03fd297 config: intel: use PCH name for tigerlake
We switch to PCH-based names instead of CPU config names for tigerlake+
platforms, because we need to support multiple variants of PCHs based
on one CPU famile - for example TGL-H & TGL-LP.

Signed-off-by: Janusz Jankowski <janusz.jankowski@linux.intel.com>
2020-09-30 12:03:54 +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
Marc Herbert d9eb16aa66 cmake: add warning when git submodule changes are found
As incredible as it sounds, some people run neither "git status" nor
"git diff" every few minutes and not even when their build fails. There
has been reports that they're puzzled when they miss a required
submodule update. This is an attempt to draw their attention based on
the assumption that they pay more attention to the CMake logs.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2020-09-29 11:19:25 +01:00
Adrian Bonislawski 96474cd0f7 ext_man: prevent removal of cavs-specific element
This patch will allow to keep cavs-specific elements

Signed-off-by: Adrian Bonislawski <adrian.bonislawski@linux.intel.com>
2020-09-29 11:08:52 +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
Bartosz Kokoszko d477a83aaa pipeline: adds missing buffer locks/unlocks
In case of changing specific values in buffer structure,
we should use buffer locks an unlocks macros in order
to retain multicore coherence.

Signed-off-by: Bartosz Kokoszko <bartoszx.kokoszko@linux.intel.com>
2020-09-25 13:42:39 +01:00
Jaska Uimonen 89acc5e4f0 docker-run.sh: pass-through PRIVATE_KEY_OPTION
Pass PRIVATE_KEY_OPTION environment variable to docker to be able to
define external key for signing.

Suggested-by: Marc Herbert <marc.herbert@intel.com>
Signed-off-by: Jaska Uimonen <jaska.uimonen@intel.com>
2020-09-25 13:41:33 +01:00
Fred Oh d344fc10cd ext_manifest: fix config name to LPRO_ONLY for cavs
Config name is CONFIG_CAVS_LPRO_ONLY.

Signed-off-by: Fred Oh <fred.oh@linux.intel.com>
2020-09-25 11:52:13 +01:00
Bartosz Kokoszko 5b8b5437d6 pipeline: fix logs in pipeline_comp_params_neg()
Use current->pipeline instead of ppl_data->p as a
pipe_dbg() and pipe_err() arguments. ppl_data->p
is not set at that point and can cause unexpected
errors.

Signed-off-by: Bartosz Kokoszko <bartoszx.kokoszko@linux.intel.com>
2020-09-25 11:35:38 +01:00
Pierre-Louis Bossart f4344e6f13 dai: use inclusive language for mclk
the term 'master clock' is misleading, a 'master clock' can have a
direction per ALSA definitions.

This patch suggests the use of the 'main clock' term instead.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
2020-09-25 10:57:46 +01:00
Pierre-Louis Bossart 676bf603c9 dai: use inclusive language for bclk and fsync
Mirror changes in alsa-lib, use codec_provider (CP) and
codec_consumer (CM)

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
2020-09-25 10:57:46 +01:00
Joseph Burt c4aa4c176b bdw: fix SSP0 channel inversion
This fixes SSP0 swapping channels after capture on BDW

Signed-off-by: Joseph Burt <caseorum@gmail.com>
2020-09-24 14:14:53 +01:00
Karol Trzcinski 3e77840074 rimage: Update submodule to v1.6, commit fccf521, CI updates.
Commit: fccf521: ("travis: Scan patch codestyle")
Commit: e29baaa: ("travis: Use $(...) instead `...` in bash scripts")

Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
2020-09-24 14:13:06 +01:00