Commit Graph

10811 Commits

Author SHA1 Message Date
Chao Song ba07a1474e ipc4: remove get_comp()
This function is not used anymore, remove it.

Signed-off-by: Chao Song <chao.song@linux.intel.com>
2023-08-23 11:22:42 +01:00
Chao Song 78619c583f ipc: explicitly get ipc device for component pipeline and buffer
The generic ipc device (struct ipc_comp_dev) assumes
the ID is unique among component, pipeline and buffer,
it is essential for existing ipc_get_comp_by_id()
function to work. This assumption is true for IPC3
but never holds true for IPC4.

The existing IPC4 code uses a trick to make the ID unique,
which also makes the component ID can not comply with
IPC4 primary message. In the IPC4 primary message,
module_id takes the first 16 bits, and instance_id
takes next 8 bits. But the component ID is composed
by 'module_id << 16 | instance_id', we don't see issues
because 'module_id==0' is taken by BringUp and BaseFw
module. So the ID for component doesn't collide with
the ID for pipeline.

In this patch, a new function considering type and
ID is added; four macros for getting component,
buffer and pipeline are added.

This patch prepares for the correction of component ID.

Signed-off-by: Chao Song <chao.song@linux.intel.com>
2023-08-23 11:22:42 +01:00
Kai Vehmanen fd7f866e3a platform: tigerlake: remove remaining build targets for XTOS
With CAVS_LPS removed, we can now remove remaining XTOS build
targets for Tiger Lake.

Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
2023-08-23 12:58:46 +03:00
Kai Vehmanen 0b79666a6d platform: tigerlake: remove CAVS_LPS support
Remove support for Intel cAVS Low Power Sequencer for Power Management.
This code is specific to XTOS builds for Tiger Lake (cAVS)
platforms and no longer used in Zephyr builds.

Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
2023-08-23 12:58:46 +03:00
Hailong Fan ba05d6b507 audio: module_adapter: Solve the build error using xtensa toolchain
Build error info is as follows when compiling with xt-xx toolchain:
1.redefinition of ‘i’
2.‘for’ loop initial declaration used outside C99 mode
Fix the above error.

Signed-off-by: Hailong Fan <hailong.fan@mediatek.corp-partner.google.com>
2023-08-22 16:28:57 +01:00
Rander Wang 5e1a9c05b5 copier: adjust valid format based on sample type
Adjust valid format in copier for some types of dai gateway which
need to use MSB type.

Currently sample type only affect the copier module so we don't do
it in audio_stream_fmt_conversion.

Signed-off-by: Rander Wang <rander.wang@intel.com>
2023-08-22 17:51:56 +03:00
Rander Wang 196f86cde4 topology2: change the sample type for Linux audio system
At first the sample type is set to MSB_INTEGER to follow windows
settings, but actually we use LSB_INTERGER type such as S24_4LE.
Now change the default sample type to LSB_INTERGER to align with
FW usage. For DAI copier we need to use MSB_INTERGER for hardware
requirement. Currently sample type only affect s24/c32 case, so only
change sample type in dai for this format config.

FW will use sample type to choose correct format conversion
function and can deal with Windows audio stream correctly with MSB
s24/c32 format.

out_fmt_cfg is redefined for a alsa-lib bug. Alsa-lib will first process
out_fmt_cfg = '$[($out_channels | ($out_valid_bit_depth * 256)) |
($out_sample_type * 65536)]' in base class and then deal with
out_sample_type, so error is reported. Now first define out_sample_type
and then out_fmt_cfg, everything works.

Signed-off-by: Rander Wang <rander.wang@intel.com>
2023-08-22 17:51:56 +03:00
Rander Wang 87856a73d7 pcm:_converter: simplify the pcm conversion algorithm
Remove gateway type and direction for pcm conversion check and will move
them to copier module. This will make pcm conversion check more general
and simple. Also remove s16/c32 for gateway since it is never used.

