This patch increases HPSRAM buffer size for TGL platform.
Thanks to this change we can provide KPB more space for
history data.
Signed-off-by: Marcin Rajwa <marcin.rajwa@linux.intel.com>
This patch changes the variable name history_depth to drain_req
as it is more understandable.
Signed-off-by: Marcin Rajwa <marcin.rajwa@linux.intel.com>
This patch adds critical section during update
of real time stream in draining task. There is a small possibility
that history data may get corrupted when real time stream preempt
draining at wrong moment.
Signed-off-by: Marcin Rajwa <marcin.rajwa@linux.intel.com>
TGL have hardware requirement that DSP should
use LPRO as clock source in waiti.
Signed-off-by: Adrian Bonislawski <adrian.bonislawski@linux.intel.com>
Kcontrol interface is needed to set the smart_amplifier algorithm
parameters at runtime for tuning purpose. This patch allows the
user to set parameters using byte kcontrol.
Signed-off-by: Dharageswari R <dharageswari.r@intel.com>
Currently, the testbench is built using the script named
'host-build-all.sh' under scripts directory. But the name of
the script, it's git history doesn't refer to what the script
is currently doing now.
The newly written script adds option to build the testbench.
This script was written in mind to remove the old script
used to build the testbench (i.e host-build-all.sh).
The script also adds an option to build the testbench with
AFL instrumentation. AFL fuzzer works well when the code
it's trying to fuzz is instrumented properly. The instrumentation
helps the fuzzer in generating unique inputs which cover
different paths in the code graph. When the option is set,
testbench is built using a compiler AFL provides, which does
the instrumentation work.
Signed-off-by: Mohana Datta Yelugoti <ymdatta.work@gmail.com>
atomic operations must use the value returned by the atomic_add() or
atomic_sub() operation rather than a subsequent (and non atomic) read.
Fix this by using values returned by atomic add() or sub()
Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Text saved to FILTER_KERNEL_PATH should be terminated with
new line, to indicate end of input and mark it redy to send
to FW in IPC message.
Fixes: 126060ae (logger: Send parsed runtime log levels to FW via debugFS)
Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
Usage of strstr for short version of logs level definitions
(for example 'e') leads to invalid level parsing, because first
log level with defined string (or letter) will be returned
(in this example 'verbose').
After change, log level will be returned only when name is
exactly as given one.
Fixes: b1fc9220 (logger: Parse runtime filter levels)
Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
When a DMA scheduling domain owner is deregistered, if there's still
another DMA channel active in the same domain, the ownership has to
be transferred. In this case even briefly disabling and re-enabling
DMA can cause over- or underruns. Avoid this by transferring domain
ownership transparently.
Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Use tr_err to have this initial message also in error logs and assert
traces works well.
Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
This log should be added just after buffer initialization,
to make it the first one in the output file - for easy identyfication.
Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
This patch fixes a segfault with null sof->sa pointer in
pipeline_schedule_copy() function. The bug has not been observed
with test topologies for processing pipelines but with other
topologies with fuzzer varied parameters.
The sa_init() is added to tb_pipeline_setup(). The scheduler_init_edf()
is a dependency. The two dummy functions platform_timer_get() and
clock_ms_to_ticks() are also added as dependency. The CMakelist for
library is edited to include agent.c build for testbench.
Fixes#3247
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
Some platforms, e.g. UP2 (APL+PCM512x) use non-standard DAI link
IDs. Let those platforms specify their IDs and still use the
generic DMIC topology template.
Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
This patch checks for the access type of kcontrol and returns error
only when the access type is not read or write.
Signed-off-by: Dharageswari R <dharageswari.r@intel.com>
This patch adds the smart amplifier get parameter byte kcontrol
to read the actual algorithm parameters from DSP during runtime.
Signed-off-by: Dharageswari R <dharageswari.r@intel.com>
This patch adds the support for read-only volatile byte kcontrol with
access type as read and volatile to read the actual values from DSP,
write-only byte kcontrol with access type as just write and read-write
volatile byte control with access type as read, write and volatile.
Signed-off-by: Dharageswari R <dharageswari.r@intel.com>
Modified initial configuration param for the smart amp.
Total number of feedback channels was changed from 8 to 4.
Assigned 4ch feedback to 0 ~ 3 slots.
Signed-off-by: Ryan Lee <ryans.lee@maximintegrated.com>
This patch will introduce additional client override flag to pm_runtime_get
Extra flag is not necessary but if used it will prevent from powering down
a core without the same flag
This will save a lot of time if quick changes are needed
eg. in dynamic hpro-lpro switching which on TGL will also require to
power up core 3
Signed-off-by: Adrian Bonislawski <adrian.bonislawski@linux.intel.com>
If in a topology the volume component ramp length (milliseconds) and
from it derived ramp update period is longer than pipeline copy()
schedule period the dev->frames (frames to process per per period) is
divided by zero. This error is not triggered by any of current
topologies.
The fix is to use dev->frames count as gain ramp update rate for
situations where the integer divider would round to zero. There is no
harm to update the gain at higher rate than suggested by topology.
Returning an error for such topologies also is not necessary since the
service is in such case done at better quality than requested. Finer
update grid results to less zipper noise.
Fixes commit 1b57609a1e ("volume: do not schedule ramping as separate task")
Fixes#3334
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
The mixer doesn't seem to work with these two formats, limit support
to S16_LE until the mixed is fixed.
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Align to provide same information for all audio processing, no reason
to be creative here.
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Switch to use CAPABILITY_FORMAT_NAME(PIPELINE_FORMAT) for all pipelines,
no matter there is PGA in it or not, the dai format is not important
here, as the pcm_converter will help.
This will help fix issue where we are claiming the wrong supported
formats in the PCM capability, e.g. our host buffer is allocated as
S16_LE so we can support S16_LE only, but with today's code it is
`S32_LE,S24_LE,S16_LE' in the pcm capability, so end user can run with
S24_LE or S32_LE and eventually end up to FW internal errors.
BugLink: https://github.com/thesofproject/sof/issues/3318
Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
Add a helper to generate supported formats of the PCM capability, it is
up to the pipeline format:
for s16_le pipeline, only S16_LE is supported.
for s24_le pipeline, both S16_LE and S24_LE are supported.
for s32_le pipeline, all S16_LE, S24_LE and S32_LE are supported.
For each pipeline, we should use CAPABILITY_FORMAT_NAME(PIPELINE_FORMAT)
in the PCM_CAPABILITIES definition.
Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
Using the same hardware timer for both "cpu_timer" and
"platform_timer" doesn't work, switch the "cpu_timer" to use
TIMER1 on Baytrail. This also fixes performance counters on
the platform.
Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
If user fails to provide a topology file, the tplg_file member
of structure tp is left uninitialized. This member is used to
check again if the file was provided, which won't be possible
unless this has been initialized to NULL and checked for NULL
after parsing arguments.
Signed-off-by: Mohana Datta Yelugoti <ymdatta.work@gmail.com>
"/sys/kernel/debug/sof/filter" file is responsible for updating
trace log levels. IPC message contain list of new trace threshold,
it is represented as single line in file where entries are separated
with ";". Single entry has form of:
"<uuid_id> <pipe_id> <comp_id> <log_level>"
Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
Parse arguments given in -F flag, in form where each -F argument
is given as separate line. Format of single -F entry is
`<log_level>=<component_list>`. <log_level> must corresponds with
.name field from log_level_dict. List of component are build from
elements separated with `,` and single element may have one of the
following forms:
"<name> <pipe_id>.<comp_id>" - single component instance
"<name> <pipe_id>.*" - components with given name on piepeline with pipe_id
"<name>*" - each component instance with given name or global component
"<name>" - as above
"* <pipe_id>.<comp_id>" - component on selected pipe_id with given comp_id
"* <pipe_id>.*" - each component on pipeline with pipe_id
"*" - each component in firmware
<name> must correspond values of uuid entries from ldc file.
Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
They will be needed during trace filering command parsing,
to skip whitespaces. As generic functions, their are placed
in misc file instead of any feature-related file.
Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
To parse filter configuration given by user, uuid dictionary
must be readed first from ldc file. Otherwise it's impossible
to validate given components names. This is reason why filter
configuration must be buffered and parsed in later steps.
Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
A few, general usage functions where implemented in converter file.
They should be moved to separate file, to make it easily accessible
form any source file. Moreover removing it from converter file, is a
part of this file cleanup.
Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
This conversion should be done in function, because of future usage
in different places, outside converter.c file.
Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
When streaming audio data on multiple DMA channels simultaneously cases
with 3 tasks (A, B, and C), scheduled on 2 DMA channels (X and Y), have
been observed, when one of the tasks wasn't scheduled. Usually when
scanning tasks in schedule_ll_is_pending() the following sequence would
take place:
channel task interrupt status
X A 1
X B 1
Y C 1
where the interrupt would be cleared in lines 2 and 3 above. However,
sometimes the following sequence takes place:
channel task interrupt status
X A 0
X B 1
Y C 1
which then leaves task A not scheduled, because similar to the first case,
the interrupt on channel X will be cleared in line 2. To fix this modify
schedule_ll_is_pending() to handle DMA channels / scheduling components
one after another.
Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
free() system call frees the memory space pointed to by
ptr, which must have been returned by previous call to
malloc(), calloc() or realloc().
Now, when incrementing the array pointer, we may have
exceeded the actual allocated size. If we do pointer arithmetic
and subtract size from the array pointer, we may not point to
the actual location returned by malloc().
This patch makes sure that when we do pointer arithmetic on array,
the array's value at the end would be same as the one returned
by malloc.
Signed-off-by: Mohana Datta Yelugoti <ymdatta.work@gmail.com>
After commit 048145fe60 ("pipeline: remove code related to preload")
buffers are no longer preloaded so we don't need to manually
update first period transfer.
Taking playback as an example, without this patch first period bytes
weren't copied downstream to DAIs removing typically first 0.1 seconds
from the input file.
With PCM streams this is not really noticeable. Anyhow, this becomes
a problem with compressed streams where we need every byte for
decompression.
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
This patch uses the functionality added by the c9e090ccf3 commit
to check for array size mismatch in various components.
Not doing so may result in cases, where we try to write into the
space not allocated leading to segmentation fault.
Signed-off-by: Mohana Datta Yelugoti <ymdatta.work@gmail.com>
This patch uses the functionality added by the c9e090c commit
to check for array size mismatch while loading topology
buffer.
Signed-off-by: Mohana Datta Yelugoti <ymdatta.work@gmail.com>
This patch uses the functionality added by the c9e090ccf3 commit
to check for array size mismatch in components.
Since, the components are in places other than tplg_parser, the
function which checks for the mismatch has been made an external
function from a static one. The function declaration has been
added to the tplg_parser header files, so that the function can
be used by any code which needs array size checks in components.
Signed-off-by: Mohana Datta Yelugoti <ymdatta.work@gmail.com>
This log allows to fully identify source code and check ldc
compatibility with FW by comparing source hash value saved in ldc
file with value received from FW in runtimee.
Without this mechanism it's impossible to
be sure about right connection without booting firmware
(to read fw_ready message content), because value of fw_hash
hasn't been provided in output logs file. This is especially
important during debugging process based on logs received by
client.
Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
GIT_TAG is user readable form of used source code version with
commit identifier, what is important for bugs reproducibility,
so it will be convenient to have this information in output logs.
Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
ABI version saved in fw_ready doesn't match with DBG_ABI version
saved in ldc file even for proper pair of fw and ldc file.
Moreover ldc file content changes at any log modyfication, what
is not related with DBG_ABI change, so this way of solving this
problem is incorrect.
Introduced src_hash value change solves both problems.
Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
This field will be used to compare ldc file with loaded fw version,
to assert validity of trace logs. Value used in sof-logger.
Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
It may be used to check FW compatibility with ldc file.
It's much better than comparing DBG_ABI because logs content
may be updated without any DBG_ABI change in opposite to source
code hash value.
Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>