Commit Graph

9913 Commits

Author SHA1 Message Date
Iuliana Prodan aeaa96e0b4 topology: imx: Add EQ topology file for i.MX8MP and i.MX8 with wm8962 codec
Generate EQ (fir and iir) topology file for i.MX8MP and i.MX8
with wm8962 codec.

Signed-off-by: Iuliana Prodan <iuliana.prodan@nxp.com>
2023-05-04 16:43:50 +03:00
Iuliana Prodan 67fa702308 topology: imx: Combine base topology files for i.MX8MP and i.MX8
Combine base topology files for i.MX8MP and i.MX8 using different
variables like RATE, SAI_INDEX, CODEC.

Based on CODEC and SAI_INDEX use the proper DAI_CONFIG or STREAM_NAME.

Signed-off-by: Iuliana Prodan <iuliana.prodan@nxp.com>
2023-05-04 16:43:50 +03:00
Iuliana Prodan 181777dea1 topology: imx: Add SRC topology file for i.MX8 and i.MX8MP with wm8962 codec
Generate SRC topology file for i.MX8 and i.MX8MP with wm8962 codec
based on sof-imx8-src-wm8960.

Signed-off-by: Iuliana Prodan <iuliana.prodan@nxp.com>
2023-05-04 16:43:50 +03:00
Iuliana Prodan e08be9c2d7 topology: imx: Combine SRC topology files for i.MX8MP and i.MX8
Combine SRC topology files for i.MX8MP and i.MX8 using different
variables like RATE, SAI_INDEX, CODEC.

Based on CODEC use the proper DAI_CONFIG or STREAM_NAME.

Signed-off-by: Iuliana Prodan <iuliana.prodan@nxp.com>
2023-05-04 16:43:50 +03:00
Iuliana Prodan ac99aaf5b9 topology: imx: Add compress topology file for i.MX8 with wm8962 codec
First, combine compress topology file for i.MX8 (i.MX8QM and i.MX8QXP)
with different codecs, stream name, rate by using CODEC and RATE variables.
Based on CODEC use the proper DAI_CONFIG.

Using the above variables, add new compress topology file for
i.MX8 with wm8962 codec.

Signed-off-by: Iuliana Prodan <iuliana.prodan@nxp.com>
2023-05-04 16:43:50 +03:00
Iuliana Prodan cc77454f86 topology: imx: Add compress topology file for i.MX8MP with wm8962 codec
First, combine compress topology file for i.MX8MP with different codecs,
stream name, rate by using CODEC and RATE variables.
Based on CODEC use the proper DAI_CONFIG.

Using the above variables, add new compress topology file for
i.MX8MP with wm8962 codec.

Signed-off-by: Iuliana Prodan <iuliana.prodan@nxp.com>
2023-05-04 16:43:50 +03:00
Iuliana Prodan 3ad5ace14d topology: imx: Rearrange topologies based on platform
Rearrange topologies, from development folder, based on
platform type: imx8 and imx8mp.

Signed-off-by: Iuliana Prodan <iuliana.prodan@nxp.com>
2023-05-04 16:43:50 +03:00
Iuliana Prodan 9c48a89f2e topology: imx8: correct comments for compress tplg
Update comments for compress typologies to reflect the correct
flow and the use for each file.

Signed-off-by: Iuliana Prodan <iuliana.prodan@nxp.com>
2023-05-04 16:43:50 +03:00
Iuliana Prodan 1b5dae791d topology: imx8mp: correct comments for compress tplg
Update comments for compress typologies to reflect the correct
flow and the use for each file.

Signed-off-by: Iuliana Prodan <iuliana.prodan@nxp.com>
2023-05-04 16:43:50 +03:00
Ranjani Sridharan dfe52aac14 Tools: Topology2: SRC format fixes
This patch avoids with development topology sof-hda-src-generic.tplg
the playback start failure and error seen in trace
"buffer: buffer_alloc(): new size = 0 is invalid".

The kernel selects in case of multiple output formats defined the
format that matches the input. It then caused the obs to become zero.
When the SRC is used in the mixin-based playback pipeline, its output
format is limited to 32-bits format only. So replace the multiple
output formats with a single 48K, 2ch 32-bit format.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2023-05-03 13:24:45 +03:00
Andy Ross 1236f9d8f1 IPC4: Handle duplicate component IDs
In the SOF scheme, component IDs are allocated by the host driver.  So
they need to be validated before use when modifying the global
component list to prevent duplicate entries from being inserted.

IPC3 was doing this already.  IPC4 had copied the form of the code in
one spot, but had missed that the ID is global across types and was
only checking for duplicate pipelines.

