Commit Graph

10292 Commits

Author SHA1 Message Date
Ranjani Sridharan ab9449fa08 topology2: tokens: Reduce the string length of token names
In preparation for changing the name of the DAI copier which will make
them a bit longer, reduce the token name lengths by removing the
sof_tkn_ prefix. This is required because the header names in topology
have a 44 character limit and with a long name like:
dai-copier.SSP.NoCodec-0.playback.sof_tkn_comp.uuid, the limit will be
hit. Removing the sof_tkn_ prefix will reduce the number of characters
in the tuple name headers.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2023-05-29 09:56:13 +03:00
Ranjani Sridharan 1b9cb679bb topology2: components: Make uuid common for all widgets
Move the uuid attribute definition to widget-common.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2023-05-29 09:56:13 +03:00
Ranjani Sridharan 96bd6bc62d topology2: copier: Rename it to dai-copier
To make it explicit that it is only for the DAI gateway.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2023-05-29 09:56:13 +03:00
Jyri Sarha a6984b8503 topology2: dmic-generic.conf: Rename generic DMIC volume
Rename generic DMIC mixer name. Define the associated PCM name in a
common place and refer to that name on the mixer name.

On cavs-tgl-nocodec.tplg is seen a following mixer name change:

'gain.13.1 DMIC0 Capture Volume 1' > 'gain.13.1 DMIC Capture Volume'

Signed-off-by: Jyri Sarha <jyri.sarha@linux.intel.com>
2023-05-26 11:08:26 +03:00
Jyri Sarha b918e1f316 topology2: nocodec-ssp0-2level.conf: Rename Port0 Aux Volume
Rename SSP0 Aux Playback stream volume before mixing. Use the
associated PCM name in the mixer name. This change affects nocodec
topologies and appears on sof-tgl-nocodec.tplg as a following change:

'gain.21.1 Playback Volume 8' -> 'gain.21.1 Pre Mixer Port0 Aux Playback Volu'

Unfortunately the new mixer name does fit into the space reserved for
it, but it should get fixed once we get rid of the "gain 21.1"-prefix.

Signed-off-by: Jyri Sarha <jyri.sarha@linux.intel.com>
2023-05-26 11:08:26 +03:00
Jyri Sarha bdff11cc7a topology2: cavs-nocodec.conf: Rename DMIC0 post mux volumes
Rename cavs-nocodec.conf DMIC0 volumes. Define variables for the
associated PCM names and refer to them in the mixer names. The changes
shown in sof-tgl-nocodec.tplg are:

'gain.18.1 Capture Raw Volume 1' > 'gain.18.1 Post Demux DMIC0 Raw Capture Volu'
'gain.19.1 Main Capture Volume 3' > 'gain.19.1 Pre Demux DMIC0 Raw Capture Volum'
'gain.20.1 Capture Raw Volume 2' > 'gain.20.1 Post Demux DMIC0 Raw 2 Capture Vo'

Signed-off-by: Jyri Sarha <jyri.sarha@linux.intel.com>
2023-05-26 11:08:26 +03:00
Jyri Sarha 0f7f4e96b8 topology2: cavs-nocodec.conf: Rename SSP0 Capture Volumes
Rename SSP0 capture related volumes. Define a variable for PCM name
and refer to it in the mixer names.

Using sof-tgl-nocodec.tplg the changes are:

'gain.8.1 Host Capture Volume' > 'gain.8.1 Pre Demux Port0 Capture Volume'
'gain.7.1 Main Capture Volume 1' > 'gain.7.1 Post Demux Port0 Capture Volume'
'gain.17.1 Main Capture Volume 2' > 'gain.17.1 Post Demux ssp-capture Capture Vo'

Signed-off-by: Jyri Sarha <jyri.sarha@linux.intel.com>
2023-05-26 11:08:26 +03:00
Jyri Sarha 76310a0a0e topology2: cavs-nocodec.conf: Rename SSP0, SSP1, and SSP2 playback volumes
Rename SSP0, SSP1, and SSP2 playback volumes according to PCM names
they are connected to. Define the PCM names as variables so the name
can be changed in a single place.

This is how the change will look like in sof-tgl-nocodec.tplg:

