Commit Graph

5574 Commits

Author SHA1 Message Date
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
Ryan Lee d4109e090f smart amp: VI data seqeunce swap
Sequence of VI(Voltage and current) sensing data is changed from
IVIV to VIVI. Swapped VI sequence to supply proper data format
to DSM library.

Signed-off-by: Ryan Lee <ryans.lee@maximintegrated.com>
2020-09-09 12:12:09 +01:00
Ryan Lee 728a482a79 smart amp: Integrated Maxim DSM library functions
Added Maxim DSM integration code.

Signed-off-by: Ryan Lee <ryans.lee@maximintegrated.com>
2020-09-09 12:12:09 +01:00
Ryan Lee 3eb1f37f50 smart amp: Disable Maxim smart amp component as default
This commit disable Maxim smart amp component as default.
This change will remain until DSM library and its license file are merged.

Signed-off-by: Ryan Lee <ryans.lee@maximintegrated.com>
2020-09-09 12:12:09 +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
Artur Kloniecki a5b1d51b80 test: selector: Utilize real buffer implementation instead of mocking.
Currently selector unit tests mock audio_stream by hand, which
adds maintenance overhead in case of changes in audio_stream
implementation, which are under way.

Signed-off-by: Artur Kloniecki <arturx.kloniecki@linux.intel.com>
2020-09-08 12:38:57 +02:00
Artur Kloniecki 4f952a3868 test: volume: Utilize real buffer implementation instead of mocking.
Currently volume unit tests mock buffer components by hand, which
adds maintenance overhead in case of changes in buffer implementation,
which are under way.

Signed-off-by: Artur Kloniecki <arturx.kloniecki@linux.intel.com>
2020-09-08 12:38:57 +02:00
Artur Kloniecki 2d1b17a55e test: buffer: read and write to buffer byte by byte.
Currently buffer is filled by memcpy_s and verified by memcmp, which
would require more UT maintenance during upcoming buffer changes.
With this change, usage of the buffer better reflects real-life usage.

Signed-off-by: Artur Kloniecki <arturx.kloniecki@linux.intel.com>
2020-09-08 12:38:57 +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
Jaska Uimonen 666f467ad7 testbench: Add definition for token SOF_TKN_COMP_UUID
This patch adds the token into header file tokens.h. It is used for
topology parsing for testbench and. The same token has been already
defined in topology m4 macros.

Signed-off-by: Jaska Uimonen <jaska.uimonen@intel.com>
2020-09-07 12:04:28 +01:00
Bartosz Kokoszko 375f84473f eq: updates set/get cmd handling with generic implementation
This commit reverts eq fir and iir set/cmd actual implementations
and makes them use generic component data blob functions.

Signed-off-by: Bartosz Kokoszko <bartoszx.kokoszko@linux.intel.com>
2020-09-07 10:54:19 +01:00
Bartosz Kokoszko a918d9fbb4 comp: updates model functions with more generic implementation
This commit refines component model functions in order to allow
component reconfiguration during the streaming (implementation
is based on equalizer set and get methods). It implements new
comp_is_new_data_blob_available() to check whether new data
blob is available. User can fetch pointer to data blob by
using comp_get_data_blob() function.

Signed-off-by: Bartosz Kokoszko <bartoszx.kokoszko@linux.intel.com>
2020-09-07 10:54:19 +01:00
Slawomir Blauciak c59b513eaf dai: fix an uninitialized variable
Issue detected by Klocwork.

Signed-off-by: Slawomir Blauciak <slawomir.blauciak@linux.intel.com>
2020-09-04 13:52:52 +01:00
Janusz Jankowski 0887c10ed8 github: remove @tlauda from CODEOWNERS
@tlauda is no longer a maintainer in SOF project.

Signed-off-by: Janusz Jankowski <janusz.jankowski@linux.intel.com>
2020-09-04 13:36:37 +01:00
Liam Girdwood ef1560cb13 zephyr: agent: Use Zephyr clocks and complain more loudly.
Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2020-09-04 13:34:07 +01:00
Janusz Jankowski 913919ae54 cpu: rename master core to primary
Change name of slave core to secondary core in order to
make terminology in SOF more inclusive.

Signed-off-by: Janusz Jankowski <janusz.jankowski@linux.intel.com>
2020-09-04 13:32:59 +01:00
Janusz Jankowski b49257b7f0 cpu: rename slave core to secondary
Change name of slave core to secondary core in order to
make terminology in SOF more inclusive.

Signed-off-by: Janusz Jankowski <janusz.jankowski@linux.intel.com>
2020-09-04 13:32:59 +01:00
Liam Girdwood 9b16cb4faf zephyr: cavs: disable memory PM for secondary cores.
Zephyr has it's own memory map for secondary cores. Memory
PM isn't implemented on them yet.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2020-09-03 11:53:12 +01:00
Liam Girdwood 65b9afb42f zephyr: dont use uncache region for zephyr yet
Disable use of uncache region on Zephyr until it's ready.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2020-09-03 11:53:12 +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
Sebastiano Carlucci 7df7c0ff9d sof: crossover: Add Crossover component
This commit adds Crossover to the list of SOF components. A crossover
filter can be used to split an input to different frequency bands.
The number of outputs should be set statically in the topology. The user
then uses the control bytes to route the frequency bands to different
outputs. (similar to the demux component).

This commit adds support for the following formats:
- S16_LE
- S24_LE
- S32_LE

Signed-off-by: Sebastiano Carlucci <scarlucci@google.com>
2020-09-02 14:31:25 +01:00
Pin-chih Lin baa43558f6 sof: math: move iir_df2t function to src/math
Moved iir_df2t() from src/audio/eq_iir to src/math as a common library for
IIR and Crossover usage.

Signed-off-by: Pin-chih Lin <johnylin@google.com>
2020-09-02 14:31:25 +01:00
Guennadi Liakhovetski 5777ef7903 uuid: use proper UUID trace format
Use "%pU" for all UUID traces, it will print lower case 'a'-'f'
hexadecimal digits and use little endianness by default.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2020-09-02 14:13:15 +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
Ryan Lee e85cbf5ea6 smart amp: modified UUID for the Maxim DSM component
Updated new UUID for the Maxim DSM component.
New component UUID : 0cd84e80-ebd3-11ea-adc1-0242ac120002

Signed-off-by: Ryan Lee <ryans.lee@maximintegrated.com>
2020-09-02 11:13:47 +01:00
Guennadi Liakhovetski 1820da7514 trace: remove a superfluous variable initialisation
Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2020-09-01 16:44:33 +01:00