Commit Graph

7993 Commits

Author SHA1 Message Date
Peter Ujfalusi d5aa222e5d ipc4: helper: Remove unused sink_cfg from ipc4_create_buffer()
Compilation fails with gcc:

src/ipc/ipc4/helper.c: In function 'ipc4_create_buffer':
src/ipc/ipc4/helper.c:210:41: error: variable 'sink_cfg' set but not used [-Werror=unused-but-set-variable]
  210 |  struct ipc4_base_module_cfg *src_cfg, *sink_cfg;
      |                                         ^~~~~~~~
cc1: all warnings being treated as errors
make[2]: *** [CMakeFiles/sof.dir/build.make:394: CMakeFiles/sof.dir/src/ipc/ipc4/helper.c.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:2042: CMakeFiles/sof.dir/all] Error 2
make: *** [Makefile:136: all] Error 2

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
2022-03-28 16:15:00 +01:00
Joe.Cheng 04ff2f99e2 config:ADL:Add DTS config
Enable DTS SDK and SOF EQ IIR on ADL platform

Signed-off-by: Joe.Cheng <joe.cheng@xperi.com>
2022-03-28 16:14:04 +01:00
Joe.Cheng 64378c57f0 topology1:ADL:add DTS topology
The DTS Codec can be conditionally added to the sof-adl-nau8825 topology
on those pipelines intended for headphone and speaker output.

Signed-off-by: Joe.Cheng <joe.cheng@xperi.com>
2022-03-28 16:14:04 +01:00
Kai Vehmanen 6a8b2e89ed zephyr: ll-scheduler: k_sem handle must be in coherent memory
Allocate "struct zephyr_ll_pdata" in shared/coherent memory as it embeds
a "struct k_sem" object. Zephyr kernel code assumes the object to be in
cache coherent memory, so incorrect operation may result if condition is
not met.

Long test runs of all-core capture stress test on Intel cAVS2.5
platform show failures that are fixed with this change.

Discovered via runtime assert in zephyr/kernel/sched.c:pend() that
is hit without this patch.

BugLink: https://github.com/thesofproject/sof/issues/5556
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
2022-03-28 15:25:10 +01:00
Jairaj Arava 95c53eafc7 topology1: add DMIC 48K Core ID flag to CMake for RTNR
For builds with no Hotword on DSP, generic dmic m4 is used.
RTNR is running on DMIC CORE ID 1. Hence adding the flag.

Signed-off-by: Jairaj Arava <jairaj.arava@intel.com>
2022-03-24 13:39:06 -07:00
Liam Girdwood 0db4a82964 tplg parser: refactor and cleanup part 1
No functional change.

Move some common testbench code into the topology parser and group
feature parsing by file name.

Add a tplg_ prefix to external APIs without a prefix, others with an
existing prefix to follow this change.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2022-03-24 16:54:40 +00:00
Andrula Song fcc891ef9b audio: crossover: fix the mistake of sink stream pointer
to fix the mistake of using audio_stream_read_frag* while
getting output sink buffer pointer.

Signed-off-by: Andrula Song <xiaoyuan.song@intel.com>
2022-03-24 15:00:24 +00:00
Andrula Song f8934a9e22 audio: dcblock: fix mistakes of sink stream pointer
to fix the mistakes of using audio_stream_read_frag*
while geeting output sink buffer pointer.

Signed-off-by: Andrula Song <xiaoyuan.song@intel.com>
2022-03-23 13:39:05 -07:00
Iris Wu 8ebb7478b8 overlays:tgl: Configure format converter for IPC4
Enable format converters when building tgl firmware with Zephyr
and IPC4.