Signed-off-by: Rander Wang <rander.wang@intel.com>
2023-08-22 17:51:56 +03:00
Rander Wang 784630f80b ipc4: add S24_4LE_MSB format support
For sample format with 24 bits valid sample bit and 32 bits container,
valid sample is at msb 24bits if IPC4_TYPE_MSB_INTEGER is set.

Signed-off-by: Rander Wang <rander.wang@intel.com>
2023-08-22 17:51:56 +03:00
Rander Wang 6efab4a7ab audio: add fixup for S24_3LE
It is missed in kconfig.

Signed-off-by: Rander Wang <rander.wang@intel.com>
2023-08-22 17:51:56 +03:00
Kai Vehmanen 91fb944956 platform: tigerlake: cleanup unused code for IPC3, SPI, GPIO, XTOS
Remove code segments in platform.c that are no longer used
in the tigerlake platform configuration. This includes code related
to IPC3, GPIO, SPI, DMA scheduling domain and XTOS. Additionally interrupt
initialization via platform_interrupt_init() can be removed as it is
a no-op in Zephyr builds.

Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
2023-08-22 16:33:54 +03:00
Kai Vehmanen 2a4cf9af4c platform: tigerlake: remove unused definitions
Zephyr native platforms do not need to have low-level definitions
in the platform.h file. These are now handled by Zephyr board files,
so stick to a single place for the definitions and remove the values
from here.

Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
2023-08-22 16:33:54 +03:00
Kai Vehmanen a89b9d41e5 platform: tigerlake: remove XTOS options
When CONFIG_TIGERLAKE is selected, omit all XTOS specific
build options.

Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
2023-08-22 12:58:05 +01:00
Kai Vehmanen 54dd8ecf19 arch: xtensa: remove tigerlake platform option
Remove Intel Tiger Lake from available XTOS platforms in arch/xtensa.
Now done in sof/zephyr/CMakeLists.txt instead.

Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
2023-08-22 12:58:05 +01:00
Kai Vehmanen 049329be0b arch: xtensa: configs: remove Intel Tiger Lake defconfigs
Remove the Tiger Lake defconfig and override files for
XTOS builds. These platforms are now supported with Zephyr which
has its own config files.

Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
2023-08-22 11:47:31 +03:00
Peter Ujfalusi 1f047fed43 Revert "lib-manager: Kconfig: Make LIBRARY_MANAGER depend on MM_DRV"
This reverts commit b0da357b3a.

The lib_manager now can be compiled without MM_DRV, there is no
need to keep the option to depend on it anymore.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
2023-08-21 19:06:33 +03:00
Peter Ujfalusi 05de1a6c4f lib_manager: Fix compilation if MM_DRV is not enabled
The module allocate/free uses APIs from MM_DRV but it does not declare
dependency on it.
Make the code compile in the case when MM_DRV is not selected by only
providing a reduced allocate/free functions with a print only.

Use a local define (PAGE_SZ) to store the page size to be used in the
library manager code and in case of !MM_DRV set it to a default 4096 which
is also used by the rimage when creating the manifest for the libraries.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
2023-08-21 19:06:33 +03:00
Marcin Szkudlinski b0360864ae src: bugfix: rate for sink not set
Rate for sink was not set properly in src.c

Signed-off-by: Marcin Szkudlinski <marcin.szkudlinski@intel.com>
2023-08-21 18:13:19 +03:00
Marcin Szkudlinski 05e8c4f615 src: add is_ready_to_process call to src module_get_private_data
Introduce is_ready_to_process method for SRC.

Signed-off-by: Marcin Szkudlinski <marcin.szkudlinski@intel.com>
2023-08-21 16:06:44 +01:00
Marcin Szkudlinski 656e739d6f src: simplify src_get_copy_limits procedure
There's no need for src_get_copy_limits to return
an exit code. The simple true/false if there's enough
data for processing is fine