'gain.1.1 Playback Volume 1' > 'gain.1.1 Pre Mixer Port0 Playback Volume'
'gain.2.1 Main Playback Volume 2' > 'gain.2.1 Post Mixer Port0 Playback Volume'
'gain.3.1 Playback Volume 3' > 'gain.3.1 Pre Mixer Port1 Playback Volume'
'gain.5.1 Playback Volume 5' > 'gain.5.1 Pre Mixer Port2 Playback Volume'
'gain.6.1 Main Playback Volume 6' > 'gain.6.1 Post Mixer Port2 Playback Volume'

Signed-off-by: Jyri Sarha <jyri.sarha@linux.intel.com>
2023-05-26 11:08:26 +03:00
Pierre-Louis Bossart 3d54d14f3f topology1: add Dell SKU 0BDA support
Yet another missing topology

This needs to be back-ported to the 2.2 stable branch for releases

Closes: https://github.com/thesofproject/linux/issues/4380
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
2023-05-26 10:49:33 +03:00
Marc Herbert a769d3941d xtensa-build-zephyr.py: stop calling west sign, rely on west build
Stop invoking west sign manually. Configure rimage using `west config`
and a platform-specific WEST_CONFIG_LOCAL file instead, then rely on
west build to invoke rimage.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2023-05-26 10:47:51 +03:00
Marc Herbert 5a82b0ab53 xtensa-build-zephyr.py: add new rimage_west_configuration()
Do not make the switch yet. Make the switch in a smaller commit that can
more easily be reverted in case of a bug or some missed dependency
somewhere.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2023-05-26 10:47:51 +03:00
Baofeng Tian 62f26d34d9 copier-host: rename host function name
Due to both legacy and zephyr function are changed, name with
zephyr prefix is not suitable, change zephyr to common to better
reflect the function status.

Signed-off-by: Baofeng Tian <baofeng.tian@intel.com>
2023-05-25 17:12:52 -07:00
Baofeng Tian e283718d1d copier-host: move out host parameter related code from copier
Host parameter related function move out from copier to copier
host.

Signed-off-by: Baofeng Tian <baofeng.tian@intel.com>
2023-05-25 17:12:52 -07:00
Baofeng Tian 78935820e1 copier-host: move copier_host_create/free to copier_host module
Move those host specific code into copier host file.

Signed-off-by: Baofeng Tian <baofeng.tian@intel.com>
2023-05-25 17:12:52 -07:00
Baofeng Tian 6024a26c90 copier-host: add new file copier_host.c to copier folder
This new file is used to maintain host related code that used
by copier.

Signed-off-by: Baofeng Tian <baofeng.tian@intel.com>
2023-05-25 17:12:52 -07:00
Andy Ross 77dad39cc4 github/workflows: Remove old fuzzing check
This has bitrotten vs. the newer code upstream at oss-fuzz, involves
an expensive docker container build, and provides little value vs. the
newer fuzz.sh script that runs in the regular CI containers.

Let oss-fuzz handle the deep validation.  We should be using fuzzing
as a smoke test via the existing scripts.

Signed-off-by: Andy Ross <andyross@google.com>
2023-05-25 13:30:28 -07:00
Seppo Ingalsuo 6a08cf22df Audio: Volume: Change volume internal gain to Q8.23 from Q1.23
This patch changes for IPC4 configuration the DSP internal gain
format from Q1.23 to Q8.23. Minimum needed would be Q2.23 but
the integer part 8 bits is same as in IPC3 and would allow
signal amplification in volume component in some later phase. The
code is prepared for amplification due to IPC3.

The change allows the Q1.31 max gain (0x7fffffff) to round to
exactly one in Q8.23 notation (0x800000). The gain value one passes
effectively the input to output unmodified. The change prevents lose
about 1 dB of signal-to-noise ratio from peak quality of PCM formats.

The comment from convert_volume_ipc4_to_ipc3() is removed because it
is unrelated and some remain from old code version.

