Commit Graph

5758 Commits

Author SHA1 Message Date
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
Karol Trzcinski 765e672ba3 preproc: Fix META_MAP functionality
This functionality counldn't handle empty __VA_ARGS__.

Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
2020-09-14 14:10:41 +01:00
Bartosz Kokoszko 47ffafa21e smart_amp: remove hardcoded frame_fmt value
In order to allow stream different audio formats,
the hardcodec frame fmt value should be removed.

Signed-off-by: Bartosz Kokoszko <bartoszx.kokoszko@linux.intel.com>
2020-09-14 14:10:00 +01:00
Kai Vehmanen 73bd5c659f doc: annotate all ABI fields added/changed in 3.17 ABI
Add a "ABImajor.minor" note to inline documentation of all
ABI interfaces that have been added or modified as part of
3.17 interface changes.

Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
2020-09-14 12:07:26 +01:00
Ryan Lee d70bf1785d smart amp: support parameter read/write
Added functions to read/write DSM parameters.
Removed component model data handler and related code
by next reason.
 - The size of DSM tuning bin file is always smaller than
   the size of actual parameter structure. The bin file do not
   include parameter values if it is same to library default to
   keep minimum binary size. The size of bin file is variable.
   Read size was limited to the bin size before modification.
 - Support parameter read even bin data is not set.
   Model data buffer was allocated only when bin data is set
   before modification.

Signed-off-by: Ryan Lee <ryans.lee@maximintegrated.com>
2020-09-14 12:02:55 +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
Seppo Ingalsuo fc5d74fccf Audio: Add Time Domain Fixed Beamformer (TDFB) processing component
This patch adds the multi-microphone beamforming component. It enhances
microphone capture via spatial noise suppression. The component is a
quite generic FIR time domain filter bank and the fixed filter band
needs to be programmed with super directive or other beamformer criteria
filter coefficients. The coefficients are fixed but they can be
re-programmed during run-time.

The component reuses the FIR filter core but has different inputs
selection and outputs mixing features than FIR EQ so it is made a
separate new processing component.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2020-09-13 15:52:24 +01:00
Seppo Ingalsuo ab4a608198 Audio: Move FIR core to math library
This patch enables FIR filter core usage independently from FIR
equalizer component. The inline of FIR core is removed to reduce
the code size when FIR is used from several components. Each
component also typically used inline FIR version for each supported
PCM format that increased further the size.

Most of the changes are due to rename and directory move of some FIR
data structures and macros. The code functionality is not changed.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2020-09-13 15:52:24 +01:00
Keyon Jie 64a1657bdd pipeline: add negotiation before propagating params
For different connected pipelines, they are usually connected via a
component with >1 source or sink buffers, as most of those components
don't have ability to converse frame format or sample rate, we need add
a params negotiation mechanism between those pipelines.

If all buffers are iterated in the params propagation direction, no
negotiation needed, otherwise we need to iterate all other buffers in
the opposite direction, to make sure all connected buffers have chance
to take part in the negotiation.

The negotiation should happen before we can propagate the params
further, when doing negotiation in a branch/buffer, we should check:
If a branch is active, check if params is matched, return error to
reject the whole .params() requirement if not.
If a branch is inactive, force update the params to its calling buffer,
to make sure all branches are aligned on the format.

We are propagating the params to branched buffer, and the subsequent
component's .params() or .prepare() should be responsible to calibrate
the buffer params if needed. For example, a component who has different
channels buffers should explicitly configure the channels for its
branched buffers (the ones connected to another pipeline).

Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
2020-09-10 12:25:50 +01:00
Keyon Jie 968eaf1621 pipeline: add a flag to indicate if the buffer is being traversed
Add a flag 'walking' to the buffer struct, to indicate if the buffer is
just being traversed while walking through the graph, and don't go back
to the buffer which is already walked.

Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
2020-09-10 12:25:50 +01:00
Keyon Jie 2ae18268a8 buffer: add helper to check if buffer format is matched to param
Add a helper buffer_param_match() to check if the configured runtime
buffer frame format/rate/channels are matched to the param ones

Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
2020-09-10 12:25:50 +01:00