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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>