Introduced solution is more elegant and reliable because of
masking given argument in SET_BITS.
Moreover remove unused masks which usability is taken by SET_BITS
macro with given bits range.
Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
The two functions in sof/audio/format.h are renamed to more descriptive
get_sample_bytes() and get_frame_bytes() to avoid potentially same
name variables to shadow the inline functions defined in the header.
The shadowing happened in component ASRC. The DAI component and another
header audio_stream.h uses these functions and needed minor edits.
Reported-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
This patch removes redundant code. The local variables update were
remains of executing the changed if statements as while loop. Since
it is no more done the code can be simplified.
Reported-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
This commit removes unused output_rate field from
comp_dev struct. If needed, component can retrieve
rate parameter from sink/source buffers.
Signed-off-by: Bartosz Kokoszko <bartoszx.kokoszko@linux.intel.com>
Overwrite frame_fmt hardware parameters with DAI private frame_fmt
in dai_comp_get_hw_params() function as DAI component is able to
convert stream with different frame_fmt's
Signed-off-by: Bartosz Kokoszko <bartoszx.kokoszko@linux.intel.com>
Changes implementation of notifications allocation.
Instead of using common empty list of messages let's
switch to allocating message per source of notification.
This way we won't have problem with memory and lack of
empty messages and also we will be able to optimize memory.
Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
Adds helper methods for IPC notifications allocation and free.
This way we can allocate only the size we need without preallocating
the maximum size. Free operation automatically handles synchronization.
Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
Adds improved implementation for sending IPC notifications
to host. New function takes ipc_msg directly and adds
it to message queue if message is not already there.
Also critical notifications will be sent right away
or added to the beginning of the queue if sending fails.
Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
Returns status -EBUSY, when IPC upstream channel is
currently busy and notification cannot be sent.
Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
Adds additional parameter to control whether upstream IPC
channel is currently free or not. It's helpful in case
for some reason checking IPC bits is not enough.
Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
In such a solution it is possible to assign BIT(31) to
uint32_t register value without any warning.
Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
Fix false positive return value for upsupported platforms.
Fix wrong parameter passed in when mutliple platform test.
Signed-off-by: Pan Xiuli <xiuli.pan@linux.intel.com>
This commit moves fetching mux/demux processing functions from
mux_prepare() to mux_set_values(). It insures us against
situation when we fetch proc_func in mux_prepare() and
after that comes mux_set_values() with new mux config.
Signed-off-by: Bartosz Kokoszko <bartoszx.kokoszko@linux.intel.com>
Fix cppcheck warning:
[src/drivers/dw/ssi-spi.c:111]: (style) struct member
'spi_reg_list::ctrlr1' is never used.
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Fix cppcheck warnings
[src/audio/kpb.c:202]: (style) Variable 'temp_ca_size' is assigned a
value that is never used.
[src/audio/kpb.c:742]: (style) Variable 'current_time' is assigned a
value that is never used.
[src/audio/kpb.c:946]: (style) Variable 'local_buffered' is assigned a
value that is never used.
[src/audio/kpb.c:948]: (style) Variable 'drain_interval' is assigned a
value that is never used.
[src/audio/kpb.c:954]: (style) Variable 'period_bytes_limit' is
assigned a value that is never used.
[src/audio/kpb.c:984]: (style) Variable 'local_buffered' is assigned a
value that is never used.
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Fix cppcheck warning (ret not modified between two returns).
[src/audio/detect_test.c:700] -> [src/audio/detect_test.c:710]:
(warning) Identical condition 'ret', second condition is always false
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Introduce SSTSA_TXEN and SSRSA_RXEN macro to define bit value in
header file instead of usage raw value in source code.
Moreover use SET_BITS to set Rx/Tx slot value.
Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
This enum code, and whats more important, related structures is
unused in whole source code, so it shouldn't be kept.
Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
It's a part of ABI interface, so enum value shouldn't change
for example after removing some old enum code.
Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
This conversion in source code looks quite magic. It should be described
in header file where are registers bits description.
Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
When some error occur during fopen routine, then errno should be
returned instead of success code.
Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
The sof-logger and potentially other debug API clients perform ABI
compatibility check using the single FW ABI version. The same one is used
by the primary FW client which is the kernel driver. If there is a change
made to the debug API, the main ABI has to be updated to protect integrity
of the debug tools while such a change may not affect the kernel driver
at all.
This patch introduces new debug ABI version to be increased when changing
user space debug interfaces while the the main ABI is not affected.
Recompilation and installation of the new driver every time the tunneled
debug protocol is upgraded may be avoided.
Signed-off-by: Marcin Maka <marcin.maka@linux.intel.com>
There was missing argument in file_get_hw_params, what breaks compilation.
Fixes: 2b84838 ("Testbench: Instantiate file component as host")
Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
This patch updates the SRC to run with the updated test topologies
set. The script is also cleaned up a bit.
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
This patch updates the load_aif_in_out(), load_dai_in_out(),
and load_pipeline() calls similarly as done for testbench to
prevent the Fuzzer build fail.
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
This patch fixes the fail to execute tests due to recent pipeline
updates. Now the fileread and filewrite component is instantiated
as host or DAI depending on stream direction. The DAI file component
is added the capability to report HW stream parameters. In testbench
case the stream parameters originate from command line parameters.
The file params() handling is updated to be similar as in other
components to successfully propagate the parameters.
The added capture pipelines support is not fully functional and will
be fixed later.
The testbench cleanup includes elimination of global variables for
certain component ids. The needed misc parameters were added to
testbench parameters struct that is passed through most topology
parsing functions.
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
This patch updates the tplg-build.sh script by omitting DMIC capture
test topologies generation, tone topolgies generation due to no
use and no maintenance. They can be fixed later.
The all DAI permutations are generated only for volume pipeline. The
src is removed. Instead a new algorithms topologies generation loop
is added for UP2 (APL) compatible topologies. The algorithms are
ASRC, FIR, IIR, and SRC.
The test-all, capture, playback macros are updated to use
PIPELINE_PCM_ADD and set up DAI for SCHEDULE_TIME_DOMAIN_TIMER. The
duplication of TEST_DAI_PORT in macro call is replaced by 0 to
prevent topology load fail on device.
The test-equalizer-playback-ssp.m4 is removed as obsolete.
Pipelines are added for FIR and IIR playback and capture. SRC playback
pipeline is improved by making tokens instance specific. The SRC
capture pipeline macro is only cosmetically improved.
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
The previous copy() function frames computation code contained
a mistake that unnecessarily prevented the filter core to access
more than nominal amount of samples from source buffer in pull mode.
It have corrupted occasionally input PCM samples and possibly
could have stalled the algorithm with an impossible processing amount
constraint.
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
Implement buffer lifecycle callbacks to properly handle extraction
from probe. Implement probe data packet header generation and sending
it along with data from buffer via extraction DMA.
Signed-off-by: Adrian Bonislawski <adrian.bonislawski@linux.intel.com>
State of probes subsystem is being updated and properly reported back
via INFO functions. DMA is being set up to perpare for transfer of
probe data.
Signed-off-by: ArturX Kloniecki <arturx.kloniecki@linux.intel.com>
Signed-off-by: Adrian Bonislawski <adrian.bonislawski@linux.intel.com>
Sets buffers to inter-core if they are connecting components
from different cores. From now on FW supports pipelines,
where some of the components are offloaded to slave cores.
Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
Implements remote operations for params, prepare, trigger
and reset calls. If the target component is running on
different core, we should send IDC in order to execute
appropriate operation.
Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
Adds buffer locking and unlocking in audio components
where it's needed. We need to retrieve the latest values
of available and free sizes in copy functions and also
use lock in case of making changes in params and prepare
methods.
Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
Calls buffer_invalidate and buffer_writeback in audio components
processing functions. It is required to achieve data synchronization
in case buffers are inter-core.
Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
Extracts buffer content invalidation and writeback functions.
They are always used for DMA buffers and also need to be used
for inter-core buffers.
Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
Changes implementation of comp_get_copy_limits function.
It now takes source and sink buffers, so they can be
available outside of the function. It will matter with
inter-core buffers, when synchronization will need to be kept.
Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>