Signed-off-by: Iris Wu <xiaoyun.wu@intel.com>
2022-03-23 14:27:55 +00:00
Jyri Sarha ece6d76b8a ll_schedule: Update DSP load tracker to provide per task numbers
Calculates average and records the maximum execution cycles taken by
each execution round and prints the results out once every 1024 round,
e.g. roughly once per second with a typical 1ms tick configuration. The
output is mimicked from the Zephyr side scheduler output. There is a
Kconfig menu option under debug menu to disable this feature. Currently
the default is on.

Signed-off-by: Jyri Sarha <jyri.sarha@intel.com>
2022-03-23 14:24:31 +00:00
Ranjani Sridharan 09ec53876c codec_adapter: return if copy_bytes is 0
Return is copy_bytes is 0 before calling copy/writeback which will do
nothing anyway.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2022-03-23 13:58:27 +00:00
Ranjani Sridharan f63951832f codec_adapter: Remove the status variable in module_set_configuration()
Remove the static variable that holds the total config size and use
the new field, new_cfg_size in struct module_data to store the size of
the config data.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2022-03-23 13:58:27 +00:00
Rafal Redzimski a0e55830a0 idc: modify idc payload size and align to cache line size
Modify IDC payload size to be cache aligned and have size of 2 cache
lines.

Signed-off-by: Rafal Redzimski <rafal.f.redzimski@intel.com>
Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2022-03-23 13:48:31 +00:00
Rafal Redzimski efd6d4a3e4 zephyr: correct the idc payload initialization
For zephyr case remove the dynamic allocation of per-core
idc elements since these are already statically allocated
in a form of idc array in zephyr/wrapper.c.
The payload pointer initialization need to use idc entries
which are returned by the get_idc() call.

Signed-off-by: Rafal Redzimski <rafal.f.redzimski@intel.com>
2022-03-23 13:48:31 +00:00
Lionel Koenig 9d7a6bda73 google_aec: Use frag_write to write data.
Due to a mistake, I was using the read API to get a pointer to the
place to write data. This commit corrects it.

Signed-off-by: Lionel Koenig <lionelk@google.com>
2022-03-22 12:32:35 -07:00
Lionel Koenig b0b8bc7a34 sof-ctl: Allow setting arbitrary size for controls
sof-ctl assumed the binary control were of size of a
multiple of unsigned integer.
This caused the control byte array to be truncated when the
size of the control was 6 bytes.
This change allow setting any size of control in binary form.
Using CSV will always end up with a number of unsigned integer size.

I tested this change using the Google RTC Audio processing with control
of size:
  - 6 bytes,
  - 2 bytes
  - and 4 bytes.

Signed-off-by: Lionel Koenig <lionelk@google.com>
2022-03-22 13:46:49 +00:00
Rander Wang 9e15ef80af ipc4: dai: update wallclock for position update
The original code was copied from ipc3 path but the wallclock usage
is different. In ipc4 path fw needs update it for each position update.

Signed-off-by: Rander Wang <rander.wang@intel.com>
2022-03-21 17:02:13 +00:00
Ranjani Sridharan 4f8a70dd23 codec_adapter: Copy from all output buffers
Modify all codec implementations to copy the produced samples to the
output_buffer. Copy the produced samples from all output buffers in the
sink_buffer_list. Remove local_buff from struct processing_module as it
is no longer needed.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2022-03-21 18:46:22 +02:00
Ranjani Sridharan dc12de821b codec_adapter: Add a helper function to copy from local buffer to sink
Add a helper function to copy from local buffer to the sink buffer. This
will be used to copy from all output buffers.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2022-03-21 18:46:22 +02:00
Ranjani Sridharan 28fdfdc4e0 codec_adapter: Add a sink_buffer_list to struct processing_module
Add a sink_buffer_list to struct processing_module to support multiple
output buffers for modules. Allocate sink buffers for all sinks during
prepare and copy the produced samples from the output_buffers into the
respective sink buffers during copy.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2022-03-21 18:46:22 +02:00
Ranjani Sridharan 64b2cb3bc8 codec_adapter: no need to init source
Remove init for source. It is not needed anymore.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2022-03-21 18:46:22 +02:00
Ranjani Sridharan d1b5ad6014 codec_adapter: no need to init ret
remove init for ret.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2022-03-21 18:46:22 +02:00
Rander Wang 4ed5c1fce1 ipc4: add volume_params support
Fix fw error found by windows audio setting test.
In ipc3 path, host driver sends ipc_hw_params message
to fw but in ipc4 path fw needs to build component
params from component config.

