Commit Graph

5653 Commits

Author SHA1 Message Date
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
Marc Herbert d194fefbca rimage: update submodule to e67d68e8e1. More warnings fewer crashes
e67d68e8e1 adsp_config.c: actually check error when parsing "version"
             array elements
75f96956e0 elf.c: check ELF32-LE magic number instead of crashing
91bd4fe796 rimage.c: print an error instead of crashing when zero ELF
             argument
82d4767ca5 Stop silently discarding -l option
f4e01789f0 travis: Treat warnings as errors
3b2398a97d travis: Add more warnings to make command

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2020-09-24 10:29:08 +01:00
Seppo Ingalsuo 1d6887f93d Audio: Continue volume ramp until all channels are complete
The volume component works correct when all channels receive the same
gain value in volume set command.

This patch fixes a bug that is triggered by applying different
gain values for the channels. The logic with setting cd->ramp_finished
to true caused the check in volume copy() to no more call volume_ramp()
when one of the channel reached their target volume. When the ramp
updating was stopped all other channels remain in intermediate gain
value.

In the fix the logic is set to opposite. Whenever a channel needs a ramp
update it sets a temporary flag. The ramp finish is set only when
no channels needed gain update.

Fixes #3455

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2020-09-23 16:38:32 +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
Ranjani Sridharan 7bda1c8315 config: cht: remove tone comp
Remove tone from the cht defconfig to reduxe code size.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2020-09-23 11:41:20 +01:00
Ranjani Sridharan 5abdf3778b volume: fix get_cmd() for SWITCH command
Switch controls can only have 0/1 for values. Fix the get_cmd() callback
to return the channel mute status for SWITCH commands instead
of the current volume gain.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2020-09-23 11:41:20 +01:00
Karol Trzcinski cad15f0405 rimage: Use only standard error codes
Error codes like ENOKEY and EBADE are not provide for all windows
toolchains, so to limit possible build errors, some more standard
error codes should be used.
Detailed error message is printed in stderr, so end user still
will be well informed about error root cause.

Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
2020-09-23 10:41:22 +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
Marc Herbert 0a247928bb travis: upgrade distribution to Ubuntu 20.04
The current default Travis default is 16.04 which is obsolete.

From https://github.com/thesofproject/linux/pull/2402

> Everyone uses 20.04, period. SOF CI also uses 20.04.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2020-09-21 10:23:13 +01:00
Marc Herbert aa20048e92 travis: fold long lines; fixes the last yamllint warnings
yamllint clean.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2020-09-21 10:23:13 +01:00
Marc Herbert 6e98d9dde4 CODEOWNERS: really add marc-hb to scripts
Fixes commit 757b13c123 ("CODEOWNERS: scripts/ += marc-hb")

