Commit Graph

9949 Commits

Author SHA1 Message Date
Ranjani Sridharan 9cd7f38973 dai: Modify the signature of dai_dma_position_update()
Pass both the dai_data and the dev pointers so that it can also be used
from the copier device.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2023-05-08 12:23:52 +03:00
Baofeng Tian 286da916ea dai-zephyr: Expose dai_zephyr_params()
Expose and use it in the single endpoint DAI case in the copier device
in preparation to remove the creation of dai component.

Signed-off-by: Baofeng Tian <baofeng.tian@intel.com>
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2023-05-08 12:23:52 +03:00
Ranjani Sridharan 897fee7d78 dai-zephyr/dai-legacy: Split up dai_params()
Add a new helper, dai_zephyr_params() to make it usable from the copier
device. Also modify the signatures of dai_playback_params() and
dai_capture_params() to use the passed dai_data and dev pointer.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2023-05-08 12:23:52 +03:00
Ranjani Sridharan fb0441760d dai: Modify the signature of ipc_dai_data_config()
To pass both the dai_data and dev pointer and make it usable for both
the DAI device and the copier device.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2023-05-08 12:23:52 +03:00
Ranjani Sridharan 20d84ce4ea ipc4: dai: Expose dai_zephyr_position()
Expose and use the function in the copier.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2023-05-08 12:23:52 +03:00
Ranjani Sridharan 8dd0adcd33 ipc4: dai: Split up dai_position()
And add a new helper, dai_zephyr_position() that can also be used by the
copier device.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2023-05-08 12:23:52 +03:00
Ranjani Sridharan b74895c193 copier: Modify get_processed_data()
Modify the get_processed_data() function to use the total_processed_data
from the dai_data directly for DAI components.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2023-05-08 12:23:52 +03:00
Baofeng Tian 066e7d70f4 dai-zephyr/dai-legacy: Expose dai_zephyr_trigger()
Expose and use the function in the single endpoint DAI case in the
copier device in preparation to remove the creation of DAI component.

Signed-off-by: Baofeng Tian <baofeng.tian@intel.com>
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2023-05-08 12:23:52 +03:00
Ranjani Sridharan 89764c048f dai-zephyr/dai-legacy: Split up dai_comp_trigger()
Add a new helper function dai_zephyr_trigger() that can also be used by
a copier device. Also, modify the signature of the
dai_comp_trigger_internal() to pass the dai_data and device pointer.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2023-05-08 12:23:52 +03:00
Baofeng Tian a281224e15 dai-zephyr/dai-legacy: Expose dai_zephyr_reset()
Expose dai_zephyr_reset() and use in the copier device for the single
endpoint case in preparation for removing the creation of DAI component.

Signed-off-by: Baofeng Tian <baofeng.tian@intel.com>
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2023-05-08 12:23:52 +03:00
Ranjani Sridharan 138fa449f7 dai-zephyr/dai-legacy: Split up dai_reset()
And add a helper function, dai_zephyr_reset() that can also be used by
the copier device in the next patch.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2023-05-08 12:23:52 +03:00
Ranjani Sridharan b127cc7e77 dai: Modify the signature of dai_dma_release()
In preparation for it to be used with both the DAI device and the copier
device, pass both the dai_data and the device pointer separately.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2023-05-08 12:23:52 +03:00
Baofeng Tian 79c4339489 dai-zephyr/dai-legacy: Expose dai_zephyr_prepare() and dai_zephyr_config_prepare()
Rename dai_config_prepare() to add the zephyr prefix and expose both
functions and use them in the copier device in the single endpoint DAI
case.

Signed-off-by: Baofeng Tian <baofeng.tian@intel.com>
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2023-05-08 12:23:52 +03:00
Ranjani Sridharan 9da71a8708 dai-zephyr/dai-legacy: split the dai_prepare() function
Split the dai_prepare() function and add a new helper,
dai_zephyr_prepare() that can also be invoked from the copier device.
Also modify the dai_config_prepare() function to pass the dai_data and
device separately for use with the copier device.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2023-05-08 12:23:52 +03:00
Baofeng Tian c8dc91ea53 copier: Expose dai_zephyr_new()/free()
Expose the dai_zephyr_new()/free() functions and use them for
creating/freeing the endpoint device when the dai_count is 1 when a
copier device is created. This is preparation to replace the endpoint
device with the copier device and eventually remove the endpoint device
itself.

