Commit Graph

10725 Commits

Author SHA1 Message Date
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
Peter Ujfalusi 3a17cde8fc board: intel_adsp_cavs25_tglh: Enable support for library loading
Add the needed config options to enable the library loading support.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
2023-08-17 13:28:11 +01:00
Peter Ujfalusi b42bbcaed7 board: intel_adsp_cavs25: Enable support for library loading
Add the needed config options to enable the library loading support.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
2023-08-17 13:28:11 +01:00
Peter Ujfalusi b0da357b3a lib-manager: Kconfig: Make LIBRARY_MANAGER depend on MM_DRV
The lib_mananger.c does not compile without MM_DRV enabled

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
2023-08-17 13:28:11 +01:00
Peter Ujfalusi cfed61eaec lib-manager: Fix compilation if INTEL_MODULES are not selected
The lib_manager_register_module() is basically a NOP if the INTEL_MODULES
is not enabled and in this case there is a compiler warning as well:

src/library_manager/lib_manager.c: In function 'lib_manager_register_module':
src/library_manager/lib_manager.c:362:26: warning: unused variable 'uid' [-Wunused-variable]
  362 |         struct sof_uuid *uid = (struct sof_uuid *)&mod->uuid[0];
      |                          ^~~

Instead of playing with inline ifdefs, provide a reduced function to just
print the error for this case.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
2023-08-17 13:28:11 +01:00
Peter Ujfalusi 27b4573a68 lib-manager: Reword the module management error and debug prints
With the rewording it is going to be easier to get idea where the error
occurred from the logs.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
2023-08-17 13:28:11 +01:00
Peter Ujfalusi 80afbacaa0 lib-manager: Cleanup LOAD_LIBRARY message handling debug and error prints
Simplify and unify the way info and errors are printed in the library
loading path.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
2023-08-17 13:28:11 +01:00
Peter Ujfalusi 9dd3f10481 lib-manager: Add timeout handling in lib_manager_load_data_from_host()
It is better to have some sort of timeout handling while waiting for the
DMA transfer of the library from host.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
2023-08-17 13:28:11 +01:00
Peter Ujfalusi 6ba343691a lib-manager: Drop log level for printing the library_base_address
Drop the log level to tr_dbg for printing the library_base_address and
print it only if the allocation was successful.
Allocation error will print an error.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
2023-08-17 13:28:11 +01:00
Peter Ujfalusi 11b9ce23f7 lib-manager: Free up memory for the library in case of a store error
If lib_manager_store_data() fails to read the rest of the library we need
to free up the allocated memory.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
2023-08-17 13:28:11 +01:00
Guennadi Liakhovetski 796a3eeb0d lib-manager: fix wrong flags
Don't overwrite flags when mapping virtual memory and don't map
data for execution.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2023-08-17 13:28:11 +01:00
Guennadi Liakhovetski 149d168025 lib-manager: don't restart DMA while loading a library
HDA DMA for host to DSP transfers should be started once on the
host and then once on the DSP, it shouldn't be restarted
multiple times during transfer.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Co-developed-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
2023-08-17 13:28:11 +01:00
Peter Ujfalusi 001415e917 lib-manager: Use stat.pending_length directly in data load loop
There is no need to use local variable in the loop when checking the
progression of the DMA.

Read the DMA status right after start as the DMA might already copied the
data.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
2023-08-17 13:28:11 +01:00
Peter Ujfalusi ee1e677afc lib-manager: Remove struct lib_manager_dma_buf
Only the addr of the struct is used, no need to keep it around to
complicate things.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
2023-08-17 13:28:11 +01:00
Guennadi Liakhovetski 1dc6a2836d lib-manager: clean up memory allocations and cache handling.
Update the memory allocation and cache handling.
Allocate comp_driver and comp_driver_info as uncached to
align with other drivers.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2023-08-17 13:28:11 +01:00
Guennadi Liakhovetski b58e5357f8 lib-manager: eliminate repeated memory allocations
No need to dynamically allocate memory for DMA block configuration,
it can be placed on stack.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2023-08-17 13:28:11 +01:00
Peter Ujfalusi dc409cdf3a lib-manager: Use kcps_adjust around the library loading
Make sure that we have the needed core frequency for the library loading.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
2023-08-17 13:28:11 +01:00
Peter Ujfalusi a6ad6fbf3b lib-manager: Check validity of lib_id
The range of lib_id is only valid for loadable libraries in a range of
1 - MAX_LIBS (15)

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
2023-08-17 13:28:11 +01:00
Ranjani Sridharan eac5a0a12e tplg_parser: Add support for parsing PCM headers
Parse the PCM headers and save the PCM info along with the host
component associated with the PCM.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2023-08-16 21:28:17 +03:00
Ranjani Sridharan ccd6949a24 tplg_parser: Rename pcm.c
Rename it to host.c as it is meant for setting the host widget.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2023-08-16 21:28:17 +03:00
Ranjani Sridharan 34518568f7 tplg_parser: Add support for parsing and saving route
Add an option to parse and save the routes from topology so that the
IPCs can be sent at a later time.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2023-08-16 21:28:17 +03:00
Serhiy Katsyuba 81bccef08d app: Enable probe for MTL
Enables extraction and injection probes for MTL platform.
NOTE: this commit does NOT enable probe log backend.