Signed-off-by: Andy Ross <andyross@google.com>
2023-05-02 14:08:16 -07:00
Andy Ross 320a93242b ipc4: Handle typing errors in component retrieval
In IPC4, the component ID is entirely under the control of the input
protocol, and as components of multiple types exist in the list, it's
possible for protocol messages to fetch an incorrectly typed object,
leading to crashes at runtime.

Force all usage to go through a get_comp() utility that does type
checking.  There was already a similar utility for the special case of
pipelines (which have a separate ID to query).

Signed-off-by: Andy Ross <andyross@google.com>
2023-05-02 14:08:16 -07:00
Fred Oh 745d4ccd8b scripts/docker-run.sh: run with sudo-cwd.sh
There is a UID mistmatch and file permission problem. sudo-cwd.sh will
switch id every docker run command.

80e9c3454a was reverted due to
missing a toolchain.

Signed-off-by: Fred Oh <fred.oh@linux.intel.com>
2023-05-02 21:09:11 +03:00
Daniel Baluta 58bd5a66fd module_adapter: Don't print an error if reset path stops
When md->ops->reset() returns PPL_STATUS_PATH_STOP this means that
reset is not propagated along the pipeline. This is a normal condition.

So do not print an error.

Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
2023-05-02 13:52:05 +03:00
Laurentiu Mihalcea de9b8beadc ipc: ipc3: Add support for SOF_IPC_FW_READY sequence initiated by host
In the case of i.MX93 Linux will send an IPC_FW_READY
message to SOF and will expect to receive the following information
in the hostbox:
	1) reply structure
	2) sof_ipc_fw_ready structure
	3) sof_ipc_fw_ready structure

