Commit Graph

4753 Commits

Author SHA1 Message Date
Payal Kshirsagar 22be53b98a test: cmocka: src: avoid NULL comparison
Replace NULL comparison with boolean negation. Issue found using
Coccinelle.

Signed-off-by: Payal Kshirsagar <payalskshirsagar1234@gmail.com>
2020-03-27 10:50:52 +01:00
Marcin Maka e197132dad comp: dox: correct old RZONE_RUNTIME name
Old name was overlooked in the component API documentation.
Corrected to SOF_MEM_ZONE_RUNTIME.

Signed-off-by: Marcin Maka <marcin.maka@linux.intel.com>
2020-03-27 10:43:23 +01:00
Marcin Maka 2d96e3978d alloc: dox: document the header
This header is an important part of API used frequently
by the developers and must be documented and referred
by the sof-docs.

Signed-off-by: Marcin Maka <marcin.maka@linux.intel.com>
2020-03-27 10:43:23 +01:00
Marcin Maka 36e58d279b alloc: replace r- macros with renamed functions
Once the debug version of allocation functions are removed,
macros may be replaced with functions declared without leading
_ which makes the documentation (and the header) more readable,
the defines section does not need to contain doubled documentation
of alloc api.

bzero macro is not esasily removable due to include deps which
bring earlier declaration of non-inline prototype.

Signed-off-by: Marcin Maka <marcin.maka@linux.intel.com>
2020-03-27 10:43:23 +01:00
Seppo Ingalsuo 8320376ab4 Testbench: Fix segfault in pipeline_new() in topology parsing
This patch fixes the crash by adding initialize of sof->pipeline_posn
into pipeline initialization code.

Also the in load_pipeline() function the pipeline is initialized
to zeros to prevent random values to be passed in not set
struct fields. It didn't fix anything but makes debugging of crash
easier.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2020-03-27 10:40:37 +01:00
Payal Kshirsagar 4bbdef7c16 src: probe: fix line exceeding 80 characters
Fix checkpatch warning of line over 80 characters.

Signed-off-by: Payal Kshirsagar <payalskshirsagar1234@gmail.com>
2020-03-27 10:39:14 +01:00
Marc Herbert 483c26e7a1 panic: add __attribute__((noreturn)) #if __GNUC__
Commit 9e1a2b251a ("panic: noreturn attribute for scan build")

 added ((analyzer_noreturn)) but only for clang.

Fixes at least these two -Werr CONFIG_PROBE=y build failures and
probably similar others with a different .config or in the future:

   sof/src/probe/probe.c: In function 'probe_cb_produce':
   sof/src/probe/probe.c:635:11: error: 'valid_bytes' and
   'container_bytes' may be used uninitialized in this function
   [-Werror=maybe-uninitialized]

Build failure reproduced with xtensa-apl-elf-gcc (crosstool-NG
1.23.0.440-3b8c) 7.3.0

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2020-03-27 10:26:56 +01:00
Marc Herbert ba38c7d750 Testbench: panic() calls abort()
... as opposed to doing nothing and returning.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2020-03-27 10:26:56 +01:00
Marc Herbert 9b1b6158e3 tplg_parser: fix -Werror=maybe-uninitialized source, sink
Fixes:

tplg_parser.c: In function ‘tplg_load_graph’:
tplg_parser.c:979:2: error: ‘sink’ may be used uninitialized
                     in this function [-Werror=maybe-uninitialized]
  979 |  printf("loading route %s -> %s\n", source, sink);
      |  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2020-03-26 21:00:19 +00:00
Marc Herbert e73344a736 scripts: build-all: warn when ignoring unknown arguments
Example:

 $ ./scripts/xtensa-build-all.sh -j3
 ./scripts/xtensa-build-all.sh: WARN: ignoring arg -j3

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2020-03-26 16:51:29 +00:00
Sebastiano Carlucci 60fc730003 tools: testbench: Include dcblock in testbench
This commit adds support for running test for dc blocker.

Signed-off-by: Sebastiano Carlucci <scarlucci@google.com>
2020-03-26 16:49:37 +00:00
Sebastiano Carlucci 2a5d1c41b9 sof: configs: Default DCB to n for cht and byt
The memory size for cht and byt is too small to include the DC Block
module. If the user wants to use it, they will have to disable some
other components.

