Commit Graph

8061 Commits

Author SHA1 Message Date
Guennadi Liakhovetski a1b9f35cc9 cache: dma: always use accessors with shared data
Access to objects, defined with a SHARED_DATA attribute should only
be performed, using the platform_shared_get() function at run-time or
using cache_to_uncache_init() at initialisation time.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2022-03-18 20:51:39 +00:00
Guennadi Liakhovetski 528accc80b cache: add cache_to_uncache_init() to all platforms
cache_to_uncache_init() is needed to convert addresses from cached to
uncached aliases in a preprocessor-friendly way. Add it to all
platforms.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2022-03-18 20:51:39 +00:00
Guennadi Liakhovetski dbd9a0e688 cache: platform: always use platform_shared_get() with shared data
Access to objects, defined with a SHARED_DATA attribute should only
be performed, using the platform_shared_get() function.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2022-03-18 20:51:39 +00:00
Guennadi Liakhovetski 4b3783d6a7 cache: memory: always use platform_shared_get() with shared data
Access to objects, defined with a SHARED_DATA attribute should only
be performed, using the platform_shared_get() function.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2022-03-18 20:51:39 +00:00
Guennadi Liakhovetski c9f2ac7c26 cache: idc: always use platform_shared_get() with shared data
Access to objects, defined with a SHARED_DATA attribute should only
be performed, using the platform_shared_get() function.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2022-03-18 20:51:39 +00:00
Guennadi Liakhovetski 904e031b24 notify: resolve a name conflict
notify_data is a name of a structure, a field in a structure, a
static object and a local variable in several functions. Use a
different name to at least avoid conflicting static and local
variables.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2022-03-18 20:51:39 +00:00
Guennadi Liakhovetski 8a3968cfbf cache: always use platform_shared_get() with shared data
Access to objects, defined with a SHARED_DATA attribute should only
be performed, using the platform_shared_get() function.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2022-03-18 20:51:39 +00:00
Guennadi Liakhovetski f60dd8527c ssp: resolve a name conflict
mn is a name of a structure, a field in a structure, a static object
and a local variable in several functions. Use a different name to at
least avoid conflicting static and local variables.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2022-03-18 20:51:39 +00:00
Guennadi Liakhovetski 626aad475a pipeline: resolve a name conflict
pipeline_posn is a name of a structure, a field in a structure, a
static object and a local variable in several functions. Use a
different name to at least avoid conflicting static and local
variables.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2022-03-18 20:51:39 +00:00
Guennadi Liakhovetski eca1aff7ca cache: use the .shared_data section with single core too
Shared objects are placed into a separate section to make sure they
don't share cache lines with core-local data. This must also be done
in single-core configurations because those configurations perform
uncached access and manage cache manually too.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2022-03-18 20:51:39 +00:00
Rander Wang ebf940e31e ipc4: don't get dai position when dai is not ready
Fix fw panic in ipc4 linux driver test. When dai
and host are in different pipelines, dai pipeline may be
prepared after host pipeline, in this case we can't get
dai position. The pipeline of copier component is set
when pipeline is prepared, now set it in initialization
function to avoid above case.

Signed-off-by: Rander Wang <rander.wang@intel.com>
2022-03-18 16:33:02 +00:00
Ming Jen Tai 88925cddb0 [RTNR] Reserve more memory for RTNR
Current RTNR version( 20220314 ) requires about 320KB heap memory, which is a little bit larger than previous versions.

Signed-off-by: Ming Jen Tai <mingjen_tai@realtek.com>
2022-03-18 16:32:27 +00:00
Andrey Borisovich ce3264a507 platform: Move configuration from Zephyr to SOF
Move software configuration from Zephyr samples directory
to SOF platforms directory using Zephyr overlay mechanism.
How it works:
1. Gets zephyr board defconfig values
2. Applies Zephyr samples prj.conf values on top of it
3. Then applies our new overlay.conf on top of it
4. Final "summary" of Kconfig settings is written to autoconf.h header

Signed-off-by: Andrey Borisovich <andrey.borisovich@intel.com>
2022-03-18 16:14:19 +00:00
Pin-chih Lin 0c634ab6f7 topology: add waves and waves-2way for sof-adl-max98357a-rt5682 tplg
Add support for waves codec for both two and four max98357a speaker
amplifiers on ADL boards.

