Commit Graph

12032 Commits

Author SHA1 Message Date
Tomasz Leman af131ae03f pipeline: params: Display component IDs in hex format in pipeline logs
Standardize component ID logging by displaying them in hexadecimal
format across all pipeline logs. This change aligns the component ID
representation with other parts of the firmware logs where hexadecimal
is used, facilitating quicker cross-referencing and searchability for
specific components during debugging.

Signed-off-by: Tomasz Leman <tomasz.m.leman@intel.com>
2024-04-15 14:43:50 +01:00
Tomasz Leman ff4daf1ae0 ipc4: helper: Use hex format for component IDs in ipc-helper logs
Unify the logging format for component IDs by converting them to
hexadecimal in ipc-helper.c. This change ensures consistency with other
log entries and improves the ease of identifying components when
cross-referencing with other debugging outputs that use hex notation for
component IDs.

Signed-off-by: Tomasz Leman <tomasz.m.leman@intel.com>
2024-04-15 14:43:50 +01:00
Seppo Ingalsuo 660e27809e Tools: Topology2: Add include of mtl.conf for LNL HDA generic
This quick fix avoids build of NHLT blob for the default (TGL)
for LNL HDA generic platform.

The DMIC part of NHLT from TGL is not suitable for LNL, while a
blob for MTL can be used. A proper lnl.conf will be added later.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2024-04-15 14:09:04 +01:00
Kai Vehmanen e9b238f826 xtos: perf_cnt: use correct timing_counter_get()
Do not use arch_timing_counter() directly, but instead use
the public timing_counter_get().

Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
2024-04-15 13:54:01 +01:00
Adrian Bonislawski 031619c526 boards: mtl: enable KCPS dynamic clock control
This will enable dynamic clock control based on KCPS budget

Signed-off-by: Adrian Bonislawski <adrian.bonislawski@intel.com>
2024-04-15 13:48:33 +01:00
Krzysztof Frydryk 5f90a88dcb platform: register proper basefw CPS consumption on boot
On init, register consumption of 10MCPS for base fw
if CONFIG_KCPS_DYNAMIC_CLOCK_CONTROL enabled

Signed-off-by: Adrian Bonislawski <adrian.bonislawski@intel.com>
Signed-off-by: Krzysztof Frydryk <krzysztofx.frydryk@intel.com>
2024-04-15 13:48:33 +01:00
Krzysztof Frydryk db921487c5 pipeline: Register and unregister pipelines CPS consumption on run/pause
Register and unregister pipelines CPS consumption on run/pause

Signed-off-by: Adrian Bonislawski <adrian.bonislawski@intel.com>
Signed-off-by: Krzysztof Frydryk <krzysztofx.frydryk@intel.com>

+Squashed commits:
924f0d26db pipeline: print warning if 0 KCPS received
Signed-off-by: Adrian Bonislawski <adrian.bonislawski@intel.com>
7bb6e7ef3b pipeline: register CPS consumption for a proper core
Signed-off-by: Adrian Bonislawski <adrian.bonislawski@intel.com>
5f0c4e4c31 pipeline: make CPC data "opt-in" with fallback
Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
2024-04-15 13:48:33 +01:00
Adrian Bonislawski 6a71338c19 platform: init kcps budged before any kcps adjustments
KCPS budged should be initialized before any KCPS adjustments

Signed-off-by: Adrian Bonislawski <adrian.bonislawski@intel.com>
2024-04-15 13:48:33 +01:00
Adrian Bonislawski 824a7820f3 clk: remove unnecessary freq change notifications
Such notification currently is used only in non-zephyr code (ll sched)
so it is safe to remove for MTL because of some idc issues

Signed-off-by: Adrian Bonislawski <adrian.bonislawski@intel.com>
2024-04-15 13:48:33 +01:00
Tobiasz Dryjanski 28100904bb base_fw: Add perf measurement state set ipc
Adds performance measurement state ipc to change the state of
performance measurement.

Signed-off-by: Tobiasz Dryjanski <tobiaszx.dryjanski@intel.com>
2024-04-12 19:21:42 +03:00
Tobiasz Dryjanski e88eab88b7 telemetry: Enable Telemetry
Add config for enabling telemetry and enable it

Signed-off-by: Tobiasz Dryjanski <tobiaszx.dryjanski@intel.com>
2024-04-12 19:21:42 +03:00
Tobiasz Dryjanski 0419b7c5e9 telemetry: Add systick_info part of telemetry
Introduces telemetry structure into debug memory window. Adds
systick_info which counts execution time of LL tasks. DP tasks are not
supported yet.

