Commit Graph

5880 Commits

Author SHA1 Message Date
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
Janusz Jankowski df3c87ce01 config: rename FIRMWARE_SHORT_NAME to RIMAGE_SIGNING_SCHEMA
Old name was misleading, because this config is not used just as name.
It is used to decide how to build and sign FW image.

Signed-off-by: Janusz Jankowski <janusz.jankowski@linux.intel.com>
2020-09-16 15:57:44 +01:00
Marc Herbert f1e2ac936a travis: remove sue creek
Sue Creek support was never completed, stop building it as it may give a
wrong impression.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2020-09-16 15:21:33 +01:00
Marc Herbert 7072eb4447 travis: run build-tools.sh with CMAKE_BUILD_TYPE=Release
For some reason gcc prints more warnings this way and of course CI is
meant to catch warnings as soon as possible.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2020-09-16 15:21:18 +01:00
Marc Herbert 2b9206231c docker-run.sh: pass-through CMAKE_BUILD_TYPE
... thanks to the docker --env option which is smart enough not to pass
anything when there is nothing to pass.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2020-09-16 15:21:18 +01:00
Marc Herbert 1c6930e29f docker-run.sh: fix quoting issues
As reported by shellcheck

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2020-09-16 15:21:18 +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 fa974eb154 host: Make 'no bytes to copy' message more descriptive
It's important to know if theres no bytes because buffers are full/empty
or there is a problem with DMA.

Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
2020-09-15 16:18:41 +01:00
Karol Trzcinski f09ebd7b1f host: Log error with comp_err instead of comp_cl_err
Classless method should be used only when device is not accessible,
component pipeline and id may be useful information during debugging.

Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
2020-09-15 16:18:41 +01:00
Karol Trzcinski 4dee8466d6 ipc: All trace about dispatching ipc to disabled core
It will help in creation multicore system. This trace is much more
descriptive than -EINVAL. Moreover changed return code to -EACCESS
to be more unique and suited.

Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
2020-09-15 16:18:41 +01:00
Karol Trzcinski 9a7e889b34 ipc: Negate error message in ipc_comp_connect()
Error trace is produced only when component NOT exist,
so it should be coherent with log message.
Moreover add full information about connection - source and sink
component id, then it will be easier to find corrupter one.

Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
2020-09-15 16:18:41 +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
Artur Kloniecki 996ffefed4 test: pcm converter: Utilize comp_buffer implementation instead of mocking
Currently pcm converter unit tests use mocked-up audio_stream
implementation which should be replaced with real FW implementation.

Signed-off-by: Artur Kloniecki <arturx.kloniecki@linux.intel.com>
2020-09-15 10:49:24 +02:00
Guennadi Liakhovetski fa5eee2463 zephyr: fix iir and fir file renaming
Two recent commits moved and renamed some of eq-iir and eq-fir files,
without updating zephyr cmake files.

fixes ab4a608198 ("Audio: Move FIR core to math library")
fixes baa43558f6 ("sof: math: move iir_df2t function to src/math")
Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2020-09-15 09:40:23 +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
Karol Trzcinski 63fe935dce trace: Limit META_RECURSE depth level to 8
There is any user in source code who need deeper recursion level,
reducing it allow to prevent compiler error message flood during
working with META_RECURSE clients (eg. trace system).

Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
2020-09-14 14:10:41 +01:00
Guennadi Liakhovetski 114bbcec9c trace: use proper pointer formats
The PP_NARG() macro can only handle integer type arguments, use
META_COUNT_VARAGS_BEFORE_COMPILE() instead to avoid having to cast
pointer types to integers.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2020-09-14 14:10:41 +01:00
Karol Trzcinski 07d56ef920 trace: Validate input arguments size
Trace system support arguments no larger that uint32_t,
so this condition should be checked for each trace.
Create separate CT_ASSERT, because of need to have
multiple instances of assertions with the same error
message, what is not possible for STATIC_ASSERT.
STATIC_ASSERT has better message printing, so
it's not replaced by new version.

Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
2020-09-14 14:10:41 +01:00
Guennadi Liakhovetski 02819769ac trace: fix 64-bit printing
SOF tracing can only handle up to 32-bit long values, attempts to
trace 64-bit values produce unpredictable results. Fix such cases
by making sure values are within range and casting them to 32 bits.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2020-09-14 14:10:41 +01:00