Commit Graph

882 Commits

Author SHA1 Message Date
Marc Herbert 9dc763f782 testbench/cmake: don't hardcode the BUILD_COMMAND
ExternalProject() preserves the existing BUILD_COMMAND

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2021-01-18 16:11:46 +00:00
Pan Xiuli a571fdb8e9 tools: sof_ri_info: add EHL support
Add EHL prod key
Add EHL memory layout

Signed-off-by: Pan Xiuli <xiuli.pan@linux.intel.com>
2021-01-12 22:16:44 +00:00
Pan Xiuli 06d126f8f4 tools: sof_ri_info: update TGL memory layout
change old TGL to TGL-LP, add new TGL-H

Signed-off-by: Pan Xiuli <xiuli.pan@linux.intel.com>
2021-01-12 22:16:44 +00:00
Pan Xiuli 0767ffaf85 tools: sof_ri_info: fix memory layout match
For sof-tgl.ri and sof-tgl-h.ri the old match function will
always return tgl layout. Add suffix in match to make sure
we always match the right name.

Signed-off-by: Pan Xiuli <xiuli.pan@linux.intel.com>
2021-01-12 22:16:44 +00:00
Pan Xiuli 586caa79f5 tools: sof_ri_info: add new community key for TGL+ platforms
Add the 3K community key for TGL+ platforms.

Signed-off-by: Pan Xiuli <xiuli.pan@linux.intel.com>
2021-01-12 22:16:44 +00:00
Pan Xiuli 5ebf036d01 tools: sof_ri_info: update the full_bytes usage
make the full_bytes can output bytes in format we need in
KNOWN_KEYS

Signed-off-by: Pan Xiuli <xiuli.pan@linux.intel.com>
2021-01-12 22:16:44 +00:00
Hans de Goede e862e25a9c topology: Add sof-cht-nau8824 topology file
Add a topology file for Cherry Trail boards with a NAU8824 codec.
These setups work with the standard settings from sof-byt-codec.m4.

This has been tested on the following devices:

Medion E2215T:   stereo speakers, analog mic
Medion E2228T:   stereo speakers, stereo digital mics
Cube iWork8 Air: mono speaker, analog mic

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2021-01-11 16:27:47 +00:00
Keyon Jie b50d496958 topology: sof-tgl-max98373-rt5682: use 32bit dai and 24.576MHz mclk
To align with maxim 98373 12.288MHz bclk requirement, change rt5682 to
32bit with BCLK 3.072MHz.

To follow the rule that the MCLK should use the same clock source with
BCLK, change the mclk to 24.576MHz.

Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
2021-01-07 14:10:55 +00:00
Daniel Baluta 85fd815f86 tools: Add cmake toolchain file for cross compilation on arm64
We need this to cross-compile sof-logger for arm64.

Steps:
	* download and install cross-compiler
	* (e.g on Ubuntu: sudo apt-get install gcc-aarch64-linux-gnu)
	* mkdir tools/build/
	* cd tools/build/
	* cmake .. -DCMAKE_TOOLCHAIN_FILE=../scripts//cross-arch64.cmake
	* make sof-logger

Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
2021-01-07 07:16:17 +00:00
Daniel Baluta 101912b934 logger: Reduce one level of indentation
There is one extra level of identation for all the
code inside format_file_name function.

Remove that to enhance readability.

Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
2021-01-05 17:23:26 +00:00
Seppo Ingalsuo b814953647 Tools: Topology: Change volume demux playback ramp length to 20 ms
The earlier length 250 ms is quite long and makes very short UI
tones etc. quite silent. The 20 ms long ramp with zero crossings
detect is used in rest of this topology for playback so this is
changed to similar.

The topologies those use the changed macro are:
sof-icl-rt711-rt1308-rt715-hdmi.m4, sof-apl-demux-pcm512x.m4,
sof-tgl-max98357a-rt5682.m4, sof-cml-demux-rt5682.m4, and
sof-tgl-nocodec-ci.m4.

Fixes: #3707

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2021-01-05 17:34:39 +08:00
Pin-chih Lin 97e0d50f5f tools: testbench: Add Multiband DRC component test
Signed-off-by: Pin-chih Lin <johnylin@google.com>
2020-12-28 13:19:54 -08:00
Pin-chih Lin 9dc85454be tools: tune: Add tools to generate ctrl bytes for Multiband DRC
This commit adds the tools to generate the control bytes for the
multiband_drc component. To generate the control bytes, run the
example_multiband_drc.m script.

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