Signed-off-by: Sebastiano Carlucci <scarlucci@google.com>
2020-03-26 16:49:37 +00:00
Sebastiano Carlucci 0cf80e2d32 tools: test: Add DC Block test case to tplg-build
This commit includes a new test case in tplg-build.sh. It also includes
the new simple pipelines pipe-dcblock-capture/playback. Those new
pipelines are used by tplg-build.sh to generate the test pipelines.

Signed-off-by: Sebastiano Carlucci <scarlucci@google.com>
2020-03-26 16:49:37 +00:00
Sebastiano Carlucci c6f83acd0e tools: tune: Add tools to generate bytes control
This commits adds the scripts to generate the bytes control blob
for the DCB. It also provides some generic scripts to convert
valid binary blob to a csv or binary file (usable by sof-ctl)
or an m4 byte control topology file.

This commit adds two new folders under tools/tune
- dcblock: scripts to generate the blob in Octave
- common: scripts to convert any generic blob to a config file.

Signed-off-by: Sebastiano Carlucci <scarlucci@google.com>
2020-03-26 16:49:37 +00:00
Sebastiano Carlucci eae636c4ff sof: dcblock: Add DC Blocking Filter Component
This change provides a DC Blocking Filter (DCB) component. A DCB is a
high-pass filter used to remove any DC offset from a signal. The
coefficients for the component can be set individually for each channel.

Currently, only the following formats are supported:

s16_le
s24_le
s32_le

Signed-off-by: Sebastiano Carlucci <scarlucci@google.com>
2020-03-26 16:49:37 +00:00
Payal Kshirsagar 9d9620ae05 src: drivers: intel: baytrail: replace bit shifting with BIT macro
Change suggested by coccinelle.
Replace bit shifting on 1 with the BIT(x) macro.

Signed-off-by: Payal Kshirsagar <payalskshirsagar1234@gmail.com>
2020-03-26 14:45:19 +01:00
Iulian Olaru 0bd34f5486 math: Make binary gcd work with negatives
This patch makes the binary gcd algorithm work for negative
numbers by turning them into positive ones. Works since
gcd(a, b) = gcd(-a, -b) = gcd(-a, b) = gcd(a, -b)

Signed-off-by: Iulian Olaru <iulianolaru249@yahoo.com>
2020-03-26 12:12:55 +00:00
Iulian Olaru 303ed59e87 test: Add extra tests fot gcd
This patch adds extra tests for the gcd of
(0, 0), (a, 0), (0, b), (-a, -b), (-a, b), (a, -b)

Signed-off-by: Iulian Olaru <iulianolaru249@yahoo.com>
2020-03-26 12:12:55 +00:00
Iulian Olaru ea9aebfa7a math: Replace the gcd algorithm
This patch replaces the former gcd algorithm which was implemented with
repetitive divisions with Stein's algorithm, whitch is a faster gcd
algorithm. All operations are arithmetic shifts, comparisons and
subtractions.

Signed-off-by: Iulian Olaru <iulianolaru249@yahoo.com>
2020-03-26 12:12:55 +00:00
Marc Herbert ffedf5be56 scripts: build-all: postpone VERBOSE decision to "make" time
CMAKE_VERBOSE_MAKE was sometimes "hardcoding" the decision in CMake's
cache. Move that decision to the make invocation.

After running xtensa-build-all.sh [-v], it's now possible to choose
again whether "make -C build_apl_gcc/" should be VERBOSE or not without
starting from scratch and with the exact same configuration.

Before this commit it was possible for make to decide again after a
non-verbose xtensa-build-all.sh but not possible to decide again after a
verbose xtensa-build-all.sh... very confusing.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2020-03-26 12:10:38 +00:00
Karol Trzcinski 93f8859148 sof: trace: Remove error prefix from logs
This prefix is added in logger converter, so it shouldn't be
added manually.

Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
2020-03-26 11:56:20 +00:00
Fred Oh f734991fbe topology: enable eq pipeline when EQ is enabled in makefile
Instead of making new files for audio equalizer topology, reuse existing
topology and replace only volume pipeline by macro replacement.

Signed-off-by: Fred Oh <fred.oh@linux.intel.com>
2020-03-26 10:18:11 +00:00
Marcin Maka 2627dd47d8 alloc: deduplicate allocation debug traces
There is no need for that many macros in the header.
The optional debug code can be inserted into the allocation
functions.

There is no need for dedicated debug trace functions for
runtime and buffer heaps. Merging the parameter setup
into switch inside a single alloc_trace_heap() function
reduces the debug ptr verification macros to a single
common one.

