Commit Graph

4939 Commits

Author SHA1 Message Date
Ranjani Sridharan 85169d3da5 codec_adapter: drop the type parameter in codec_adapter_set_params()
It can be accessed via cdata in the function.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2022-01-11 20:40:48 +02:00
Pierre-Louis Bossart 71cd9666a9 platform: cavs: make IMR restore feature default - except APL/GLK
Let's enable this capability, with CAVS_1_5 left out for now since there
are known issues with suspend-resume on Up2 board that were never
root-caused.

Enabling this at the firmware level is not enough, this capability
need to be enabled by kernel patches in
https://github.com/thesofproject/linux/pull/3340

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
2022-01-11 15:59:07 +00:00
Guennadi Liakhovetski 2317e879c7 DAI: join identical trigger handling flows
All SSP drivers handle COMP_TRIGGER_RELEASE and COMP_TRIGGER_START in
the same way. Similarly sai.c handles COMP_TRIGGER_PAUSE and
COMP_TRIGGER_STOP identically. This patch joins those flows.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2022-01-11 09:27:28 +00:00
Guennadi Liakhovetski 03fb524f15 heap: remove unused mm_pm_context_{save,restore}()
mm_pm_context_save() and mm_pm_context_restore() are never used,
remove them.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2022-01-11 09:27:28 +00:00
Guennadi Liakhovetski 1de8e74b9e DMA: remove unused dma_pm_context_{store,restore} operations
.dma_pm_context_store and .dma_pm_context_restore DMA operations are
never used, remove them.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2022-01-11 09:27:28 +00:00
Guennadi Liakhovetski ca0e94ddab DAI: remove unused pm_context_{store,restore} operations
.pm_context_store and .pm_context_restore DAI operations are never
used, remove them.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2022-01-11 09:27:28 +00:00
Guennadi Liakhovetski eb0ef7bb85 component: convert COMP_TRIGGER_* values to an enum
COMP_TRIGGER_* values are internal to SOF, they aren't a part of an
API, their numeric values are unimportant. Convert them to an enum to
make removing deprecated and adding new values easier.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2022-01-11 09:27:28 +00:00
Guennadi Liakhovetski 95f7b8e68e ipc: remove two unused trigger commands
COMP_TRIGGER_SUSPEND and COMP_TRIGGER_RESUME are never issues, remove
them.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2022-01-11 09:27:28 +00:00
Lionel Koenig 3b48da9cf5 platform: allow primary core stack size config.
Allow to set the primary core stack size using the Kconfig mechanism.

Signed-off-by: Lionel Koenig <lionelk@google.com>
2022-01-10 15:56:56 +00:00
Lionel Koenig ba77d3a74f xtos: Add stub for some missing OS function
In order to ease porting algorithm to SOF, it is convenient to have
stubs for some operating system function.
Those stubs are not meant to be called.

Signed-off-by: Lionel Koenig <lionelk@google.com>
2022-01-10 13:12:39 +00:00
Marc Herbert e64a6cfd31 trace.c: rename emit_recent_entry() to emit_suppressed_entry() + comments
This makes much clearer why this function is not called when the burst
is short enough.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2022-01-10 11:50:21 +00:00
Marc Herbert 7614351b74 trace: log "hidden" feature turning off adaptive filtering at run-time
Also clarify related Kconfig help strings.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2022-01-10 11:50:21 +00:00
Marc Herbert 5fd7c88f3d trace.c: minor #ifdef simplification in trace_log_filtered()
Group two #ifdef into one.

Top of block variables do not require C99.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2022-01-10 11:50:21 +00:00
Marc Herbert a51a64665b Replace perf_*_trace() macros with functions.
The fewer macros, the better.