The hard coded 23 for conversion to/from Qx.23 is changed to
macro VOL_QXY_Y because it's used elsewhere in the component. The
saturation (to 32 bit signed) with 64 bit intermediate is kept in
the function convert_volume_ipc4_to_ipc3() in case of VOL_QXY_Y
would be 31. The code requires int32_t or ae_f32 compatible signed
32 bit compatible gain value instead of full uint32_t range.

The gain range for Q8.23 format is min. -138.47 dB and max. +42.14 dB.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2023-05-25 14:47:56 +03:00
Tomasz Leman 9b4a618c52 pm: policy: d0i3: wait for ipc ack before pg
The DSP cannot enter the power gating state if it has not yet received
an ack from host after sending an ipc message.

Signed-off-by: Tomasz Leman <tomasz.m.leman@intel.com>
2023-05-25 14:45:42 +03:00
Tomasz Leman 478cea5b3d west.yml: upgrade zephyr to 7d54586751
Zepych update: total of 228 commits.

Changes include:

- build LNL with Zephyr SDK,
- MMU initial implementation,
- check for pending ack in intel_adsp_ipc_is_complete.

Signed-off-by: Tomasz Leman <tomasz.m.leman@intel.com>
2023-05-25 14:45:42 +03:00
Guennadi Liakhovetski e7c404fec8 xtensa: xtos: remove bootloader support
The bootloader was only used by Intel platforms when building SOF
with XTOS. Now that that possibility has been removed, bootloader
support can be removed too to eliminate dead code.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2023-05-25 14:43:55 +03:00
Seppo Ingalsuo e4342324c0 Tools: Test: Audio: Add test for level dependent gain
This patch adds to process_test.m test with amplitude sweep
to determine level dependent logarithmic gain.

Currently there is no test pass/fail criteria. But the test result
plot can be examined from directory plots. E.g. first full test
for DRC with "process_test('drc', 32, 32, 48000, 1);".

The view the plots from shell with "eog plots/ldlg_drc_*.png". Or
examine the plots directory with a file maneger GUI.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2023-05-25 14:42:24 +03:00
Marc Herbert 1cc4a1f31e .github: add LNL compilation
Because now we can.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2023-05-25 14:28:26 +03:00
Marc Herbert 892c2d94a7 ipc4/dai.c: ACE2: remove unused local variable `sof_cfg`
Fixes commit 22ad526c26 ("LNL: Add hda_dma_config for interfaces")

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2023-05-25 14:28:26 +03:00
Laurentiu Mihalcea ff0fc14c11 zephyr: include: rtos: cache.h: Remove unused macros
This commit removes CACHE_INVALIDATE and CACHE_WRITEBACK_INV
macros which are not used.

Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
2023-05-25 14:26:17 +03:00
Laurentiu Mihalcea 58b96d1c7f zephyr: include: rtos: Switch to using Zephyr cache management API
Thanks to PR [1], Zephyr cache management API can now be
used on xtensa-based SoCs. As a consequence to this, there's
no longer a need to use SOF's arch/ layer for cache management.
This commit forces all SoCs which support Zephyr to use
its native cache management API.

[1]: https://github.com/zephyrproject-rtos/zephyr/pull/50136

Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
2023-05-25 14:26:17 +03:00
Bard Liao 601d2bc41e topology2: sdw-amp-generic: set virtual widget type output
Widget type snd_soc_dapm_out_drv and snd_soc_dapm_output will be treat
as virtual widget and be ignored in sof topology in kernel.
We need to set type = output or out_drv in topology when it is a virtual
widget.

Fixes: 3835846836 ("topology2: sdw-amp-generic: Show all aggregated DAIs on the graph")
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
2023-05-25 13:39:23 +03:00
Andrula Song f796e0a580 Audio: EQ-FIR: Optimize the eq_fir_2x_sx functions
Optimize the eq_fir_2x_sx functions by remove the duplicated usage
of circular buffer.

Signed-off-by: Andrula Song <andrula.song@intel.com>
2023-05-25 13:37:22 +03:00
Kai Vehmanen aeda64b61c dai-zephyr: handle dynamic disconnect of one sink
In IPC4 mode, the DAI supports writing data to multiple sinks.
It is possible one of the sinks to be on a different pipeline,
which can be disconnected while the DAI is still running.

Depending on the order of pipeline setup, the disconnected sink
might have been chosen as the local_buffer.

