Commit Graph

7267 Commits

Author SHA1 Message Date
Peter Ujfalusi aad035ac1e .github: workflows: codestyle: Drop --codespellfile
With the backported patch to checkpatch.pl the dictionary.txt location
should automagically found and no need to specify it by hand.

Suggested-by: Marc Herbert <marc.herbert@intel.com>
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
2021-11-11 17:09:30 +00:00
Peter Ujfalusi 81c8279590 checkpatch: get default codespell dictionary path from package location
The standard location of dictionary.txt is under codespell's package, on
my machine atm (codespell 2.1, Artix Linux):

  /usr/lib/python3.9/site-packages/codespell_lib/data/dictionary.txt

Since we enable the codespell by default for SOF I have constant:

  No codespell typos will be found - file '/usr/share/codespell/dictionary.txt': No such file or directory

The patch proposes to try to fix up the path following the
recommendation found here:

  https://github.com/codespell-project/codespell/issues/1540

Mainline commit:
0ee3e7b8893e ("checkpatch: get default codespell dictionary path from package location")

Link: https://lkml.kernel.org/r/29e25d1364c8ad7f7657cc0660f60c568074d438.camel@perches.com
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Acked-by: Joe Perches <joe@perches.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2021-11-11 17:09:30 +00:00
Ranjani Sridharan 5048eb74b1 topology2: pcm/pipeline: add instance attribute
Add an instance attribute for all pipeline class definitions and the pcm
class. This will be used to instantiate unique PCM/pipeline instances.

The ID attribute for PCM and the index attribute for pipeline may be the
same as the instance attribute in most cases. But in some cases, the
pipeline ID or the PCM index will be passed from the CMakeLists.txt file
as pre-processor definitions and they will be replaced as needed.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2021-11-11 16:44:38 +00:00
Seppo Ingalsuo 3bb7cbaabc Audio: Mixer: Optimize sources and sink buffers access
This patch replaces the usage of audio_stream_read/write_frag_sXX()
usage with block processing based on audio_stream_bytes_without_wrap().

There are no processing related changes.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2021-11-11 14:45:39 +00:00
Seppo Ingalsuo 53070fcf22 Audio: Mixer: Fix saturate of S24_LE PCM output
This patch adds a 24 bit mixer function. Previously 24 bit was
handled with 32 bit function. It did not properly saturate the
output to 24 bits.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2021-11-11 14:45:39 +00:00
Rander Wang 5d3c650435 ipc4: copier: update stream position for audio driver
Pipeline registers are located in memory windows0. FW needs
to update it with current stream position.

Currently we don't change stream_end_addr since we don't support
EOS. Will add support later.

Signed-off-by: Rander Wang <rander.wang@intel.com>
2021-11-11 14:40:09 +00:00
Peter Ujfalusi f3b91f60e8 Audio: TDFB: Use correct type for the IPC message sent on change
The tdfb is sending the direction information via the ctrl_data->chanv[]
which is valid in case of SOF_CTRL_TYPE_VALUE_CHAN_GET type.

Correct the message initialization to make sure that the message is
correctly parsed by the receiver.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
2021-11-11 13:29:54 +00:00
Guennadi Liakhovetski 36a8049932 zephyr: ll_schedule: tasks in INIT state aren't on the task queue
Tasks in the INIT state aren't on the queue, calling
schedule_task_free() for them causes a panic due to the task counter
underrun. Don't try to dequeue such tasks.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2021-11-11 13:29:12 +00:00
John Zimmermann 17d0e2d5ab logger: use more specific format specifiers
Signed-off-by: John Zimmermann <me@johnnynator.dev>
2021-11-11 13:24:33 +00:00
Bard Liao fa6365b0ad Topology2: tokens: add token for low power mode
Adding low power mode token

Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
2021-11-11 13:21:40 +00:00
Marc Herbert d1b264c3f0 xtensa-build-zephyr: add new -z option to clone any Zephyr version
Default behavior is still to clone the default Zephyr branch (main) but
this could be changed with just one line.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2021-11-11 10:33:18 +00:00
Marc Herbert fa0888991c xtensa-build-zephyr: cosmetic rename of two functions
Zero functional change.