Signed-off-by: Marcin Szkudlinski <marcin.szkudlinski@intel.com>
2023-08-21 16:06:44 +01:00
Marcin Szkudlinski 112a28e57c mod: add module_is_ready_to_process method
This is a modification of module API - add is_ready_to_process call
In case of LL modules all modules have "copy" or "process" method
called periodically, regardless if they're ready to process or not

In case of DP processing the module must have enough data on all
its inputs, enough space for result storage on all outputs, etc.
Unfortunately simply check of number of bytes at all sources/sinks
may not be sufficient (i.e. in case of variable rate audio formats)

The is_ready_to_process call will be called when DP scheduler makes
decision if the module is to be scheduled at this LL tick or not.
If the module wants its thread to start (and process called) it should
return TRUE

Signed-off-by: Marcin Szkudlinski <marcin.szkudlinski@intel.com>
2023-08-21 16:06:44 +01:00
Iuliana Prodan afe5bb76f7 topology: imx: Add compress and PCM mixer topology file for boards with wm8962 codec
Generate compress and PCM mixer topology file for i.MX8 and i.MX8MP
with wm8962 codec based on sof-imx8-compr-wm8960-mixer.

Signed-off-by: Iuliana Prodan <iuliana.prodan@nxp.com>
2023-08-21 13:18:58 +01:00
Iuliana Prodan b16d5bf662 topology: imx: Combine mixer of compress and PCM topology files for i.MX8MP and i.MX8
Combine topology files for i.MX8MP and i.MX8 using different
variables like SAI_INDEX and CODEC.

Based on CODEC use the proper STREAM_NAME.

Signed-off-by: Iuliana Prodan <iuliana.prodan@nxp.com>
2023-08-21 13:18:58 +01:00
Jyri Sarha 865946cf06 topology2: widget-common.conf: Default no_wname_in_kcontrol_name to true
Set no_wname_in_kcontrol_name attribute default to true to for all
widgets.

This change will drop widget name prefixes from all kcontrols created
from currently defined widgets, as they all include
widget-common.conf. In practice this means that for example "gain.2.1
Post Mixer Analog Playback Volume" becomes just "Post Mixer Analog
Playback Volume" and same for all kcontrols.

This behavior can be reverted per widget basis by setting
no_wname_in_kcontrol_name attribute to false in the relevant widget.

Signed-off-by: Jyri Sarha <jyri.sarha@linux.intel.com>
2023-08-21 13:07:17 +01:00
Jyri Sarha 53281d3b17 topology2: mixer: Add no_wname_in_kcontrol_name attribute to comp tokens
Adds "no_wname_in_kcontrol_name" token, and the associated boolean
attribute to generic component attributes.

If the attribute is set to true for a widget then non of its
associated kcontrols names will have the widget name as a prefix. For
example "gain.2.1 Post Mixer Analog Playback Volume" becomes just
"Post Mixer Analog Playback Volume".

Signed-off-by: Jyri Sarha <jyri.sarha@intel.com>
2023-08-21 13:07:17 +01:00
Ranjani Sridharan 6bb1ed4b01 audio: volume: Fix compilation error when COMP_PEAK_VOL is not selected
CONFIG_PEAK_METER_UPDATE_PERIOD depends on CONFIG_COMP_PEAK_VOL

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2023-08-21 15:02:30 +03:00
Rander Wang 5674c31c8f topology2: update pin setting to latest one
pin_index is not used so replace it with input_pin_index

Signed-off-by: Rander Wang <rander.wang@intel.com>
2023-08-21 10:58:09 +01:00
SaiSurya Ch b14dc2e2fd driver: amd: introducing initial silence in DMIC path to
remove the popping noise

Initial silence in DMIC path to remove the popping noise
during the start of DMIC.

