Commit Graph

7736 Commits

Author SHA1 Message Date
Marc Herbert deb0e7340e Rename generated version.h to sof_versions.h
Zephyr also a version.h too so the situation was a buggy #include mess
that (among others) dropped the SOF git version from the SOF banner when
using Zephyr. It's absolutely impossible to fix this mess while keeping
two .h files both named exactly the same and even included with the
exact same '#include version.h' line, I mean no sof/version.h or other
prefix.

As a bonus, this rename also reduces the XTOS-only confusion between
"version.h" and cavs/version.h".

Generating a file in the source tree is a serious bug (to be fixed
later), it means this file is never cleaned. Do not hide this bug with a
.gitignore rule.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2022-01-14 16:56:29 +00:00
Bard Liao 06c83dc375 topology2: cavs-sdw: add audio format tokens
Add audio format tokens for cavs-sdw.conf

Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
2022-01-14 16:52:37 +00:00
Pierre-Louis Bossart 6b8b1cee16 topology: add all possible permutations for ES8336-based platforms
So far we support apl, glk, cml, jsl, tgl.

SSP0 or SSP2 can be used.

DMICS may or may not be present, the simplifying assumption is that we
have 0, 2 or 4channels.

the existing topology names are kept but will not be used with kernel
updates, the -ssp<N> and -dmic<N> ch suffixes will be added based on
NHLT information to avoid a need to override topology files.

A better solution would be a DAI index that can be overridden in a
topology file, but we have no interface to do so at the moment, so
brute-force combinatorial handling of all possible solutions it is.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
2022-01-13 14:18:43 +00:00
Ranjani Sridharan 17064d4f22 module_interface: remove the id field
It is never used.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2022-01-12 14:24:32 +00:00
Ranjani Sridharan 317f80b4f2 codec_adapter: waves: make interface ops static
and remove waves.h

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2022-01-12 14:24:32 +00:00
Ranjani Sridharan 115ffbc1bc codec_adapter: dts: Make interface ops static
and remove dts.h.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2022-01-12 14:24:32 +00:00
Ranjani Sridharan 509532e0b5 codec_adapter: cadence: Make all interface ops static
Make all the ops static.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2022-01-12 14:24:32 +00:00
Ranjani Sridharan 57fabdca8e codec_adapter: passthrough: remove passthrough.h
All interface op definitions are static. No need to declare them.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2022-01-12 14:24:32 +00:00
Ranjani Sridharan 9a89f4eb80 codec_adapter: fix states before and after processing
set the state to MODULE_PROCESSING before starting to process the
samples and reset it to MODULE_IDLE afterwards.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2022-01-12 14:24:32 +00:00
Ranjani Sridharan 820ef37c82 codec_adapter: generic: remove unnecessary goto's
Return ret in case of error.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2022-01-12 14:24:32 +00:00
Ranjani Sridharan 0fdfca96d6 codec_adapter: fix typo in error message
It's free not reset and while we're at it, remove the unnecessary braces
too.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2022-01-12 14:24:32 +00:00
Ranjani Sridharan 7615eced49 codec_adapter: remove some unnecessary else's
No need for an else after returns or gotos.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2022-01-12 14:24:32 +00:00
Ranjani Sridharan fe04bad091 codec_adapter: remove unnecessary goto's in module_init()
Remove the goto's and return the appropriate values right away.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2022-01-12 14:24:32 +00:00
Ranjani Sridharan 9ba96e2c4a codec_adapter: remove validate_setup_config()
It has not been implemented and can be introduced later when needed.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2022-01-12 14:24:32 +00:00
Guennadi Liakhovetski befc3d9a61 lib: use 32-bit assignments for memset()
SOF loves memset(). It takes great care to 0-initialise buffers and
objects. And its memset() routine only sets one byte at a time.
Optimise it to use 32-bit assignments where possible.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2022-01-12 13:05:12 +00:00
Guennadi Liakhovetski 9abc285574 build: add missing headers
common.h calls panic() and uses SOF_IPC_PANIC_ASSERT, add missing
headers.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2022-01-12 13:05:12 +00:00
Guennadi Liakhovetski 986b16495c build: add a missing RELATIVE_FILE definition
base_module and boot_module are separate targets, they need
RELATIVE_FILE defined for them too.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2022-01-12 13:05:12 +00:00
Seppo Ingalsuo 9c002f37e0 Arch: Host: Enable default-no components for testbench build
Components those use library functions fail to run in testbench
if they are not enabled in library_defconfig. The testbench build
builds the component library but not the library dependencies. E.g.
DRC component run in testbench failed because of this. Crossover
worked because it does not currently use library functions. All such
components with functional source are enabled for completeness.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2022-01-11 22:12:02 +00:00
Rander Wang 0ced5ed0f3 ipc4: set pipeline ready after reset.
Currently pipeline reset is used by ipc3 for pipeline
free and pcm param error. It is used by ipc4 to
reinitialize pipeline, so it suitable to set pipeline
to default ready status

