Commit Graph

6467 Commits

Author SHA1 Message Date
Anas Nashif 1c805dbec9 zephyr: move to new workq APIs
Convert remaining work queue APIs and remove to be deprecated calls.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2021-05-10 15:05:40 +01:00
Pin-chih Lin 8b40cd0c1a drc: hifi3 implementation for DRC algorithms
Implemented DRC algorithmic functions with hifi3 library.

Signed-off-by: Pin-chih Lin <johnylin@google.com>
2021-05-10 09:54:59 +01:00
Pin-chih Lin 7e471ce18d drc: hifi3 implementation for DRC mathematics
Implemented log, asin, lin2db, and inv functions with hifi3 library in
drc_math.

Signed-off-by: Pin-chih Lin <johnylin@google.com>
2021-05-10 09:54:59 +01:00
Pin-chih Lin f797ff5b75 drc: move constant if-else check out of while loop
Moved the constant is_2byte if-else check out of while loop. We then have 2
while loops and the constant becomes to be checked once.

Signed-off-by: Pin-chih Lin <johnylin@google.com>
2021-05-10 09:54:59 +01:00
Keyon Jie 47d223c09f topology: sof-tgl-nocodec-ci: change to run smart_amp on core 1
Change to run smart_amp pipelines on DSP core 1, this will help reduce
the core 0 usage and add multi-core to the CI coverage.

Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
2021-05-08 22:43:58 +08:00
Ranjani Sridharan cbf0a1e359 pipeline: fix pipeline's scheduling comp setting
Move the code that sets the scheduling comp for
a pipeline to allow setting it in ipc_pipeline_complete().
This removes the restriction that the scheduling comp must
be set up before the pipeline widget and provides the
flexibility in the kernel to set up the widgets in any order
while parsing topology.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2021-05-08 14:34:19 +01:00
Guennadi Liakhovetski f8172a9b87 zephyr: move timer domain away from a legacy API
The delayed work API is deprecated, convert to use the replacement
delayable work API.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2021-05-08 14:32:40 +01:00
Guennadi Liakhovetski f2f75740f5 ll_scheduler: (cosmetic) simplify pointer dereferencing
Replace sch->domain with a local domain pointer variable on many
occasions.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2021-05-08 14:32:40 +01:00
Guennadi Liakhovetski 2f674127d0 timer_domain: zephyr: fix multi-core scheduling
With Zephyr timer domain handlers are per-core, therefore
rescheduling has to be performed after each scheduler run, but the
next scheduling tick must be calculated only once.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2021-05-08 14:32:40 +01:00
Guennadi Liakhovetski f8448fec11 timer_domain: fix wrong addressing
In timer_domain_set() timer_domain is a pointer to a single struct
timer_domain object, not an array. Fix potential access beyond the
object memory.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2021-05-08 14:32:40 +01:00
Guennadi Liakhovetski bfe7707f37 cavs: disable data cache operations on uncached addresses
Trying to write back cache on uncached addresses can overwrite data.
Invalidating cache should have no ill effects but isn't very
meaningful either. Disable both.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2021-05-08 14:32:40 +01:00
Guennadi Liakhovetski bbe046f858 zephyr: no need for explicit memory sharing
When built with Zephyr all memory except stack is sharable: either it
is read-only, or it is accessed via the non-caching address range.
Besides no .shared_data section is actually created under Zephyr,
therefore trying to place data in it leads to linker warnings and
actually moves that data to the caching address range.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2021-05-08 14:32:40 +01:00
Kai Vehmanen 11b9916714 audio: crossover: declare init with UT_STATIC
Allow component to be included in unit tests by using UT_STATIC
in the declaration.

Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
2021-05-08 14:21:52 +01:00
Kai Vehmanen 00fb4e9dba audio: smart_amp: declare init with UT_STATIC
Allow component to be included in unit tests by using UT_STATIC
in the declaration.

Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
2021-05-08 14:21:52 +01:00
Ross Chisholm f706843697 topology: adding IIR component on max98373-rt5682 topology
Builds a configuration of the max98373-rt5682 topology with AMP_SSP=2
defined and includes the IIR component

Signed-off-by: Ross Chisholm <ross.chisholm@xperi.com>
2021-05-06 17:21:57 +01:00
Libin Yang 7851493534 topology: add sof-adl-rt711 topologies
Add sof-adl-rt711.tplg and sof-adl-rt711-4ch.tplg.

Signed-off-by: Libin Yang <libin.yang@intel.com>
2021-05-06 16:59:52 +01:00
Libin Yang 37c485df36 topology: sof-tgl-rt711-rt1308: add EXT_AMP option
Some devices are using rt711 only, without amplifiers.
Add the "EXT_AMP" option in sof-tgl-rt711-rt1308.