Rename clone() to west_init_update() and build_all() to
build_platforms(). Also expand description of the west_init_update()
feature in the usage message and add a direct SHA1 fetch example.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2021-11-11 10:33:18 +00:00
Paul Olaru 6cc5ba98ed tools: ctl: CMakeLists: Add -Wall and -Werror flags
These flags are required to prevent unwanted bugs in the ctl tool. They
have been used to detect an undefined behaviour instance which occurred
due to lack of a return value in a non-void function.

Signed-off-by: Paul Olaru <paul.olaru@nxp.com>
2021-11-10 08:34:53 +02:00
Paul Olaru e3ac593f86 tools: ctl: Fix various errors
Most of the errors are unused variables, plus an unused label. Those are
benign.

One of the errors was the following:

/work/repos/sof/tools/ctl/ctl.c: In function ‘ctl_set_get’:
/work/repos/sof/tools/ctl/ctl.c:497:1: error: control reaches end of
non-void function [-Werror=return-type]
  497 | }
      | ^

This error had caused an undefined-behaviour-driven bug internally (an
error being displayed with a return code of 0, when it shouldn't have
been possible to display that message if the return code was 0). At line
614 of the old code, the message "Error: could not Set control, ret:0"
was displayed.

The errors only show up when you add -Wall -Werror to the compile
options of ctl, which I will do in the next commit.

Signed-off-by: Paul Olaru <paul.olaru@nxp.com>
2021-11-10 08:34:53 +02:00
Peter Ujfalusi a4606425fa tone: Validate the type of data in cdata before accessing to it
The data via cdata->chanv is only valid if:
cdata->type == SOF_CTRL_TYPE_VALUE_CHAN_*

Likewise, the data is only valid via cdata->compv if:
cdata->type == SOF_CTRL_TYPE_VALUE_COMP_*

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
2021-11-08 17:32:21 +00:00
Seppo Ingalsuo 73f98145d3 Audio: Optimize IIR performance
This patch optimizes the buffer copying and output scaling to
other format than int32_t. The main saving is from not using
read/write frag buffer access functions for every sample.

The saving of processing cycles consumption varies per platform
but a second order IIR stereo EQ on TGL shows 43% improvement for
average copy() duration.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2021-11-08 17:28:56 +00:00
Kai Vehmanen 601cbc061d topology1: sof-cavs-nocodec: fix documentation
Fix the documentation to match actual topology definition. The comments
did not include addition of mixers nor the capture PCMs. Also many
comments reflect a fixed core id that is no longer accurate.

Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
2021-11-08 13:29:13 +00:00
Bartosz Kokoszko ec63f3a70e pm_runtime: prepare secondary cores for power down in d0->d0ix flow
Primary core during going to D0i3 state disables all another cores
in platform_pg_int_handler() function. Before it secondary cores
should be prepared (disable interrupts, perform writeback) in order
to make proper restore flow after D0i3->D0 transition.

This commit adds cpu_secondary_cores_prepare_d0ix() function in
ipc_pm_gate() handler, which sends idc to secondary cores
with information that they should perform preparation for power down
in the next platform_wait_for_interrupt() invocation. In
platform_wait_for_interrupt() there is cpu_power_down_core()
invocation with CPU_POWER_DOWN_MEMORY_ON (performs writeback/invalidate,
disables interrupts), when proper flag is set.

Signed-off-by: Bartosz Kokoszko <bartoszx.kokoszko@linux.intel.com>
2021-11-08 13:25:44 +00:00
Bartosz Kokoszko 15c9335962 scheduler: allow scheduler_free functions to disable only irqs
This commit:
- adds flags argument into scheduler_free function pointer in
  scheduler_ops struct;
- adds SOF_SCHEDULER_FREE_IRQ_ONLY flag, which indicates to disable
  only interrupts in scheduler_free() functions.

Signed-off-by: Bartosz Kokoszko <bartoszx.kokoszko@linux.intel.com>
2021-11-08 13:25:44 +00:00
Bartosz Kokoszko 225d8e3b86 idc: allow idc_free() to disable only irqs
This commit:
- adds flags argument to idc_free() function;
- adds IDC_FREE_IRQ_ONLY flags, which allows
  idc_free() to disable only interrupts.

Signed-off-by: Bartosz Kokoszko <bartoszx.kokoszko@linux.intel.com>
2021-11-08 13:25:44 +00:00
Adrian Bonislawski 17ebe860f0 init: secondary_core_restore possibility on boot
In some multicore scenarios dsp can try to restore secondary core state
if all memory is still powered up and there was no external request
for a core shutdown before

