Commit Graph

8993 Commits

Author SHA1 Message Date
Marc Herbert b7708182fb .github: fail on errors and address space warnings in sparse output
sparse does not have a useful exit status so let's use 'grep' instead.

Fixes: #6317

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2022-11-01 10:55:58 +00:00
Baofeng Tian 5261853027 Performance: remove perf avg macro and reduce print profiling logs
PERFORMANCE_COUNTERS_RUN_AVERAGE is not an independent macro,
it depend on: PERFORMANCE_COUNTERS, so it is duplicated,
remove this macro and use one macro to control this module,
also reduced unnecessary profiling log print.

Signed-off-by: Baofeng Tian <baofeng.tian@intel.com>
2022-11-01 10:45:00 +00:00
Andrula Song ef62a50893 Cmocka: EQ: Fix the errors lead to eq-iir test failure
Fix the mistakes in scripts which would lead to eq-iir
test failure.

Signed-off-by: Andrula Song <xiaoyuan.song@intel.com>
2022-10-31 13:33:40 +00:00
Andrula Song 87bd3d628b Math: IIR: add Direct-1 format implementation of IIR
Add C and hifi3 version Direct-1 implementation for IIR,
and rename the structure of sof_eq_iir_header_df2t to
sof_eq_iir_header for both two format sharing. Compared
with the original Direct-2 transport format,Direct-1 has
better performance on low frequency since lower quantization
noise while asking the same memory. The C version cost the
same cycles and hifi version can save about 9.8% cycles than
Direct-2 transport format.

Signed-off-by: Andrula Song <xiaoyuan.song@intel.com>
2022-10-28 12:33:56 +01:00
Rander Wang efc71f6c71 topology2: nocodec: add volume and mixer support
Mixer and volume (gain) are used in nocodec topology.

Signed-off-by: Rander Wang <rander.wang@intel.com>
2022-10-28 12:26:38 +01:00
Pin-chih Lin aa589343fd topology: waves: remove deprecated kcontrol widget and data
Fix aligned to pipe-waves-codec-playback.m4 due to module_adapter
design change.

Signed-off-by: Pin-chih Lin <johnylin@google.com>
2022-10-27 22:05:38 +01:00
Pin-chih Lin 02a7b29884 configs: fix override tigerlake_chrome_* configs
Fix config name from COMP_CODEC_ADAPTER to COMP_MODULE_ADAPTER.

Signed-off-by: Pin-chih Lin <johnylin@google.com>
2022-10-27 22:05:38 +01:00
Marc Herbert e0722f493a xtensa-build-zephyr.py: de-hardcode mode=511 in mkdir()
These hardcoded 511 permissions came with the initial commit
1de3ef3675 ("Rewritten xtensa-build-zephyr.sh to python") without any
particular explanation.

On Unix, permissions of new files and directories are a user preference
set with the `umask`, different applications are not supposed to create
directories differently.

On Windows/NTFS it's not clear what 511 maps to.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2022-10-27 21:38:56 +01:00
Rander Wang b97fd67ef0 cmocka: add eq_fir unit test
This test uses module interface for eq_fir.

The use of decoded 16 bit FIR blob coefficients decreases a lot
the mismatch between float reference FIR vs. SOF fixed point
implementation.

This patch adds the script tools/tune/eq/cmocka_data_eq_fir.m that
generates the files cmocka_fir_coef_2ch.h and cmocka_fir_ref.h.

The script debug_files_plot.m can be used to visualize the unit
test result and error for data that is generated if macro
DEBUG_FILES is defined.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
Signed-off-by: Andrula Song <xiaoyuan.song@intel.com>
Signed-off-by: Rander Wang <rander.wang@intel.com>
2022-10-27 21:12:37 +01:00
Rander Wang 880f9d72ba eq-fir unit test: add ext_data_length for eq-fir
Eq-fir is a process component and use ext_data_length
with module adapter.