Handle this case by reconfiguring the local buffer after
disconnect in the copy function.

Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
2023-05-25 11:12:51 +03:00
Kai Vehmanen e2f66c65ab dai-zephyr: fix use-after-free in dai copy
The dd->local_buffer may be freed between calls to copy if
the peer module is unbound. This can only happen if the peer
module is on a different pipeline as runtime changes to
pipeline connections are not allowed while pipeline is active.
It is however allowed to connect the DAI to sink/sources
on another pipeline, so this scenario is still possible. This
issue only affects IPC4 builds using copier.

In current code, disconnection of local_buffer will lead
to heap corruption as dd->local_buffer is freed but DAI keeps
accessing the buffer in its copy calls.

Fix the issue by implementing an explicit DAI unbind and
setting dd->local_buffer to NULL in case the peer module is
disconnected.

This patch does not add support for dynamic reconfiguration
of the DAI to adjust converters and local_buffer to the new
connections. If capture DAI is set up with multiple sinks and
one of them is stopped, the DAI will stop processing data.

Link: https://github.com/thesofproject/sof/issues/7191
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
2023-05-25 11:12:51 +03:00
Kai Vehmanen 16ee5b8427 audio: component: fix frame size calculation with large period sizes
If the product of sampling rate and period size (in microseconds)
exceeds INT_MAX (signed 32bit), an invalid component->frame is
set. This happens for example with sampling rate of 48000Hz and
period size of 50000usec.

While the 'rate' and 'period' fields are uint32_t values, ceil_divide()
in math/numbers.h does calculation with signed 32bit values, leading to
invalid results with smaller input values.

Fix the issue by doing the frame size calculation with 64bit
arithmetic.

Link: https://github.com/thesofproject/sof/issues/7652
Reported-by: Vamshi Krishna Gopal <vamshi.krishna.gopal@intel.com>
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
2023-05-25 11:07:00 +03:00
Jaroslaw Stelter 22ad526c26 LNL: Add hda_dma_config for interfaces
In LNL the GPDMA engine was removed. Instead HD Audio
Link DMA is used to transport data over audio interfaces.
Since HD Audio is a Host managed engine, the link configuration
is passed through IPCv4.
The configuration must be forwarded to appropriate interface driver
to configure HW.

Signed-off-by: Jaroslaw Stelter <Jaroslaw.Stelter@intel.com>
2023-05-24 18:52:53 +03:00
Jaroslaw Stelter 2df3cba533 LNL: Add new platform to RI_INFO_FIXME
The LNL platform added to RI_INFO_FIXME
list in build script.

Signed-off-by: Jaroslaw Stelter <Jaroslaw.Stelter@intel.com>
2023-05-24 18:52:53 +03:00
Jaroslaw Stelter 02635875fb lnl: Lunarlake configuration
Add initial LNL configuration.
Enable building for xt-clang.

Signed-off-by: Jaroslaw Stelter <Jaroslaw.Stelter@intel.com>
2023-05-24 18:52:53 +03:00
Marc Herbert 2ac64cf16b xtensa-build-zephyr.py: change rimage_options() to return tuples
Zero functional change. This will allow excluding some options.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2023-05-24 18:36:39 +03:00
Marc Herbert fdc05c718f xtensa-build-zephyr.py: extract new function rimage_options()
Unlike rimage_configuration(), rimage_options() will be kept free of
side-effect.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2023-05-24 18:36:39 +03:00
Marc Herbert 3ac849eac5 xtensa-build-zephyr.py: stop passing `--tool-data rimage/config/`
We used to use `-- -c rimage/config/platf.toml` for the IPC4 overlay and
the older `--tool-data rimage/config/` for the rest. This was confusing,
inconsistent and used to print this warning:

```
WARNING: --tool-data /var/home/mherber2/SOF/sof/rimage/config ignored,
         overridden by: -- -c ...
```

`--tool-data` was always a bad idea. It looks generic but it's not; it
allows changing only a config directory that is always in the same
location.