Signed-off-by: Tobiasz Dryjanski <tobiaszx.dryjanski@intel.com>
2024-04-12 19:21:42 +03:00
Tobiasz Dryjanski 79751cfc27 memory_window: Increase Debug Window size
Increase Debug Window (Memory window 2) size by one slot (4096 bytes).
The reason for this change is making space for telemetry functionality.

Signed-off-by: Tobiasz Dryjanski <tobiaszx.dryjanski@intel.com>
2024-04-12 19:21:42 +03:00
Tobiasz Dryjanski de66f38b1c base_fw: add scheduler_info_get ipc
Add ipc to retrieve info about schedulers.

Signed-off-by: Tobiasz Dryjanski <tobiaszx.dryjanski@intel.com>
2024-04-12 19:21:42 +03:00
Tobiasz Dryjanski 6afbebd259 ipc4: Add Vendor Config Get
Add Vendor Config Get, a special case of Large Config Get. Large Config Get
handling now checks for this case and extracts extended param_id from ipc
payload as param_id and handles the rest of the payload as usual. Base_fw
now uses extended param_id.

Signed-off-by: Tobiasz Dryjanski <tobiaszx.dryjanski@intel.com>
2024-04-12 19:21:42 +03:00
barry.jan 355e46f051 waves: verify payload size and initialize memory to zero to the
allocated memory in waves.c

    Enhance payload corruption handling by verifying size
    and make sure to have clean buffer before using it.

Signed-off-by: barry.jan <barry.jan@waves.com>
2024-04-12 16:42:08 +01:00
Adrian Warecki 4ff19b82d5 lib_manager: Rename lib_manager_get_library_module_desc function
The lib_manager_get_library_module_desc function was renamed to
lib_manager_get_library_manifest, which better describes what it do.

Signed-off-by: Adrian Warecki <adrian.warecki@intel.com>
2024-04-12 16:55:49 +03:00
Adrian Warecki e7a71b9f9a lib_manager: Add lib_manager_get_module_manifest function
Added the lib_manager_get_module_manifest function that returns manifest
of selected module based on its id. It was performed in many places and
moving it into function simplified the code and increased its readability.

Signed-off-by: Adrian Warecki <adrian.warecki@intel.com>
2024-04-12 16:55:49 +03:00
Adrian Warecki eba6e2a437 ipc4/helper: ipc4_get_comp_drv: Change parameter type to uint32_t
All calls to the ipc4_get_comp_drv function pass the uint32_t value as a
parameter, so the type of functions parameter was changed.

Signed-off-by: Adrian Warecki <adrian.warecki@intel.com>
2024-04-12 16:55:49 +03:00
Guennadi Liakhovetski fc49de7e7d west: update to a newer Zephyr version
Update to a Zephyr version, containing
2ccf775396c2 ("llext: add support for relocatable objects on Xtensa")

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2024-04-11 11:25:06 +01:00
Seppo Ingalsuo b6aa921e02 Audio: Volume: No update of process function for every ramp value
The volume process function for pass-through can be changed
when all ramps are completed. This change that avoids processing
function lookup in worst case every 128 us is measured to
save in TGL platform about 1 MCPS from CPU_PEAK(MAX).

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2024-04-11 11:55:25 +03:00
Seppo Ingalsuo bc506f12c8 Audio: Volume: Jump volume directly to target when no ramp
This ensures that volume for a channel changes immediately
after receiving the control if ramp duration is zero or if
type is no fade.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2024-04-11 11:55:25 +03:00
Seppo Ingalsuo e23a663d13 Audio: Volume: Fix condition for identical ramp
The "is_same_volume=true" was returned if target volumes for
all channels are the same. The check omitted the fact that
start volumes for ramp can be different, e.g. one channel is
attenuated while others are 0 dB.

This change fixes the random ignore of volume ramp and smooth
transition when a volume control is changed.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2024-04-11 11:55:25 +03:00
Seppo Ingalsuo eb463a5f2a Audio: Volume: Add linear ramp coefficient function with fixes
The linear slope coefficient calculation is moved to a separate
function. Two functional changes are done.

- The ramp_coef for channel is set to zero if there is no
  transition for the channel. The ensure of non-zero coefficient
  is only needed if there is a transition that is so slow that
  the slope coefficient would round to zero. If this function is
  called for equal volume and tvolume for channel, the ramp_coef
  remains zero, and not smallest non-zero value.
- The handling of ramp disable with zero initial_ramp is changed
  to similar as for windows fade. The set of coefficient to
  volume delta (a large value for large volume jump) is not correct
  even if it appeared to work. It is a remain from old code where
  ramp was not a function of time but a constant step added.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2024-04-11 11:55:25 +03:00