Signed-off-by: Pin-chih Lin <johnylin@google.com>
2022-03-17 13:07:25 -07:00
Ming Jen Tai bcccf1253d [RTNR] Add Realtek Noise reduction support option to ADL with MAX98360A topology
Signed-off-by: Ming Jen Tai <mingjen_tai@realtek.com>
2022-03-16 17:44:29 -07:00
Ranjani Sridharan 219903903d codec_adapter: remove init_done check
Remove the extra module_process() call when the init_done flag is not
set. Pass all the available bytes to the codec's process callback and
let it handle initialization and processing depending on the number of
bytes available.

Modify all codec implementations to perform init in their first process
callback so as to not break bisect.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2022-03-16 18:50:33 +02:00
Ranjani Sridharan 9272126dd3 codec_adapter: move the check for required data into codec implementation
Move the check for required data for each process callback into the
individual codec implementation. This is in preparation for removing
in_buff_size from struct  module_processing_data eventually.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2022-03-16 18:50:33 +02:00
Rander Wang b6eaf11121 ipc4: copier: reserve cd data for reset state
Progress bar of audio player disappears when it is dragged by
mouse. In this case pipeline is first paused then reset, paused
started again. Cd data is initialized when copier is created and
will not be initialized again after reset operation, so we can't
clear cd data in reset state, only reset stream position and used
dai or host.

Signed-off-by: Rander Wang <rander.wang@intel.com>
2022-03-16 16:31:09 +00:00
Rander Wang 4002483e7d ipc4: dai: reset llp position to 0 for dai_reset
Progress bar of audio player disappears when it is dragged by
mouse. In this case pipeline is first paused then reset.Driver
checks the llp position in memory windows by node id. Driver
can't find llp position since fw cleared node id. This patch
reserves node id for pause-reset case and only reset llp position.
The node_id will be cleared when dai is free.

Signed-off-by: Rander Wang <rander.wang@intel.com>
2022-03-16 16:31:09 +00:00
Guennadi Liakhovetski 2e45906807 zephyr: ll-schedule: initialise n_tasks
When the ll-scheduler is initialised and its private data is
allocated, all fields of that data have to be initialised. Add a
missing n_tasks initialisation.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2022-03-16 13:08:30 +00:00
Adrian Warecki c1e75603b2 timer: Use Zephyr timer API
Replaced sof timer related functions with Zephyr alternative.

Signed-off-by: Adrian Warecki <adrianx.warecki@intel.com>
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
2022-03-16 12:02:29 +00:00
Adrian Warecki 619065f164 timer: Separate xtos timer API and add wrappers for Zephyr timer API
Created a new directory xtos-wrapper for xtos related files. Moved timer
header there.

Signed-off-by: Adrian Warecki <adrianx.warecki@intel.com>
2022-03-16 12:02:29 +00:00
Adrian Warecki c38eb8fdd4 zephyr_domain_init: Remove unused timer parameter
Removed needless ll_timer field from structure zephyr_domain and timer
parameter from function zephyr_domain_init.

Signed-off-by: Adrian Warecki <adrianx.warecki@intel.com>
2022-03-16 12:02:29 +00:00
Adrian Warecki e0e8980eb1 dma-trace: Move log time delta from timer to dma_trace_buf struct.
Function platform_timer_set_delta was replaced with generic
clock_ns_to_ticks. Moved log time delta value from timer structure to the
dma_trace_buf.

Signed-off-by: Adrian Warecki <adrianx.warecki@intel.com>
2022-03-16 12:02:29 +00:00
Adrian Warecki 3cbab7ad5b clk: Add new function clock_ns_to_ticks
Added the new function clock_ns_to_ticks which allows conversion from
nanoseconds to ticks.

Signed-off-by: Adrian Warecki <adrianx.warecki@intel.com>
2022-03-16 12:02:29 +00:00
Adrian Warecki 5245c2e5f4 wait: Add functions to wait ms and us
Waiting for a certain time has been simplified by adding a functions
wait_delay_ms and wait_delay_us. Previously now, its required a conversion
between time to ticks using clock_ms_to_ticks.

