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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
Add some files from src/platform/library/ to generic arch
builds with Zephyr.
Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
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>
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>
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>
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>
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>
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>
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>
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>
Replace two instances of open-coded rounding-up division with
DIV_ROUND_UP() calls.
Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
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>
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>
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>
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>
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>
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>
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>
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>
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>