For example multicore case with d0ix sleep where secondary core will be
put to sleep along with primary core and after wakeup there will be
a possibility to restore it

Signed-off-by: Adrian Bonislawski <adrian.bonislawski@intel.com>
Signed-off-by: Bartosz Kokoszko <bartoszx.kokoszko@linux.intel.com>
2021-11-08 13:25:44 +00:00
Adrian Bonislawski 493e9c32a8 schedule: add possibility to restore all schedulers
EDF scheduler restores interrupt

Signed-off-by: Adrian Bonislawski <adrian.bonislawski@intel.com>
2021-11-08 13:25:44 +00:00
Adrian Bonislawski b87352c754 idc: add idc_restore
Restores idc interrupt if all is ready

Signed-off-by: Adrian Bonislawski <adrian.bonislawski@intel.com>
2021-11-08 13:25:44 +00:00
Adrian Bonislawski e62855935d lps: restore secondary cores on wake up
This will add missing secondary cores restore on wake up,
simple pm_runtime_get(PM_RUNTIME_DSP, PLATFORM_PRIMARY_CORE_ID)
in lps is not enough in multicore scenario

Signed-off-by: Adrian Bonislawski <adrian.bonislawski@intel.com>
2021-11-08 13:25:44 +00:00
Adrian Bonislawski bc92d766fc platform: lps_wait_for_interrupt entry core check
LPS functionality is limited to the primary core

Signed-off-by: Adrian Bonislawski <adrian.bonislawski@intel.com>
Signed-off-by: Bartosz Kokoszko <bartoszx.kokoszko@linux.intel.com>
2021-11-08 13:25:44 +00:00
Rander Wang 73ff152bd5 ipc4: alh: fix a typo
Should use IPC4_ALH_DAI_INDEX_OFFSET to adjust dai index

Signed-off-by: Rander Wang <rander.wang@intel.com>
2021-11-08 13:13:51 +00:00
Rander Wang 596470e286 ipc4: pipeline: refine pipeline state transfer
Two different pipeline state setting in windows.
(1) init -> pause -> reset
(2) init -> reset
we should do nothing for (1) and skip stop operation
for (2).

Signed-off-by: Rander Wang <rander.wang@intel.com>
2021-11-08 13:13:51 +00:00
Rander Wang 8810101a26 ipc4: handler: return correct error value
Current some ipc helper functions return error type of ipc3, now
convert it to ipc4.

Signed-off-by: Rander Wang <rander.wang@intel.com>
2021-11-08 13:13:51 +00:00
Rander Wang c0a27ec46a ipc4: skip component in different pipelines
Only Set hw params for single pipeline.

Signed-off-by: Rander Wang <rander.wang@intel.com>
2021-11-08 13:13:51 +00:00
Rander Wang 5ebb71be50 ipc4: init sched_id in FW
Ipc3 set sched_id in topology but it is set in FW
for ipc4. Now initialize it when pipeline is set up.

Signed-off-by: Rander Wang <rander.wang@intel.com>
2021-11-08 13:13:51 +00:00
Rander Wang cbf6f58158 ipc4: mixer: fix mixin buffer connection
For mixin + mixout case, we use mixer to replace mixout
and skip mixin component. In this case we need to connect
the buffer between mixin and mixout to mixin then it can
be free when mixin is free.

Signed-off-by: Rander Wang <rander.wang@intel.com>
2021-11-08 13:13:51 +00:00
Rander Wang 60c5e50a87 ipc4: copier: invalidate data cache for memory window
Attenuation is stored in memory window by host driver
and we need to invalidate data cache.

Signed-off-by: Rander Wang <rander.wang@intel.com>
2021-11-08 13:13:51 +00:00
Rander Wang 20d4eadc48 ipc4: copier: fix a typo
In & out are container size and should be compared for
conversion function.

Signed-off-by: Rander Wang <rander.wang@intel.com>
2021-11-08 13:13:51 +00:00
Rander Wang 810838da2e ipc4: report ALH support to host driver
Host driver checks ALH capability to enable sdw.

Signed-off-by: Rander Wang <rander.wang@intel.com>
2021-11-08 13:13:51 +00:00
Jaska Uimonen ff63219de2 topology2: add mic extension and vendor mic config classes
Add two classes to be used with dmic for nhlt conformance. Mic extension
includes snr and sensitivity values. Mic vendor config has multiple
values for defining the mic array geometry and mic positions.