Signed-off-by: Rander Wang <rander.wang@intel.com>
2022-10-27 21:12:37 +01:00
Ranjani Sridharan c2408be66f mixin_mixout: generate 0s when mixout pipeline starts first
IPC4 requires that the sink pipeline be started first before the source
pipeline starts. So, generate silence if there are no source frames
available.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2022-10-27 19:33:38 +03:00
Ranjani Sridharan d47add305d ipc4: helper: use pipeline_disconnect during unbinding
Use pipeline_disconnect() to disconnect the source and sink components
from the buffer between them to do this properly.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2022-10-27 19:31:35 +03:00
Ranjani Sridharan 0b7b3a5c7e ipc4: helper: Fix module free
When 2 modules are bound together, they are bound with a buffer between
them with the connection like this : source_module->buffer->sink_module.

So, what this means is that there is only one connection going from a
module to the buffer. So, calling pipeline_disconnect() from the same
module to the same buffer in both directions makes no sense.

Consider the following pipeline:
host_copier->gain->mixin

With the current logic, while iterating through the list of modules, if
mixin goes first for freeing, we'd end up freeing the buffer between the
mixin and gain before it is disconnected from the gain.

The right way to free a module would be first disconnect the module from
the sink buffer, then check if the sink buffer has been disconnected
from its sink module. If so, the buffer should be freed. Otherwise the
buffer will be freed whenever the sink module is disconnected from it.
The same thing must be repeated for the module's source buffer as well.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2022-10-27 19:31:35 +03:00
Ranjani Sridharan 56b4773884 pipeline: set buffer comp to NULL during disconnect
Set the buffer comp to NULL after the component has been disconnected
from it.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2022-10-27 19:31:35 +03:00
Ranjani Sridharan 496ce8c5a4 copier: Only copy if sink comp is active
When a copier is connected to multiple output components, the processed
data should be copied to the output  buffer only if the sink component
is also active.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2022-10-27 17:05:15 +03:00
Ranjani Sridharan e52de83dff ipc4: Set comp direction during module binding
Simplify the direction setting for components to assign the direction
for components during module binding. Copier components always have
their direction set during init, so use that to set the direction for
the other modules.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2022-10-27 14:11:57 +03:00
Seppo Ingalsuo 82bdd0f9f0 Audio: SRC: Fix HiFi2 SRC off-by-one frame issue
This patch fixes the FIR compute off-by-one frame bug. The fix
is similar as for generic C except that HiFi2 pointers
arithmetic is in bytes.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2022-10-27 13:47:33 +03:00
Seppo Ingalsuo e76b92bf18 Audio: SRC: Fix HiFi4 SRC off-by-one frame issue
This patch fixes the FIR compute off-by-one frame bug. The fix
is similar as for generic C except that HiFi4 pointers
arithmetic is in bytes.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2022-10-27 13:47:33 +03:00
Seppo Ingalsuo b35ad45f3a Audio: SRC: Fix HiFi3 SRC off-by-one frame issue
This patch fixes the FIR compute off-by-one frame bug. The fix
is similar as for generic C except that HiFi3 pointers
arithmetic is in bytes.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2022-10-27 13:47:33 +03:00
Seppo Ingalsuo 13ce3345ad Audio: SRC: Fix generic SRC FIR off-by-one frame issue
This patch fixes the pointer arithmetic to start FIR calculation
from latest written PCM frame pointer. The rewind step was too
small and caused the first FIR coefficient to be multiplied with
the eldest frame in delay line while it should have pointed to
youngest. The second coefficient multiplied with youngest, etc.

The time shift for FIR coefficient caused a difference
to filter response vs. designed. Since especially in longer filters
the first tap value is near zero the impact was hard to notice.

The "easy" conversions such as 8 kHz to 48 kHz with short filters
and larger first tap values suffered most of this.

With this change THD+N (dB) for 8 kHz to 48 kHz improves:

		16 bits		24 bits		32 bits
Before		-60.59		-63.98		-63.98
After		-62.35		-80.39		-80.40

44.1 kHz to 48 kHz no impact:

		16 bits		24 bits		32 bits
Before		-62.36		-85.69		-85.72
After		-62.35		-85.69		-85.72

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2022-10-27 13:47:33 +03:00
Piotr Makaruk 506e994dc4 hda: enable chain dma pipeline start
Maintain flow by enabling pipeline trigger to start