Signed-off-by: Adrian Warecki <adrianx.warecki@intel.com>
2022-03-16 12:02:29 +00:00
Ben Zhang 51e7c61801 google_rtc_audio_processing: Add config controls
1. Added a byte control to accept Google RTC audio processing
   configuration blob
     `name='GOOGLE_RTC_PROCESSING10.0 Config'`

Tested using:
    sof-ctl -n 48 -t 0 -b -r -s /root/tuning.bin
And verified correct audio processing behaviour on a alderlake board.

Signed-off-by: Ben Zhang <benzh@chromium.org>
Signed-off-by: Lionel Koenig <lionelk@google.com>
2022-03-15 16:27:53 -07:00
Lionel Koenig d792b0602d google-rtc-audio: Make AEC reference stereo
To provide echo cancelling effect while a stereo signal is played out,
the RTC Audio processing component required to have both left and right
channel as reference.

This CL ensure this is the case.

Signed-off-by: Lionel Koenig <lionelk@google.com>
2022-03-15 09:45:12 -07:00
Marc Herbert a62fc4b9af xtensa-build-zephyr.py: restore ability to override CI
This has been useful to test Zephyr work in progress.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2022-03-15 13:39:12 +00:00
Marc Herbert ffdf001eee xtensa-build-zephyr.py: clone zephyr with --depth 5
This restores the performance of the original shell script and makes a
big difference in CI. CI clones over and over again whereas developers
clone rarely and can run a simple git fetch --unshallow.

Don't use --depth 0 to provide more context in the logs and also make it
more obvious that this is a shallow clone and not just git log -n 1.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2022-03-15 13:39:12 +00:00
Marc Herbert 5a80db78af xtensa-build-zephyr.py: give -z option a long form --zephyr-ref
This makes the code more readable and other scripts possibly too.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2022-03-15 13:39:12 +00:00
Marc Herbert df6b48c889 xtensa-build-zephyr.py: make "unsupported OS" actually a warning
Running on a mac crashed with "undefined xtensa_tools_version_postfix",
that should not be fatal (there are other toolchains).

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2022-03-15 13:39:12 +00:00
Rander Wang e72a05fce0 ipc4: revert "ipc4: fix pipeline reset"
This reverts commit 819c023d23.
Fix a regression issue on windows.

Component is set to reset status in pipeline_reset, so no
need to propagate reset status to each component.

Pipe_reset may return PATH_STOP of value 1 and this is not
a error status, so we don't return error for this case.

Signed-off-by: Rander Wang <rander.wang@intel.com>
2022-03-15 13:05:01 +00:00
Allen-kh Cheng edc80c793f topology1: add sof-mt8195-mt6359-max98390-rt5682 topology
Add sof-mt8195-mt6359-max98390-rt5682 topology

Signed-off-by: YC Hung <yc.hung@mediatek.com>
Signed-off-by: Trevor Wu <trevor.wu@mediatek.com>
Signed-off-by: Allen-KH Cheng <allen-kh.cheng@mediatek.com>
2022-03-14 15:36:39 +00:00
YC Hung 8b6fb345da mediatek: mt8195: afe-drv: fix fs cppcheck warning
Define fs as signed integer in afe_irq_config to fix cppcheck
warning.

Fixes: 1b7f8ed2a6(drivers: mtk: add afe driver for mtk mt8195)
Signed-off-by: YC Hung <yc.hung@mediatek.com>
2022-03-14 15:36:07 +00:00
Guennadi Liakhovetski b5248054c5 volume: use rmalloc() for an internal allocation
rballoc() is used for buffer allocations, no need to use it for
volume internal control structures.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2022-03-14 15:32:46 +00:00
Marc Herbert d8572420d0 xtensa-build-zephyr.py: un-hardcode execute_command() wrapper
Duplicating all parameters of subprocess.run() is not just tedious and
error-prone, it makes the script compatible only with a range of
specific Python versions.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2022-03-14 15:04:45 +00:00
Fred Oh f039b9eda1 topology2: common: fix to add '$' for SAMPLE_TYPE_LSB_INTEGER
$ and S are hard to tell in text editor. Without '$' final value are
much different.