Signed-off-by: SaiSurya Ch <saisurya.chakkaveeravenkatanaga@amd.com>
2023-08-21 10:52:51 +01:00
Peter Ujfalusi be53396359 lib_manager: Use i/dcache_invalidate_region() for cache invalidation
The i/dcache_invalidate_region wraps the sys_cache_* functions and is the
proper API to use for cache invalidation.

Fixes: 1dc6a2836d ("lib-manager: clean up memory allocations and cache handling.")
Reported-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Suggested-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
2023-08-21 12:36:35 +03:00
Peter Ujfalusi 64c537d893 lib_manager: Add missing _sparse_force in lib_manager_store_library() error case
The fix for the memory leak missed the _sparse_force, causing sparse
warning.

Fixes: 11b9ce23f7 ("lib-manager: Free up memory for the library in case of a store error")
Reported-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
2023-08-21 12:36:35 +03:00
Kai Vehmanen 59028ad3d1 drivers: Intel: remove Intel XTOS drivers
Now that Intel cAVS2.5 has been migrated to use native Zephyr
drivers, we have no need to keep the Intel specific XTOS
drivers in the tree anymore.

Adjust board configuration files to not refer to removed
Kconfig options.

Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
2023-08-21 12:21:55 +03:00
Kai Vehmanen 35b17a41c1 platform: tigerlake: remove XTOS platform definitions
Complete migration of Intel TigerLake platform to Zephyr RTOS by
removing remaining platform definitions for XTOS for this platform.

Link: https://github.com/thesofproject/sof/issues/7248
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
2023-08-21 12:21:55 +03:00
Kai Vehmanen ba5b755f97 platform: Intel: icelake: remove unused idc.h
Remove unused idc.h header for Intel IceLake platform (no
longer supported in SOF main).

Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
2023-08-21 12:21:55 +03:00
Kai Vehmanen 9948d439d9 app: Intel: switch cAVS2.5 configs to use IPC4 by default
The IPC3 build is no longer supported for Intel cAVS2.5 target,
so move the config overlay definitions as-is to the main
board config file.

To smoothen the transition, keep an empty IPC4 overlay file
in the tree to allow developers to update build scripts.

Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
2023-08-21 12:21:55 +03:00
Kai Vehmanen 3a02dacab5 zephyr: Intel cavs25: remove non-native build
Remove all cmake rules to build SOF for Intel cAVS2.5 hardware
using non-native drivers (i.e. use XTOS drivers from SOF tree
instead of Zephyr native drivers). This is no longer supported
nor tested, so can be removed.

Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
2023-08-21 12:21:55 +03:00
Kai Vehmanen 6efff4ccdb zephyr: remove mem_window.c from Intel cAVS2.5 build
Memory window management has been moved to Zephyr drivers
for this platform, so building this file on SOF side is no
longer needed.

Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
2023-08-21 12:21:55 +03:00
Seppo Ingalsuo df460c8c6b Audio: Crossover: Fix a mistake in s32 processing core
The filters state need to be retrieved for every channel as
it is done in other s16 and s24 processing cores. The mistake
caused very distorted sound with waveform discontinuity every
copy period, e.g. 1 ms.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2023-08-18 13:19:09 -07:00
Seppo Ingalsuo 5bcbcf19f7 Audio: Crossover: Convert to module adapter
This patch contains the changes to run crossover component as
module adapter client in IPC3 and IPC4 systems. The largest change
is to use pin indices in IPC4 instead of pipeline IDs to identify
sink streams. Pipeline IDs on firmware side are temporary in IPC4.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2023-08-18 13:19:09 -07:00
Marcin Szkudlinski d2f96d46bd sink/src: remove unused data from struct comp_dev
min_sink_bytes and min_source_bytes were not set
nor used

Signed-off-by: Marcin Szkudlinski <marcin.szkudlinski@intel.com>
2023-08-18 13:03:35 +01:00
Marcin Szkudlinski cd3e20e0c8 comp_buffer: set ibs and obs in sink/src
set IBS an OBS in sink/src when creating
buffer and binding it to modules