Signed-off-by: Pin-chih Lin <johnylin@google.com>
2020-12-28 13:19:54 -08:00
Pin-chih Lin eb4b124a9a tools: topology: Add Multiband DRC topology files
This commit adds the topology files for the multiband_drc component.
The control bytes are generated by the tools in tune/multiband_drc.

Signed-off-by: Pin-chih Lin <johnylin@google.com>
2020-12-28 13:19:54 -08:00
Marcin Rajwa 82bddf6cb8 topology: increase buffer sizes off post processing
This patch increases buffer periods of all components on a
post processing pipeline. This is needed because post processing
may introduce deep buffering and hence needs more space in its
buffers.

Signed-off-by: Marcin Rajwa <marcin.rajwa@linux.intel.com>
2020-12-18 16:23:42 +00:00
Marcin Rajwa 2b17a8605d topology: add missing C_CONTROLBYTES for post processing
This patch adds C_CONTROLBYTES for runtime parameters of
post processing topology.

Signed-off-by: Marcin Rajwa <marcin.rajwa@linux.intel.com>
2020-12-18 16:23:42 +00:00
Jaska Uimonen 589055d38a topology: fix setting mux uuid in m4
Currently the mux/demux uuid setting doesn't work and uuid is always set
to "demux". Fix this by quoting the ifelse in 1 line.

Signed-off-by: Jaska Uimonen <jaska.uimonen@intel.com>
2020-12-18 12:44:31 +00:00
Seppo Ingalsuo 51b64f460a Tools: Tune: Add variable initialize to EQ blobs plotter
This fix adds initialization and declaration of variable f_single
to avoid a previously overlooked error when accessing it in the
end of script. It produces the plot but with a warning print.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2020-12-15 13:39:06 +00:00
Jaska Uimonen fc9b89ad8b topology: add enum control
Add m4 macros to generate enumerated control. Usage is similar to mixer
and bytes control except enumerated values are specified using separate
text section.

Signed-off-by: Jaska Uimonen <jaska.uimonen@intel.com>
2020-12-10 22:30:42 +00:00
Curtis Malainey 6823206761 oss-fuzz: add seed corpus
There are simply a dump of a series of messages from the kernel of
messages sent to the firmware. This will be used by the fuzzer to infer
inputs to tests against the the firmware.

Signed-off-by: Curtis Malainey <cujomalainey@chromium.org>
2020-12-10 22:26:25 +00:00
Curtis Malainey 0a7df45e87 library: add trace and shared memory region
Trace is enabled by default for library builds, but the module is not
included. This breaks the ipc handler. Therefore lets include it and
give it a mocked section of memory to write to.

Signed-off-by: Curtis Malainey <cujomalainey@chromium.org>
2020-12-10 22:26:25 +00:00
Curtis Malainey 44c72a4f25 library: refactor init sequence
The fuzzer is makings its way into a lot places where we assume hw
configs exist. Therefore a refactor is needed make it easy to fill in
the missing configs.

Signed-off-by: Curtis Malainey <cujomalainey@chromium.org>
2020-12-10 22:26:25 +00:00
Keyon Jie aeea2b0935 topology: smart_amp: restrict channel number of PCM capabilities
Both the playback and capture PCMs should be restricted to the
corresponding SMART_PB_CH_NUM and SMART_REF_CH_NUM, as running them with
other channel numbers will not work correctly.

Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
2020-12-07 11:44:16 +00:00
Seppo Ingalsuo cc1cd8a4af Tools: Test: Fix Matlab compatibility in process_test.m
The set of figure property in figure() command is not supported
in Matlab. The separate set() property works for both Octave and
Matlab.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2020-12-03 20:43:31 +00:00
Brent Lu 65217991dd topology: sof-tgl-max98357a-rt5682: support rt1011 amp
Add a macro 'CODEC' to generate topology for rt1011 speaker amp.
Add a macro 'FMT' to seperate speaker dai format: s16le, s24le
Modify both pcm name by 'Speakers'

Signed-off-by: Brent Lu <brent.lu@intel.com>
Signed-off-by: Mac Chiang <mac.chiang@intel.com>
2020-12-03 10:49:42 +00:00
Sathyanarayana Nujella 12ce388775 topology: sof-smart-amplifier: update speaker amp ssp DAI configuration
Speaker amp's SSP tdm & clock is configured for 32-bit, accordingly
update DAI configuration to s32_le.

Signed-off-by: Sathyanarayana Nujella <sathyanarayana.nujella@intel.com>
2020-12-02 21:44:16 +00:00
Artur Kloniecki 5d9ae0de93 logger: Decode %pQ format specifiers as log entries.
To allow proper display of suppressed message info traces, %pQ specifier
was chosen to decode pointers to log entries.
Helper function asprintf_entry_text() is used to handle the log entry
text for display.