Signed-off-by: Fred Oh <fred.oh@linux.intel.com>
2022-03-14 15:03:52 +00:00
Kai Vehmanen 8f3a78dc6a xtensa-build-zephyr.sh: fix shellsheck warning
In scripts/xtensa-build-zephyr.sh line 199:

  if test $platform = tgl-h ; then
           ^-------^ SC2086: Double quote to prevent globbing
			     and word splitting.

Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
2022-03-14 11:43:32 +00:00
Seppo Ingalsuo 4013215f93 Audio: Move multiband_drc component source to end of sources
This patch fixes issue in testbench when multiband-drc is executed.
Since the library libsof_multiband_drc.so includes also crossover
and drc component sources the topology component register is done
for drc instead of multiband-drc. Therefore testench executes drc
when multiband-drc run is attempted.

Placement of multiband-drc as last in sources list is a workaround
to fix but recommended now since this impacts only testbench. The
proper fix of moving DRC and Crossover parts to library would be
a much larger change.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2022-03-14 11:40:22 +00:00
Seppo Ingalsuo 6f0bb2b012 Topology: Add sof-hda-generic topologies to test multiband-drc
This patch adds build of topologies sof-hda-generic-multiband-drc.tplg
and sof-hda-generic-2ch-multiband-drc.tplg. The processing happens in
pipeline part after mixer. Volume is controlled in PGA before mixer.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2022-03-14 11:40:22 +00:00
Seppo Ingalsuo bdcaa295c0 Audio: Multiband DRC: Optimize source and sink buffers access
This patch replaces the audio stream read/write frag functions
based source read and sink write operations. The processing is
performed in blocks those are based on number of samples from
audio_stream_samples_without_wrap_s16/s24/32() function.

On TGL-H and stereo 48 kHz playback stream the MCPS is decreased
from 216.8/216.8/216.0 to 201.6/200.4/200.8 for s16/s24/s32
formats. The saving is in average 15.6 MCPS.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2022-03-14 11:40:22 +00:00
Seppo Ingalsuo c186b41818 Audio stream: Add audio_stream_samples_without_wrap_s16/s24/s32 functions
This patch adds functions to retrieve number of PCM samples until
source or sink buffer circular wrap need.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2022-03-14 11:40:22 +00:00
Kai Vehmanen 6d0ecc37cc xtensa-build-all: add a separate target for JSL
Use intel_adsp_cavs20_jsl Zephyr board when building for
Intel Jasper Lake.

BugLink: https://github.com/thesofproject/sof/issues/4539
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
2022-03-14 11:35:35 +00:00
Marc Herbert 177e18f701 xtensa-build-zephyr.sh: add new -u zephyr_remote option
Same -u option as the new Python script.

We need this for the new sof/stable-v2.1 branch on
https://github.com/thesofproject/zephyr while our CI has not entirely
switched to the python script yet.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2022-03-14 11:32:59 +00:00
Balakishorepati 901d3947b8 Revert "drivers: amd: renoir: Fix 16K sample rate for dmic"
This reverts commit 82886c6b41.

Signed-off-by: Balakishorepati <balaKishore.pati@amd.com>
2022-03-11 13:19:53 +00:00
Balakishorepati 8be523eb79 topology1: Set Dmic samplerate to 48000Hz
Set default samplerate for DMIC to 48000Hz for
amd platforms.

Signed-off-by: Balakishorepati <balaKishore.pati@amd.com>
2022-03-11 13:19:53 +00:00
Bard Liao ccde447b05 topology2: add be pipeline for sdw
Use two separated pipelines for BE and FE.

Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
2022-03-11 13:03:07 +00:00
Marc Herbert 0ee59c317e xtensa-build-zephyr.py: do not update SOF submodules after west init
This script is run from an existing SOF repo that is assumed to be fully
initialized. Updating existing submodules is a potentially destructive
operation.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2022-03-11 12:52:41 +00:00
Marc Herbert 78667c028d xtensa-build-zephyr.py: do not modify submodules after building!
The older shell script had a deprecated convenience hack to clone
submodules before building rimage but _only if submodules were missing_!

While trying to preserve that, the new script changed that to an
unconditional git submodule update that can be destructive when
submodules are already present.

Generally speaking, using git and building must always be two very
distinct activities. No one wants the source code to change quietly from
one build to the next.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2022-03-11 12:52:41 +00:00