Copy what `west sign` does with `--tool-data`, drop it and use `-- -c`
always.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2023-05-24 18:36:39 +03:00
Marc Herbert 9bbbac778a xtensa-build-zephyr.py: call rimage_configuration() before building
This makes no difference now because it has no side-effect yet but it
will make a difference once it starts using `west config`.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2023-05-24 18:36:39 +03:00
Marc Herbert 51fddc64a3 xtensa-build-zephyr.py: extract new function rimage_configuration()
Zero functional change, pure clean-up.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2023-05-24 18:36:39 +03:00
Marc Herbert 463e8bd152 xtensa-build-zephyr.py: add a new line after logging the environment
In some cases it was difficult to separate the command's output from the
extra environment it ran in.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2023-05-24 18:36:39 +03:00
Marc Herbert 494d174b6e xtensa-build-zephyr.py: parse new versions.json instead of generated .h
For rimage parameters, parse new, static versions.json file instead of
generated sof_versions.h file. This will make possible to configure
rimage before west build.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2023-05-24 18:36:39 +03:00
Ievgen Ganakov ead25e82a2 kd: add ams support
Add support for AMS notifications

Signed-off-by: Ievgen Ganakov <ievgen.ganakov@intel.com>
2023-05-24 15:47:07 +03:00
Ievgen Ganakov 5aae7e12e2 kpb: add ams support
Add AMS notifications support to KPB module

Signed-off-by: Ievgen Ganakov <ievgen.ganakov@intel.com>
2023-05-24 15:47:07 +03:00
Ievgen Ganakov 7ae382ddbb ams: add helper functions
Every module which needs AMS for notifications uses the same flow when
configuring itself as a consumer or producer for such notifications.

Add AMS helper functions to avoid code repetition.

Signed-off-by: Ievgen Ganakov <ievgen.ganakov@intel.com>
2023-05-24 15:47:07 +03:00
Ievgen Ganakov 508881687f kconfig: limit AMS to IPC4
Add IPC4 dependency for AMS

Signed-off-by: Ievgen Ganakov <ievgen.ganakov@intel.com>
2023-05-24 15:47:07 +03:00
Ievgen Ganakov a5a0255a64 ams: add kpd message
Add "Key Phrase Detected" message uuid

Signed-off-by: Ievgen Ganakov <ievgen.ganakov@intel.com>
2023-05-24 15:47:07 +03:00
Laurentiu Mihalcea d735c91d9a west.yml: Update Zephyr revision
Update Zephyr revision to contain CONFIG_DCACHE_LINE_SIZE
additions.

Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
2023-05-24 15:24:07 +03:00
Andy Ross e4aee1afe7 Revert "tools: Remove older fuzz framework"
This got merged too fast.  Turns out it broke the newer fuzz
integration that was in the same YAML file.  Also there are some
evolving review comments.  Will resubmit.

This reverts commit 11e57f5030.

Signed-off-by: Andy Ross <andyross@google.com>
2023-05-23 12:27:28 -07:00
Andy Ross 11e57f5030 tools: Remove older fuzz framework
Fuzzing via the new framework is now integrated at oss-fuzz upstream,
so there's no point to keep this in SOF anymore.  The github workflow
has bitrot vs. the newer build.sh, and that docker build is very
heavyweight vs. the newer fuzz.sh smoke test that runs in the regular
build container anyway.

Signed-off-by: Andy Ross <andyross@google.com>
2023-05-23 10:03:02 -07:00
Kai Vehmanen 9ea2f05ac7 ipc4 : send panic on Zephyr OS panic
Send panic notification message to host when panic happens. The panic
detail is built by Zephyr framework and included in debug memory window.

Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Signed-off-by: Rander Wang <rander.wang@intel.com>
Co-developed-by: Rander Wang <rander.wang@intel.com>
2023-05-23 13:29:33 +03:00
Kai Vehmanen a55fbfabd9 ipc: add ipc_msg_send_direct support
For emergency like FW panic event, we need to send notification IPC
message to host directly without inserting this message in msg_list
since at this time the system is not stable now and it is very possible
that the normal message processing logic can't work.

Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Signed-off-by: Rander Wang <rander.wang@intel.com>
Co-developed-by: Rander Wang <rander.wang@intel.com>
2023-05-23 13:29:33 +03:00