It's not clear why the initial contribution used mclk ID1, mclk ID0 is
used by 99% of devices - and a manual inspection of NHLT supports that
claim. We will have to deal with the MCLK ID1 case with quirks.
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reset host position in ipc_stream_pcm_params before reply. It could avoid
that linux side get invalid value before host position updating. This
invalid value happens when running alsa conformance test and use pcm
pointer function to get host position value but see invalid value at
the beginning. After providing this patch, the invalid value will be
replaced with zero.
Signed-off-by: YC Hung <yc.hung@mediatek.com>
The position is currently updated by the host component when a
period was consumed. The granularity of this position is too large,
applications relying on timer-based scheduling may query the
position at any time and conformance test suites fail.
This patch introduce another field "cont_update_posn" in
sof_ipc_stream_params which suggests a more precise position
reporting, by storing the latest position in a memory window
when the host component completes a transfer. This will increase
the traffic to memory windows, but allow for a much smaller
granularity in position updates.
In hindsight, this solution should have been the default behavior
but to avoid backwards compatibility issues is added as a new
capability controlled by an ABI check. Only with a recent-enough
Linux kernel will this behavior be enabled.
Signed-off-by: YC Hung <yc.hung@mediatek.com>
Modify the signature of the process API in the module interface to pass
the input/output buffers along with the counts of the number of input
and output buffers.
Please note that the pass input/output buffers are not used at this
point. The codec implementations will be modified in the follow-up
patches to use them.
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Introduce 2 new structures to represent the input and output stream
buffers. These will be passed as inputs to the process API.
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Fix issue of ipc4 pipeline initialization with zephyr enabled.
Need to initialize these two components. Gain module is another
type of volume without peak volume support and mixin has subset
function of mixer.
Signed-off-by: Rander Wang <rander.wang@intel.com>
Zephyr recently added support for separate configs for 2-core and 4-core
variants of cAVS2.5. Use the new "tgph" configuration for when building
SOF for TigerLake-H variant.
BugLink: https://github.com/thesofproject/sof/issues/5018
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Use the new interface to initialize non-primary cores before
enabling them with arch_start_cpu(). This interface is not
available in Zephyr 3.0.0, but is mandatory in later release.
Depends on Zephyr commit 2b210cb3db05 ("kernel: Refactor SMP cpu
initialization a bit").
BugLink: https://github.com/thesofproject/sof/issues/5456
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
z_wrapper_cpu_enable_secondary_core() may be called
repeatedly on a core that is already running. Add a check
to ensure we do not try to restart a core that is already
running.
Also add a check for ready_flag as done in upstream Zephyr
kernel/smp.c to ensure z_wrapper_cpu_enable_secondary_core()
does not return until the target core has finished its
startup and arch_cpu_active() returns true.
BugLink: https://github.com/thesofproject/sof/issues/5446
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
This reverts commit 58ce6e6860.
This commit has caused the DMA trace to be frequently empty on a number
of ADL and TGL in daily runs for two days in a row (test runs 10429 and
10459).
The DMA trace could be completely empty in the past but that was on
different platforms and a very long time ago, this had been fixed in
bug #4333 and had not happened for many months.
The _only_ commit difference between the last successful test
run (10402) and the first failing one (10459) is this commit.
Signed-off-by: Marc Herbert <marc.herbert@intel.com>
When DSP enter suspend:
1.Define CLK_SUSPEND_CPU_HZ 26M for DSP suspend frequency and turn
off adsp pll clock to avoid unexpected behavior after resume.
2.Increase wait for interrupt level to 15 to avoid unexpected interrupts.
3.Remove XT_WAITI_DELAY for LX7.
Signed-off-by: YC Hung <yc.hung@mediatek.com>
Fix a regression issue on windows. Need to invalidate dcache
for host message or FW will get garbage data.
Signed-off-by: Rander Wang <rander.wang@intel.com>
This patch adds FIR function that computes two samples per call
it reduces the coefficients and PCM data accesses. Saving from
original FIR is 34 MCPS from 134 MCPS to 100 MCPS.
The samples include constrain of FIR coefficients length to
be multiple of four and add two into delay line length to have
room for two input samples while keeping the length even.
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
This change saves 18 MCPS as gcc build build for xtensa on TGL-H
from 134 MCPS to 115 MCPS in a stereo 48 kHz 64 tap filter case.
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
The new samples processing loop uses audio_stream_without_wrap()
function to loop maximum amount of frames without source and
sink buffer pointers wrap check.
In a test with TGL-H and gcc build the performance was improved by
this patch 9.2 MCPS from 140 MCPS to 130 MCPS.
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
This patch prevent driver from requesting FW to enter D0 state when
there are still active pipelines.
Signed-off-by: Tomasz Leman <tomasz.m.leman@intel.com>
This patch refactors the SetDX handler to avoid entering infinity loop.
Secondary cores are enabled/disabled in loop iterating from 1 to
CONFIG_CORE_COUNT. Primary core is disabled at the end, because it's
required that all secondary cores to be already disabled. If all
conditions are met, FW can enter the D3 state.
Signed-off-by: Tomasz Leman <tomasz.m.leman@intel.com>
With Zephyr, spinlock.h needs to know `struct k_spinlock`
definition.
Include, Zephyr's <kernel.h> header.
This fixes compile time warnings like this:
z/modules/audio/sof/zephyr/../src/include/sof/schedule/ll_schedule_domain.h:
In function 'domain_init'"
z/modules/audio/sof/zephyr/../src/include/sof/schedule/ll_schedule_domain.h:93:18:
warning: passing argument 1 of 'k_spinlock_init' from incompatible
pointer type [-Wincompatible-pointer-types]
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
Some builds require more memory, hotword can be handled by CRAS so lets
add the ability to drop it. The 16kHz dmic is not needed either so lets
drop that too.
Signed-off-by: Curtis Malainey <cujomalainey@chromium.org>
This will allow users to pass NULL to buffer_free.
This fixes codec_adapter_free crash, where mod->local_buff is only
allocated when the module is prepared.
With dynamic pipelines we could have the situation where the pipeline
is created then SOF device enters suspend and pipeline is destroyed.
Thus we try to free unallocated mod->local_buf. Fix this by allowing
buffer_free to live free when receiving a NULL pointer.
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
Include dmic-generic conditionally based on NUM_DMIC's and add nhlt
build support in CMake variables.
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Move all defaults variable definitions to dmic-default.conf. These should
be included by all topologies before overriding the defaults with
platform-specific or machine-specific definitions.
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
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>