Signed-off-by: Libin Yang <libin.yang@intel.com>
2021-05-06 16:59:52 +01:00
Kai Vehmanen 798226afcf zephyr: fix key-phrase-buffer init in wrapper
The key-phrase-buffer (kpb) component can be included in
Zephyr-based builds, but the component is not initialized
properly in the builds.

Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
2021-05-06 14:45:05 +01:00
Kai Vehmanen bc6888ecab zephyr: add sample-smart-amp component to the wrapper
Add the sample-smart-amp to the wrapper build if the component
is enabled in build config.

Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
2021-05-06 14:45:05 +01:00
Kai Vehmanen e6729f0106 samples: fix prototype for smart_amp_test
Initialize sys_comp_smart_amp_init() with UT_STATIC to make
it unit-testable.

Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
2021-05-06 14:45:05 +01:00
Daniel Baluta 8397e064da topology: Allow overriding DAI_PERIODS
This will allow topologies to use different size dai periods.

Fixes: 1280987999 ("topology: use DAI_PERIODS in calculation of DAI buffer size")
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
2021-05-06 14:44:20 +01:00
Marc Herbert 55e292ee85 xtensa-build-zephyr: add mkdir -p modules/audio
More robust support for "manual" installations.

Also rephrase usage string to remove a single quote breaking
the shell parser in one editor I use (sorry).

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2021-05-06 14:36:25 +01:00
Jaska Uimonen b1775f27ea topology: define a channel map macro for all topologies
Previously we had a channel map macro only in general dmic topology. As
the pipelines used with dmic are also used with other topologies the
dmic specific macro does not work anymore. Thus define generic macro in
pipeline.m4 that defaults to stereo channel map. This can be overridden
in topologies as shown in general dmic.

fixes: #4136

Signed-off-by: Jaska Uimonen <jaska.uimonen@intel.com>
2021-05-06 14:34:23 +01:00
Ranjani Sridharan f2bd51a138 Revert "topology: Switch HDA topologies to use dynamic pipelines"
This reverts commit 2c69afc5fd.
The dynamic pipeline feature is broken with PA enabled. Revert
this change until the issue is sorted.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2021-05-06 14:31:50 +01:00
fy.tsuo 37d97d4357 audio: igo_nr: Added intelliGo noise reduction wrapper code and topology
This commit consists of files for adding IGO_NR component in arbitrary
topology. The proprietary static library shall be released by intelliGo
via private channel upon request.

Signed-off-by: fy.tsuo <fy.tsuo@intelli-go.com>
2021-05-05 12:48:47 +01:00
fy.tsuo 776977852a topology: Added IGO_NR in sof-tgl-max98373-rt5682 topology.
This commit added IGO_NR component into sof-tgl-max98373-rt5682.m4
as DMIC capture PCM99 pipeline.

Signed-off-by: fy.tsuo <fy.tsuo@intelli-go.com>
2021-05-05 12:48:47 +01:00
Guennadi Liakhovetski 59d2318a4c zephyr: schedule: enable multi-core scheduling
Initialise LL-schedulers on secondary cores too, which also
requires per-core scheduler data.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2021-05-05 11:03:35 +01:00
Guennadi Liakhovetski 3fefbf55f9 zephyr: notifier: per-core notifier support
Notifier data has to be per-core and its allocation is
performed in init_system_notify(), no need to also do it in
architecture code.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2021-05-05 11:03:35 +01:00
Guennadi Liakhovetski 084b851e33 zephyr: fix multicore booting and status management
sof_main() doesn't run on secondary cores. Instead we provide
a new function, that initialises a dummy thread, runs SOF
initialisation by calling secondary_core_init() and switches
over to the dummy thread.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2021-05-05 11:03:35 +01:00
Guennadi Liakhovetski b406ca1ae8 zephyr: make timer-domain and EDF threads per-core
When running on Zephyr, timer domain and EDF scheduling is
implemented by per-core work queues. Make sure they only run
on designated cores.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2021-05-05 11:03:35 +01:00
Guennadi Liakhovetski bf4a65f2fa zephyr: allow multicore builds
Lift the temporary restriction on Zephyr builds: re-enable
multi-core support.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2021-05-05 11:03:35 +01:00
Guennadi Liakhovetski 385586a5f6 zephyr: implement IDC using P4WQ
When running on Zephyr we use P4WQ to implement inter-core
messaging.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2021-05-05 11:03:35 +01:00
Jaska Uimonen 147b6fcbfe kconfig: add separate format configs for pcm converter
Pcm converter function definitions are under same format configs as all
other component format configs. This creates problems if you want to for
example configure whole pipeline to 16 bits but your dai needs to be
fixed in other format. Thus duplicate and rename the format configs for
pcm converter for fine grained tuning.

