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>
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>
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>
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>
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>
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>
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>
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>
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>
Instead of saving a local copy of the base configuration, use the
common one.
Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Instead of saving a local copy of the base configuration, use the
common one.
Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
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>
.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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
<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>
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>
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>
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>
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>
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>
`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>