Seppo Ingalsuo 51c686f953 Audio: Volume: Fix ongoing gain ramp stop and wrong final gain
In IPC4 the individual channel gains are passed in separate
messages. One channel may have started to ramp to a new gain
while a new channel gain arrives for other channel. If the
gain is same as the previous control value, the ongoing ramp
is stopped and the gain remains at a transition value.

The incorrect code is not fixed but instead the volume_set_volume()
function is simplified. When a volume control is received, it is
assumed that pass-through mode is disabled and ramp is prepared. If
the control is received but gains are not changed, the ramp mode
is finished and pass-through is restored in ramp function.

The volume_set_switch() function is updated similarly to ensure
similar operation.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2024-04-11 11:55:25 +03:00
Marc Herbert 2cfc85eda0 Use new '-DREM=#' prefix to preserve comments in pre-processed .toml
Having to find source files to read comments is not convenient.

This depends on https://github.com/zephyrproject-rtos/zephyr/pull/67019
which was merged a while ago.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2024-04-10 09:37:43 +03:00
Tomasz Leman a43981e472 init: zephyr: Fix memory leak during secondary core init
This patch refines the initialization process for secondary cores in a
multicore environment when using Zephyr as the RTOS. The patch
introduces a `check_restore` function specifically for Zephyr, which
checks if basic core structures (IDC, notifier, schedulers) have been
previously allocated and are still present in memory, indicating that
the system is not undergoing a cold boot.

By adding this check, the system avoids unnecessary re-allocation of
these structures during the power-up sequence of secondary cores,
effectively preventing the memory leak observed during repeated power
cycle tests.

fix #9005

Signed-off-by: Tomasz Leman <tomasz.m.leman@intel.com>
2024-04-09 17:04:46 +01:00
Tomasz Leman c159c1fa35 init: Refactor check_restore to return bool
This patch refactors the `check_restore` function to return a `bool`
instead of an `int`. This change enhances code readability and clarifies
the intent of the function, which is to return a true or false value
based on the presence of core structures in memory.

No functional changes are introduced by this patch; it is purely a code
quality improvement.

Signed-off-by: Tomasz Leman <tomasz.m.leman@intel.com>
2024-04-09 17:04:46 +01:00
Laurentiu Mihalcea 00ab55462c west.yml: update Zephyr to fd1a129a3e63
Contains the following patches affecting SOF:

bba8641354bf dts: xtensa: nxp_imx8: add ESAI0 node
bd9b3c67b240 drivers: dai: add driver for NXP's ESAI
f4c73105e55a drivers: dai: sai: add pinctrl support

Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
2024-04-09 18:41:30 +03:00
Marcin Szkudlinski 0542687ad9 debug: add an overlay enabling Zephyr's kernel tracing
This commit adds an overlay enabling kernel traces from
Zephyr.
Those traces may be read on the host side from memory window

Signed-off-by: Marcin Szkudlinski <marcin.szkudlinski@intel.com>
2024-04-09 13:14:28 +03:00
Bard Liao 2e71793421 Topology2: sof-tgl-rt712: remove SDWx from stream name
The widget name size will exceed the character limit and lead to below
error

failed to find module info for widget
alh-copier.SDW0-Playback-SimpleJack.0 with UUID
00000000-0000-0000-0000-000000000000

Shorten the stream name to fix it.

Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
2024-04-09 13:13:51 +03:00
Kai Vehmanen 07b762e0ae topology2: pipeline: add constraints on pipeline.priority attribute
Add constraints on valid pipeline priority values and document
the semantics so that 0 is considered the highest priority and such
pipeline should be run first.

The range matches definitions in include/ipc4/pipeline.h and
SOF_IPC4_MAX_PIPELINE_PRIORITY.

Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
2024-04-05 21:13:37 +03:00
Marc Herbert 929b194b1c .github/zephyr: upgrade obsolete actions/setup-python@v4 to v5
Fixes the following warning:
https://github.com/thesofproject/sof/actions/runs/8289483047

```
Node.js 16 actions are deprecated. Please update the following actions
to use Node.js 20: actions/setup-python@v4. For more information see:
https://github.blog/changelog/2023-09-22-github-actions-transitioning-from-node-16-to-node-20/.
```

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2024-04-05 13:02:49 -05:00
Ievgen Ganakov 2126e2896e dai: use ibs/obs for dma buffer size calculation
Use ibs/obs size from ipc4_base_module_cfg to properly calculate
period_count. It is especially important when FW aggregation mode
is enabled and there are multiple DMAs allocated under one copier
instance. That way period count for every DMA will be correctly
evaluated and used for DMA buffer size calculation.