Signed-off-by: Artur Kloniecki <arturx.kloniecki@linux.intel.com>
2020-11-27 15:10:46 +00:00
Guennadi Liakhovetski fe66007d4d testbench: file.c calls free(), it must include stdlib.h
Add the missing stdlib.h include to file.c.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2020-11-21 16:22:54 +00:00
Daniel Baluta 8a8e8736a8 topology: imx8: Add memory caps for i.MX8 platforms
This adds memory capabilities macros for different buffer
types on i.MX8.

Once we started to enable more complex pipelines
on i.MX8 we found out that we need these caps defined.

Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
2020-11-21 13:50:56 +00:00
Seppo Ingalsuo da9e0d3c41 Tools: Tune: Add tool for DMIC FIR filters setup
This patch adds the the Matlab script dmic_init() that simulates
initialization of the Intel PDM digital microphones decimation
block. The tool computes the needed FIR filters and exports
them as C header files. The script dmic_batch computes all the
currently used decimation settings.

The generated header files from subdirectory include need to be
manually copied to src/include/sof/audio/coefficients/pdm_decim/
and the header file pdm_decim_table.h edited manually if the
header file names were changed due to different filter characteristic
(band frequencies, stop-band attenuation).

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2020-11-20 11:42:24 +00:00
Fred Oh 2dcb2ebe1d topology: cnl-nocodec: update data format in comment
Updated s24le data format in comment to match with actual value.

Signed-off-by: Fred Oh <fred.oh@linux.intel.com>
2020-11-18 11:10:04 +00:00
Fred Oh ceabe95d6b topology: icl-nocodec: enable more SSP and DMIC pipelines
Previously sof-icl-nocodec topology only enabled SSP0. To effectively test
more test cases, this enables more playback and capture pipelines with
SSP1, SSP2 and DMIC3.

Signed-off-by: Fred Oh <fred.oh@linux.intel.com>
2020-11-18 11:10:04 +00:00
Keyon Jie 50b7b3bc06 tools/README: update comment for testbench building
The host-build-all.sh is deprecated, update to the recommended
'rebuild-testbench.sh'.

Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
2020-11-11 14:16:19 +08:00
Pin-chih Lin 91998d7d01 sof: drc: Use one_over_attack_frames in replace of attack_frames
Replaced the config coefficient "attack_frames" by "one_over_attack_frames"
(=1/attack_frames). It is because only "one_over_attack_frames" is used by
firmware and it could save a division operand by the replacement.

Signed-off-by: Pin-chih Lin <johnylin@google.com>
2020-11-10 18:38:57 -08:00
Marcin Rajwa a6a11d8e65 topology: add C_CONTROL to codec processing topology
This patch extends codec processing topology with C_CONTROLS
which comprises of SETUP configuration for both SoF component
and CADENCE codec.

Signed-off-by: Marcin Rajwa <marcin.rajwa@linux.intel.com>
2020-11-09 22:14:38 +00:00
Marcin Rajwa aacbe98768 topology: add simple topology with codec processing
This patch adds a processing topology which uses external
codec for processing. This topology comprises of:

HOST -> CODEC_ADAPTER -> DAI

So the only processing component is codec_adapter which can be
configured to work with any codec.

Signed-off-by: Marcin Rajwa <marcin.rajwa@linux.intel.com>
2020-11-09 22:14:38 +00:00
Marcin Rajwa 09dadff771 topology: add codec_adapter component
This patch adds codec_adapter component in the topology
of SoF.

