Make SCHEDULE_LL_STATS_LOG_EVERY_OTHER_WINDOW=y the default.
This in practise filters out the impact of the stat logging
from the results. Another impact is that logging rate is halved
to once per two seconds with the new default settings.
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Change the logic how overrun count is reported out in the
low-latency scheduler statistics reporting. Instead of resetting
the overrun count after every window, keep a cumulative count
of overruns seen. Overruns are in practise a rare occurrence and
this change makes the CONFIG_SCHEDULE_LL_STATS_LOG_EVERY_OTHER_WINDOW
option more useful as one can still track overruns for all
executed iterations, even if reporting is done at a slower pace.
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Add Kconfig options to enable and disable the low-latency
scheduler statistics reporting, and to set the window size.
Also add an option to set reporting to be done only for every other
statistics window. This can be useful to exclude impact of
the logging itself. With most current configurations and logging
backends, printing out the scheduling report at the end of
the window, will show up as an execution time spike on the first
iteration of the subsequent measurement window. This can mask
spikes caused by other components in the system.
Defaults match the earlier settings hardcoded in code, so this commit
has no functional change.
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
This patch adds unit test for the inverse function used in DRC
component. The function is tested with all used Q-formats
for input and output with 500 points in the positive int32_t
range. Negative numbers are not tested since the DRC specific
function inverse function does not need and implement it.
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
This patch adds to unit tests platform unit_test to be able
to add new Kconfig enables without altering configuration of
of other production platforms.
The used platform for the purpose is MTL to be able to unit
test code for HiFi4. Components/features to test can be
freely added to unit_test_defconfig.
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
rt713_vb on SoundWire link 2 and rt1320 on SoundWire link 1 and 3.
Which is another configuration of Realtek Gen6 AIOC.
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
rt713_vb on SoundWire link 2 and rt1320 on SoundWire link 1 and 3.
Which is another configuration of Realtek Gen6 AIOC.
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
rt712_vb on SDW link2 and 1 rt1320 on SDW link2.
This is one of the audio configurations on Realtek Gen6 AIOC.
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Implement wait_delay*() variants with k_busy_wait(). If some
target requires to customize the busy wait implementation,
this can be done with Zephyr CONFIG_ARCH_HAS_CUSTOM_BUSY_WAIT.
Remove idelay() as this is no longer used in generic SOF code.
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Prepare to remove idelay() use from generic code, so it can be removed
from the SOF rtos abstraction layer. This is Zephyr specific code,
so k_busy_wait() can be used directly.
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Prepare to remove idelay() use from generic code, so it can be removed
from the SOF rtos abstraction layer.
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Prepare to remove idelay() use from generic code, so it can be removed
from the SOF rtos abstraction layer.
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
The HiFi4 build is looking for enable only from the
configuration blob and the ALSA switch control has no impact.
This change unifies the operation with generic and HiFi3
builds.
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
Use of native Zephyr DAIs has no dependency to SOF platform
definitions anymore, so this include can be removed.
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Stop using the SOF platform layer and directly pull the hardware
properties from devicetree.
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
To calculate the gateway count in hardware config IPC response,
ALH bidirection link count is needed.
Instead of pulling this from the SOF platform layer, use
the ipc4/alh.h directly as it now has this information.
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Stop using platform layer to query number of SSP instances
and number of HDA in/out DMA channels. The hardware specific
information is already defined in device tree data, so no need
to have same information duplicated in SOF platform layer.
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
The alh.h headers have used SOF platform layer to handle
differences between different Intel ALH generations. In the end
the only difference is the encoding used for DAI index.
Move the variation to ipc4/alh.h directly as this only affects
Intel builds with ALH support.
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
The unnecessary shift and multiply functions can be removed
with use of normal C shift left and with use xtensa multiply,
shift, and round intrinsics directly in the function.
This change saves in TGL HiFi3 platform 1.3 MCPS in DRC
processing mode.
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
There was no unit test for the function, so it is added. The
pass criteria is tuned for current implementation to just
pass in the three defined regions. It is useful to verify
the next changes to optimize the function.
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
PLATFORM_DEFAULT_DELAY is not needed in Zephyr builds, so it
can be dropped from platform.h for all Intel platforms.
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
A new definition has been added, which is crucial for the proper
execution of the test test_102_08_extended_time_check.
This definition ensures the correct operation of the
basefw_get_ext_system_time() function.
Signed-off-by: Grzegorz Bernat <grzegorzx.bernat@intel.com>
Add explicit dependency to CONFIG_DMA_INTEL_ADSP_HDA as the current
chain DMA uses HDA definitions in its implementation.
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
cpu.h definition is no longer needed in platform definitions for
SOF Zephyr builds. Remove for all Intel targets.
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Remove dependency to platform cpu.h layer for Zephyr targets. The lib/cpu.h
is now common to all SOF targets when building for Zephyr.
Add a note to PLATFORM_PRIMARY_CORE_ID documentation that "primary core"
is a SOF/application convention and not visible in Zephyr OS interfaces.
Core 0 is the boot core in Zephyr, so use this definition as
PLATFORM_PRIMARY_CORE_ID for all SOF targets. This was already the case
in all platform definitions, so no functional change.
In SOF, the primary/secondary distinction is primarily used
in IPC code, together with Zephyr CONFIG_SMP_BOOT_DELAY=y.
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
The rt1320 could use the same SoundWire link as rt712. In that case
there is still one rt1320, but the NUM_SDW_AMP_LINKS should be 1.
Name the tplg with the exact link number to avoid confusing.
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
PTL blobs are different for I2S. This entry will create a
topology for I2S MAX98360a(SSP1), RT5682(SSP0) codecs, BT
at SSP2 and PDM0, PDM1 DMIC.
This also enables deep buffer for speaker and headset
Signed-off-by: Uday M Bhat <uday.m.bhat@intel.com>
This patch addresses an issue with incorrect IPC responses due to the
lack of cache flushing and invalidation on secondary cores.
The following changes have been made:
1. Added cache writeback for IPC message data in `ipc_msg_send` when the
current core is not the primary core.
2. Added cache invalidation for IPC message data in
`ipc_prepare_to_send` before writing to the mailbox.
These changes ensure that the IPC data is correctly synchronized between
cores.
Signed-off-by: Tomasz Leman <tomasz.m.leman@intel.com>
During assignment of ipc4_base_module_cfg, received in
Init Instance IPC, to sof_ipc_stream_params valid_bit_depth is used
to set frame_fmt instead of container size. It is then applied to
buffer format in params/prepare stage. Thus, leads to inconsistency
between buffer format and audio stream params provided in IPC.
Signed-off-by: Ievgen Ganakov <ievgen.ganakov@intel.com>
All control structures of buffers shared between cores
are now stored in a non-cached memory alias.
Cache writeback is no longer needed here
Signed-off-by: Marcin Szkudlinski <marcin.szkudlinski@intel.com>
This commit modifies both existing buffers implementations
to use simplified API for sink/source/audio_buffer
Signed-off-by: Marcin Szkudlinski <marcin.szkudlinski@intel.com>
There are 3 APIs each buffer must implement (Sink/src/audio_buffer)
for data producers/consumers/maintenance
each of them need to have methods doing same operations - like settings
stream parameters
this commit provides simplification for buffer implementation -
it is enough to implement those methods for audio_buffer API, default
handlers for sink/src will propagate calls accordingly
Specific handlers for sink and source may still be provided
i.e. in case when sink or source API is not provided by a buffer
but some other data producer (i.e. DAI)
Also a default implementation of .audio_set_ipc_params is provided,
that probably will fit needs of all buffers' implementation,
except of currently used legacy comp_buffer
Signed-off-by: Marcin Szkudlinski <marcin.szkudlinski@intel.com>
clean method does clean all buffer data
leaving config as is
Need to be implemented as virtual method
as is implemented difrently in each buffer type
Signed-off-by: Marcin Szkudlinski <marcin.szkudlinski@intel.com>
The document is updated after changing build default to IPC4
and to show usage of added helper scripts.
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
This patch adds scripts sof-testbench-helper.sh and
sof-testbench-build-profile.sh to ease audio module
developer's frequent tasks.
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
The configuration blob is checked in drc_prepare(). If
the blob does not have params.enable set, then it is safe
to switch to a more efficient buffer copy function that
bypasses the internal DRC lookup delay with channels
de-interleave and interleave operations. The enable in the
blob is a master switch for DRC. With such configuration in
the blob the switch control from user space can't switch the
processing on. Therefore it is safe to change the processing
function. This change minimizes the MCPS overhead of unused
DRC and reduces audio latency.
If a new blob is received during streaming, the params.enable
is checked again and the processing function is set again
if the pass-through copy mode was in use. If the new blob
has enable false, then the processing is changed to pass-through
mode.
The pass-through blob configuration is useful when the same
pipeline is used for both headphone and speaker, where DRC
is usually disabled for headphone mode.
This change saves in hda-generic topologies with the default
blob about 1.2 MCPS in TGL platform.
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
rt712_vb on SDW link2 and 1 rt1320 on SDW link2.
This is one of the audio configurations on Realtek Gen6 AIOC.
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Changed adsress -> address, also the comments are edited to avoid
to be mistaken as Doxygen.
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
Add HiFi5 implementation of volume functions, compared with
HiFi3 version, can reduce about 28% cycles.
Signed-off-by: Andrula Song <andrula.song@intel.com>
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
Remove CONFIG_SOF_ZEPHYR_STRICT_HEADERS and make strict headers mode the
only supported way to build SOF with Zephyr. This means SOF Zephyr
builds do not use any headers from sof/xtos/include anymore.
This change simplifies the SOF build as full RTOS adaptation is
in sof/zephyr/include for Zephyr builds.
Link: https://github.com/thesofproject/sof/issues/9015
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Add support for 6 channel and 8 channel amp feedback.
The host-copier defaults provide 2 channel stereo and 4 channel 3.1.
Use the value of AMP_FEEDBACK_CH to set special case input and output
formats for 6 channels and 8 channels.
The alh-copier also needs special cases for 6 and 8 channels.
Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Replace the hardcoded assumption of 2 feedback channels per link
A new constant AMP_FEEDBACK_CH_PER_LINK is added to set the number of
channels for the link BE DAI, replacing the original hardcoded value
of 2.
The default values are:
For NUM_SDW_AMP_LINKS=1:
AMP_FEEDBACK_CH=2, AMP_FEEDBACK_CH_PER_LINK=2
For NUM_SDW_AMP_LINKS=2:
AMP_FEEDBACK_CH=4, AMP_FEEDBACK_CH_PER_LINK=2
The alh-copier definition has been rewritten so that it is based only on
AMP_FEEDBACK_CH, instead of making assumptions from NUM_SDW_AMP_LINKS.
It supports 2 or 4 total feedback channels. Support for 1 and 3 feedback
channels has not been included because these are unusual and the code is
smaller without them. They can be added later if they are needed.
Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>