Signed-off-by: Ievgen Ganakov <ievgen.ganakov@intel.com>
2024-04-05 19:23:30 +03:00
Pierre-Louis Bossart 1e9a497316 topology2: add support for MTL HP Omen14
This device has RT711 on link0, RT1316 on link3 and 2 PCH-attached DMICs.

Add 3 configurations with no DMIC, 4 DMIC and 2 DMIC. For now no
support for -pdm1.

Link: https://github.com/thesofproject/linux/issues/4880
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
2024-04-05 13:54:03 +03:00
Seppo Ingalsuo 6980cdd7b4 Tools: Tune: Eq: Fix IIR data files names in example_spk_eq.m
The IIR files export overwrites the FIR files due to mistake
in the script.

Fixes commit 5ddbd34ba9 ("Tools: Tune: EQ: Add tplg2 blobs create")

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2024-04-04 18:58:02 +03:00
Tomasz Leman 732f07c296 ipc4: Ensure pipeline component directions are synchronized
This patch addresses an issue where audio output could be silent due to
the direction property of pipeline components not being set. The problem
manifests when the pipeline is initialized in the sequence:

Init -> Reset -> Pause -> Ready

In this scenario, the direction property may remain unset, leading to
incorrect pipeline behavior.

In flow of transitions: Init -> Pause -> Ready, this issue does not occur
because the firmware attempts to set the directions in pipe components
during the transition from Init to Pause. This step is skipped if Pause
is done after Reset, which is the scenario that this patch addresses.

The added code ensures that if the source component's direction is unset
but the sink's direction is set, or vice versa, the direction is copied
from the set component to the unset one. This synchronization of the
direction property guarantees that the pipeline's data flow is correctly
established.

This synchronization of the direction property guarantees that the
pipeline's data flow is correctly established, allowing the
`pipeline_for_each_comp` function to traverse and process all components
as intended, thus resolving the silent audio output problem.

Signed-off-by: Tomasz Leman <tomasz.m.leman@intel.com>
2024-04-04 13:38:23 +03:00
Guennadi Liakhovetski f77bdfbf74 math: avoid re-initialising variables every loop iteration
In psy_get_mel_filterbank() if fb->slaney_normalize isn't set, 3
variables are reset to the same values needless every loop iteration.
Move initialisations outside the loop instead.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2024-04-03 15:32:23 +03:00
Adrian Warecki 1ce9e4536c modules: Remove unused module_entry_point from module_data
The value assigned to the module_entry_point field in the module_data
structure wasn't used anywhere. This field has been removed.

Signed-off-by: Adrian Warecki <adrian.warecki@intel.com>
2024-04-03 15:31:42 +03:00
Adrian Warecki 49bd8def85 module_adapter: modules: Remove unused sys_service pointer
The unused sys_service field has been removed from the processing_module
structure. It was never initialized anywhere, and its value was passed as
a parameter to the native_system_agent_start function which did not use it.

Signed-off-by: Adrian Warecki <adrian.warecki@intel.com>
2024-04-03 15:31:42 +03:00
Adrian Warecki 31207e50f2 module/base: modules: Remove module_adapter from module_data
The value stored by the Processing Module Adapter in the module_adapter
field of module_data structure has been moved to an unused private field.
This change allowed the module_adapter field to be removed.

Signed-off-by: Adrian Warecki <adrian.warecki@intel.com>
2024-04-03 15:31:42 +03:00
Adrian Warecki 99f06ca681 modules: Remove unused buffers
The code allocating/freeing in_buff and out_buff buffers, which were not
used, was removed from the processing module adapter.

Signed-off-by: Adrian Warecki <adrian.warecki@intel.com>
2024-04-03 15:31:42 +03:00
Adrian Warecki dc19c871c7 modules: Remove unnecessary functions from Processing Module Adapter
To ensure proper operation of native loadable modules it is necessary to
bypass Processing Module Adapter used by IADK modules. This is currently
done by overriding the pointer to module_interface used by the Module
Adapter. Thanks to this, the Module Adapter directly calls functions
provided by native module. As in this case the Processing Module Adapter
functions are omitted, support for native libraries are removed from it as
it is no longer needed. This leads to remove modules_process_raw and
modules_process_audio_stream functions.

Signed-off-by: Adrian Warecki <adrian.warecki@intel.com>
2024-04-03 15:31:42 +03:00
Peter Ujfalusi baca261531 audio: dai-zephyr: Do not reset the DMA buffer cursor for HD-DMA on TRIGGER_RELEASE
During DMA stop/config/start the read/write pointer of HD-DMA is not
reset unlike other DMAs (GPDMA, DMAC).

