Commit Graph

5943 Commits

Author SHA1 Message Date
Keyon Jie 6b590cc42d pipeline: add helper to retrieve the pipeline id
Add inline helper pipeline_id() to retrieve the pipeline_id from a
pipeline pointer.

Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
2021-01-22 13:38:33 +00:00
Guennadi Liakhovetski f4c9c28bc5 zephyr: fixed cached rimage path
Fix the cached rimage path to the temporary cloned rimage location.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2021-01-22 13:35:29 +00:00
Keyon Jie 74d7b54f63 dmic: stop dmic at xrun to avoid interrupt flooding
Once an Xrun happens, only clearing the interrupt can't recover it, stop
the dmic to avoid interrupt flooding.

This will lead to subsequent pipeline Xrun and eventually the pipeline
will be stopped.

Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
2021-01-22 13:30:15 +00:00
Marc Herbert e17b90d9b2 scripts: replace "make" with "cmake --build"
This makes it possible to switch to Ninja with a single line change
which can be useful to test build changes and issues.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2021-01-18 16:11:46 +00:00
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
Marc Herbert 027bda1fcd .travis.yml: build Sue Creek
Sue Creek is the only platform using the ALIGN() macro in assembly. If
it had been built in CI then we would have avoided the ALIGN()
regression in commit 39266cac81 ("core: assure alignment is only done
on power of 2 values"). Building Sue Creek is practically free and finds
bugs so let's build it.

I'm aware Travis isn't the future but it's still running for now and
this is a tiny and totally trivial change that took 1/100 of the time
spent writing this commit message. It's also a reminder not to forget
Sue Creek in whatever will replace Travis.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2021-01-18 14:34:04 +00:00
Adrian Bonislawski fadd8e7077 tgl: enable WOVCRO clock
This will allow to save significant amount of SOC power
in low power S0ix WoV

Signed-off-by: Adrian Bonislawski <adrian.bonislawski@linux.intel.com>
2021-01-15 16:59:12 +00:00
Adrian Bonislawski 908838ac15 clk: release clock in low power mode
This patch will release previous clock in low power mode
because there are some rare problems with not releasing it

Signed-off-by: Adrian Bonislawski <adrian.bonislawski@linux.intel.com>
2021-01-15 16:59:12 +00:00
Adrian Bonislawski 66e8496a80 clk: add LOWEST_FREQ_IDX to make clock switching more flexible
It will allow to define cpu lowest clock per platform
instead of fixed one (LPRO)

Signed-off-by: Adrian Bonislawski <adrian.bonislawski@linux.intel.com>
2021-01-15 16:59:12 +00:00
Marc Herbert 32fe8a4b81 common.h: restore basic ALIGN() macro compatible with assembly
commit 39266cac81 ("core: assure alignment is only done on power of 2
values") changed the alignment macros, they now use C code to perform a
sanity check. This broke ALIGN() usage in
platform/suecreek/include/platform/lib/memory.h in two different ways:

1. it broke static initializers in platform/suecreek/base_module.c
because these can't use statement-expressions. This could have been
fixed by simply switching to ALIGN_UP_COMPILE(), BUT:

2. memory.h files are also included in assembly.

Also note memory.h values are copied unprocessed to linker scripts that
require the ALIGN() spelling.

For these reasons ALIGN() needs to be switched back to a "dumb" macro.

Preserve the sanity checks just added in alloc.c and pm_memory.c by
switching them to the new and smarter ALIGN_UP() macro.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2021-01-15 13:30:07 +00:00
Adrian Bonislawski 7daaa518c6 config: byt: remove tone comp
Remove tone from the byt defconfig to reduxe code size.

Signed-off-by: Adrian Bonislawski <adrian.bonislawski@linux.intel.com>
2021-01-15 13:28:11 +00:00
Adrian Bonislawski dcbee3cdf3 mixer: dont stop mixer on pause
Dont stop mixer on pause and write zeros
if all sources are inactive

Signed-off-by: Adrian Bonislawski <adrian.bonislawski@linux.intel.com>
2021-01-15 13:28:11 +00:00
Adrian Bonislawski d6e3ffcc40 audio_stream: add function writing zeros
This will allow to write zeros to the buffer without
reference to a source buffer

Signed-off-by: Adrian Bonislawski <adrian.bonislawski@linux.intel.com>
2021-01-15 13:28:11 +00:00
Guennadi Liakhovetski 2bf7defdb6 alloc: remove a redundant call to platform_shared_commit()
alloc_block() will call platform_shared_commit() on the map
too, no need to do that twice.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2021-01-14 14:29:58 +00:00
Guennadi Liakhovetski ad7de3f572 alloc: reduce the scope of a variable
temp_bytes is only used if CONFIG_DEBUG_BLOCK_FREE is
defined. Limit its scope to only such configurations.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2021-01-14 14:29:58 +00:00
Guennadi Liakhovetski 12a56d1b96 alloc: fix the general one-buffer memory allocation case
The condition "size + alignment <= block_size" for allocating
memory from a signle buffer is sufficient but not precise enough.
For example if we want to allocate 20 bytes with 64-byte alignment,
a 32-byte buffer *might* be sufficient if it's suitably aligned.
Fix the algorithm to account for such cases.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2021-01-14 14:29:58 +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
Pin-chih Lin 39285411d3 codec_adapter: Used nested Kconfig of codec adapter codecs
The codec config of codec adapter should be placed under
src/audio/codec_adapter. In the future we might add multiple other
types of libraries. So far we support Cadence and Dummy codecs.

Signed-off-by: Pin-chih Lin <johnylin@google.com>
2021-01-12 22:04:47 +00:00
Pin-chih Lin 9b0209ba8b sof: drc: fix drc_sin_fixed function
drc_sin_fixed() utilized sin_fixed() while its input range is
non-negative. This commit fixes drc_siz_fixed() for negative input by
using ABS(input) to sin_fixed() and then inverting the output sign.

Signed-off-by: Pin-chih Lin <johnylin@google.com>
2021-01-12 21:47:57 +00:00
Keyon Jie d5840a9200 ssp: move mclk request/release to pre_start and post_stop
For power saving, we should release the mclk when not used, postpone the
requesting to pre_start, and release it at post_stop.

Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
2021-01-11 16:28:19 +00:00
Keyon Jie b90315f0f0 ssp: mn: clean up the mclk part
We have 2 mclks in total for cAVS platforms, they share the same clock
source, but have separated dividers.

SSP ports can use either of the 2 mclks, add a ref count to manage the
mclk usage, and release it when not used.

Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
2021-01-11 16:28:19 +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
Adrian Bonislawski f45bc1e216 ssp: try to use the same source clock for BCLK and MCLK
This is recommended flow to avoid glitches

Signed-off-by: Adrian Bonislawski <adrian.bonislawski@linux.intel.com>
2021-01-11 16:24:30 +00:00
Marc Herbert c915001ba0 CODEOWNERS -= jajanusz
Left Intel.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2021-01-11 16:24:06 +00:00
Guennadi Liakhovetski b580a787da zephyr: update for unsupported arch builds
Add some files from src/platform/library/ to generic arch
builds with Zephyr.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2021-01-11 16:11:42 +00:00
Guennadi Liakhovetski d93692ce80 alloc: pick up allocation start correctly
When allocating multiple buffers the first free buffer might not
contain a suitably aligned start address. Skip it instead of
allocating it with the others. Also don't add alignment to the
allocation size, but find a suitably aligned start address
instead.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2021-01-11 16:07:52 +00:00
Daniel Baluta 551bb2d952 codec: Add dummy codec implementation
This is useful to test codec adapter component and generic codec code.

Our dummy codec has 1 input buffer and 1 output buffer and in its
initial implementation just copies input to output without any processing
on the data.

Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
2021-01-08 10:27:41 +00:00
Guennadi Liakhovetski 7531d6bd07 zephyr: add a cache variable with a rimage configuration path
zephyr needs a path to rimage configuration files, add it to
cmake cache.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2021-01-08 10:24:07 +00:00
Guennadi Liakhovetski 39266cac81 core: assure alignment is only done on power of 2 values
Alignment should always be done on powers of 2. Enforcing this
rule also allows the use of binary AND for alignment instead of
much slower division. Also add compile-time checks where possible.
At the moment no non-power-of-2 alignment cases are known in SOF,
but a complete verification is difficult, therefore we add
compile- and runtime checks, enabled by default for now. After a
period of time (one or two releases) this verification option can
be converted to an off by default configuration parameter.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2021-01-08 09:56:07 +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
Karol Trzcinski 5a1078d293 ext_man: Remove dictionary elements counter from ABI for ext_man_cavs_config_data
This value shouldn't be included in any ABI header, because it may
vary between firmware configurations.
This change makes header file more similar to version provided by kernel.

Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
2021-01-07 12:10:53 +00:00
Karol Trzcinski 5c02bbc283 ext_man: cavs: Always include EXT_MAN_CAVS_CONFIG_LPRO element to manifest
This value should be included to output image with proper value instead
of including only for some configurations. It will reduce dictionary
element counting complexity.

Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
2021-01-07 12:10:53 +00:00
Karol Trzcinski 28d06341bc ext_man: Remove dictionary elements counter from ABI for ext_man_config_data
This value shouldn't be included in any ABI header, because it may
vary between firmware configurations.
This change makes header file more similar to version provided by kernel.

Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
2021-01-07 12:10:53 +00:00
Keyon Jie d6b9f1f795 smart_amp_maxim_dsm: log warning for zero frame copy
Change to comp_warn() when zero fram is copied, which really requires
attention on.

Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
2021-01-07 11:23:48 +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
Guennadi Liakhovetski 3c20133263 common: use DIV_ROUND_UP() instead of open-coding
Replace two instances of open-coded rounding-up division with
DIV_ROUND_UP() calls.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2021-01-06 13:20:44 +00:00
Guennadi Liakhovetski ae7f90c468 common: make common.h invisible to linker scripts
common.h defines an ALIGN() macro, which would conflict with the
identically named linker builtin function. At the moment
common.h isn't included in linker scripts, but it might get
included via a different header.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2021-01-06 13:20:44 +00:00
Guennadi Liakhovetski 6d2e64f608 common: add a macro for a rounded-up division
Multiple locations in the code open-code a round-up division
operation. Add a common macro for it.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2021-01-06 13:20:44 +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
Guennadi Liakhovetski 71b4751600 cavs: add a missing sanity check in a mask calculation
cavs_pm_memory_hp_sram_mask_get() checks starting and ending
bank indices against the requested segment range incompletely.
Add the missing end segment check.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2021-01-05 17:04:04 +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
Guennadi Liakhovetski a2ce9d7f38 tgl: fix a compilation warning
lp_sram_unpack() is currently only built for Tigerlake targets, it
contains a wrong type cast from "uintptr_t *" to "uint32_t *" and a
superfluous cast from "uint32_t" to itself. Fix both.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2021-01-04 16:46:14 +00: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 691275533d sof: multiband_drc: Implement multiband_drc_generic
This commit implements multiband_drc_generic for sample processing.

Multiband DRC is a single-source-single-sink compound component which
consists of 4 stages: Emphasis Equalizer, Crossover Filter (from
1-band to 4-band), DRC (per band), and Deemphasis Equalizer of summed
stream.

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