Once the debug code is moved from the header to .c file,
there is no need to expose memory unit trace macros that
should be internal.

Signed-off-by: Marcin Maka <marcin.maka@linux.intel.com>
2020-03-26 10:09:32 +00:00
Marcin Maka 0f88be3e1a mm: separate alloc api and heap mgmt api
All clients that just wants to allocate and free memory
does not need to know all the heap management api
and internals.

Signed-off-by: Marcin Maka <marcin.maka@linux.intel.com>
2020-03-26 10:09:32 +00:00
Marcin Maka 3a85a3d648 alloc: fix debug trace compilation
There was old RZONE_BUFFER symbol left in the debug code, not
changed to SOF_MEM_ZONE_BUFFER.
Went under the radar so far since the DEBUG config options are
not included in CI builds yet.

Signed-off-by: Marcin Maka <marcin.maka@linux.intel.com>
2020-03-26 10:09:32 +00:00
Seppo Ingalsuo 3ce54df7b8 Tools: Test: Audio: Add double quotes to shell scripts
This patch adds the double quotes to shell scripts to avoid fails
with arguments or shell variables when there are space characters.

The processing components run scripts are all edited for better
structure with functions usage() and main() and with local variables
within functions.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2020-03-26 10:03:16 +00:00
Payal Kshirsagar 8ce242b40b src: drivers: intel: baytrail: remove unnecessary parentheses
Remove unnecessary parentheses around the right hand side of an
assignment.

Signed-off-by: Payal Kshirsagar <payalskshirsagar1234@gmail.com>
2020-03-26 09:55:48 +00:00
Payal Kshirsagar 6dd5e22f32 src: platform: intel: cavs: lib: remove unnecessary parentheses
Remove unnecessary parentheses around the right hand side of an
assignment.

Signed-off-by: Payal Kshirsagar <payalskshirsagar1234@gmail.com>
2020-03-26 09:55:48 +00:00
Karol Trzcinski 7bf879b226 tools: logger: Add clock parameter in help message
help message should explicity show that -c flags needs parameter.

Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
2020-03-26 10:18:30 +01:00
Karol Trzcinski fc84534247 tools: logger: Add LDC dump option
Create dump options for logger to print important information from
LDC file, like DBG_ABI version and UUID with corresponding names.

Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
2020-03-26 10:18:30 +01:00
Karol Trzcinski ee692abd97 tools: logger: Refactor format_uid()
Split this function to part responsible for pointer calculation
and string formatting. It make possibility to use same
string format with different pointer arithmetic.
Moreover introduce aprintf to make memory allocation for output
string more automated process.

Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
2020-03-26 10:18:30 +01:00
Karol Trzcinski e087ed7aa4 tools: logger: Align logs header to content
Double space in formatting string led to little mismatch between header
and content in output logger file.

Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
2020-03-26 10:18:30 +01:00
Bard Liao ae53aebcff topology: sof-icl-rt711-rt1308-rt715-hdmi: define NO_AGGREGATION mode
We will create individual PCM for each speaker when NO_AGGREGATION
is defined

Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
2020-03-25 13:10:48 -05:00
Bard Liao 2c00080987 Topology: sof-icl-rt711-rt1308-rt715-hdmi: Use demux for platforms with multiple speakers
We only need demux for two speaker dais case.

Fixes: 5e8de9fd52 "topology: sof-icl-rt711-rt1308-rt715-hdmi: Merge
two pipeline with demux"

Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
2020-03-25 13:10:48 -05:00
Karol Trzcinski 4e87899f25 cmake: Do not duplicate subdirectory adding for library build
Cmake files should have consistent directory linkage scheme
where lines duplication should be avoided.

Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
2020-03-25 16:38:35 +01:00
Karol Trzcinski 6713d90c21 dw_dma: Split DMA pause and stop command
Data after pause command should be kept compatible to omit
pop noise on output. The solution may be waiting for FIFO
empty but it takes to long - up to 1 processing period time.
Another - introduced - solution is to stop draining new data
from buffer after pause, but keeping dma connection with dai
up to release command. In this place waiting for FIFO empty
shouldn't take so much time, so system agent won't panic and
data will be consistent.

Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
2020-03-25 16:13:37 +01:00
Karol Trzcinski ed3919a1b1 dw_dma: Align argument list
Keep code style consistent.

Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
2020-03-25 16:13:37 +01:00
Payal Kshirsagar 7a646c9dbd testbench: remove unneeded variable
Remove unneeded temporary local variable, its declaration and newlines.