Signed-off-by: Jaska Uimonen <jaska.uimonen@intel.com>
2021-05-05 09:49:29 +01:00
Marc Herbert 0f989b10e9 xtensa-build-zephyr.sh: show zephyr short git log / version after clone
By default, the Zephyr build does not log its version. The fix has
already been submitted at
https://github.com/zephyrproject-rtos/zephyr/pull/34842 however:

- 34842 may take some time. Zephyr reviewers are even busier than the
  SOF reviewer.
- 34842 could even be rejected
- 34842 will at best log the SHA1 and no context. This is more verbose
  and future-proof because it supports more complex situations like
  testing a pull/12345/merge

As seen in (unrelated) PR #4123, we need Zephyr git versions NOW.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2021-05-05 09:45:55 +01:00
Marc Herbert 61f286c8a9 build-zephyr.sh: don't update rimage every time we run
Fixes 33c5f5d38e ("xtensa-build-zephyr: do not clone a second version of
sof.git")

The very first version of this test was checking whether the rimage/
directory exists, which proves nothing. So I switched to
rimage/CMakelists.txt but forgot change the `test` flag.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2021-05-05 09:43:54 +01:00
Seppo Ingalsuo b12ce50712 Topology: Add build of topology to run ASRC in cml-rt1011-rt5682
This patch adds development topology to run ASRC playback and
capture via SSP port to headset plug. We don't have many topologies
to test ASRC in current development devices so this is useful

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2021-05-04 20:04:13 +01:00
Daniel Baluta cdd64aa9f6 codec_adapter: Remove processing loop
Calling codec_process() multiple times in a loop limits the minimum
pipeline period we can choose.

For example with AAC one codec_process() can take up to 0.7ms which
means that we cannot reliable set pipeline period to 1ms on i.MX where
DSP has only 1 core.

In order to avoid this and to simplify the code remove the processing
loop hence each codec_adapter_copy() call will call exactly once the
codec_process() function.

Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
2021-05-04 19:55:05 +01:00
Karol Trzcinski 234faf1879 rimage: Update
994ee247e1 ext_man: Fix code formating
6c44aefb1f ext_man: Fix memory leak after manifest build
dbb49e03b9 rimage: add cavs fw layout support
0d641a7b05 minor -h fix: -s meu_offset disables rimage signing
0dba230832 pkcs_v1_5_sign_man_v2_5(): add "salt length" comment

Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
2021-05-04 16:14:00 +01:00
Guennadi Liakhovetski 9e84ec2726 schedule: (cosmetic) use container_of() instead of a type-cast
Where possible container_of() should always be used instead of
direct type-casting.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2021-05-04 16:10:49 +01:00
Guennadi Liakhovetski 5a5d82eeb3 cavs: (cosmetic) remove superfluous parentheses
Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2021-05-04 16:10:49 +01:00
Guennadi Liakhovetski 89eea6c5a9 cavs: register number is always 32-bit
Even when addressing 16-bit data the register number remains
the same - 32-bit.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2021-05-04 16:10:49 +01:00
Guennadi Liakhovetski ac6939868c init: (cosmetic) make primary_core_init() static
primary_core_init() is never called from outside init.c, make
it static.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2021-05-04 16:10:49 +01:00
Guennadi Liakhovetski 0eba431d66 schedule: edf: use a proper type for schedule_edf()
Now that schedule_edf() is just a static function, use a
proper type for its parameter.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2021-05-04 16:10:49 +01:00
Guennadi Liakhovetski 61c91be9fd scheduler: remove .scheduler_run
The .scheduler_run() operation is never used, remove it.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2021-05-04 16:10:49 +01:00
Guennadi Liakhovetski fad27f13d1 zephyr: remove LOG_* API left-over
Remove a log-module declaration to eliminate unused static
variables until we return to using the LOH_* Zephyr API.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2021-05-04 16:10:49 +01:00
Guennadi Liakhovetski e111252a5f zephyr: move library platform code to platform.c
Move logging code and static data to platform/library and
declare a LOG module properly.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2021-05-04 16:10:49 +01:00
Guennadi Liakhovetski 1e4ff1ed5b perf: (cosmetic) use a high level API function
Call timer_get_system() instead of arch_timer_get_system().

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2021-05-04 16:10:49 +01:00
Guennadi Liakhovetski 23fc4e5bc9 cavs: (cosmetic) add a comment to clarify function scope
Clarify, that platform_init() only runs on the primary core.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2021-05-04 16:10:49 +01:00
Guennadi Liakhovetski 369a59431a scheduler: make ops static
In both native and Zephyr builds schedule_edf_ops and
schedule_ll_ops are only used in one file each, make them
static.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2021-05-04 16:10:49 +01:00
Guennadi Liakhovetski 0c7e4c3255 init: (cosmetic) simplify a function
Simplify a function by removing a redundant variable.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2021-05-04 16:10:49 +01:00