Commit Graph

6167 Commits

Author SHA1 Message Date
Ranjani Sridharan 6db728dfcf dma/dai: use spin_lock_irq/spin_unlock_irq during get/put
Long run multi pipeline tests fail with dynamic pipeline
setup when trying to enable/disable the DMA and DAI.
Disabling interrupts during get/put addresses this issue.

Suggested-by: Jaska Uimonen <jaska.uimonen@linux.intel.com>
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2021-01-28 13:28:15 +00:00
Marc Herbert 356cc852e1 Replace run-time ALIGN_UP() check by ALIGN_UP_COMPILE() where possible
Should save some cycles

See related PR #3739

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2021-01-28 13:21:48 +00:00
Marc Herbert 921e52c680 common.h: rename two alignment verification macros, add comments
Zero functional change.

Rename "is_non0_power_of_2(x)" to "is_power_of_2(x)" because it's
simpler and because zero is not a power of 2.

Rename "compile_fail_zero_or_true(x)" to "compile_assert()" because it's
much simpler and because I really couldn't find what "zero_or_true"
meant?

Add a few comments, especially explain why COMPILE_TIME_ALIGNED(align)
uses __builtin_constant_p(align) because it took me ages to figure it
out.

Also recommend ALIGN_UP_COMPILE() over ALIGN_COMPILE() when compiling
with -O0

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2021-01-28 13:21:48 +00:00
Marc Herbert cdee91d01e .github: rename workflow from "Github Action CI" to "Github Actions"
The singular "Action" makes it look like our workflow is an action. The
plural "Github Actions" is at least the name of the product; so it's
vague enough.

A technically acccurate name would be "Main workflow" but we have only
one so it would be useless plus we're next to "Jenkins" and others and
want to stay consistent with them.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2021-01-28 13:20:22 +00:00
Pin-chih Lin fdbb90e786 tools: topology: Add common Codec Adapter capture pipeline tplg
pipe-codec-adapter-capture.m4 is implemented as a common pipeline
module of a capture codec w/ Codec Adapter API.

For codec developers, a upper-layer tplg file should be provided for
the specified codec with the information of control bytes, schedule
core, and byte-control names.

Signed-off-by: Pin-chih Lin <johnylin@google.com>
2021-01-27 18:20:17 -08:00
Pin-chih Lin 1a2afeb552 tools: topology: Add common Codec Adapter playback pipeline tplg
pipe-codec-adapter-playback.m4 is implemented as a common pipeline
module of a playback codec w/ Codec Adapter API.

For codec developers, a upper-layer tplg file should be provided for
the specified codec with the information of control bytes, schedule
core, and byte-control names.

Signed-off-by: Pin-chih Lin <johnylin@google.com>
2021-01-27 18:20:17 -08:00
Pan Xiuli 76b3f1eaaf README.md: add GitHub action status badge
Add the status badge for GitHub action CI.

Signed-off-by: Pan Xiuli <xiuli.pan@linux.intel.com>
2021-01-27 21:40:31 +00:00
Pan Xiuli 76d2e10fa8 CI: GitHub action: change name shows on PR status
change name for the GitHub actions to make the status context name
show in PR check looks nicer

Signed-off-by: Pan Xiuli <xiuli.pan@linux.intel.com>
2021-01-27 21:40:31 +00:00
Pan Xiuli 893c6b94a8 CI: GitHub action: allow action check runs on more branch
allow to run the check on PR and push to release stable branch

Signed-off-by: Pan Xiuli <xiuli.pan@linux.intel.com>
2021-01-27 21:40:31 +00:00
Curtis Malainey 64540b85aa pipeline: fix log message
quoting wrong function name