Signed-off-by: Piotr Makaruk <piotr.makaruk@intel.com>
2022-10-27 11:01:41 +02:00
Piotr Makaruk 30dbbb999a mtl: hda: add additional link inputs
Define more link inputs for mtl platform

Signed-off-by: Piotr Makaruk <piotr.makaruk@intel.com>
2022-10-27 11:01:41 +02:00
Guennadi Liakhovetski eb712a40db volume: don't modify read-only mailbox data
Fix a case of dropping the `const` modifier and overwriting read-only
data in the mailbox in volume_set_config().

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2022-10-26 15:56:49 +01:00
Guennadi Liakhovetski 10f6dd0d7b module-adapter: add a constant data pointer
module_config contains a .data pointer that is used both for initial
and run-time configuration. The initial configuration should be
const. We add a new .init_data pointer for it.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2022-10-26 15:56:49 +01:00
Guennadi Liakhovetski 7ab88ad9be selector: use base configuration from the common location
Instead of saving a local copy of the base configuration, use the
common one.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2022-10-26 15:56:49 +01:00
Guennadi Liakhovetski 5f92e7645e volume: use base configuration from the common location
Instead of saving a local copy of the base configuration, use the
common one.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2022-10-26 15:56:49 +01:00
Guennadi Liakhovetski cdb8cd46a3 iadk: don't store the IPC data pointer permanently
IADK modules obtain a pointer to IPC data for their initialisation in
system_agent_start()'s last parameter. No need to also store it as
module's private data - it doesn't belong to the module and its
contents can change. Store a pointer to the module itself instead.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2022-10-26 15:56:49 +01:00
Guennadi Liakhovetski 2babc0b8da module-adapter: fix .get_attribute() functionality
.get_attribute() can be called any time after component
initialisation, mailbox data isn't available at that time any more.
Save a copy of IPC4 base module configuration instead.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2022-10-26 15:56:49 +01:00
Guennadi Liakhovetski b787fbaaa3 dai: make special configuration in dai_config() const
DAI special configuration can be delivered from an IPC buffer,
make it const to catch any inadvertent modifications.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2022-10-26 15:56:49 +01:00
Guennadi Liakhovetski f748461ffc volume: don't modify IPC data
In volume_init() use a temporary local array instead of modifying
IPC data, that can be stored in a host IPC memory window.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2022-10-26 15:56:49 +01:00
Guennadi Liakhovetski eda36261fc ipc4: switch to read-only access to host mailbox where possible
Convert several use cases of the host mailbox to use const pointers.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2022-10-26 15:56:49 +01:00
Guennadi Liakhovetski 940f1a88d2 probe: don't modify input configuration data
In probe_point_add() avoid modifying input configuration data that
can be located in the host memory window.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2022-10-26 15:56:49 +01:00
Guennadi Liakhovetski 6f38baa1a0 probe: don't store pointers to configuration data
probe configuration data, passed to probe_point_add() cannot be used
outside of the scope of the function, therefore storing pointers to
it for later use is invalid. The pointer is only used in the
notification handler to extract the buffer ID. Use the ID from the
probes' persistent data instead.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2022-10-26 15:56:49 +01:00
Tomasz Leman ab3ad0151a ace: cpu: cpu management for mtl
This patch adds implementation of core power state changing functions
for meteorlake. Code uses zephyr kernel api provided by power manager.

Signed-off-by: Tomasz Leman <tomasz.m.leman@intel.com>
2022-10-26 13:27:25 +01:00
Tomasz Leman b6a4bb682c platform: Kconfig: add timeout for disabling secondary core
Count of loops used when waiting for secondary core to enter OFF state
in transition to D3 state.

Signed-off-by: Tomasz Leman <tomasz.m.leman@intel.com>
2022-10-26 13:27:25 +01:00
Tomasz Leman e973f5245e zephyr: cpu: moving outside of the wrapper
Moving core management code out of the wrapper for solutions builded
with zephyr.

Signed-off-by: Tomasz Leman <tomasz.m.leman@intel.com>
2022-10-26 13:27:25 +01:00
Andrula Song 96506488c8 Audio: EQ-FIR: fix the shift round bugs
Fix the shift round bugs caused by not suitable
xtensa intrinsics.