Signed-off-by: Rander Wang <rander.wang@intel.com>
2022-01-11 22:11:18 +00:00
Rander Wang 17453b58ec ipc4: refine HDA dai driver for ipc4
The blob data of HDA is only for lp mode, not
for hw params, so just return.

Signed-off-by: Rander Wang <rander.wang@intel.com>
2022-01-11 22:11:18 +00:00
Rander Wang d14b1931a5 ipc4: add chain dma support
Chain dma is only support by HDA gateway. The idea is
to copy data from host to dai directly without any process.
It is just like a pass-through pipeline.

This patch adds support by create a pass-through pipeline
internally.

Signed-off-by: Rander Wang <rander.wang@intel.com>
2022-01-11 22:11:18 +00:00
Rander Wang 40d625db38 ipc4: return correct ipc status to host
Currently some of pipeline setting ipc messages are
scheduled in another thread, both ipc thread and the
schedule thread may return the status. It is work for
IPC3, but for IPC4 a batch of pipelines will be set
by single ipc message and they will be scheduled in
multiple threads, then multiple ipc messages will be
repied to host. This is invalid.

In this case error may occur in both ipc thread and
schedule thread. To update err status simple, schedule
thread will only return error to ipc thread which will
maintain error status and reply to host.

Signed-off-by: Rander Wang <rander.wang@intel.com>
2022-01-11 22:11:18 +00:00
Rander Wang f8451fd8b1 ipc4: fix pause issue with windows audio player
(1) IPC4 does not need mixer workaround.
(2) trigger pipeline in release state for pause-running case

Signed-off-by: Rander Wang <rander.wang@intel.com>
2022-01-11 22:11:18 +00:00
Ranjani Sridharan 56784a9e29 codec_adapter: remove load_setup_config()
Modify module_load_config() to handle both setup and runtime configs and
remove load_setup_config().

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2022-01-11 20:40:48 +02:00
Ranjani Sridharan 42dd0a6932 codec_adapter: check if more fragments are expected first.
Check if more fragments of config data are expected first and return
immediately to make the code easier to follow.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2022-01-11 20:40:48 +02:00
Ranjani Sridharan 6241f50549 codec_adapter: remove unnecessary braces
Remove the unnecessary braces in codec_adapter_set_params().

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2022-01-11 20:40:48 +02:00
Ranjani Sridharan 6aa96e231b codec_adapter: remove unnecessary goto's
Remove the goto's and return the appropriate values to simplify the
codec_adapter_set_params() function.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2022-01-11 20:40:48 +02:00
Ranjani Sridharan 85169d3da5 codec_adapter: drop the type parameter in codec_adapter_set_params()
It can be accessed via cdata in the function.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2022-01-11 20:40:48 +02:00
Pierre-Louis Bossart 71cd9666a9 platform: cavs: make IMR restore feature default - except APL/GLK
Let's enable this capability, with CAVS_1_5 left out for now since there
are known issues with suspend-resume on Up2 board that were never
root-caused.

Enabling this at the firmware level is not enough, this capability
need to be enabled by kernel patches in
https://github.com/thesofproject/linux/pull/3340

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
2022-01-11 15:59:07 +00:00
Lionel Koenig c687815185 topology1: Undefine after in DAI & PIPELINE macros
In order to ease comprehension and avoid side-effect of constants being
defined after calling a macro, this change undefined the locally define
constants for pipelines and dai macros.

Signed-off-by: Lionel Koenig <lionelk@google.com>
2022-01-11 15:57:41 +00:00
Michal Wasko 954614b5fb codeowner: add Marcin to review ipc changes
Marcin is responsible for ipc4 enabling in SOF
and integration with Windows drivers.