Signed-off-by: Curtis Malainey <cujomalainey@chromium.org>
2021-01-27 21:38:58 +00:00
Liam Girdwood 8112cad6ce component: doxygen: add more content around prepare() and reset().
Add some more usage context around prepare() and reset() for developers.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2021-01-27 21:27:58 +00:00
Guennadi Liakhovetski e580ca538c schedule: build only one of single- and multi-channel DMA schedulers
Only cAVS platforms use the single-channel DMA scheduler, all
other platforms use the multi-channel one. Add Kconfig options
to only build one of them.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2021-01-27 21:26:50 +00:00
Pan Xiuli 0b2876b279 cavs: pm: poll for IPC_DIPCIDR_BUSY to be clear before powerdown hpsram
If IPC_DIPCIDR_BUSY is set, DSP is sending IPC to HOST and HOST will
try to read from mailbox on hpsram.
polling for IPC_DIPCIDR_BUSY is cleared before power offer hpsram to
avoid HOST read fail.

Signed-off-by: Pan Xiuli <xiuli.pan@linux.intel.com>
2021-01-27 11:11:32 +00:00
Pan Xiuli 4c16fd491d platform: cavs: ipc: change hard code value to defined macro
Change 0x80000000 to IPC_DIPCI_BUSY and IPC_DIPCIDR_BUSY to
increase the code readablity

Signed-off-by: Pan Xiuli <xiuli.pan@linux.intel.com>
2021-01-27 11:11:32 +00:00
Pan Xiuli 1602cba5f3 drivers: cavs: ipc: change hard code value to defined macro
change 0x80000000 value to IPC_DIPCIDR_BUSY to increase the code
readablity

Signed-off-by: Pan Xiuli <xiuli.pan@linux.intel.com>
2021-01-27 11:11:32 +00:00
Marc Herbert e163bf1513 sof.doxygen.in: change ../test to @top_srcdir@/test
Makes it possible to place the build directory anywhere.

This directory does not seem in use any more; fixing it does not change
the doxygen output. However this does silence a doxygen error message
when the build directory is not in the usual place.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2021-01-27 11:00:04 +00:00
Oleksandr e3a1301cd6 audio: codec_adapter: increase codec adapter max blob size to 8192 bytes
4096 bytes is not enough to fit startup config of Waves custom codec

Signed-off-by: Oleksandr Strelchenko <strelchenko.oleksandr@gmail.com>
2021-01-27 10:58:17 +00:00
Guennadi Liakhovetski f3b87b400f byt: fix sporadic channel swap
Commit 05e1c26166 ("byt-ssp: fixes for DSP modes") removed a
work-around for known hardware bugs, causing channel swapping
in I2S mode. Restore the work-around but make sure it's only
enabled in I2S and LEFT_J modes.

Fixes: #3699, #3520

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2021-01-25 13:01:25 +08:00
Keyon Jie 385cf89c76 smart_amp_maxim_dsm: change logging level for xrun
When overrun happens for maxim_dsm_ff_proc() or maxim_dsm_fb_proc(), it
is not fatal, change the logging level to warning to avoid flooding the
memory windows.

Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
2021-01-22 15:41:56 +00:00
Keyon Jie 7fb6d5f0f3 topology: smart_amp: make the DSP core configurable
Define SMART_AMP_CORE configurable, configure to run DSM pipelines on
DSP core0 if it is not set.

Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
2021-01-22 15:38:45 +00:00
sriram a47a8a6a21 audio: tools: fix matlab/octave directory compatibility
To support exist function - fullfile() path addition is to prevent Matlab (differently than Octave)
to give false positive with some other directory location with it's search path

Added correction to isempty.

Signed-off-by: ShriramShastry <malladi.sastry@intel.com>
2021-01-22 15:28:32 +00:00
Marc Herbert 05dded7b7b [skip ci] translate .travis.yml to new .github/workflows/pull-request.yml
Full translation except the IRC notifications, appreciate if someone
else can add later. Seems much faster.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2021-01-22 13:42:03 +00:00
Marc Herbert 9938a66db4 docker-run.sh: use --tty only when we have one
--tty is not compatible with github actions, fails with "the input
device is not a TTY"

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2021-01-22 13:42:03 +00:00
Keyon Jie 07d45e4b9a pipeline: use id for component/pipeline comparison
Switch to use component id and pipeline id for comparison, to avoid
getting wrong results when using different pointers point to the same
component/pipeline.

Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
2021-01-22 13:38:33 +00:00
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