This patch adds checks and errors for fopen() failures. The check
is useful with setup scripts paths changes. Aborting the script
avoids the errors in blob exports to be missed.
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
The purpose of this patch is to consolidate all the files
those belong to the DRC module. The top level function names
are changed to have sof_ prefix to avoid conflict with possible
other similar files.
Note: A small fix is needed after similar patch for EQ
is merged since some functions for DRC blob are used from
there.
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
Enable the system-managed device power management feature for the ACE30
PTL board configuration. This feature allows the power management
subsystem to automatically suspend devices before entering a low power
state and resume them after waking up.
The following configuration option has been added:
- `CONFIG_PM_DEVICE_SYSTEM_MANAGED=y`: This option is set to enable
system-managed device power management, ensuring that the power
management subsystem takes care of suspending and resuming devices as
part of the power state transitions.
This change is in line with the power management strategy to minimize
power consumption and manage device states more efficiently without the
need for explicit device power state management in the application code.
Signed-off-by: Tomasz Leman <tomasz.m.leman@intel.com>
For some reason we still have NUM_HDMIS=0 in production topologies,
that's a miss. We have no reason to keep those initial developer
settings.
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
PM_DEVICE_RUNTIME_EXCLUSIVE was deprecated and the new symbol
PM_DEVICE_SYSTEM_MANAGED shall be used when the applications wants
the subsystem to trigger device power management when the system sleeps.
Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
Commit 0eb34dbb92 ("google_aec: Don't allocate giant blobs on the
heap") dropped some sparse annotations and exposed warnings with
dealing with the cached temporary buffers handed to the AEC code.
Unfortunately the underlying API isn't sparse-aware, so rather than go
through the trouble to keep the tags consistent through the new
conversion API (which is a little non-trivial syntactically) just to
throw it away on entry to the library, force it off at conversion time
for simplicity. Essentially now it's checking that all computation in
this module is "uncached", which is fine as long as we don't try to
mix conventions.
Signed-off-by: Andy Ross <andyross@google.com>
The older native_posix board is being deprecated, use native_sim,
which is the future-proof API. Mostly just swap the board target and
change the C API names.
Note the NATIVE_SIMULATOR_IF decoaration on LLVMFuzzerTestOneInput():
that forces the function to be included in the first-stage zephyr.elf
link (otherwise it would be dropped as Zephyr/SOF itself doesn't
reference the entry point) and to be visible as a global symbol to the
libfuzzer instrumentation layer.
Signed-off-by: Andy Ross <andyross@google.com>
There was a problem with test test_102_08_extended_time_check.
The structure ext_system_time_data was sending with wrong size.
Because of this it was not possible to correctly read the value
from the art clock to determine the HH counter.
Signed-off-by: Grzegorz Bernat <grzegorzx.bernat@intel.com>
Add a test to avoid --all breakages like the one in commit
05bfc36dac ("ptl: Add initial PTL configuration"), reported in #9262
See also previous commit.
Signed-off-by: Marc Herbert <marc.herbert@intel.com>
As reported in #9262, this fixes the --all option.
Fixes commit 05bfc36dac ("ptl: Add initial PTL configuration")
Signed-off-by: Marc Herbert <marc.herbert@intel.com>
Passing options one by one in .github/workflows/zephyr.yml was becoming
unwieldy. Reduces Windows/Linux duplication. This also makes local
testing easier; less typing and guess work.
This should also help with #9116.
Signed-off-by: Marc Herbert <marc.herbert@intel.com>
OVERLAY_CONFIG has been deprecated by EXTRA_CONF_FILE since Zephyr 3.4
Also fix the corresponding --help string.
Zephyr 3.4 is one year old and has just been end-of-lifed.
Signed-off-by: Marc Herbert <marc.herbert@intel.com>
Replaces intermediate variable and redundant comments with a direct
call to return multiband_drc_init_coef function.
Signed-off-by: Shriram Shastry <malladi.sastry@intel.com>
Add helper function to add and remove the additional search path.
Removing the search path is useful for interactive shell usage.
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
The purpose of this change is to consolidate the files those
belong to the SRC module. This commit only moves the files. The
next commits are fixing the issues caused by the move.
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
This commit optimizes the division by the speed of sound in the
`theoretical_time_differences` function. By precomputing the fixed-point
reciprocal of the speed of sound, we eliminate the need for a costly
division operation in each iteration.
Additionally, a redundant 'if' statement is removed from the
'tdfb_direction_copy_emphasis' function, simplifying the code.
Signed-off-by: Shriram Shastry <malladi.sastry@intel.com>
Keep context save still disabled for Intel Meteor Lake. This
setting has been used in SOF2.8 and SOF2.9 releases and is used
in Chromebook SOF builds for these platforms. Make the SOF main
default match the releases.
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Combinatorics get hard with all the features, but it's really useful
to be able to test features in isolation.
Signed-off-by: Andy Ross <andyross@google.com>
Change buffer allocation functions to buffer_alloc_range and
buffer_set_size_range. This makes it possible to allocate the buffer even
if the suggested size given in ipc cannot be met.
Signed-off-by: Adrian Warecki <adrian.warecki@intel.com>
Change buffer allocation functions to buffer_alloc_range and
buffer_set_size_range. This makes it possible to allocate the buffer even
if the suggested size given in ipc cannot be met.
Signed-off-by: Adrian Warecki <adrian.warecki@intel.com>
Add two new buffer allocation functions buffer_set_size_range and
buffer_alloc_range dedicated to deep buffering. They try to allocate
the largest possible buffer according to the suggested size. If this size
cannot be obtained, it will be reduced step by step until it reaches
the minimum size.
Signed-off-by: Adrian Warecki <adrian.warecki@intel.com>
Move part of the code responsible for initializing the buffer structure
to the new function buffer_alloc_struct, which will also be used
by a new buffer allocation function.
Signed-off-by: Adrian Warecki <adrian.warecki@intel.com>
Change name of the buffer_init to buffer_init_stream because it is only
responsible for initiating a stream. Omit the caps parameter because it is
only assigned to a structure field. Assign this field in the function
caller.
Signed-off-by: Adrian Warecki <adrian.warecki@intel.com>
FW infrastructure shall support buffering of historic data
from 1ch up to 6 channels 24bit samples in 24bit container.
For this reason, the heap should be extended.Increase HEAPMEM_SIZE
by 0x90000 because for audio format 16000Hz/6ch/24bit
history_buffer_size = 16 * 6 * 3 * 2100s = 604800 bytes (0x93A80)
Signed-off-by: Jaroslaw Stelter <Jaroslaw.Stelter@intel.com>
Add PTL configuration changes required to build FW
for FPGA. After next SOF rebase default target will be
build for RVP, so for FPGA we will use configuration
overlay.
Signed-off-by: Jaroslaw Stelter <Jaroslaw.Stelter@intel.com>
Patch adds PTL configuration basing on MTL
DMIC depends on PM_DEVICE_RUNTIME and PM_DEVICE_POWER_DOMIAN settings.
To effectively enable DMIC these flags must be set.
Additionally DMIC Ownership bit is not supported on ACE 2.0 and ACE 3.0.
Therefore CONFIG_DAI_DMIC_HAS_OWNERSHIP is switched off.
Signed-off-by: Jakub Dabek <jakub.dabek@intel.com>
Due to introducing new platform to sof we need to recognize which
iteration of ace board we are dealing with.
Signed-off-by: Dobrowolski, PawelX <pawelx.dobrowolski@intel.com>
Big rewrite of the core processing code of AEC:
Support both S32 and S16 input and output formats, dynamically
selected at prepare() time based on stream configuration.
Copy/convert data in maximally inlined/unrolled loops, using
cleanly-generated (no duplication!) custom conversion utilities for
each format variant.
Orthogonalize and elaborate the validation code in prepare(). Check
all state for all input/output streams.
Decouple AEC operation from the input stream, filling zeros on
underflow and allowing AEC to run in circumstances where no playback
data exists and to recover when it starts/stops. IPC3 setups can
exploit this now, unfortunately IPC4 always starts connected pipelines
from the host kernel so sees no benefit.
Fix a latency bug with the original code where it would copy the
processed results to the output stream before the call to
ProcessCapture() instead of after, leading to a needless delay. Copy
the results as soon as they are available, if the output buffer backs
up, we'll continue at the next call to process()
Signed-off-by: Andy Ross <andyross@google.com>
Put the AEC tunables inside an if COMP_GOOGLE_RTC_AUDIO_PROCESSING for
hygine. This prevents them from appearing in .config files of SOF
builds where AEC was never enabled at all.
Set MOCK via a default instead of select. Select is unoverridable, it
forces the MOCK to be used whenever COMP_STUBS=y, but it's more
flexible to allow the app to pick and choose which components get
stubbed (STUBS is often set at the platform layer).
Signed-off-by: Andy Ross <andyross@google.com>
On IPC3 pipelines, triggers can arrive at this component due to
changes in the reference pipeline. Those aren't for us, and have the
effect of incorrectly resetting the capture stream if someone stops
playback. Earlier product branches handled this logic in the pipeline
layer, but that never reached SOF main, and it's easier to do here by
just ignoring the event.
On IPC4, triggers never propagate across pipelines (and in any case
dependent pipeline state management happens in the host kernel), so
this becomes a benign noop.
Signed-off-by: Andy Ross <andyross@google.com>
In point of fact the AEC code has never worked on SOF main, and this
code doesn't either. It got left here as new code got added to
support for MTL, and it's just a wart.
Really there's nothing "IPC4ish" at all about the new code at all,
there's no reason a single code path can't be used for both, the
process/source/sink APIs are identical. The new code doesn't work
with legacy builds, mind you. But it will. Remove the stuff that
will never be used.
Signed-off-by: Andy Ross <andyross@google.com>
The internals of the AEC library are floating point already. If we're
going to support using the float variant of the API, we should use it
always to avoid all the complexity.
Signed-off-by: Andy Ross <andyross@google.com>
This technique doesn't work. The ID returned by get_source_id() is
not fixed by topology. Those numbers are derived from a component ID
allocated in the Linux kernel via ida_alloc(). The specific values
will depend on the state and history of the allocator, we can't
compare them via numerical identity here in the firmware even if they
happen to work right now due to topology ordering.
Fall back to the older technique of checking whether the input source
is on the same pipeline as the AEC component to determine if it's the
microphone input.
Signed-off-by: Andy Ross <andyross@google.com>
The operation of the AEC component uses a single buffer as an internal
heap. This is very large, over half the available SRAM at component
creation time on MTL. That's just a poor fit for the heap. It would
be trivial to create a fragmentation scenario by creating/destroying
components (which happens under user control all the way out in Linux
userspace!) where AEC can't initialize and microphone input breaks.
Longer term we can look at moving this usage back to the heap by
integrating the component's internal allocations with the SOF/Zephyr
heap (which is quite performant), allowing it to make fine-grained
allocations which will work more robustly.
Signed-off-by: Andy Ross <andyross@google.com>
There's a race posiibility in DP when stopping a pipeline:
- dp starts processing
- incoming IPC - pause the pipeline. IPC has higher priority
than DP, so DP is preempted
- pipeline is stopping, module "reset" is called. Some of resources
may be freed here
- when IPC finishes, DP thread continues processing
Sollution: wait for DP to finish processing and terminate DP thread
before calling "reset" method in module
To do this:
1) call "thread cancel" before calling "reset"reset
2) modify "thread cancel" to mark the thread to terminate and
execute k_thread_join()
3) terminated thread cannot be restarted, so thread creation must be
moved from "init" to "schedule". There's no need to reallocate memory
zephyr guarantees that resources may be re-used when a thread
is terminated.
Signed-off-by: Marcin Szkudlinski <marcin.szkudlinski@intel.com>
Update zephyr main to support PTL target for dai/ssp
e452bc36a6d9 dai: ssp/ptl: Add missing definition in PTL
Signed-off-by: Dobrowolski, PawelX <pawelx.dobrowolski@intel.com>
Free the memory allocated for tplg base and available input/output
formats when the topology is freed.
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
The controls names for IIR, FIR need to be same as in
sof-hda-generic for UCM to find the controls and set up
the components for processing.
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
Virtual index value for I2S on PTL contains two information:
- time slot group index : 4
- i2s instance : 4
In order to correctly configure the dai api, both of the above
values should be retained.
Update zephyr branch to commit:
a2386efbce1 drivers: ssp: update SSP driver to support Intel ACE30 PTL
Signed-off-by: Damian Nikodem <damian.nikodem@intel.com>
This commit introduces a new constant 'I2S_VER_30_PTL' that describes
specific I2S blob configurations for Intel ACE30 PTL.
Signed-off-by: Damian Nikodem <damian.nikodem@intel.com>