Signed-off-by: Baofeng Tian <baofeng.tian@intel.com>
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2023-05-08 12:23:52 +03:00
Ranjani Sridharan d968578882 dai: Modify the signature of dai_config_dma_channel()
In preparation for this function to be used by both a copier device and
the DAI device, modify the signature to pass both the dai_data and the
device pointer.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2023-05-08 12:23:52 +03:00
Ranjani Sridharan b31d2a1595 dai-zephyr/dai-legacy: Split the dai_free() function
Split the dai_free() function to add a helper function, dai_zephyr_free()
in preparation for this to be called from both a DAI device and copier
device.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2023-05-08 12:23:52 +03:00
Ranjani Sridharan f7e47aa6af dai-zephyr/dai-legacy: Split the dai_new() function
Split the dai_new() function to add a helper function, dai_zephyr_new()
in preparation for this to be called from both a DAI device and copier
device.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2023-05-08 12:23:52 +03:00
Ranjani Sridharan 39f81954c4 dai: Modify the signature of dai_release_llp_slot()
In preparation for using this function for both a DAI device and a
copier device, modify the signature to pass the dai_data as the input
instead of the dev pointer.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2023-05-08 12:23:52 +03:00
Marc Herbert de6690f104 .github: upgrade most runners to latest Ubuntu 22.04
Let's not fall behind.

Ubuntu 22.04 is the latest runner offered by Github:
https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2023-05-08 12:21:55 +03:00
Andrula Song 523fe82732 Smart_amp: Convert IPC4 dummy smart_amp component to use the module adapter
Convert the IPC4 dummy smart_amp(smart_amp_test_ipc4.c) module to use
module adapter interface. And remove the k_mutex lock from struct
smart_amp_data since the lock is used for bind/unbind thread and process
thread. Now bind/unbind are removed, all lock reference is used in the same
thread so we don't need it anymore.

Signed-off-by: Andrula Song <andrula.song@intel.com>
2023-05-08 12:21:14 +03:00
Andrula Song 460bca5402 Smart_amp: Remove the k_mute lock of IPC3 implementation
Since smart_amp_test will always start feedback path firston IPC3
and the k_mute lock is added for IPC4 to support arbitrarily order
of starting source path and feedback source. So remove the k_mute
from IPC3 implementation.

Signed-off-by: Andrula Song <andrula.song@intel.com>
2023-05-08 12:21:14 +03:00
Andrula Song 250a17c449 Smart_amp: Split dummy smart_amp to IPC3/IPC4 version
Split smart_amp_test.c to IPC3 version smart_amp_test_ipc3.c
and IPC4 version smart_amp_test_ipc4.c

Signed-off-by: Andrula Song <andrula.song@intel.com>
2023-05-08 12:21:14 +03:00
Marc Herbert 3f24c05ab2 .gitmodules: add comments about relative URL. No change.
Answering a question from @ceolin and others before him.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2023-05-08 12:19:17 +03:00
Ranjani Sridharan 3c39c2c996 topology2: cavs-sdw: Enable PDM 1 mics for 4ch
It would be better to make these dependedent on NUM_DMICS. Something to
improve in a follow up PR.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2023-05-05 19:42:29 +03:00
Marc Herbert a4ece86d4d xtensa-build-zephyr.py: drop intermediate build-$platf/sof-$platf.ri
Remove one intermediate and unnecessary .ri file. Simplify the code and
the build directory. Example below with `sof-mtl.ri` for better
readability but this applies the same to `sof-imx8.ri` and every other
`sof-$platf.ri` file.

There were 3 .ri copies before this commit:

```
                build-mtl/zephyr/zephyr.ri
copied to  ->   build-mtl/zephyr/sof-mtl.ri
copied to  ->   build-sof-staging/___/sof-mtl.ri
```

Only 2 left after dropping the second and pointless copy:

```
                build-mtl/zephyr/zephyr.ri
copied to  ->   build-sof-staging/___/sof-mtl.ri
```

Fewer copies means less wondering about what is what, two identical
files in the same directory is at best pointless and at worst misleading.

The `build-mtl/` directory belongs to the zephyr build system
exclusively, this wrapper script has no business interfering with
`build-mtl`. `build-mtl/zephyr/sof-mtl.ri can even be dangerous because
it does not get cleaned. Demonstration:

```
 # Compile successfully
 $ ./scripts/xtensa-build-zephyr.py mtl

 # Write some code and make a mistake.
 # Fail to compile.
 $ echo BROKEN >> ../zephyr/kernel/sched.c
 $ ./scripts/xtensa-build-zephyr.py mtl

 # Obsolete .ri files are still there
 $ find ../build-mtl/ -name *.ri
  ../build-mtl/zephyr/zephyr.ri
  ../build-mtl/zephyr/sof-mtl.ri

 $ ninja -C ../build-mtl clean

 # Obsolete sof-mtl.ri is still there!
 $ find ../build-mtl/ -name *.ri
  ../build-mtl/zephyr/sof-mtl.ri