Commit 1758279623 ("perf: make trace part of perf counting
configurable") provided no specific rationale for using macros. It did
not explain why it passed some ignored arguments either - renamed
accordingly.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2022-01-10 11:50:21 +00:00
Ranjani Sridharan 90e6925e7c codec_adapter: rename comp_get_codec()
to comp_get_module_data(). No functional change.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2022-01-10 13:08:16 +02:00
Ranjani Sridharan 681a4338af codec_adapter: rename codec_id in struct ca_config
to module_id. No functional change.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2022-01-10 13:08:16 +02:00
Ranjani Sridharan 34e2eb13c6 codec_adapter: rename codec_free_all_memory()
to module_free_all_memory(). No functional change.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2022-01-10 13:08:16 +02:00
Ranjani Sridharan 77deb27e33 codec_adapter: rename codec_allocate/free_memory()
to module_allocate/free_memory(). No functional change.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2022-01-10 13:08:16 +02:00
Ranjani Sridharan 032cddc854 codec_adapter: rename codec_load_config()
to module_load_config(). No functional change.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2022-01-10 13:08:16 +02:00
Ranjani Sridharan ae0e7fb774 codec_adapter: rename codec_process() to module_process()
No functional change.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2022-01-10 13:08:16 +02:00
Ranjani Sridharan fdddd20c8b codec_adapter: rename codec_apply_runtime_config()
Rename it to module_apply_runtime_config(). No functional change.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2022-01-10 13:08:16 +02:00
Ranjani Sridharan 39150a9301 codec_adapter: rename codec_prepare() to module_prepare()
Rename codec_prepare() to module_prepare(). No functional change.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2022-01-10 13:08:16 +02:00
Ranjani Sridharan 2f06f173de codec_adapter: rename codec_reset() to module_reset()
Rename codec_reset() to module_reset. No functional change.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2022-01-10 13:08:16 +02:00
Ranjani Sridharan bf8a77ecdc codec_adapter: Rename codec_free() to module_free()
Rename the codec_free() function to module_free() and remove an
unnecessary pair of braces from the function. No functional change.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2022-01-10 13:08:16 +02:00
Ranjani Sridharan e9d87f4c4c codec_adapter: rename codec_init() to module_init()
Rename the codec_init() function to module_init(). No functional change.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2022-01-10 13:08:16 +02:00
Ranjani Sridharan 0485e5dbad codec_adapter: rename struct codec_param to module_param
Rename codec_param to module_params. No functional change.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2022-01-10 13:08:16 +02:00
Ranjani Sridharan 60288c4051 codec_adapter: rename codec_cfg_type to module_cfg_type
Rename enum codec_cfg_type to module_cfg_type. No functional change.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2022-01-10 13:08:16 +02:00
Ranjani Sridharan b6b7c3c9b8 codec_adapter: rename codec_processing_data to module_processing_data
Rename struct codec_processing_data to module_processing_data. No
functional change.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2022-01-10 13:08:16 +02:00
Ranjani Sridharan 77315d436b codec_adapter: rename codec_memory to module_memory
Rename struct codec_memory to module_memory. No functional change.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2022-01-10 13:08:16 +02:00
Ranjani Sridharan e240b41ea9 codec_adapter: fix typo in comment
It's struct codec_param not codec_config.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2022-01-10 13:08:16 +02:00
Ranjani Sridharan d8d79fba9d codec_adapter: rename codec_config to module_config
Rename struct codec_config to struct module_config. No functional
change.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2022-01-10 13:08:16 +02:00
Ranjani Sridharan f158e14fbf codec_adapter: rename codec_state to module_state
Rename the enum codec_state to module_state. No functional change.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2022-01-10 13:08:16 +02:00
Ranjani Sridharan 251191832e codec_adapter: rename codec_data to module_data
Rename struct codec_data to struct module_data. No functional change.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2022-01-10 13:08:16 +02:00
Ranjani Sridharan 92ff6b3aff codec_adapter: rename struct comp_data to struct processing_module
Rename struct comp_data to processing_module. No functional change.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2022-01-10 13:08:16 +02:00
Ranjani Sridharan aeecf5a741 codec_adapter: dts: check for !cd->ca_source instead of == NULL
Make checkpatch happy

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2022-01-10 13:08:16 +02:00
Ranjani Sridharan d577f4b760 codec_adapter: rename codec_interface to module_interface
The interface will be common for all processing modules not just the
codecs. So rename struct codec_interface to struct module_interface.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2022-01-10 13:08:16 +02:00
Allen-KH Cheng e9e6db4299 arch: xtensa: fix unaligned pointer in irq dispatcher
In 8186 mtk dsp (hifi5), we meet a system exception when irq is rasied.
The panic is LoadStoreAlignmentCause.
We found the problem is in int-xxx-dispatcher.S

mov a11, a1
addi a11, a11, UEXC_cp1
xchal_cp1_store a11, a12, a13, a14, a15

In xchal_cp1_store macro, ptr must a certain byte aligned address
In the 8186 mtk dsp Xtensa header, we have

/*
 *  Macro to store the state of TIE coprocessor AudioEngineLX.
 *  Required parameters:
 *      ptr         Save area pointer address register (clobbered)
 *                  (register must contain a 16 byte aligned address).
 *      at1..at4    Four temporary address registers (first XCHAL_CP1_NUM_ATMPS
 *                  registers are clobbered, the remaining are unused).
 *  Optional parameters are the same as for xchal_ncp_store.
 */

.macro xchal_cp1_store ptr at1 at2 at3 at4 continue=0 ofs=-1 select=XTHAL_SAS_ALL alloc=0

In xtruntime-frames.h, the UEXC_cp1 macro is
STRUCT_AFIELD (long,4,UEXC_,cp1, XCHAL_CP1_SA_SIZE / 4)

I have checked history and found the original UEXC_cp1 define is using STRUCT_AFIELD.
(After 3e1eebe)
In 8186 mtk dsp, we need 16 aligned address in xchal_cp1_store using STRUCT_AFIELD_A
with XCHAL_TOTAL_SA_ALIGN.
2022-01-10 10:37:03 +00:00
Mark Barton 7901eec1ca arch: add configuration override to enable DTS codec on mt8195
Allow SOF to be built for mt8195 platform with DTS codec and SOF IIR EQ enabled.

Signed-off-by: Mark Barton <mark.barton@xperi.com>
2022-01-05 13:15:35 +00:00
Lionel Koenig ba2d4fea72 comp: Add mock for google_rtc_audio_processing
This adds a mock to be able to build with the
google_rtc_audio_processing component.

Signed-off-by: Lionel Koenig <lionelk@google.com>
2022-01-04 15:24:18 -08:00
Lionel Koenig 9ee413bf46 comp: Add initial Google AEC
Introduce a new component to perform acoustic echo cancellation
on capture path using a buffer from the playback as a reference.

1. Put the google_rtc_audio_processing at
$SOF_REPO/third_party_libraries
  - libgoogle_rtc_audio_processing.a
  - libgoogle_rtc_audio_processing_tuning.a
  - libc++.a (Corresponding stdlibc++)
  - libc++abi.a
2. Put the header in $SOF_REPO/third_party_includes
  - google_rtc_audio_processing.h

3. Build firmware and tool with xcc

4. To verify it works:
  - aplay some speech
  - At the same time arecord the mic which uses AEC
  The mic signal should not exhibit any echo from the playback.

Signed-off-by: Lionel Koenig <lionelk@google.com>
2022-01-04 15:24:18 -08:00
Guennadi Liakhovetski e0ff1b16d8 zephyr: add a generic Zephyr platform
When built with Zephyr, SOF ideally should be a fully platform-
agnostic application. All platform-specific code should reside in
Zephyr itself, including core architecture and platform
infrastructures and drivers. To prepare for this transition we add a
generic SOF-Zephyr platform. It is based on the current Tiger Lake
architecture and should be usable for cAVS 2.5 and newer systems.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2021-12-31 08:06:24 +00:00
Marc Herbert ecd2d464f9 Revert "zephyr: fix build after a recent trace filter PR"
This reverts commit b31d19b6c2.

Part of the fix for #5032

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2021-12-25 20:54:50 +00:00
Marc Herbert 749d41d577 Revert "trace: do not set trace_ctx section for Zephyr [REVERTME]"
This reverts commit 206df545c4.

Part of the fix for #5032

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2021-12-25 20:54:50 +00:00
Adrian Bonislawski ea85ccf25f ipc4: copier: update source format if needed
used only for rare cases where two pipelines are connected by a shared
buffer and 2 copiers, this will set source format only for shared buffers
for a short time when the second pipeline already started
and the first one is not ready yet along with sink buffers params

Signed-off-by: Adrian Bonislawski <adrian.bonislawski@intel.com>
2021-12-25 20:49:48 +00:00
Mark Barton 1727cecb0d audio: codec_adapter: Support for arbitrary periods in DTS Codec
DTS Codec can accommodate topologies containing pipelines with periods other than 1000.

Signed-off-by: Mark Barton <mark.barton@xperi.com>
2021-12-25 20:41:25 +00:00
YC Hung 7981197f6d platform: mt8195: implement dsp clock function
Implement set_freq callback function to set dsp clock, dsp clock source
can be 26M(13/26M) or ADSPPLL(370/540/720M) for different use cases,
default support is 720MHz.

Signed-off-by: YC Hung <yc.hung@mediatek.com>
2021-12-24 21:59:52 +00:00
Bartosz Kokoszko b1ff2b303c ll_schedule: unregister domain in free function with IRQ_ONLY_FLAG
scheduler_free_ll() function should invoke domain_unregister()
in case when SOF_SCHEDULER_FREE_IRQ_ONLY flag is used, because
in timer domain case, timer_domain_unregister() function
unregisters timer interrupts.

Signed-off-by: Bartosz Kokoszko <bartoszx.kokoszko@linux.intel.com>
2021-12-23 20:38:09 +00:00
Seppo Ingalsuo 7552de76cf Audio: KPB: Optimize kpb_copy_samples() function
The audio_stream_read/write_frag_s16/s32() functions usage and
sample-by-sample copying are replaced by more efficient block
memcpy() operations.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2021-12-22 21:51:46 +00:00
Seppo Ingalsuo 906131a255 Audio: KPB: Optimize kpb_buffer_samples() function
The audio_stream_read_frag_s16/s32() functions usage and
sample-by-sample copying are replaced by more efficient block
memcpy() operations.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2021-12-22 21:51:46 +00:00
Seppo Ingalsuo d8288601db Audio: KPB: Optimize kpb_drain_samples() function
The audio_stream_write_frag_s16/s32() functions usage and
sample-by-sample copying are replaced by block memcpy()
operations.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2021-12-22 21:51:46 +00:00