Also add *.bash which we don't use yet but should considering how
not portable is the vast majority of our scripts.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2020-09-19 08:30:29 +01:00
Marc Herbert c40749b981 CODEOWNERS: fix path to dmic.
Fixes commit f545e3e832 ("dmic: move dmic driver out of the cavs
specific directory")'

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2020-09-19 08:30:07 +01:00
Karol Trzcinski 0e1176d943 trace: Update trace level after ipc message
Update process must be splited into two parts - updating global
components, which have trace contect saved in dedicated section
and updating ipc components, where trace contect is part of
particular instance and data.

Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
2020-09-18 16:08:04 +01:00
Karol Trzcinski 82c005c713 ipc: trace: Add trace filter message handling
Message received from host carry information about new log level for
component with pass selected filter values. Filter values are passed
as a set of key-value values, what make it easy to extend in future.
Last element in set must have SOF_IPC_TRACE_FILTER_ELEM_FIN bit set
in key field, to mark end of filter values.
New log level is also obligatory, must be within LOG_LEVEL_CRITICAL
to LOG_LEVEL_VERBOSE range.
It allows to changing trace lelvel for each components in firmware,
on particular pipeline or with particular uuid key with single ipc
command.
Updating trace level is not fully implemented yet.

Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
2020-09-18 16:08:04 +01:00
Marcin Rajwa 7b5365f776 dai: add warning when we skip .copy
This patch logs warning message when we skip dai .copy() method.
Also the condition has been changed, there is no need to compare
positions - if there is nothing to copy we should terminate this
procedure regardless of positions.

Signed-off-by: Marcin Rajwa <marcin.rajwa@linux.intel.com>
2020-09-18 15:58:55 +01:00
Karol Trzcinski dd5a56f37b rimage: Update to version with toml devices description
This allow to add new platform with old version of rimage tool.

Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
2020-09-18 14:19:39 +01:00
Ranjani Sridharan 88b69cc2e5 scripts: xtensa-build-all: Add support for building TGL and signing with MEU
Add support for building TGL FW and signing with MEU tool. Signing
with rimage is not supported atm.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2020-09-18 10:45:28 +01:00
Marc Herbert dfd2336bb2 cmake: empty MEU_OPENSSL param is now the same as not defined
For convenience, let users pass the location of their MEU_OPENSSL tool
even when they don't use it. Silence the corresponding warning.

See https://cmake.org/pipermail/cmake/2011-February/042933.html for the
rationale.

Note this may fail if you install openssl in a relative directory called
"FALSE". Don't do that.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2020-09-18 10:45:28 +01:00
Ranjani Sridharan 9956f6bb55 scripts: xtensa-build-all: add support for override config files
Some platforms needs platform-specific configuration
that override the default config. For example, chrome platforms
need the LPS to be enabled by default for maximizing the
power savings for the WoV feature. Add a -o switch to allow
specifying the override config file.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2020-09-18 10:45:28 +01:00
Ranjani Sridharan 26ca41b55e scripts: xtensa-build-all: print usage when no args passed
Print usage when no arguments are passed to the script.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2020-09-18 10:45:28 +01:00
Marc Herbert 646e562399 travis: remove duplicate and deprecated host-build-all.sh
We already build _and_ run the testbench in the next stage, with the
newer script. No need to build the same thing twice.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2020-09-17 14:48:20 +01:00
Marc Herbert 81b21c33b6 travis: remove deprecated 'sudo: required'
As reported by travis lint:

 [x] [warn] on root: deprecated key: sudo
         (The key `sudo` has no effect anymore.)

Also copy to the top of the file well-tested .travis.yml tips from
sof/linux/.travis.yml

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2020-09-17 14:48:20 +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
Slawomir Blauciak af366cfbd2 kpb: reduce buffer length on non-TGL platforms
Due to memory constraints, the keyphrase buffer cannot be too long.
As a consequence of reducing the buffer,
platform wakeup margin check has to be removed as well,
otherwise the maximum draining request will be very short.

This is a temporary measure,
ultimately the buffer length and wakeup time settings
should be moved to the topology.

Signed-off-by: Slawomir Blauciak <slawomir.blauciak@linux.intel.com>
2020-09-17 09:56:55 +01:00
Marc Herbert 0f4a0e2907 build-tools.sh: remove all the "Entering directory..." noise
This gets rid of about 600 lines of noisy "Entering directory..."
messages which cuts the size of the output of the script in half leaving
only useful stuff on the screen. This (and other changes before it) may
finally avoid bugs like 'commit f430addec7 ("Tools: Fuzzer: Do not use
illegal BUILD_COMMAND in CMakeLists.txt") evading scrutiny for months.

After so many years enjoying the convenience of make's '-C' option, I
finally did some research and realized it is the cause of this very
serious noise issue with no other easy way out :-(

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2020-09-17 09:56:19 +01:00
Janusz Jankowski 8eb6b543d1 cmake: add FIRMWARE_NAME option
Add CMake argument FIRMWARE_NAME that enables setting custom suffix
for output binary.

Example `cmake ... -DFIRMWARE_NAME=custom ...` will save output files as
sof-custom.ri, sof-custom.ldc etc.

Signed-off-by: Janusz Jankowski <janusz.jankowski@linux.intel.com>
2020-09-16 15:57:44 +01:00