Do not add tokens as these values are used currently only with nhlt
generation. Defining these classes in dmic is optional.

Signed-off-by: Jaska Uimonen <jaska.uimonen@intel.com>
2021-11-08 12:18:06 +00:00
Seppo Ingalsuo 3eeda96c0c Test: Add cmocka test case for IIR equalizer
This patch adds for the IIR equalized component a test with
comparison 100 ms of Octave generated output to output of the
component. The test signal is a full scale chirp signal. The
IIR response is both amplifying and attenuating to trigger as
much as possible issues with internal overflows.

All test data was generated by Octave script
cmocka_data_eq_iir.m. Re-run of script updates the used header
files the in cmocka tests directory.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2021-11-08 12:14:43 +00:00
Yong Zhi bb847b7639 topology2: nocodec: remove index initialization from DMIC instance
The DMIC DAI does not have index attribute, so remove it.

Signed-off-by: Yong Zhi <yong.zhi@intel.com>
2021-11-08 12:06:25 +00:00
Daniel Baluta f696e52482 cmake: Add imx8ulp to the list of unsigned images
NXP platforms do not use signed firmware image for now. Add imx8ulp
to the list of unsigned firmware to fix build.

With this we fix the following build error
make[3]: Entering directory
'~/sof_dir/sof/build_imx8ulp_gcc'
[100%] Creating reproducible.ri
0x2e0   error: CSE Manifest magic number NOT found, instead: (Reef)

Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
2021-11-08 11:45:32 +02:00
Pierre-Louis Bossart 9e4b18d19f drivers: Intel: hda-dma: only check DGCS_BUSY with delayed stop
When an older kernel is used, we use the immediate stop. On some
platforms, we see an -EBUSY error that prevents the trigger stop from
working.

This patch adds a check to be 'bug-compatible' with previous releases
and older kernels. An additional fix would be to insert a poll timeout
to make sure the BUSY bit is cleared.

BugLink: https://github.com/thesofproject/sof/issues/4919
Fixes: 7e54f456e ('drivers: Intel: hda-dma: ensure DMA channel is idle after stop')
Suggested-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
2021-11-04 14:50:56 +08:00
Ranjani Sridharan ef5358474a topology2: cavs: gain-playback/capture: Add all includes
Include all dependencies to be able to build the conf file individually.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2021-11-03 21:44:19 +00:00
Ranjani Sridharan 328e1650d8 topology2: cavs: mixin-playback: Add all includes
Include all dependencies to be able to build the conf file individually.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2021-11-03 21:44:19 +00:00
Ranjani Sridharan ee2cb09ba6 topology2: cavs: mixout-gain-playback: Add all includes
Include all dependencies to be able to build the conf file individually.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2021-11-03 21:44:19 +00:00
Ranjani Sridharan 7fc1b7159b topology2: cavs: passthrough-capture: Add all includes
Include all dependencies to be able to build the conf file individually.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2021-11-03 21:44:19 +00:00
Ranjani Sridharan f30cb4b1a3 topology2: cavs: passthrough-playback: Add all includes
Include all dependencies to be able to build the conf file individually.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2021-11-03 21:44:19 +00:00
Ranjani Sridharan dbc3ba5e3e topology2: eq-iir-volume-capture: Add all includes
Include all dependencies to be able to build the conf file individually.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2021-11-03 21:44:19 +00:00
Ranjani Sridharan f21a25abe5 topology2: Add class definition for EQIIR
Add the class definition for EQIIR widget.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2021-11-03 21:44:19 +00:00
Ranjani Sridharan 06684c9308 topology2: passthrough-capture: Add all includes
Include all dependencies to be able to build the conf file individually.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2021-11-03 21:44:19 +00:00
Ranjani Sridharan 47c6dba606 topology2: volume-capture: Add all includes
Include all dependencies to be able to build the conf file individually.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2021-11-03 21:44:19 +00:00
Ranjani Sridharan f29234fba8 topology2: volume-demux-playback: Add all includes
Include all dependencies to be able to build the conf file individually.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2021-11-03 21:44:19 +00:00
Ranjani Sridharan da6ea477da topology2: Add class definition for muxdemux
Add the class definition for the MUX/DEMUX process type widget.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2021-11-03 21:44:19 +00:00