Signed-off-by: Marcin Rajwa <marcin.rajwa@linux.intel.com>
2020-11-09 22:14:38 +00:00
Marc Herbert 3de29dac2a testbench: make lib_table actually global and stop passing it around
This fixes compilation with:

  CFLAGS=-fno-common ./scripts/rebuild-testbench.sh

  sof/tools/testbench/topology.c:24: multiple definition of `lib_table';
  sof/tools/testbench/testbench.c:39: first defined here

This was detected by Gentoo 10 which uses -fno-common by default, thanks
Guennadi for the report and investigation.

Commit 03067c6c77 ("host: set up shared library table") introduced a
strange "lib_table" symbol that was apparently meant to be global but
was not really because of some confusion between arrays and pointers and
needed to be passed around and "initialized to itself" (!) at run time
as seen in the sample trace below:

topology.c

struct shared_lib_table *lib_table;

parse_topology(..., library_table,...)
{

        printf("DEBUG1 ----- %p, %p, %p\n",
                  &lib_table,     lib_table,      library_table);

        lib_table = library_table;

        printf("DEBUG2 ----- %p, %p, %p\n",
                 &lib_table,      lib_table,      library_table);

}

Log:

    DEBUG1 ----- 0x56298c954040, 0x56298c951183, 0x56298c954040

    DEBUG2 ----- 0x56298c954040, 0x56298c954040, 0x56298c954040

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2020-11-05 23:09:35 +00:00
Pin-chih Lin 51c034c408 tools: tune: Generate ctrl bytes from params for DRC
Used the similar parameter set as the DRC kernel in CRAS to generate ctrl
bytes for DRC component.

Plotted input-output dB response curve with the specific parameter set.

Signed-off-by: Pin-chih Lin <johnylin@google.com>
2020-11-05 11:35:40 -08:00
Seppo Ingalsuo 0963d88ba3 Tools: Tune: TDFB: Simplify typical usage of bf_design(), bf_export()
The bf_defaults() now sets the default directory locations for
for bf_export() so it does not need to be set in every script.

Also the defaults for input channels and output mixing are set to
that in typical design they do not need to be set.

The default distance for look direction is set to 5.0m so it is better
guaranteed in far field for even relatively large arrays. The far field
assumes planar sound waves. The design equations do not fully support
near field with spherical waves.

The FFT length is changed to 1024 to enable design of longer filter bank
filters. There's no compromise in performance for for e.g. length 64.

The incorrect use of mic_n (number of microphones) is replaced by
num_filters. It's possible define beamformer that ignores some mic
channels so these are not the same.

The automatic systematic design file names are now created for all array
types, not just line.

The script is made more flexible to run without need to export data and
clutter just to quickly interactively check from plots what kind of
beam pattern and other characteristic some array, e.g. circular with
some radius and mic count gives.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2020-10-30 13:45:29 +00:00
Seppo Ingalsuo db47e28154 Tools: Test: Audio: Cleanup for TDFB component test script
The common array identifier string is brought up for easier edit to
test other array geometries than this default. A typo about 16 kHz
is fixed, the test runs at 48 kHz testbench default rate.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2020-10-30 13:45:29 +00:00
Seppo Ingalsuo d88e36987b Tools: Tune: TDFB: Fix typo in copyright text year
This patch fixes the small mistake.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2020-10-30 13:45:29 +00:00
Seppo Ingalsuo bede56972c Tools: Tune: TDFB: Updates for array geometry helpers and add 3D array
This patch adds the missing XYZ 3D array helper and does minor fixes
for two others. The L-shape microphones orientation is made similar as
in rectangular array by inverting the y-axis. The missing centering
of rectangular array is added.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2020-10-30 13:45:29 +00:00
Curtis Malainey 1d028ab9c1 fuzz_ipc: use calloc instead of malloc for ipc region
The memory sanitzer catches uninitialized value errors on the size check
for small data sizes. Therefore lets us calloc so we can assume the
whole region exists without having the sanitizer get upset.

Signed-off-by: Curtis Malainey <cujomalainey@chromium.org>
2020-10-29 15:55:41 +00:00
Karol Trzcinski 9e131360fc logger: Check for unused arguments
There is no place for unused arguments, their are consequence of invalid
argument list as usual.
Such an situation is highly possible especially during defining trace
filters, eg `-Fv=mux 4.1` instead `-F"v=mux 4.1"` or `-Fv=mux4.1`.

Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
2020-10-21 11:48:19 +01:00
Pan Xiuli 2fe7c89489 logger: change the usage string for filter
Change the misleading usage info for filter.
Add format as tips for filter string.

Signed-off-by: Pan Xiuli <xiuli.pan@linux.intel.com>
2020-10-20 11:08:20 +01:00
Pan Xiuli b804e1df7e logger: fix opt for filter parameter
The -F filter option has argument, we should use
F: instead of F in the optstring.

Fixes: #3530

Signed-off-by: Pan Xiuli <xiuli.pan@linux.intel.com>
2020-10-20 11:08:20 +01:00
Karol Trzcinski 1ad0269f5d logger: Fix log_err usage at early stages of sof-logger run
This function could fail when called before convert()

Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
2020-10-20 10:41:17 +01:00
Yong Zhi 2de506025f topology: sdw: Update echo ref channel number on max98373
The topology has two speaker amp configured, with voltage info
feedback-ed to host for each channel in the EchoRef, so update
SMART_REF_CH_NUM accordingly.

Signed-off-by: Yong Zhi <yong.zhi@intel.com>
2020-10-20 10:38:06 +01:00
Curtis Malainey 955201897d oss-fuzz: add ipc fuzzer
Add shim to fuzz the full ipc space with

Signed-off-by: Curtis Malainey <cujomalainey@chromium.org>
2020-10-20 09:28:28 +01:00