Signed-off-by: Marcin Szkudlinski <marcin.szkudlinski@intel.com>
2023-08-18 13:03:35 +01:00
Marcin Szkudlinski 3538b2e06c sink_api: add ibs parameter to source structure
Input Buffer Size, the amount of data required for
processing is declared by module in IPC init_instance

This IBS value is kept in module structure, however, there
may be a module that have different IBS per each input.

There's a single source structure per connection to the module,
so it looks like a good place to store IBS there

Signed-off-by: Marcin Szkudlinski <marcin.szkudlinski@intel.com>
2023-08-18 13:03:35 +01:00
Marcin Szkudlinski 2a5e327372 sink_api: add OBS parameter to sink structure
Output Buffer Size, the amount of free space required for
processing is declared by module in IPC init_instance

This OBS value is kept in module structure, however, there
may be a module that have different OBS per each output.

There's a single sink structure per connection to the module,
so it looks like a good place to store OBS there

Signed-off-by: Marcin Szkudlinski <marcin.szkudlinski@intel.com>
2023-08-18 13:03:35 +01:00
Marcin Szkudlinski a4cc6066e9 sink_src: add cache operations to audio_stream sink/src
Audio_stream is not making cache operations on data
buffer itself, it requires that the module to
call data invalidation/writeback

Sink/source interface works differently, it removes any
responsibility from the module providing a ready to
use pointers in cached memory

this commit adds cache operations to audio_stream
sink/src implementation

Signed-off-by: Marcin Szkudlinski <marcin.szkudlinski@intel.com>
2023-08-18 13:03:35 +01:00
Baofeng Tian 897f5167fa audio: dai: fix the error reported by CI after enable inline
after enable inline build option, CI build is reporting not
initialize this structure, init it to remove the error.

Signed-off-by: Baofeng Tian <baofeng.tian@intel.com>
2023-08-18 10:15:44 +03:00
Baofeng Tian 05dcf1ccde audio: zephyr: add -fno-inline-functions option to zephyr code
By enable/disable COMPILER_INLINE_FUNCTION_OPTION to control
add or remove -fno-inline-functions build option for sof zephyr
code.

Signed-off-by: Baofeng Tian <baofeng.tian@intel.com>
2023-08-18 10:15:44 +03:00
Baofeng Tian 51556ddd63 audio: sof: remove -fno-inline-functions option for cavs2.5 and ace
remove this build option for sof build cavs2.5 and ace platform
with enable COMPILER_INLINE_FUNCTION_OPTION.

Signed-off-by: Baofeng Tian <baofeng.tian@intel.com>
2023-08-18 10:15:44 +03:00
Baofeng Tian 01d2fd0a7a audio: add a config to sof and zephyr code
this config will be used to add or remove -fno-inline-functions
into compiler build option.

Signed-off-by: Baofeng Tian <baofeng.tian@intel.com>
2023-08-18 10:15:44 +03:00
Rander Wang 9b08ce026d zephyr: cpu: use correct condition to init cpu
When converting #ifdef CONFIG_ADSP_IMR_CONTEXT_SAVE to if(IS_ENABLE(
CONFIG_ADSP_IMR_CONTEXT_SAVE), we should use if (!IS_ENABLE() ||

Signed-off-by: Rander Wang <rander.wang@intel.com>
2023-08-17 20:23:46 +03:00
Pin-chih Lin b793d1ce2b topology1: waves: add definition WAVES_SPK_ONLY
Introduced var WAVES_SPK_ONLY (depend on WAVES) for specifying the
topology requested to apply Waves module on Speaker pipeline only
(not on Heaadphones).

Signed-off-by: Pin-chih Lin <johnylin@google.com>
2023-08-17 17:06:06 +01:00
Ranjani Sridharan 9a5cadcf2b tplg_parser: Introduce debug print helper
Useful to turn on/off the topology parsing logs at run-time.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2023-08-17 13:29:46 +01:00