The aim of this patch is to fix the following issue:
after some pause-release operations the sound would play
with higher volume in one earpiece compared to the other one.
This seemed to happen only during a certain part of some song
(the beginning).
By removing the unnecessary set of CSR_START register in
edma_start the problem seemed to have disappeared. Setting
aforementioned register in edma_start is not necessary
because we don't need to explicitly start a channel in the
software. The hardware will take care of it.
Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
Since we introduced a new function used to handle the release
case (sai_release), we want to handle COMP_TRIGGER_RELEASE
using said function and not use sai_start.
The aim of this and the previous patch is to fix the
following issue: after a sequence of pause-release operations a
static sound would play along with the song. This static sound
would sometimes disappear after another sequence of pause-release
operations and would appear again after another sequence of
those operations.
Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
Since the release and start operations should behave
differently, we need to add a new function which will
be used to handle the release case.
Initially, release would be treated just as start which is not
really correct because:
1) we don't need to do a software reset of the SAI.
(according to the documentation, apart from
resetting the SAI internal logic, it was also
resetting the FIFO read and write pointers which
was not required)
2) we don't need to enable the flags that were
not disabled by sai_stop.
Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
Currently, SDMA's edma_start considers that COMP_STATE_SUSPEND
is a state from which you can get to COMP_STATE_ACTIVE which
is not true because the SDMA channel never reaches that state.
According to the device state diagram, we can only reach
the COMP_STATE_ACTIVE state if we are currently in
COMP_STATE_PAUSED or COMP_STATE_PREPARE.
Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
On COMP_TRIGGER_RELEASE, dai_trigger first calls edma_release and then
calls edma_start. Currently, edma_release changes the state of the
channel to COMP_STATE_ACTIVE which is wrong because that state
should be achieved after calling edma_start.
Since we know that edma_release is followed by edma_start the
correct state for the channel after a edma_release should
be COMP_STATE_PREPARE.
Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
Currently, EDMA's edma_start considers that COMP_STATE_SUSPEND
is a state from which you can get to COMP_STATE_ACTIVE which
is not true because the EDMA channel never reaches that state.
According to the device state diagram, we can only reach
the COMP_STATE_ACTIVE state if we are currently in
COMP_STATE_PAUSED or COMP_STATE_PREPARE.
Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
Add hifi3 & hifi4 version implementation of mixer processing functions.
The hifi version functions can save at least 47% cycles than C version.
Signed-off-by: Andrula Song <xiaoyuan.song@intel.com>
Parameters audio_fmt.depth and audio_fmt.valid_bit_depth are
expressed in bits. Therefore should be divided by 8 when set for params:
params->sample_container_bytes
params->sample_valid_bytes
Signed-off-by: Jaroslaw Stelter <Jaroslaw.Stelter@intel.com>
This causes problems when displaying heap traces.
Fixes: b67c2bf0d9 ("alloc: Making heap trace dump more readable")
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
At present module_adapter, period_bytes is calculated assuming the schedule
period is 1ms, which could be arbitrary in practice determined by the
topology.
This commit replaces the calculation code by audio_stream_period_bytes().
In addition, the timing for getting period_bytes is moved to the beginning
of prepare() (prior to the module prepare). At that moment it is guaranteed
that all parameters in components/buffers are settled through the pipeline.
Signed-off-by: Pin-chih Lin <johnylin@google.com>
Add log definition for Zephyr allowing to build this module
for Zephyr when logging is enabled.
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Fixes pylint warning `scripts/xtensa-build-zephyr.py:426:5: W0621:
Redefining name 'platform' from outer scope (line 14)
(redefined-outer-name)` and reduce "grep confusion": the script uses
`platform` A LOT.
Signed-off-by: Marc Herbert <marc.herbert@intel.com>
There's just too many of them and fixing them would cause a lot of churn
at a wrong time (big migration to west happening now)
Signed-off-by: Marc Herbert <marc.herbert@intel.com>
shlex.join() requires 3.8, maybe others too. 3.8 is 3 years old and it's
the default Python version in Ubuntu 20.04
Fixes#6121
Signed-off-by: Marc Herbert <marc.herbert@intel.com>
Fixes: #5323
The v1.2.6 requirement was a lie the whole time because alsatplg v1.2.6
does not have any `-I` option. The truth was: un-released alsa-utils
from git was required. The check for v1.2.6 was an approximation good
enough for many users but not for everyone, see for instance #5323.
Now that alsa-utils v1.2.7 has been released we can stop lying:
https://github.com/alsa-project/alsa-utils/commit/7d934f3142549
Signed-off-by: Marc Herbert <marc.herbert@intel.com>
Simply replace `/**` with `/*`. This can be very easily reverted if
someone ever fixes the corresponding comment.
We don't build doxygen for .C files in continuous integration, only for
.H files. We don't build doxygen for .C files in continuous integration
because there are way too many errors and no one has time to fix
them. Because we never build doxygen for .C files, people keep adding
untested and invalid doxygen comments or they change the code while
leaving the doxygen out of sync.
I build doxygen for .C files locally. The call graphs are especially
useful (they don't need doxygen comments). I have local hacks to filter
out the most common doxygen errors. The broken doxygen comments disabled
by this commit escaped my local filters.
Signed-off-by: Marc Herbert <marc.herbert@intel.com>
comp_verify_params() is declared in two different .h files. This is
probably wrong but this very small and quick fix is only about
removing the doxygen duplication and removing this super confusing
error message that does NOT point at the duplication:
```
src/include/sof/ipc/topology.h:209: warning: argument 'dev' from the
argument list of comp_verify_params has multiple @param documentation
sections
src/include/sof/ipc/topology.h:209: warning: argument 'flag' from the
argument list of comp_verify_params has multiple @param documentation
sections
src/include/sof/ipc/topology.h:209: warning: argument 'params' from
the argument list of comp_verify_params has multiple @param
documentation sections
```
Signed-off-by: Marc Herbert <marc.herbert@intel.com>
coherent_release() doesn't need to return the uncached address, that
was originally used to acquire the object, that address is available
to the caller already.
Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
buffer_release() currently returns the original pointer that was used
for buffer acquisition, which is never used and shouldn't be needed
either. Remove it and make the function return void instead.
Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Since rtnr_reset() will be called once recording is finished,
the value of process_enabled should not be changed in this function.
Otherwise every new recording will start with the value set in
rtnr_reset(), and it should be an incorrect behavior.
Signed-off-by: Ming Jen Tai <mingjen_tai@realtek.com>
We add a new i.MX8MP topology which will use the compress API for PCM
capture. This topology is mainly used for testing.
Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
We add a new i.MX8MP topology which will use the compress API for PCM
playback. This topology is mainly used for testing.
Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
We add a new i.MX8Q(M/XP) topology which will use the compress API for
PCM capture. This topology is mainly used for testing.
Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
We add a new i.MX8Q(M/XP) topology which will use the compress API for
PCM playback. This topology is mainly used for testing.
Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
We want to be able to create topologies for the case of
compress capture. This change will enable us to do so.
Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
This change will allow us to prepare for adding a new macro
for the case of compress capture.
Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
In module adapter, Waves will receive bin file from user space
before .prepare method be called. To support this change, move buffer
acquisition in .ini method instead.
Signed-off-by: barry.jan <barry.jan@waves.com>
Implement a Zephyr logging backend which routes the logs via SOF
probes interface.
Tested with Linux SOF driver, crecord and sof/tools/probes for decoding.
The patch modifies the probes IPC3 interface, adding a new probe purpose
field (PROBE_PURPOSE_LOGGING, 0x3) to specify probe extraction for
logging. A field for system trace (as is also reserved (PROBE_PURPOSE_TRACING).
Example usage in Linux:
term1# crecord -c3 -d0 -b8192 -f4 -FS32_LE -R48000 -C4 /tmp/extract.dat
term2# echo 0,3,0 > /sys/kernel/debug/sof/probe_points
term1# <terminate crecord>
term1# sof-probes -p /tmp/extract.dat
term1# cat buffer_0.bin
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Modify probe task to support cases where the amount of available data is
not multiple of the DMA copy size, or wraps around in the DMA
buffer.
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Identify non-audio probe streams and write them out with ".bin"
extension and without the RIFF WAVE header.
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Modify code to correctly handle probe streams where sync word
can occur at any byte boundary, and where probe packet size may
not be aligned to 32bit word size.
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
The component .bind() method is called twice - for the upstream and
for the downstream links. When mixout's .bind() is first called for
the upstream link, it correctly sets up its connection to the mixin
component. However, if after that .bind() is called for the
downstream link, that configuration is overwritten with 0. Remove
that overwrite.
Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
SOF probes use notifiers to be informed when buffer fill state
changes. These notifiers are always called synchronously on the same
core. We use that fact to pass locked buffers to probes.
Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
probe_gen_header() only needs a single field from comp_buffer,
so simplify the function interface.
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
After commit:
5763c74bf4 ("codec_adapter: Remove setup config from module data")
we no longer setup config bytes in codec adapter control bytes.
So, we need to remove ca_config bytes and fix payload size. This
didn't introduce any bug because this is the default
CA_SETUP_CONTROLBYTES. Each topology uses a custom control bytes
which overrides this default values.
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
West tool returns on windows OS different white characters
than on Linux OS. Paths outputted from west tool had been
stripped for any trailing whitespaces.
Fixes "xtensa-build-zephyr.py: use west manifest"
(608833cf27)
Signed-off-by: Andrey Borisovich <andrey.borisovich@intel.com>
find_mixout_source_info() can return NULL, always check return value
before dereferencing.
Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
No reason for ipc_get_ppl_comp() to only look for components on the
same core as where it is running, same pipeline components can run
on different cores too.
Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
The stream format info is useful for debugging SRC issues so it
is added to comp_info() trace print.
The blk_in and blk_out are at this code location always zeros so
the comp_info() to trace them is unnecessary.
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
This patch allows to test SRC with all 16/24/32 bit formats
in UP-squared device. Without this patch only 16 bit is
supported.
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>