Commit Graph

8532 Commits

Author SHA1 Message Date
Kai Vehmanen 8881a406af topology: add sof-rpl-nocodec.tplg
Add nocodec topology for Intel Raptor Lake.

Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
2022-08-04 16:22:56 +01:00
Kai Vehmanen f2bfa2824e topology: add sof-rpl-rt711 and sof-rpl-rt711-4ch topologies
Add new topologies for Intel Raptor Lake.

Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
2022-08-04 16:22:56 +01:00
Kai Vehmanen 09944bc058 topology: Add platform definition file for Intel Raptor Lake
Start with Alder Lake definitions.

Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
2022-08-04 16:22:56 +01:00
Marc Herbert 8543f5c889 .github: compile-test multiple zephyr revisions + IPC4
This will show very clearly:
- upstream Zephyr regressions
- upstream Zephyr progressions / fixes

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2022-08-04 12:48:50 +01:00
Marc Herbert dfaf9b8f28 west.yml: clarify warning about ignored zephyr/west.yml changes
Fixes commit 2c9772d5ad ("Add west.yml configuring zephyr
dependencies from sof")

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2022-08-04 09:46:22 +01:00
Marc Herbert 125d372b19 docker-build.sh: don't switch versions when already initialized
Restore ability to use (and test!) zephyr/docker-build.sh locally
without overwriting work in progress.

Fixes commit b371373f7d ("scripts: docker-build.sh updated with
changes from xtensa-build-zephyr.py")

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2022-08-04 09:46:22 +01:00
Guennadi Liakhovetski 2cfefc1103 ipc3: connect buffers on the primary core
Connecting buffers belongs to pipeline initialisation, it can be done
completely on the master core.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2022-08-03 22:03:44 +01:00
Guennadi Liakhovetski 9f4def94ab host: use cached buffer access
Protect the buffer while accessing the stream address.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2022-08-03 22:03:44 +01:00
Guennadi Liakhovetski e4a5359440 TGL: enable CONFIG_INCOHERENT correctly
Kconfig options with no description cannot be selected from
defconfig. They can only be selected from other Kconfig options.
This means, that CONFIG_INCOHERENT doesn't get selected on TGL. Move
it to Kconfig to fix this.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2022-08-03 22:03:44 +01:00
Guennadi Liakhovetski b3e0599922 keyphrase: fix buffer acquisition in detection test
test_keyword_params() must acquire and release the source buffer
appropriately for access.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2022-08-03 22:03:44 +01:00
Guennadi Liakhovetski 984cf7c280 ipc: always remove freed buffers from lists
When a component or a buffer is freed, it has to be made inaccessible
from everywhere. Make sure to always delete buffers from lists in
such cases and also to use correct direction macros.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2022-08-03 22:03:44 +01:00
Guennadi Liakhovetski 1c10b8a54c mixer: check component pointers before dereferencing
Buffers, attached to mixers, can be remaining parts of pipelines,
being freed. Then their component pointers might no longer point to
valid components. Check them before dereferencing.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2022-08-03 22:03:44 +01:00
Guennadi Liakhovetski b15a0418d4 component: delete stale pointers when freeing components
Freeing components and buffers is performed one by one from IPC
commands, sent by the host. When a component is freed, buffers,
connected to it might still exist and keep pointers to the component,
that is being freed. Then, for example if such a buffer is also
connected to a mixer from a different pipeline, that other pipeline
might still be active. Then the mixer might walk its connected
pipelines and come across the no longer existing component. Remove
those stale pointers to avoid such issues.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2022-08-03 22:03:44 +01:00
Guennadi Liakhovetski b0b15e66b3 buffer: (cosmetic) remove a goto
Use a switch-case clause to remove a goto.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2022-08-03 22:03:44 +01:00
Guennadi Liakhovetski fe688ddd5f buffer: remove redundant NULL check
calling_buf cannot be NULL in pipeline_comp_params_neg, don't check.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2022-08-03 22:03:44 +01:00
Guennadi Liakhovetski 566415e642 ipc: fix buffer cache handling during freeing
Both IPC3 and IPC4 stream termination paths use uncached buffer
addresses, which can contain stale data with core-local buffers. Fix
both to use cached buffer aliases.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2022-08-03 22:03:44 +01:00
Guennadi Liakhovetski 9ead82e1b8 buffer: fix cache-handling during initialisation
Buffer control structures are accessed at run-time via their cached
aliases. But buffer enumeration involves accessing list headers,
embedded in those control structures. To be able to use the standard
list traversal routines that access is performed via uncached
aliases. Therefore the life-cycle of a buffer control object looks as
follows:

- initialisation
 1. allocate memory
 2. obtain a cached alias
 3. use cached access to initialise the audio stream
 4. release cached access
 5. initialise some fields, using the uncached alias
- linking
 6. add to the list
 7. obtain a cached alias
 8. bind to a component
 9. release cached access
- run-time
10. scan buffer list
11. obtain a cached alias
12. use the buffer
13. release cached access

This patch fixes buffer object initialisation and linking to ensure
data consistency between cached and uncached accesses.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2022-08-03 22:03:44 +01:00
Guennadi Liakhovetski 5fee08996c cache: remove wrong component cache synchronisation
Current component object cache synchronisation is wrong. Firstly
component objects are always allocated with uncached addresses, so no
cached access ever takes place. Secondly cache manipution should be
performed via cached addresses. Thirdly if we decide to access
component objects via cached addresses we'll likely use the coferent
API to do this. Remove wrong cache manipulation to fix cases with
componentson different cores within a single pipeline.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2022-08-03 22:03:44 +01:00
Guennadi Liakhovetski 1529fe52fb buffer: restore original comp_update_buffer_* names
Previously we temporarily added two functions
comp_update_buffer_cached_produce() and
comp_update_buffer_cached_consume() to be able to migrate users of
comp_update_buffer_produce() and comp_update_buffer_consume() to them
respectively. Now that all users have been migrated we can remove
original implementations and restore original names.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2022-08-03 22:03:44 +01:00
Guennadi Liakhovetski e135633636 zephyr: update for recent Zephyr include path changes
Zephyr removed support for header inclusion without the zephyr/ path.
Update SOF with correct paths.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2022-08-03 20:59:53 +01:00
Marc Herbert d6906d3aeb installer: add rpl and rpl-s aliases to tgl and tgl-h
rpl firmware is tgl but signed with a different key

This commit adds the following files and links below

$ tree installer/staging/sof |
     grep -e tgl  -e rpl -e community |
     grep -v -e adl -e ehl

├── community
│   ├── sof-rpl.ri -> sof-tgl.ri
│   ├── sof-rpl-s.ri -> sof-tgl-h.ri
│   ├── sof-tgl-h.ri
│   └── sof-tgl.ri
├── sof-rpl.ldc -> sof-tgl.ldc
├── sof-rpl.ri -> intel-signed/sof-rpl.ri
├── sof-rpl-s.ldc -> sof-tgl-h.ldc
├── sof-rpl-s.ri -> intel-signed/sof-rpl-s.ri
├── sof-tgl-h.ldc
├── sof-tgl-h.ri -> intel-signed/sof-tgl-h.ri
├── sof-tgl.ldc
└── sof-tgl.ri -> intel-signed/sof-tgl.ri

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2022-08-03 15:36:29 +01:00
Andrey Borisovich 70406a0db0 scripts: added versioning to xtensa-build-zephyr.py and west manifest
Added versioning to scripts/xtensa-build-zephyr.py to get version
information when incompatible changes are done to the script.
Added yml schema version number to west.yml manifest.

Signed-off-by: Andrey Borisovich <andrey.borisovich@intel.com>
2022-08-03 11:43:22 +01:00
Andrey Borisovich b371373f7d scripts: docker-build.sh updated with changes from xtensa-build-zephyr.py
Removed old flags from python script call and replaced with
new one. Added one more working directory to zephyr-build container
now SOF is placed in /workdir/sof and west workspace in /workdir .

Signed-off-by: Andrey Borisovich <andrey.borisovich@intel.com>
2022-08-03 11:43:22 +01:00
Andrey Borisovich 4be98e4dc9 scripts: xtensa-build-zephyr.py removed calls over symlink
xtensa-build-zephyr.py had been using some execute_command
calls when building rimage and using rimage keys over
symlink from modules/audio/sof. Changed it so that calls are
executed now over normal sof directory and symlink is not needed
for script execution.

Signed-off-by: Andrey Borisovich <andrey.borisovich@intel.com>
2022-08-03 11:43:22 +01:00
Andrey Borisovich 627e29f287 scripts: xtensa-build-zephyr.py west reinitialization
Added new flag for non-interactive mode that should be used
when script is invoked programmatically.
In default (interactive) mode user is asked using a prompt whether to
reinitialize west manifest if it is initialized to manifest other
than SOFs.

Signed-off-by: Andrey Borisovich <andrey.borisovich@intel.com>
2022-08-03 11:43:22 +01:00
Andrey Borisovich 608833cf27 xtensa-build-zephyr.py: use west manifest
Added usage of west manifest in the script to update both
SOF and zephyr dependencies.
Renamed "clone-mode" to "update" flag - the logic where
sof dependencies and zephyr with dependencies is cloned.
Removed "point-mode" from script as it will no longer work
(west manifests require fixed directory structure).
Removed "zephyr revision" or "-z" argument as it is no longer
needed (now revision may be set in west.yml manifest).
Added "-p" pristine flag to rebuild platforms while removing build
directory.

Co-developed-by: Krzysztof Frydryk <krzysztofx.frydryk@intel.com>
Signed-off-by: Krzysztof Frydryk <krzysztofx.frydryk@intel.com>
Signed-off-by: Andrey Borisovich <andrey.borisovich@intel.com>
2022-08-03 11:43:22 +01:00
Krzysztof Frydryk 2c9772d5ad Add west.yml configuring zephyr dependencies from sof
Added west.yaml file, that manages zephyr repo and its dependencies.
Additionally west manifest may now control sof submodules.
Added submanifests directory with README.txt file so the
submanifests directory exists in version control - otherwise
west update command returns error. This is bug described in
https://github.com/zephyrproject-rtos/west/issues/594 .

Co-developed-by: Andrey Borisovich <andrey.borisovich@intel.com>
Signed-off-by: Andrey Borisovich <andrey.borisovich@intel.com>
Signed-off-by: Krzysztof Frydryk <krzysztofx.frydryk@intel.com>
2022-08-03 11:43:22 +01:00
Ming Jen Tai f781a0b554 Modify used static libraries
With the version released in 20220728, some libraries are removed or renamed.

Signed-off-by: Ming Jen Tai <mingjen_tai@realtek.com>
2022-08-03 10:50:59 +01:00
Marc Herbert dcf0577a77 logger: allow starting before the driver is loaded
Don't fail immediately when the driver is not loaded. Use inotify
instead to wait for /sys/kernel/debug/sof/[e]trace to appear.

This makes it possible to start before the driver is loaded which
reduces considerably the chances of missing early logs.

Fixes a small part of https://github.com/thesofproject/linux/issues/3275

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2022-08-02 16:48:27 +01:00
Marc Herbert af6bd41a99 logger: open /sys/debug/fw_version _after_ /sys/debug/[e]trace
Open /sys/kernel/debug/sof/fw_version _after_
/sys/kernel/debug/sof/[e]trace because reading the former is optional
and the latter is not.

So when the driver is not loaded, we get the same (missing trace) error
trace message whether we use the -n option or not.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2022-08-02 16:48:27 +01:00
Tomasz Leman ee06c700f3 ipc4: setdx: error checking on core disabling
If operation of disabling secondary core fails at any of the steps, host
will only learn about it after checking the SPA/CPA bits.

This patch adds checking core state after it disabling. If core will be
still active ipc response will report error.

Additionally, it removes an outdated comment.

Signed-off-by: Tomasz Leman <tomasz.m.leman@intel.com>
2022-08-02 16:13:07 +01:00
Serhiy Katsyuba 8591087c4f ipc4: add mixin gain support
Add possibility to apply gain to mixed sources to avoid
mixed output saturation. Gain (attenuation) is configurable
per source and comes from host via IPC4 large config set.

Signed-off-by: Serhiy Katsyuba <serhiy.katsyuba@intel.com>
2022-08-02 15:55:10 +01:00
Laurentiu Mihalcea 12f71cd8df pipeline-stream: Fix pipeline_get_timestamp dai posn query
Because of the fact that some platforms use a software host DMA
(e.g: i.MX8QM) pipeline_copy() implicitly calls
pipeline_get_timestamp() when a host copy operation occurs.

The issue with this is that when the host copy operation
occurs, pipeline_for_each() is in the middle of a pipeline
graph traversal. Because of this, pipeline_get_timestamp()
is not able to get to the DAI because it will stop the
pipeline graph traversal at the host buffer (because
of the fact that the 'walking' flag of the buffer is set
to true). This is bad because this way, pipeline_get_timestamp()
is unable to get the updated dai position.

The aim of this fix is to bypass the conditioned pipeline graph
traversal (based on the 'walking' flag) and use an unconditioned
pipeline graph traversal (pipeline_get_dai_comp())
in order to reach the DAI component and get its updated position.

Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
2022-08-02 15:53:58 +01:00
Laurentiu Mihalcea aac20298d2 pipeline-graph: pipeline: Add dir parameter to pipeline_get_dai_comp
Originally, pipeline_get_dai_comp would be able to find the
DAI only for the PLAYBACK case because the direction would
be hardcoded and would be PPL_DIR_DOWNSTREAM.

The aim of this change is to make pipeline_get_dai_comp more
general and give it the ability to find the DAI for the
CAPTURE case as well.

Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
2022-08-02 15:53:58 +01:00
Guennadi Liakhovetski 3ce3bc9ccb rtnr: fix a bad commit
Commit b832e96b66 ("rtnr: fix buffer acquisition") got damaged
during a rebase, re-add the dropped part, fixing buffer acquisition
in rtnr_prepare().

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2022-08-02 15:53:05 +01:00
Marc Herbert f777417400 Add new submanifests/sof-ci-jenkins/zephyr-override.yml
This file provides the flexibility to test any Zephyr commit in Linux
CI without any pollution of `git -C sof describe --dirty`. See (too)
long discussion in #6005 for details.

This new file will have no effect until #6005 is merged. However it can
and SHOULD be merged before #6005 because #6005 is backwards
incompatible and requires a "flag day" and the synchronization of
several moving parts. So merging this commit earlier means having one
less moving part to synchronize and it will simplify "flag day"
rehearsals.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2022-08-01 16:38:19 +01:00
Seppo Ingalsuo b0336346f7 [SKIP CI] Tools: Tune: SRC: Add missing gain to generate scripts
Patch a0ff2bb277 added field .gain to configuration data for
src_generate() but the previous generator scripts were not
updated to set it. This patch fixes in them the error about
undefined gain by setting it to previous -1 dB default.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2022-08-01 11:11:56 +01:00
Seppo Ingalsuo 978827f7fc [SKIP CI] Tools: Tune: SRC: Add to coefficients data Doxygen cond comments
This patch updates the SRC tool to export same guidance for
Doxygen as added by a previous patch for coefficients
header files. The added comments to begin and end are:

/** \cond GENERATED_BY_TOOLS_TUNE_SRC */
/** \endcond */

The impacted headers remain identical so they don't need update.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2022-08-01 11:11:56 +01:00
Daniel Baluta 1c018d517f timer: Introduce sof_cycle_get_64
With Zephyr, SOF uses k_cycle_get_64() API in order to
count clock cycles.

Not all platforms have a 64bit counter (e.g i.MX dsp integration
only has xtensa timer which is limited to 32 bits).

So, instead of using k_cycle_get_64 introduce new API sof_cycle_get_64
which keeps the existing behavior for platforms which define
CONFIG_TIMER_HAS_64BIT_CYCLE_COUNTER, otherwise use k_uptime_ticks().

See comments from @andyross at
https://github.com/zephyrproject-rtos/zephyr/pull/48318

Suggested-by: Andy Ross <andrew.j.ross@intel.com>
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
2022-08-01 11:09:39 +01:00
Krzysztof Frydryk a6e936359c src: enable hifi4 optimized src build with zephyr
Add src_hifi4.c to sources when building with zephyr.

Signed-off-by: Krzysztof Frydryk <krzysztofx.frydryk@intel.com>
2022-07-27 23:08:16 +01:00
Krzysztof Frydryk d25b64950e ipc4: set pipeline components dir based on source component
Prefer to use source components direction, rather than dai direction when
setting pipeline components direction. Accept first direction set in
pipeline. This properly handles
host_copier -> module -> host_copier pipelines.

Signed-off-by: Krzysztof Frydryk <krzysztofx.frydryk@intel.com>
2022-07-27 23:04:54 +01:00
Balakishorepati 8ec680cf2e platform: amd: renoir: Configure dma descriptor
configure dma descriptor base and count during firmware bootup.

Signed-off-by: Balakishorepati <balaKishore.pati@amd.com>
2022-07-27 22:24:09 +01:00
Balakishorepati 8cf0bea7a3 drivers: amd: Bug fixes and optimizations
1. Fix avail and free bytes for BT and SP modes.
2. Code cleanup and code optimizations.

Signed-off-by: Balakishorepati <balaKishore.pati@amd.com>
2022-07-27 22:24:09 +01:00
Balakishorepati a2f5b86882 drivers: amd: renoir: Fix no audio issue.
while simultaneous playback and internal mic capture usecases
are running, there is a case where dmic driver was clearing the
playback interrupt.This might cause noise in playback or no audio
in speaker.Done changes to clear only dmic interrupt status only
in dmic irq handler.

Signed-off-by: Balakishorepati <balaKishore.pati@amd.com>
2022-07-27 22:24:09 +01:00
Paul Olaru e4c2872b60 audio: module_adapter: Visual fixes to kconfig
Group together the Cadence main Kconfig option with the options related
to various Cadence based codecs.

This is only a visual fix.

Signed-off-by: Paul Olaru <paul.olaru@nxp.com>
2022-07-25 21:35:44 +01:00
Paul Olaru 88325b9560 audio: kconfig: Group module adapter configs with the main module adapter config option
When module adapter is enabled, it is best to keep the new related
options next to it, rather than one option after that.

Signed-off-by: Paul Olaru <paul.olaru@nxp.com>
2022-07-25 21:35:44 +01:00
Andrula Song bd205292a3 Audio: Pcm_converter: Optimize the signed type converter functions
Deprecate the usage of circular buffer check while doing convert, and
use 2-way and 4-way xtensa instructions first to optimize the converter
functions, and process the left samples one by one to avoid potential
risk of memory access overrun. Here are the results:
Optimize pcm_convert_s16_to_s24 and save about 38% cycles;
Optimize pcm_convert_s24_to_s16 and save about 25% cycles;
Optimize pcm_convert_s16_to_s32 and save about 39% cycles;
Optimize pcm_convert_s32_to_s16 and save about 40% cycles;
Optimize pcm_convert_s32_to_s24 and save about 38% cycles;
Optimize pcm_convert_s24_to_s32 and save about 47% cycles;

Signed-off-by: Andrula Song <xiaoyuan.song@intel.com>
2022-07-25 21:20:14 +01:00
Krzysztof Frydryk 95e7d9605a dai-zephyr: Set dai rate in config
Fill in cfg.rate to be used by zephyr native drivers as rate is not
always present in ipc config.

Signed-off-by: Krzysztof Frydryk <krzysztofx.frydryk@intel.com>
2022-07-25 21:18:19 +01:00
Andrula Song 54ab3c3e86 Audio: copier: Fix the potential risk of memory overrun
Fix the memory overrun risk of odd samples to be processed.
Since the 2-way xtensa instruction would always process 2
samples and there would be risk of memory overrun at the
boundary of buffer.

Signed-off-by: Andrula Song <xiaoyuan.song@intel.com>
2022-07-25 21:17:34 +01:00
Jaroslaw Stelter f9741cb0ce Connect intel_module_adapter with generic module adapter.
Added glue logic to integrate with module adapter
the loadable modules developed under Intel
IADK Framework.

Signed-off-by: Jaroslaw Stelter <Jaroslaw.Stelter@intel.com>
2022-07-25 21:10:22 +01:00