Commit Graph

7993 Commits

Author SHA1 Message Date
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
Marc Herbert 7a847a5bd8 xtensa-build-zephyr.py: de-duplicate common code
De-duplicate this code:

	if args.platforms:
		build_platforms()
		show_installed_files()

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2022-03-10 13:15:11 +00:00
Marc Herbert fc3bc3c805 xtensa-build-zephyr.py: don't git_submodules_update() twice
A second git_submodules_update() immediately after the first one does
not make sense. This looks like something leftover from a past
experiment.

Fixes initial commit 1de3ef3675 ("Rewritten xtensa-build-zephyr.sh to
python")

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2022-03-10 13:15:11 +00:00
Daniel Baluta b18f08d095 zephyr/cmake: Add support for linking with cadence libs
We add support for linking with Cadence AAC/MP3 libs.

Cadence lib MP3 support is enabled via CONFIG_CADENCE_CODEC_MP3_DEC config
symbol. Path to library file needs to be set via CONFIG_CADENCE_CODEC_MP3_DEC_LIB

Similar for AAC.

Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
2022-03-10 09:57:11 +02:00
Adrian Warecki b9d971920e xtensa-build-all.sh: Use appropriate defconfig for tgl-h platform
Recent combination of tgl and tgl-h building resulted in use of an invalid
defconfig file for tgl-h platform. This commit reverts that change.

Fixes: f1e6e1fdd3

Signed-off-by: Adrian Warecki <adrianx.warecki@intel.com>
2022-03-09 11:38:29 -08:00
Seppo Ingalsuo c9d603bb11 Tools: Test: Fix mistake in script test_run.m
Remove the extra argument for fprintf(). For some reason there was
no harm seen but this should trigger an error when run in Octave or
Matlab.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2022-03-09 15:44:06 +00:00
Andrula Song 39205fb5a6 Audio: volume: Optimize source and sink buffers usage
This patch replaces the audio stream read/write frag based
access to source and sink by block processing based on
audio_stream_bytes_without_wrap() bytes count. In this way,
the copy and scale volume function can reduce about 25%
cycles for S16, 34% for S24 and 30% for S32.

Signed-off-by: Andrula Song <xiaoyuan.song@intel.com>
2022-03-09 11:52:31 +00:00
Lionel Koenig 980a5b25b3 topology1: Fix m4 issue in conditional definition
Due to m4 peculiarities it is require to escape the content of an
ifdef. I forgot to add those escaping for around the `SPK_MIC_PERIOD_US`
definition leading to erroneous value if GOOGLE_RTC_AUDIO_PROCESSING was
defined.

Signed-off-by: Lionel Koenig <lionelk@google.com>
2022-03-08 22:05:15 +00:00
Marc Herbert 2ac78a0603 version.cmake: make XTOS and Zephyr .ldc file different from each other
This is especially important considering some sof-bin releases are now
"hybrid": with a mix of XTOS and Zephyr.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2022-03-08 22:02:36 +00:00
Marc Herbert f052cbffaa zephyr/cmake: fix SOF_ROOT_SOURCE_DIR to fix the .ldc checksum
Fixes copy/paste of commit de41202f8f ("zephyr: build: Add initial
build support for SOF application.")

This fixes the dictionary hash when using Zephyr; no more fallback on
the git SHA1.

When using Zephyr, SOF_ROOT_SOURCE_DIR (and SOF_ROOT_BINARY_DIR) are used
only by version.cmake

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2022-03-08 22:02:36 +00:00
Marc Herbert 302ebe3b03 version.cmake: fix git -C sof/ log command when building Zephyr
When building Zephyr, CMAKE_CURRENT_SOURCE_DIR does not point at
SOF. Use SOF_ROOT_SOURCE_DIRECTORY instead.

No impact besides the logs.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2022-03-08 22:02:36 +00:00
Marc Herbert d722ee15b1 version.cmake: --no-abbrev-commit cause github has allowAnySHA1InWant
Some git servers like Github allow fetching by full length SHA so this
useful information to share.

(Others forbid this entirely, see last page of `git help fetch-pack`)

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2022-03-08 22:02:36 +00:00
Marc Herbert 23d2a01777 version.cmake: add comments and fix logs to clarify recursive invocation
version.cmake has a not very intuitive logic to make sure sof_versions.h
is always up to date without triggering a full rebuild. Add comments and
rephrase some logs to make it less hard to follow.

Absolutely zero functional change.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2022-03-08 22:02:36 +00:00
Guennadi Liakhovetski 49f019fe1a dma: make DMA platform data static
Each platform defines a list of DMA controllers and related objects
in their lib/dma.c files. All of them are needlessly defined as
global. Make them all static.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2022-03-08 16:43:30 +00:00
Pierre-Louis Bossart 83ada5ac08 topology: disable SSP0 and SSP1 on APL/GLK to enable Zephyr tests
This is a temporary work-around to enable CI tests while performance
is being optimized.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
2022-03-08 15:17:29 +00:00
Lionel Koenig 21a1ee1d16 topology1: Simplify the DMICPROC selection
This should make sure to surface pipeline period and microphone
processing in the top topology file so incoherence are easier to spot
and correct.

I compared topology1/production/*.conf outputs prior and after the
change: except some new line and comment change introduced by the
simplification, there are no changes.

Signed-off-by: Lionel Koenig <lionelk@google.com>
2022-03-08 14:58:44 +00:00
Adrian Warecki f1e6e1fdd3 xtensa-build-all.sh: Code style correction
Combined case label tgl and tgl-h similarly as in xtensa-build-zephyr.sh
Corrected code formatting.

Signed-off-by: Adrian Warecki <adrianx.warecki@intel.com>
2022-03-08 09:25:28 +00:00
Adrian Warecki 95d887251e xtensa-build-all.sh: Don't override user private key path
If the user doesn't set the path to own private key, the default path is
placed in the variable containing the user's key. This causes a leak of the
default key of one platform to the others platforms, which will treat it as
a key supplied from the user.

Signed-off-by: Adrian Warecki <adrianx.warecki@intel.com>
2022-03-08 09:25:28 +00:00
Ranjani Sridharan 8355f6047a codec_adapter: Move input/output buffer allocation to prepare
Add 3 fields for input_buffers, output_buffers and output_buffer_size
to struct processing_module. Move the memory allocation for input/output
buffers for the module to the prepare op from the copy op.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2022-03-07 12:55:19 -08:00