This patch add params function for volume.

Signed-off-by: Rander Wang <rander.wang@intel.com>
2022-03-21 16:23:54 +00:00
Libin Yang 5ef9e496d0 topology1: CMakefile: add sof-adl-rt711-l2-rt1316-l01
Add sof-adl-rt711-l2-rt1316-l01 support. This tplg doesn't include any
local MICs.

Signed-off-by: Libin Yang <libin.yang@intel.com>
2022-03-21 16:21:29 +00:00
Libin Yang 0bb995a7a6 topology1: sof-icl-rt711-rt1308-rt715-hdmi: add NO_LOCAL_MIC & NOAMP support
add sof-icl-rt711-rt1308-rt715-hdmi NO_LOCAL_MIC & NOAMP support

Signed-off-by: Libin Yang <libin.yang@intel.com>
2022-03-21 16:21:29 +00:00
Libin Yang 4bb686380e topology1: sof-icl-rt711-rt1308-rt715-hdmi: correct the link description
The links are dynamically assigned. The descriptions should
be changed correspondingly.

Signed-off-by: Libin Yang <libin.yang@intel.com>
2022-03-21 16:21:29 +00:00
Libin Yang 2898a1a6d9 topology1: sof-icl-rt711-rt1308-rt715-hdmi: remove NO_AGGREGATION
NO_AGGREGATION is never used now. Let's remove it.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Libin Yang <libin.yang@intel.com>
2022-03-21 16:21:29 +00:00
Rander Wang 0f74422e32 ipc4: stop dma when dai is reset
Fix FW error when changing progress bar in windows auido player.
For this case, pipeline is paused and reset and then paused and
started.  FW reports a error that dma is still running when pipeline
is started.

Signed-off-by: Rander Wang <rander.wang@intel.com>
2022-03-21 16:01:55 +00:00
Curtis Malainey 06ee0fef11 pipeline: params: don't use uninitialized hw_params
pipeline_comp_hw_params does 2 things, it fetches the hw_params from the
DAI and writes those parameters to buffers. The issue here is that we
walk from host to DAI, so any buffer we see along the way gets set with
uninitialized hw_params as we don't get the params till the end of the
walk. Typically this is not an issue in most pipelines that are linear
as the following call to pipeline_comp_params will overwrite any bad
values in the buffer params. Not good practice but not harmful. The
problem arises when components such as the demux or SRC which pass flags
into comp_verify_params receive these bad values. There are edge cases
as a result where the values are not cleared and the buffers end up with
bad data. The result is usually an xrun, in the case of identifying this
bug, the uncleared buffer had 4.6k channels.

Signed-off-by: Curtis Malainey <cujomalainey@chromium.org>
2022-03-21 15:42:31 +00:00
Guennadi Liakhovetski e1ca6f6252 dw-dma: allocate uncached memory for LLI always
Multi-core configurations already use uncached memory for LLI. This
also makes sense to avoid having to manually synchronise cache. Force
LLI objects uncached.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2022-03-21 15:35:54 +00:00
Rafal Redzimski cd0c1f99c2 ipc4: fix the compound ipc wait timeout
The number of retries is too small to successfully handle some
compound IPC messages (in particular setting pipeline state to running
in case of multi-core distributed pipeline).

Signed-off-by: Rafal Redzimski <rafal.f.redzimski@intel.com>
2022-03-21 10:23:16 +01:00
Guennadi Liakhovetski 2c4e29187d cache: dai: 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 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