Signed-off-by: Payal Kshirsagar <payalskshirsagar1234@gmail.com>
2020-03-25 15:22:09 +01:00
Tomasz Lauda 9e1affa19b byt: bdw: imx8: disable agent by default
Disables system agent for BYT/CHT, HSW/BDW and IMX8 platforms.
System agent is supposed to track drift between timer ticks,
but it's only valid for the platforms with timer based scheduling.
Platforms with DMA based scheduling have asynchronous interrupts,
which can potentially starve the agent and cause system panic.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2020-03-25 15:09:35 +01:00
Seppo Ingalsuo 586c6c58dc DMIC: Fix minor mistake in FIR scale value computation
The equation for fir_in_max value was missing term -1 and returned
too high value that resulted in FIR scale coefficient calculation an
overall gain of 0.000004 dB while it should be exactly 0 dB. The HW
decimator contains saturation in output so it have not caused
overflows of PCM capture stream.

The new macro INT_MAX() returns the correct max PCM code value for
the used FIR input word length and looks better readable than
original code.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2020-03-25 15:05:33 +01:00
Seppo Ingalsuo 8d9d3ce664 Math: Get max and min signed integer values for given word length
This patch adds to header file sof/math/numbers.h two macros
INT_MAX(N) and INT_MIN(N). E.g. for 16 bits the returned values
are 32767 and -32768. The macro works up to N = 64.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2020-03-25 15:05:33 +01:00
Marcin Maka 0cf6d769a1 apollolake: turn on perf counters
Performance traces turned on for Apollolake.

Signed-off-by: Marcin Maka <marcin.maka@linux.intel.com>
2020-03-25 15:02:37 +01:00
Marcin Maka 24586ee69c perf: add cpu ticks counting for comp_copy
Cpu ticks are counted for each invocation
of comp_copy and peak values are traced.

Signed-off-by: Marcin Maka <marcin.maka@linux.intel.com>
2020-03-25 15:02:37 +01:00
Marcin Maka 1758279623 perf: make trace part of perf counting configurable
Clients may provide they own trace macro to be run
when new cpu peak value is detected.

Signed-off-by: Marcin Maka <marcin.maka@linux.intel.com>
2020-03-25 15:02:37 +01:00
Marcin Maka 8d350a3eff test: move timer mocks to the common part
Previously used by kpb tests only and defined locally.
New pieces of the code, like perf macros need them
globally.

Signed-off-by: Marcin Maka <marcin.maka@linux.intel.com>
2020-03-25 15:02:37 +01:00
Pan Xiuli 2978741118 topology: fix apl-demux-pcm512x HDMI dai id
The HDMI DAI id changed, update the demux topology.

Signed-off-by: Pan Xiuli <xiuli.pan@linux.intel.com>
2020-03-25 14:55:49 +01:00
Marc Herbert c84706e3f8 check patch: "top_of_sof_tree()" so it works out of the box
Adjust top_of_kernel_tree() function to SOF so invoking
./scripts/checkpatch.pl works out of the box and doesn't require
figuring what's going on and the existence of the --no-tree option which
sof-ci invokes "behind the scenes".

This instead of failing with:

  Must be run from the top-level dir. of a kernel tree

Compared to --no-tree, this is also enables a couple extra checks like:
WARNING: use relative pathname instead of absolute in changelog text

PS: the space between check and patch is here to... defeat checkpatch
itself. It apparently doesn't expect any change to itself.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2020-03-25 14:46:03 +01:00
Shreeya Patel 0a1c8b65af alloc: Match alignment with open parenthesis
Match alignment with open parenthesis to
maintain the coding style.

Reported by checkpatch.pl

Signed-off-by: Shreeya Patel <shreeya.patel23498@gmail.com>
2020-03-25 14:16:56 +01:00
Guennadi Liakhovetski 0f93ec1aef hda-dma: fix a failure to restore interrupt flags
In hda_dma_data_size() if an XRUN leads to an early return,
interrupt flags have to be restored.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2020-03-25 13:12:14 +00:00
Guennadi Liakhovetski 4da849e99b IPC: (cosmetic) remove a superfluous variable
The ret variable in ipc_comp_new() is never changed from its
initialisation value of 0, remove it.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2020-03-25 13:12:14 +00:00