Signed-off-by: Serhiy Katsyuba <serhiy.katsyuba@intel.com>
2023-08-16 21:21:55 +03:00
Serhiy Katsyuba 583329173e probe: Fix injection probe creation
Both extraction and injection probes require to subscribe to buffer
produce notification. Hence notification subscription logic should be
enabled for both types of probes.

Signed-off-by: Serhiy Katsyuba <serhiy.katsyuba@intel.com>
2023-08-16 21:21:55 +03:00
Serhiy Katsyuba 6f5eabd6eb module_adapter: Enable buffer produce notifications required by probe
Probe module subscribes to buffer produce notifications in order to
perform data extraction or injection. Hence this fix is required to
enable probe feature.

Signed-off-by: Serhiy Katsyuba <serhiy.katsyuba@intel.com>
2023-08-16 21:21:55 +03:00
Serhiy Katsyuba 3813a135d5 audio: Put buffer state log under CONFIG_SOF_LOG_DBG_BUFFER switch
comp_update_buffer_consume() and comp_update_buffer_produce() generate
too much log output. Usually such amount of logs results in many log
messages been dropped. It is also results in significant CPU load if
selected log backend formats log messages at runtime.

This patch adds a separate switch to enable these logs only when necessary.
Default value is 'n'.

Signed-off-by: Serhiy Katsyuba <serhiy.katsyuba@intel.com>
2023-08-16 21:21:55 +03:00
Adrian Bonislawski 6f4084b4d9 probe: add support for zephyr native drivers
This patch ports probe component to use zephyr native drivers.

Signed-off-by: Adrian Bonislawski <adrian.bonislawski@intel.com>
Signed-off-by: Serhiy Katsyuba <serhiy.katsyuba@intel.com>
2023-08-16 21:21:55 +03:00
Rander Wang 108df32c6b TigerLake: disable memory windows setting on sof side
Memory windows is set on zephyr side, so remove it and also remove
xsram_window for memory windows to save memory since it is not used
by ipc4.

Signed-off-by: Rander Wang <rander.wang@intel.com>
2023-08-16 18:51:26 +03:00
Baofeng Tian ff717aec46 mixin_mixout: remove all related code for remap function
remove remap code since there is no requirement for this.

Signed-off-by: Baofeng Tian <baofeng.tian@intel.com>
2023-08-16 15:28:27 +01:00
Baofeng Tian babb16b155 mixin_out: remove remap mode
remove remap support from mixin process, there is no usecase
for remap for now, in future, if there is a need, we can add it back.

Signed-off-by: Baofeng Tian <baofeng.tian@intel.com>
2023-08-16 15:28:27 +01:00
Seppo Ingalsuo 8aededeb96 Tools: Topology2: Fix playback EFX FIR and IIR defaults
The default values should be "passthrough" since the pipeline
mixout-gain-efx-dai-copier-playback.conf applies them this way:

IncludeByKey.EFX_FIR_PARAMS {
  "passthrough" "include/components/eqfir/passthrough.conf"
}

And IIR similarly.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2023-08-16 17:05:25 +03:00
Seppo Ingalsuo 53e8b71f69 Tools: Topology2: Remove 24 bit formats from EFX pipeline
This patch makes similar change to pipeline as done earlier
for mixout-gain-dai-copier-playback.conf. The 24/32 bit formats
are deleted as unnecessacy. The audio format definition for
DRC is changed to similar style as for copier and gain.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2023-08-16 14:39:30 +01:00
Seppo Ingalsuo 8652395490 Tools: Topology2: Add DRC to sof-hda-efx-generic topologies
This patch adds DRC component to EFX pipeline. The DRC is very
useful for speaker output to enhance loudness and reduce
speaker distortion in loud playback.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2023-08-16 14:39:30 +01:00
Yong Zhi aec3bfdb77 topology2: add core id macros for echo ref & EC pipelines
Add macros in preparation to run RTC AEC on secondary core

Signed-off-by: Yong Zhi <yong.zhi@intel.com>
2023-08-16 14:06:01 +01:00
Pin-chih Lin ad2f035c06 smart amp : Do not use DYNAMIC topology with DTS
Follows after:
    214f98378 ("smart amp : Do not use DYNAMIC topology")

which makes DYNAMIC undefined during smart amp tplg pipeline pcm/dai config due
to the use of volatile Kcontrols.

This commit applies the same on sof-eq-iir-dts-codec-smart-amplifier.m4 which
is used for (DTS + smart amp) projects.

Signed-off-by: Pin-chih Lin <johnylin@google.com>
2023-08-16 14:00:31 +01:00
Rander Wang 84befa2563 zephyr: cpu: init cpu if context save is not support
Fix multicore test issue on cavs platforms which don't support context
save now, so need to init cpu when the core boot up.

Signed-off-by: Rander Wang <rander.wang@intel.com>
2023-08-16 13:43:38 +01:00
Ranjani Sridharan 1358afacc9 audio: mux: Remove unused variable
valid_bit_depth isn't used anywhere.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2023-08-16 13:42:41 +01:00
Kai Vehmanen 8f6018057b app: enable OUTPUT_DISASSEMBLY for Zephyr builds
With Zephyr commit cc5763344709 ("Build system: disable
`OUTPUT_DISASSEMBLY` by default"), generation of zephyr.lst
is disabled by default.

Enable disassembly generation in SOF configuration as it is expected by
SOF builds rules for reproducible builds.

Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
2023-08-15 10:48:38 +03:00