```

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2023-05-05 19:40:58 +03:00
Serhiy Katsyuba 9c98cfd611 ipc4: Fix Host gtw conversion to/from 24_4LE audio
Fixes audio format conversions on Host gateway between 16/16 and 24/32
(and vice versa) and between 32/32 and 24/32 (and vice versa).

Signed-off-by: Serhiy Katsyuba <serhiy.katsyuba@intel.com>
2023-05-05 09:13:57 -07:00
Seppo Ingalsuo 43b08c62b5 Tools: Test: Audio: Convert tabs to spaces in comp_run.sh
No script changes, just unify shell script style to be
with indents with spaces instead of both tabs and spaces.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2023-05-04 18:07:52 +03:00
Seppo Ingalsuo b4af9d93a1 Tools: Test: Changes for process_test.m run with xt-xcc
This patch adds to process_test() sixth argument to run the tests
with xt-run environment with argument set to 'xt-run' or
'xt-run --turbo'.

The set and print of LD_LIBRARY_PATH is no more needed with static
testbench version.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2023-05-04 18:07:52 +03:00
Seppo Ingalsuo 10d0b3b5e1 Scripts: Add xt-run build target for rebuild-testbench.sh
This patch adds to rebuild-testbench option -x <platform> that
can be used to build testbench for xt-run execution. The enhanced
script reuses native testbench build but with CC, LD, LDFLAGS,
etc. defines to use the xt-xcc compiler for build.

Currently TGL (HiFi3) is the only supported platform. More will
be added later.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2023-05-04 18:07:52 +03:00
Seppo Ingalsuo a380d21d85 Tools: Testbench: Fixes for xt-xcc build and cycles counting
This patch avoids the build errors. Most of the issues are
from different types for formatted printing in gcc vs. xt-xcc.

The "__attribute__ ((fallthrough));" is not supported in xt-xcc.

The xtensa C library does not have clock_gettime() so it is
only left out from build. The cycles count and MCPS is printed
instead.

The include of dlfcn.h is not needed since the testbench no
more has dynamic libraries.

Structs within structs need to be initialized to zero in xt-xcc
with multiple brackets.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2023-05-04 18:07:52 +03:00
Marc Herbert 11592fed5b version.cmake: switch SOF_MAJOR etc. to a new, static `versions.json`
As discussed in #6952, relying on `git describe` for defining SOF_MAJOR
and friends is very brittle and unreliable. Switch to a static
versions.json file instead.

Note the full `git describe --tags` output is _still_ present in the
binary, this is useful and left unchanged. It's just not used any more
to guess SOF_MAJOR, SOF_MINOR and SOF_MICRO.

Use JSON because CMake and pretty much every other piece of software has
a JSON parser out of the box.

This aligns with linux/Makefile, Zephyr/VERSIONS and probably many
others. - except we use JSON because we're in 2023 so we don't spend
time having fun re-implementing parsers any more.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2023-05-04 16:57:28 +03:00
Marc Herbert 65a68b7c31 .github: upgrade all checkout actions to v3
Search and replace checkout@v2 with checkout@v3.

This finally gets rid of all warnings "Node.js 12 actions are
deprecated".

We've been using v3 in a few other places and never met any backwards
compatibility issue.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2023-05-04 16:46:43 +03:00
Keith Packard 3a5f7a3d2d app: Switch main return type to 'int'
With Zephyr adopting a different type for 'main', adapt this
application to match.

Signed-off-by: Keith Packard <keithp@keithp.com>
2023-05-04 16:45:32 +03:00
Iuliana Prodan 6580e68302 topology: imx: Add mixer topology file for i.MX8 and i.MX8MP with wm8962 codec
Generate MIXER topology file for i.MX8 and i.MX8MP with wm8962 codec
based on sof-imx8-wm8960-mixer.

Signed-off-by: Iuliana Prodan <iuliana.prodan@nxp.com>
2023-05-04 16:43:50 +03:00
Iuliana Prodan 5846763006 topology: imx: Combine mixer topology files for i.MX8MP and i.MX8
Combine mixer 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 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