This flow is required because the FW (due to Jailhouse's design)
will be up before the platform driver from Linux so the
SOF_IPC_FW_READY sequence can't be initiated by SOF.

Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
2023-05-02 12:19:11 +03:00
Laurentiu Mihalcea bcbb85a29e zephyr: wrapper: Conditionally call platform_boot_complete()
Due to the fact that on i.MX93 the host will initialize the
SOF_IPC_FW_READY sequence there's no need to call
platform_boot_complete() at the end of start_complete(). This
will be handled in the IPC3 handler.

This commit makes sure that aforementioned scenario won't
happen for i.MX93 while keeping the flow constant for the
other platforms.

Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
2023-05-02 12:19:11 +03:00
Guennadi Liakhovetski 91dbc05ff3 IPC4: host: remove notifier, call the copier callback directly
Using the notifier between the copier and the host makes little
sense with native Zephyr drivers: it ends up in a direct function
call, but before that it has to look for the correct callback in a
global notifier list. The callback can perfectly be called directly
instead.

With legacy SOF drivers we still need to use the notifier because
that is how SOF DMA drivers trigger the host component. We have to
provide a compatibility callback in the copier for the IPC4 case.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2023-04-28 14:43:33 +03:00
Guennadi Liakhovetski cfd877e6c0 notifier: add a type for callbacks
To make sure the same prototype is used for all notifier callbacks
add a typedef.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2023-04-28 14:43:33 +03:00
Iuliana Prodan 7a445b8b38 hal: Update parameter type to match xtensa/hal.h
Update parameter type for _xt_atomic_compare_exchange_4()
to match xthal_compare_and_set() from xtensa/hal.h

This fixes "error: passing argument 1 of
'xthal_compare_and_set' from incompatible pointer type"

Signed-off-by: Iuliana Prodan <iuliana.prodan@nxp.com>
2023-04-28 14:34:16 +03:00
Iuliana Prodan 68da12b195 ASRC: Update parameter type to match the header
Update parameter type for asrc_initialise() to match those
from header file.

This fixes "error: conflicting types for 'asrc_initialise'".

Signed-off-by: Iuliana Prodan <iuliana.prodan@nxp.com>
2023-04-28 14:34:16 +03:00
Guennadi Liakhovetski 880ee3b202 buffer: add final accessors to struct audio_stream fields
Add read and write accessors for .underrun_permitted and
.overrun_permitted fields of struct audio_stream and convert the code
base to use them.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2023-04-28 14:05:58 +03:00
Guennadi Liakhovetski 6afe1ddbc2 buffer: don't access stream internals in buffer_new()
Don't access struct audio_stream internals in buffer_new(), pass
buffer flags to buffer_alloc() instead.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2023-04-28 14:05:58 +03:00
Guennadi Liakhovetski d8ce56c59f buffer: add more accessors for setting struct audio_stream fields
Add accessors for setting .frame_fmt, .valid_sample_fmt, .channels
and .rate and convert direct assignments to use them.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2023-04-28 14:05:58 +03:00
Guennadi Liakhovetski ec22e4a702 rtnr: fix a left over direct access
Fix a missed direct read of the stream channel count.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2023-04-28 14:05:58 +03:00
Guennadi Liakhovetski ffbac0ca6b buffer: add accessors for setting some struct audio_stream fields
Multiple fields in struct audio_stream are only set in the
audio_stream.h header itself, which is valid, and in rtnr.c. Add
accessors to replace the latter operations.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2023-04-28 14:05:58 +03:00
Anas Nashif 54c4b88d57 zephyr: use system cache API
Use zephyr cache APIs instead of xtensa specific ones.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
2023-04-28 10:37:55 +03:00
Paul Olaru b09d1afabc imx8m: scripts: Add XCC build configuration for Zephyr
This configuration is build tested, builds fine.

Signed-off-by: Paul Olaru <paul.olaru@nxp.com>
2023-04-27 11:07:39 +03:00
Paul Olaru 7f1be246bd imx8x: scripts: Add XCC build configuration for Zephyr
This configuration is build tested, builds fine.

Signed-off-by: Paul Olaru <paul.olaru@nxp.com>
2023-04-27 11:07:39 +03:00
Paul Olaru de884627f8 imx8: scripts: Add XCC build configuration for Zephyr
This configuration is build tested, builds fine.

Signed-off-by: Paul Olaru <paul.olaru@nxp.com>
2023-04-27 11:07:39 +03:00
Chao Song fabeb63842 Topology2: Add mtl-rt711-l0-rt1316-l23-rt714-l1 support
This topology could be used by MTL SDW RVP with 3-in-1
SDCA codec board, or other hardware configuration with
the same codec layout:
    SDW0: RT711 Headphone
    SDW1: RT714 DMIC
    SDW2: RT1316 Speaker
    SDW3: RT1316 Speaker

Signed-off-by: Chao Song <chao.song@linux.intel.com>
2023-04-27 10:29:34 +03:00
Chao Song d3e3943bad Topology2: add comment to separate chromebook topology clearly
Add a single comment to separate chromebook topologies
from non-chromebook topologies.

Signed-off-by: Chao Song <chao.song@linux.intel.com>
2023-04-27 10:29:34 +03:00
Brent Lu eff50e4262 pipeline: try to stop active component when reset
When resetting a pipeline, components may be still in active state if
previous pipeline walkthrough of stop trigger aborted due to some
reason. Here we give it a second chance to stop the component before
resetting it. Without doing this, some components like dai could cause
DSP panic because the DMA is still running.

Signed-off-by: Brent Lu <brent.lu@intel.com>
2023-04-27 10:27:16 +03:00
Ranjani Sridharan 0140c43099 topology2: Set the deepbuffer PCM D0i3 compatibility conditionally
Set the deep buffer PCM as D0I3 compatible only for MTL.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2023-04-27 10:25:45 +03:00
Guennadi Liakhovetski 64f011acdb rtnr: fix regression
Earlier commits wrongly used struct audio_stream accessors to read
members of struct audio_stream_rtnr in rtnr_copy_to_sof_stream().
Revert those changes.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2023-04-27 10:22:05 +03:00
Tomasz Leman 9632135d33 west.yml: upgrade zephyr to 9028ad5d71
Zepych update: total of 132 commits.

Changes include GP DMA power management changes.

Signed-off-by: Tomasz Leman <tomasz.m.leman@intel.com>
2023-04-26 16:55:10 +03:00
Peter Ujfalusi f599f61311 audio: mixin_mixout_generic: normal_mix: Update src/dst after each copy
The copying part of the functions need to update the src/dst buffer
pointers after each iteration to correctly account for the possible wrap
of the buffer.

This was discovered while doing pause - 1sec_wait - resume - 3sec_wait
cycles and around the 10th iteration audio became 'metallic' sounding.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
2023-04-26 15:04:39 +03:00
Guennadi Liakhovetski eee146bd02 lib-manager: fix compilation breakage
Fix breakage introduced by 32e4f7e27a ("buffer: use an accessor to
read struct audio_stream::end_ptr") which accidentally wrongly used
audio_stream_get_end_addr() to access the .end_addr member of
struct lib_manager_dma_buf.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2023-04-26 12:02:05 +01:00
Marc Herbert 34d7baa800 scripts: Dockerfile: re-add TGL toolchain removed by accident
TGL has always been using the `xtensa-cnl-elf` toolchain. That
toolchain was removed by accident when cavs 1.8 support (including
CNL) was removed by massive search/replace commit dc9ba281d7
("platform: remove support for cAVS 1.8 platforms")

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2023-04-26 11:38:10 +01:00
Marc Herbert 0c7db9a58e Revert "scripts/docker-run.sh: run with sudo-cwd.sh"
This reverts commit 80e9c3454a.

This was merged too early, there are still build issues and failures
to solve first, notably issues caused by the now missing
xtensa-cnl-elf-gcc

https://github.com/thesofproject/sof/actions/runs/4789961860/jobs/8518459642
https://github.com/thesofproject/sof/actions/runs/4789961859/jobs/8518459155
etc.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2023-04-25 12:48:44 -07:00
Fred Oh 80e9c3454a scripts/docker-run.sh: run with sudo-cwd.sh
There is a UID mistmatch and file permission problem. sudo-cwd.sh will
switch id every docker run command.

This can be done like this,
./scripts/docker-run.sh ./scripts/sudo-cwd.sh CMD

But not to make build script, just include sudo-cwd.sh in docker-run.sh.

Signed-off-by: Fred Oh <fred.oh@linux.intel.com>
2023-04-25 15:30:45 +01:00
Fred Oh 05f92cb371 docker: upgrade to ubuntu 22.04 as a base image
Upgrade Ubuntu to latest LTS version, 22.04.
Permission issue has started when UID didn't match with local UID.
As an solution, created high value UID to unmatch local UID.
sof home doesn't have permission for others, so add o+rx permission to
avoid any permission issue when id does not match.

Signed-off-by: Fred Oh <fred.oh@linux.intel.com>
2023-04-25 15:30:45 +01:00
Guennadi Liakhovetski e57883f3c2 buffer: use an accessor to read struct audio_stream::channels
This patch adds audio_stream_get_channels() to read
struct audio_stream::channels and converts all users. Apart from
hiding internals of the structure, it also enforces the use of the
__sparse_cache annotation.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2023-04-25 14:59:34 +01:00
Guennadi Liakhovetski f8e4d693b2 buffer: use an accessor to read struct audio_stream::rate
This patch adds audio_stream_get_rate() to read
struct audio_stream::rate and converts all users. Apart from
hiding internals of the structure, it also enforces the use of the
__sparse_cache annotation.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2023-04-25 14:59:34 +01:00
Guennadi Liakhovetski a25f098b72 buffer: use an accessor to read struct audio_stream::valid_sample_fmt
This patch adds audio_stream_get_valid_fmt() to read
struct audio_stream::valid_sample_fmt and converts all users. Apart
from hiding internals of the structure, it also enforces the use of
the __sparse_cache annotation.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2023-04-25 14:59:34 +01:00
Guennadi Liakhovetski 017b8ebcde buffer: use an accessor to read struct audio_stream::frame_fmt
This patch adds audio_stream_get_frm_fmt() to read
struct audio_stream::frame_fmt and converts all users. Apart from
hiding internals of the structure, it also enforces the use of the
__sparse_cache annotation.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2023-04-25 14:59:34 +01:00
Guennadi Liakhovetski 3ab21638cf buffer: remove cache annotations from audio_stream_fmt_conversion()
audio_stream_fmt_conversion() is used both directly with fields from
acquired buffers in its arguments and ordinary local variables. In
the former case the arguments should have cache annotations, in the
latter case it isn't compulsory. A choice has been made to enforce
cache annotations in both cases, which however now becomes an
inconvenience. Revert that by using temporary variables instead of
buffer fields directly.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2023-04-25 14:59:34 +01:00
Guennadi Liakhovetski b8233ce791 buffer: use an accessor to read struct audio_stream::free
This patch adds audio_stream_get_free() to read
struct audio_stream::free and converts all users. Apart from hiding
internals of the structure, it also enforces the use of the
__sparse_cache annotation.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2023-04-25 14:59:34 +01:00
Guennadi Liakhovetski b667c914c6 buffer: use an accessor to read struct audio_stream::avail
This patch adds audio_stream_get_avail() to read
struct audio_stream::avail and converts all users. Apart from hiding
internals of the structure, it also enforces the use of the
__sparse_cache annotation.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2023-04-25 14:59:34 +01:00
Guennadi Liakhovetski 932cf4f73c buffer: use an accessor to read struct audio_stream::size
This patch adds audio_stream_get_size() to read
struct audio_stream::size and converts all users. Apart from hiding
internals of the structure, it also enforces the use of the
__sparse_cache annotation.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2023-04-25 14:59:34 +01:00
Guennadi Liakhovetski f1ee4eb3ac buffer: use an accessor to read struct audio_stream::addr
This patch adds audio_stream_get_addr() to read
struct audio_stream::addr and converts all users. Apart from hiding
internals of the structure, it also enforces the use of the
__sparse_cache annotation.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2023-04-25 14:59:34 +01:00