Signed-off-by: Michal Wasko <michal.wasko@intel.com>
2022-01-11 15:39:13 +00:00
Guennadi Liakhovetski 2317e879c7 DAI: join identical trigger handling flows
All SSP drivers handle COMP_TRIGGER_RELEASE and COMP_TRIGGER_START in
the same way. Similarly sai.c handles COMP_TRIGGER_PAUSE and
COMP_TRIGGER_STOP identically. This patch joins those flows.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2022-01-11 09:27:28 +00:00
Guennadi Liakhovetski 03fb524f15 heap: remove unused mm_pm_context_{save,restore}()
mm_pm_context_save() and mm_pm_context_restore() are never used,
remove them.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2022-01-11 09:27:28 +00:00
Guennadi Liakhovetski 1de8e74b9e DMA: remove unused dma_pm_context_{store,restore} operations
.dma_pm_context_store and .dma_pm_context_restore DMA operations are
never used, remove them.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2022-01-11 09:27:28 +00:00
Guennadi Liakhovetski ca0e94ddab DAI: remove unused pm_context_{store,restore} operations
.pm_context_store and .pm_context_restore DAI operations are never
used, remove them.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2022-01-11 09:27:28 +00:00
Guennadi Liakhovetski eb0ef7bb85 component: convert COMP_TRIGGER_* values to an enum
COMP_TRIGGER_* values are internal to SOF, they aren't a part of an
API, their numeric values are unimportant. Convert them to an enum to
make removing deprecated and adding new values easier.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2022-01-11 09:27:28 +00:00
Guennadi Liakhovetski 95f7b8e68e ipc: remove two unused trigger commands
COMP_TRIGGER_SUSPEND and COMP_TRIGGER_RESUME are never issues, remove
them.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2022-01-11 09:27:28 +00:00
Lionel Koenig 3b48da9cf5 platform: allow primary core stack size config.
Allow to set the primary core stack size using the Kconfig mechanism.

Signed-off-by: Lionel Koenig <lionelk@google.com>
2022-01-10 15:56:56 +00:00
Lionel Koenig ba77d3a74f xtos: Add stub for some missing OS function
In order to ease porting algorithm to SOF, it is convenient to have
stubs for some operating system function.
Those stubs are not meant to be called.

Signed-off-by: Lionel Koenig <lionelk@google.com>
2022-01-10 13:12:39 +00:00
Marc Herbert f50b6fe0ad topologies: switch all .m4 files to codec_provider and codec_consumer
All .tplg output files have been compared and are strictly identical
after the change.

The deprecation warnings were added more than one year ago in
https://github.com/alsa-project/alsa-lib/commits//706192341d1d0bbb906

Now that we just upgraded our Docker image to ALSA 1.2.6
(https://hub.docker.com/r/thesofproject/sof/tags) so #5153 can enable
topology v2, the volume of warnings has became unbearable.  For instance
good luck trying to find the actual error messages for the build
failures of #5155 - they're totally drowned in these deprecation
warnings.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2022-01-10 11:52:26 +00:00
Marc Herbert 950728c095 Docker: sof: add ninja-build
We should gradually switch to ninja as a default.

ninja-build is apparently missing from build-essential

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2022-01-10 11:52:04 +00:00
Marc Herbert e64a6cfd31 trace.c: rename emit_recent_entry() to emit_suppressed_entry() + comments
This makes much clearer why this function is not called when the burst
is short enough.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2022-01-10 11:50:21 +00:00
Marc Herbert 7614351b74 trace: log "hidden" feature turning off adaptive filtering at run-time
Also clarify related Kconfig help strings.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2022-01-10 11:50:21 +00:00
Marc Herbert 5fd7c88f3d trace.c: minor #ifdef simplification in trace_log_filtered()
Group two #ifdef into one.

Top of block variables do not require C99.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2022-01-10 11:50:21 +00:00
Marc Herbert a51a64665b Replace perf_*_trace() macros with functions.
The fewer macros, the better.

Commit 1758279623 ("perf: make trace part of perf counting
configurable") provided no specific rationale for using macros. It did
not explain why it passed some ignored arguments either - renamed
accordingly.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2022-01-10 11:50:21 +00:00
YC Hung e7f6430004 topology1: mt8195: support 1ms pipeline capture period
1.Default support 1ms period capture pipeline to update host position
  more precisely.
2.Revise pipeline 1 to playback and pipeline 4 to capture in comment.

Signed-off-by: YC Hung <yc.hung@mediatek.com>
2022-01-10 11:48:08 +00:00
Rander Wang e64fdf2e40 codeowner: add rander to review ipc changes
I am working on ipc interface for IPC4 and will
focus on ipc interface for both IPC3 & IPC4.

Signed-off-by: Rander Wang <rander.wang@intel.com>
2022-01-10 11:47:22 +00:00
Ranjani Sridharan 90e6925e7c codec_adapter: rename comp_get_codec()
to comp_get_module_data(). No functional change.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2022-01-10 13:08:16 +02:00
Ranjani Sridharan 681a4338af codec_adapter: rename codec_id in struct ca_config
to module_id. No functional change.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2022-01-10 13:08:16 +02:00
Ranjani Sridharan 34e2eb13c6 codec_adapter: rename codec_free_all_memory()
to module_free_all_memory(). No functional change.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2022-01-10 13:08:16 +02:00