Commit Graph

8931 Commits

Author SHA1 Message Date
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
MARUTHI MACHANI 252e7e7559 topology1: support for dmic with 4 channels
Topology support to configure dmic with
four channels for amd platforms.

Signed-off-by: MARUTHI MACHANI <maruthi.machani@amd.com>
2022-10-24 12:16:29 +01:00
Ranjani Sridharan 337bd8ea72 ipc4: handler: make error message more informative
<err> ipc: ipc4: 0 failed err 12
The above error isn't so informative.

Replace the target number with the actual IPC message names.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2022-10-24 12:15:34 +01:00
Marc Herbert ce28e09bd3 xtensa-build-zephyr.py: west update --depth 5 --narrow
Restore previous optimization. Can easily be undone with
git -C zephyr/ fetch --unshallow.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2022-10-24 12:10:45 +01:00
Marc Herbert 9a3a518644 xtensa-build-zephyr.py: pass -j option to west -> ninja
This is especially useful when compiling each C file requires a
network round-trip to a license server

Also stop overriding the ninja default when building rimage.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2022-10-24 12:10:45 +01:00
Piotr Kmiecik da5edbdf7d ace_v1x: host system time set and get
Base firmware functionality for setting and getting host system time.

Signed-off-by: Piotr Kmiecik <piotrx.kmiecik@intel.com>
2022-10-24 14:08:48 +03:00
Ranjani Sridharan 0b69384473 ipc4: handler: skip trigger if pipeline is already paused
This will avoid the pipeline walk and all the NOP's in each module
trigger when the pipeline is already paused.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2022-10-24 14:03:33 +03:00
Guennadi Liakhovetski a9c5a1bb78 module_adapter: mark data buffers as cached
Module adapter code uses struct input_stream_buffer and
struct output_stream_buffer to pass generic data to individual
modules for processing. Further, modules implementing the
.simple_copy option pass a cached pointer to struct audio_stream
which is already acquired at the generic code level. That means,
that in those cases .data contains cached memory aliases. This
patch marks the .data pointer as cached.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2022-10-24 11:49:23 +01:00
Marc Herbert adce544450 xtensa-build-zephyr.py: simplify installation, prepare for more files
Simplify the final installation code to prepare for installing more
files. Zero functional change.

Notably perform the cavs naming trick inside the build directory first
which allows using a destination directory instead of a destination file.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2022-10-21 20:02:11 +03:00
Marc Herbert ab7c1a2c7b xtensa-build-zephyr.py: de-interleave signing and installation code
Very minor, zero-change re-ordering to make the next commit easier to
review. Fixes commit 762f63bf8b ("xtensa-build-zephyr: add option to
build FW in cavs naming style")

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2022-10-21 20:02:11 +03:00
Marc Herbert a42592eda1 xtensa-build-zephyr.py: don't make "." a special case in tree listing
Small simplification.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2022-10-21 20:02:11 +03:00
Marc Herbert 0497212dca xtensa-build-zephyr.py: sort glob(**/*) list used for tree display
`pathlib.glob()` (and filesystems in general) provide no ordering
guarantee, which is likely why every glob() example in
https://docs.python.org/3/library/pathlib.html#pathlib.Path.glob
is sorted(). Follow these examples and use `sorted()`.

Fix error handling to run _before_ the `list index out of range`
exception hits. Also make it fatal now because there's no more any good
reason for this to fail.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2022-10-21 20:02:11 +03:00
Marc Herbert 6cba64d2cb xtensa-build-zephyr.py: fix a few minor pylint warnings
Declare globals at the top level.
Stop shadowing globals.
Replace `== or ==` with `in [ ]`.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2022-10-21 20:02:11 +03:00