Only call the audio_stream_reset() if the link is not serviced by HD-DMA.

Link: https://github.com/thesofproject/sof/issues/8986
Fixes: 9831a9ded7 ("audio: dai-zephyr: reset DMA buffer cursors on TRIGGER_RELEASE")
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
2024-04-03 15:26:44 +03:00
Marc Herbert 9d7c33adc3 xtensa-build-zephyr.py: make --deployable-build the default
Every Linux developer should use deployable builds by default.

Until Peter Ujfalusi's very recent work in this script, we had a
complete `/lib/firmware/` structure disconnect between the IPC4 output
of this script and the IPC4 expectations of the Linux kernel. To
workaround this disconnect, every CI and Linux developer used to
implement duplicate and inconsistent firmware deployment hacks.

People crafting sof-bin releases also had to organize IPC4 releases
manually, which was extremely error-prone and with limited test
coverage (Thanks Kai and Mengdong!)

Now that Peter gracefully fixed the layout, documented it in sof-docs
and implemented it in this script, the time for all Linux developers to
drop their inconsistent deployment hacks is overdue. All these hacks
must be replaced with a simple, one-line recursive copy which makes sure
the layout committed in version control is constantly tested by
everyone.

So, make deployable builds the new default.

The new default will also help with sof-bin releases, making sure they
use a well tested /lib/firmware/ layout.

The --no-deployable-build was recently introduced to help minimize
disruption and migration effort for people and automation who do NOT use
Linux. The `/lib/firmware/` directory structure is irrelevant outside
Linux (but everyone is of course free to choose it)

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2024-04-02 20:00:13 +03:00
Grzegorz Bernat 78831db0f9 app: boards: Enable Probe for LNL
Enables extraction and injection probes for LNL platform.
NOTE: this commit does NOT enable probe log backend.

Signed-off-by: Grzegorz Bernat <grzegorzx.bernat@intel.com>
2024-04-02 14:16:52 +03:00
Laurentiu Mihalcea f0740ed103 west.yml: update Zephyr to 1f55be8b42df
Contains the following squashed SOF commits:

nxp: imx8ulp: change SOC name to MIMX8UD7
zephyr: CMakeLists.txt use new `CONFIG_SOC_C` for 8ULP
cmake: update configs for NXP ADSP

and the following Zephyr patches affecting SOF:

951763939034 nxp: imx8ulp: change SOC name to MIMX8UD7
b8214b673970 dts: xtensa: nxp_imx8: add SAI1 node
a0e32f07ef76 dts: intel_adsp: ace: update host dma copy alignment
3fde2c50c6ef tracing: add intel ADSP memory window backend
6b9d01f995c7 intel_adsp/ace: power: No pending transaction before power gate
6ea749de5283 arch: rename arch_start_cpu() to arch_cpu_start()
b69d2486fee6 kernel: rename Z_KERNEL_STACK_BUFFER to K_KERNEL_STACK_BUFFER
1f55be8b42df nxp: imx8: change CONFIG_SOC_<name> to match the value
688fbb53aeb2 intel_adsp: ace: Fix sparse error

Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
Signed-off-by: Iuliana Prodan <iuliana.prodan@nxp.com>
2024-04-02 13:13:07 +03:00
Peter Ujfalusi 41bdc0c152 copier: Use correct multiplier for latency to bytes calculation
The latency value is in number of periods (1ms) while the buffer allocated
for the DAI copier is at least 2 periods.
This can shoot up the calculated  stream_start_offset resulting invalid
delay reporting.
Use the period size of the DAI copier to correct this error.

The kernel reported delay currently (on normal non DeepBuffer PCM):
at start: ~302 frames
after 20x pause/resume: ~6530 frames

With this patch:
at start: ~254 frames
after 20x pause/resume: ~3600 frames

The drift rate is about the same with DeepBuffer.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
2024-03-26 17:59:28 +02:00
Laurentiu Mihalcea aaf2f11eb9 nxp: imx93: Switch to native Zephyr drivers and timer domain
Starting with this commit, i.MX93 now uses the timer domain
in conjunction with the Zephyr native drivers.

Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
2024-03-25 15:12:00 +02:00
Laurentiu Mihalcea 0441484940 boards: mimx93_evk_a55: Enable SAI, EDMA and HOST DMA drivers
This commit introduces the necessary changes to the overlay
and configuration files required for enabling the Zephyr native
SAI, EDMA and HOST DMA drivers on i.MX93.

Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
2024-03-25 15:12:00 +02:00