Some XCC/Clang are based on older Clang 3.9 which does not
support the fallthrough attribute. So a blanket statement
that all Clang supports fallthrough attribute is not true.
Also, XCC/Clang can be based on newer version of Clang which
will eventually support the fallthrough attribute. Therefore,
use the compiler version as guard on whether the fallthrough
attribute is supported instead of simply basing it on
what the underlying compiler is. Note that the fallthrough
attribute is supported since GCC 7 and Clang 10.
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
Modify the signature of codec_adapter_copy_from_module_to_sink() to pass
the module buffer. Also, clarify comments to make it more easier to
follow.
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Modify the signature of codec_adapter_copy_from_source_to_module() to pass
the buffer pointer and buffer size. Also, clarify the comments to make it
more easier to follow.
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
In preparation for supporting more than 1 input/output buffers, access
the first source/sink buffer from the comp_dev's buffer_list instead of
accessing the ca_source/ca_sink.
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
With dynamic pipeline feature, pipelines are destroyed
when SOF device enters suspend and .remove callback is called in order
to free memory.
SAI/ESAI are missing this callback and the FW crashes. Fix this by
adding .remove callback.
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
This component is an incomplete shell, there is no reason to build it
unless someone decides to complete it.
Signed-off-by: Curtis Malainey <cujomalainey@chromium.org>
There is no reason to have a function just call another function that is
used no where else.
Signed-off-by: Curtis Malainey <cujomalainey@chromium.org>
The explanation takes sof-adl-max98357a-rt5682 as an example:
During pipeline_complete(), we search for the source widget
for a pipeline from a list and the ipc_get_ppl_comp() returns
the first widget from the list of source widgets for a pipeline.
With SSP2.IN on pipeline 1, which is the same pipeline ID as the
ECHO_REF playback pipeline for PCM0P, pipeline_complete() for
pipeline 1 ends up not walking the rest of widgets in pipeline 1.
This Echo Ref feature works in chrome kernel today by accident,
because we set up the widgets in the reverse order after resuming
from runtime suspend and the source widget happens to be PCM0P.
To fix this, create a new pipeline for the capture dai widget SSP2.IN,
so that it doesn't pollute the widget list for pipeline 1.
Fixes: #5395
Signed-off-by: Chao Song <chao.song@linux.intel.com>
This fixes the banner which was recently added by SOF commit
a053e04d7e ("trace: add Zephyr git version to the initial FW ABI
banner")
SHM: FW ABI ... tags SOF:v1.2.3 zephyr:zephyr-v3.0.0-346-g1470228eb10
... but was broken very soon after by Zephyr commit 91709778a487 ("cmake:
version.h generation performed at build time")
SHM: FW ABI ... tags SOF:v1.2.3 zephyr:BUILD_VERSION
Signed-off-by: Marc Herbert <marc.herbert@intel.com>
Adding code routine for enabling and disabling cores.
Cores id are check in high to low order, because primary core on path
to disable should be done last.
Signed-off-by: Tomasz Leman <tomasz.m.leman@intel.com>
Signed-off-by: Rafal Redzimski <rafal.f.redzimski@intel.com>
Reading and validation of the ipc message payload.
Signed-off-by: Tomasz Leman <tomasz.m.leman@intel.com>
Signed-off-by: Rafal Redzimski <rafal.f.redzimski@intel.com>
This patch removes code prepare for SetDx send via large config set.
Only module message is proper way to do this.
Moving payload struct from base_fw to module.
Signed-off-by: Tomasz Leman <tomasz.m.leman@intel.com>
Signed-off-by: Rafal Redzimski <rafal.f.redzimski@intel.com>
Using copies of module_id and instance_id, otherwise they are unnecessary.
Removing unnecessary log, it has no useful information. Any value different
that 0 will be printed in error.
Signed-off-by: Tomasz Leman <tomasz.m.leman@intel.com>
Signed-off-by: Rafal Redzimski <rafal.f.redzimski@intel.com>
We declare that S24_LE is supported by a HDA PCM, but 24 bit audio
format is not included in the available audio format list.
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
The DAI copiers only support 32-bit format. Change the gain-playback and
gain-capture to set the input/output bit-depth to match the DAI copier
requirement.
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Add the input/output bit depth's for the BE DAI copier for the DMIC
capture pipeline.
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
The most important fix is the addition of the "flush" argument which
means are commands are now printed when they are run and not all at the
end when everything is done.
Commands run by this script are very few so they are always shown. This
makes it possible to debug just this script without being completely
drown in build noise. All '-v's are passed to west.
Pass -v to `west sign`, not just to `west build`.
Drop the manual "-DCMAKE_VERBOSE_MAKEFILE=ON", west knows how to do that.
Print directories first so commands are aligned, more visible and can be
copied. Use shlex to quote whitespace.
Signed-off-by: Marc Herbert <marc.herbert@intel.com>
This patch optimizes the buffer seek for zero crossing. The
audio_stream_read_frag_s16/24/32() is replaced with block
based search. The search block is defined by new stream function
audio_stream_rewind_bytes_without_wrap(). The other added stream
function audio_stream_rewind_wrap() handles the pointer wrap
when reading backwards.
The saving during volume ramping is from 12.4 MCPS to 10.8 MCPS
(1.6 MCPS) for 16 bit play, and 16.4 MCPS to 14.4 MCPS (2 MCPS)
for 24 bit and 32 bit playback.
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
format
Only the host copier should do the conversion based on the runtime
params. The DAI copiers should always support only 32-bit playback and
capture. So, fix the input/output formats for the copiers in the
respective pipelines.
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
When the dma-trace is enabled (or re-enabled) the DMA channel is
re-initialized, configured.
The DMA will start reading data from the local buffer from the start (!!)
it can not be configured to start reading from the point it is left off.
Because of this, if the dtrace is disabled and re-enabled, the DMA will
copy old log entries starting from the beginning of the local buffer.
To be able to preserve the logs while the dtrace is disable we need to
reset both read and write pointers on the local buffer and when the dtrace
is again enabled we can transfer the logs from this point, without
misaligned or missed logs.
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Added the const specifier to protect the message passed to
ipc_platform_send_msg and ipc_prepare_to_send functions. The deletion of
the message from the list has been moved to ipc_send_queued_msg function.
Signed-off-by: Adrian Warecki <adrianx.warecki@intel.com>
This commit fixes two issues in the ipc_prepare_to_send function.
1. Function should not modify the message structure. Some modules
(eg. dma-trace) repeatedly send a previously prepared message. We can't
modify it.
2. Before freeing the dynamically allocated tx_data buffer, the function
should check for the processed message is an ipc reply.
Signed-off-by: Adrian Warecki <adrianx.warecki@intel.com>
Removed redundant notification about log position from function
dma_trace_get_avail_data. Function trace_work already send it.
Signed-off-by: Adrian Warecki <adrianx.warecki@intel.com>
This patch optimizes the remaining EQ functions eq_iir_s32_s16_pass()
and eq_iir_s32_s24_pass() to not use audio stream read/write
frag functions.
This patch did not change x-x bit case that was already handled
efficiently by 1:1 stream copy function with 6 MCPS. The 32-16 bits
case improved 22.4 MCPS to 6.4 MCPS (-16 MCPS), the 32-24 bits case
improved 23.6 MCPS to 6.8 MCPS (-16.8 MCPS).
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
The dictionary does not support character strings.
Fixes commit c11562b00a ("dma-trace: Align DMA buffer correctly to fix
dma tracing issues")
Take the opportunity to log the d pointer (which _is_ supported).
Fixes the following error message:
TIMESTAMP (us) DELTA C# COMPONENT LOCATION CONTENT
error: String printing is not supported
[ 2.604167] ( 0.000000) c0 dma-trace src/trace/dma-trace.c:266 ERROR <String @ 0xbe035e60> failed: no DMAC
Signed-off-by: Marc Herbert <marc.herbert@intel.com>
Make it possible to invoke -C multiple times which is required to
support whitespace as in:
-C=--warn-uninitialized -C '-DEXTRA_FLAGS=-Werror -g0'
Signed-off-by: Marc Herbert <marc.herbert@intel.com>
The checks added in commit fc73578be7 ("drivers: Intel: SSP: ignore
config when SSP is already configured") also filter out cases where the
SSP parameters actually are modified in prepare state. This will happen
e.g. with a topology that has multiple configs for SSP and uses static
topology loading.
Modify the checks such that reconfiguration is done if:
- the config is actually modified,
- early MCLK/BCLK is not running.
BugLink: https://github.com/thesofproject/sof/issues/5375
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
The test scripts missed test component keyword change from e.g.
eqiir to eq-iir. Due to this the process_test() failed for IIR and
FIR for gain and frequency response due to wrong result expect.
The expected result is retrieved with the blob decode function. It
can be also used manually to check the filters defined in the
blob. The help texts in the decode functions needed fix. Also some
usage examples were added.
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
Currently we build separate topologies for TGL and CNL since their
io_clk's are different. Eventually, we'd need to unify these and let the
driver handle the blob selection in the kernel.
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
This enables codec_adapter and cadence/passhtrough codecs
with SOF on Zephyr.
passthrough codec can be used as it is, but cadence codec
will also need codec libraries from cadence.
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
With the current implementation argument 'adapter' was ignored
for each instance of the codec the sys_*_init function name was the
same.
Fix this by properly using 'adapter' name.
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
Two comp_err calls have mismatching formats and arguments. When built
with zephyr, comp_err() translates to printk which has better format
checks.
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
host driver uses DMA link counter to calculate stream position for
playback, but it is not fit for the following 3 cases:
(1) dai is enabled before host since they are in different pipelines
(2) multiple stream are mixed into one dai
(3) one stream is paused but the dai is still working with other stream
host uses stream_start_offset & stream_end_offset to deal with such cases:
if (stream_start_offset) {
position = DMA counter - stream_start_offset
if (stream_stop_offset)
position = stream_stop_offset -stream_start_offset;
} else {
position = 0;
}
When host component is started stream_start_offset is set to DMA counter
plus the latency from host to dai since the accurate DMA counter should be
used when the data arrives dai from host.
When pipeline is paused, stream_end_offset will save current DMA counter
for resume case
When pipeline is resumed, calculate stream_start_offset based on current
DMA counter and stream_end_offset
Signed-off-by: Rander Wang <rander.wang@intel.com>
The linear link position is only used by windows driver for
computing present position. When doing pause-resume operation
only zero data is reported by linear link position register.
Currently when stream is resumed after paused, dw-dma will
be first stopped and then started and the value of link position
register is cleared when it is disabled.
This patch will disable linear link position when the dma channel
is released
Signed-off-by: Rander Wang <rander.wang@intel.com>
Audio framework requires processed sample count
and audio driver gets processed bytes count and converts
to sample count, so fw doesn't need to calculate sample
count.
Signed-off-by: Rander Wang <rander.wang@intel.com>
The dma position is only used by ipc4 and host
requires it is initialized when the copier module
is initialized.
Signed-off-by: Rander Wang <rander.wang@intel.com>
When trigger.aborted is set, pipeline_trigger_run() also returns
PPL_STATUS_PATH_STOP. So the current test for trigger.aborted in
pipeline_task_cmd() after pipeline_trigger_run() is a left-over from
an earlier implementation and is never entered with the current flow.
In the current implementation, a typical playback topology like
[pipeline A] PCM -> ... - [pipeline B] mixer -> ... -> DAI
when a pause is triggered mixer will stop its propagation, set
trigger.aborted on pipeline B to true and return
PPL_STATUS_PATH_STOP. pipeline_task_cmd() is still running in the
context of pipeline A, so it will detect PPL_STATUS_PATH_STOP, check
that trigger.aborted is not set and terminate the task. Then the
scheduler will run the task for pipeline B, that one will verify,
that trigger.host == NULL, then find the trigger.aborted to be true
and will keep the task running.
In a topology, where the PCM, the mixer and the DAI all belong to the
same pipeline, when PAUSE is triggered, the whole pipeline should be
left running which is what this patch achieves by checkint
trigger.aborted when PPL_STATUS_PATH_STOP is returned by
pipeline_trigger_run().
BugLink: https://github.com/thesofproject/sof/issues/5257
Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>