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>
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>
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>
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>
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>
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>
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>