Signed-off-by: Andrula Song <xiaoyuan.song@intel.com>
2022-10-26 13:26:21 +01:00
Rander Wang 1447d43aac ipc4: fw_reg: add more description for fw_reg
Signed-off-by: Rander Wang <rander.wang@intel.com>
2022-10-25 13:21:58 +01:00
Rander Wang f897921490 ipc4: refine dsp core comments
Found by Linux patch review.

Signed-off-by: Rander Wang <rander.wang@intel.com>
2022-10-25 13:21:58 +01:00
Guennadi Liakhovetski e961e442ba copier: (cosmetic) fix alignment
Fix two cases of misalignment.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2022-10-25 10:34:08 +01:00
Guennadi Liakhovetski 54455d592f ipc4: (cosmetic) convert several if-else chains to switch-case
Where applicable, switch-case provides better readability than
chained if-else, replace several such cases.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2022-10-25 10:34:08 +01:00
Ming Jen Tai 4a438b962b rtnr: refine set/get component data procedure
This commit refines the following procedures to
make it more stable on different platforms.

1.  The initial data( not config ) defined in the topology
is empty. On some platforms rtnr_get_comp_data
might be called with the size equals 0 during
initialization. We only do the memcpy_s when the size
is valid.

2. There are 3 control widgets in RTNR topology. During
initialization, the initial data could be received via IPC
in the form of config+data+switch or config only. In
either case we now just copy the preceding portion
of the data since it has the required config.

Signed-off-by: Ming Jen Tai <mingjen_tai@realtek.com>
2022-10-25 10:32:51 +01:00
Ievgen Ganakov 7029fb7b01 detect_test: add ipc4 support
Add ipc4 support for KD module keeping ipc3
backward compatibility. Add ipc4 model blob
handler based on large_config_set architecture

Signed-off-by: Ievgen Ganakov <ievgen.ganakov@intel.com>
2022-10-25 09:11:13 +02:00
Marc Herbert 3a9413eebd xtensa-build-zephyr.py: restore lost reproducible .ri checksum
At the end of the build, parse the .ri file and print a reproducible
checksum of the its content.

This feature was in xtensa-build-zephyr.sh but never made it to the .py
conversion. It was lost when the .sh file was deleted in commit
ef028f634a ("Removed obsolete xtensa-build-zephyr.sh")

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2022-10-24 16:15:12 +01:00
Marc Herbert 367df306b6 sof_ri_info: minor BinReader logging fix to support pathlib
Switch to an f-string which automatically converts the argument to a
string.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2022-10-24 16:15:12 +01:00
Ranjani Sridharan 06226d00b0 ipc4: handler: Don't reset pipeline before STOP trigger
When setting the SOF_IPC4_PIPELINE_STATE_RESET for a pipeline,
pipeline_trigger() gets invoked first but the actual STOP trigger
execution could get delayed until the next invocation of the pipeline
task. In this case, pipeline_reset() must be invoked only after the STOP
trigger has completed. Fix this by calling pipeline_reset() in
set_pipeline_state() only if the trigger is not delayed. Also, add the
call to pipeline_reset() in pipeline_task_cmd() after the successful
completion of the STOP trigger.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2022-10-24 18:07:01 +03:00
Ranjani Sridharan 60ac9b714f pipeline-graph: remove assert in pipeline_new()
Log the memcpy_s() failure and return NULL so that the IPC won't time
out.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2022-10-24 15:23:54 +03:00
Marc Herbert de90f55657 .github: extract standalone testbench.yml from Main Actions
Divide and Conquer.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2022-10-24 12:20:11 +01:00
MARUTHI MACHANI 07d401af9d drivers:amd:four channel dmic configurations
configurations to support dmic for four channels for amd
platforms.

Signed-off-by: MARUTHI MACHANI <maruthi.machani@amd.com>
2022-10-24 12:16:29 +01:00
MARUTHI MACHANI 2a8fd7d206 platform:amd:support for fence register change
support for IRAM fence register change.

Signed-off-by: MARUTHI MACHANI <maruthi.machani@amd.com>
2022-10-24 12:16:29 +01:00