Previously sof-icl-nocodec topology only enabled SSP0. To effectively test
more test cases, this enables more playback and capture pipelines with
SSP1, SSP2 and DMIC3.
Signed-off-by: Fred Oh <fred.oh@linux.intel.com>
When a DAI_CONFIG IPC is sent from the driver for a particular
DAI type and index, all DAI components that match the type and index
are configured. When all components are set up during topology
loading, this isn't really much of a problem as all DAI_CONFIG
IPCs will be sent at that time as well ie there is no active
playback/capture. But with dynamic pipeline loading, the playback
and capture DAIs will be individually configured whenever the
respective pipeline is started. This will end up with errors both
when configuring the SSP and when configuring the DAI comp itself.
So, ignore the request to configure the SSP and the DAI comp
that is already active so that the other DAI comp can be
configured successfully when its pipeline is set up.
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Read whole DSM parameters including non-volatile parameters
from DSM component instead of reading cache.
The function is added for the diagnostic purpose.
Signed-off-by: Ryan Lee <ryans.lee@maximintegrated.com>
DSM is re-initialized when the format is changed.
DSM parameters loaded from the blob before re-init
is not safe for the re-init process
Parameter re-configuration is necessary after re-init.
'maxim_dsm_restore_param' was added for this purpose.
Signed-off-by: Ryan Lee <ryans.lee@maximintegrated.com>
Support dynamic bit deptch conversion on runtime.
Re-initialize DSM if the frame_fmt is changed.
Signed-off-by: Ryan Lee <ryans.lee@maximintegrated.com>
Changed variable x to idx and variable y to ch because x and y are
not good name for an iterator.
Signed-off-by: Ryan Lee <ryans.lee@maximintegrated.com>
At this point PLATFORM_DCACHE_ALIGN is equal with DCACHE_LINE_SIZE
which on i.MX boards is 128.
Functions like rmalloc and rzalloc are allocating memory aligned at
PLATFORM_DCACHE_ALIGN bytes. This means that blocks under 128 bytes
are not really used and blocks sized > 128 are preffered for small
allocations.
This seems to be an unnecessary overhead which results in SOF not
being abel to allocate memory for simple pipelines (e.g simple
pipeline with a mixer).
For this reason, we set PLATFORM_DCACHE_ALIGN to a smaller value
(sizeof(void*)) but keep HEAP_BUF_ALIGNMENT unchanged.
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
The comment implies that it's looking for what Zephyr knows as the
"cavs_timer" driver, but the test was specifying an old (and AFAICT
SOF-specific?) kconfig. Use the one that corresponds to the actual
driver selection.
Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
This kconfig variable no longer exists in upstream Zephyr (the feature
it used to control is now zero-overhead and always enabled).
Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
IS_ENABLED and ARRAY_SIZE exist in effectively identical forms in the
Zephyr headers already. Disable the SOF definitions when building
with Zephyr to avoid the macro redefinition collision. Likewise
__unused gets defined twice.
Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
If we are fuzzing we can get the trace system into a state where it
tries flush dma and overshoot the mailbox boundary.
Signed-off-by: Curtis Malainey <cujomalainey@chromium.org>
The SSSR_BSY is not necessary for flushing, we need to read out entries
every time the FIFO is not empty. This flushing may need take place
several rounds, and we need to wait 1 sample time between 2 flushing
rounds.
Fixes#3525
Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
Add helper clock_ticks_per_sample() to calculate and return the clock ticks
for a specific sample rate.
Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
We cannot assume the build will always be 32bits, therefore when casting
an int to a ptr use uintptr_t
Signed-off-by: Curtis Malainey <cujomalainey@chromium.org>
We are using int types in this header, we need inttypes.h otherwise
sometimes we fail to build.
Signed-off-by: Curtis Malainey <cujomalainey@chromium.org>
Implemented s24 and s32 sample format cases of both pass and default
functions.
Because both s24 and s32 cases use 32-bit samples for source/sink stream
while s16 case uses 16-bit, for pre_delay_buffers, it followed as well
(32-bit for s24/s32, 16-bit for s16). One special note is that we <<8 when
storing samples from source to pre_delay_buffers, and >>8 when loading from
pre_delay_buffers. It makes 32-bit samples in pre_delay_buffers are always
Q1.31 in both s24 and s32 cases.
In common functions (e.g. drc_compress_output), sample byte information is
required to pass if the function has the operation of pre_delay_buffers, to
distinguish 16-bit and 32-bit sample cases.
Signed-off-by: Pin-chih Lin <johnylin@google.com>
In drc_generic.c and drc_math_generic.c, all floating-point math functions
are removed, and all float vaiables are replaced by fixed-point (int32_t)
variables with the appropriate precisions. It is verified that the
fixed-point replacement only lead to quite insignificant MSE errors among
all test patterns.
- Multiplications are replaced by Q_MULTSR_32X32 with the appropriate
precisions.
- Divisions (x/y) are replaced by Q_MULTSR_32X32(x, inv(y)), where inv(y)
is approximated 1/y by polynomial functions generated by fpminimax of
Sollya with rexp optimization.
Signed-off-by: Pin-chih Lin <johnylin@google.com>
Replaced the config coefficient "attack_frames" by "one_over_attack_frames"
(=1/attack_frames). It is because only "one_over_attack_frames" is used by
firmware and it could save a division operand by the replacement.
Signed-off-by: Pin-chih Lin <johnylin@google.com>
Implemented the following fixed-point functions for the approximation of
math calculations in drc_math_generic.c. fpminimax of Sollya is used for
generating a good polynomial approximation of wanted functions.
logf(x)
- Input is Q6.26: max 32.0
- Output range ~ (-inf, 3.4657); regulated to Q6.26: (-32.0, 32.0)
linear_to_decibels(x)
- Input is Q6.26: max 32.0
- Output range ~ (-inf, 30.1030); regulated to Q11.21: (-1024.0, 1024.0)
asinf(x)
- Use two-step polynomial approximation among [0, 1] whose pivot point is
1/sqrt(2)
- Input is Q2.30: (-2.0, 2.0)
- Output range: [-1.0, 1.0]; regulated to Q2.30: (-2.0, 2.0)
powf(x, y)
- Input x is Q6.26: (-32.0, 32.0); y is Q2.30: (-2.0, 2.0)
- Output is Q12.20: max 2048.0
Signed-off-by: Pin-chih Lin <johnylin@google.com>
We are leaking memory if the host sends bad messages to the firmware
since we are not freeing the buffer.
Signed-off-by: Curtis Malainey <cujomalainey@chromium.org>
This commit adds demux_prepare_active_look_up()
function. It contains channel parameter checking.
Look up table should not include elements referring
to channels higher than those actually set in
source/sink buffers.
Signed-off-by: Bartosz Kokoszko <bartoszx.kokoszko@linux.intel.com>
This commit adds channel parameter checking in
mux_prepare_active_look_up() function. Look up
table should not include elements referring to
channels higher than those actually set in
source/sink buffers.
Signed-off-by: Bartosz Kokoszko <bartoszx.kokoszko@linux.intel.com>
This patch extends codec processing topology with C_CONTROLS
which comprises of SETUP configuration for both SoF component
and CADENCE codec.
Signed-off-by: Marcin Rajwa <marcin.rajwa@linux.intel.com>
This patch adds a processing topology which uses external
codec for processing. This topology comprises of:
HOST -> CODEC_ADAPTER -> DAI
So the only processing component is codec_adapter which can be
configured to work with any codec.
Signed-off-by: Marcin Rajwa <marcin.rajwa@linux.intel.com>
This implements a middle layer between the SoF component
codec_adapter and specific codec. For example, the SoF component
may receive a prepare request from the driver, so it prepares itself
(assigns sink/source buffers, check states, etc) and then calls this
middle layer which proceed with codec specific preparation. The exact
same scenario happens for any other interface as well.
Signed-off-by: Marcin Rajwa <marcin.rajwa@linux.intel.com>
This introduces new SoF component called "codec adapter".
It provides means to process samples through external codec
libraries. This part implements only the SoF component.
Signed-off-by: Marcin Rajwa <marcin.rajwa@linux.intel.com>
Before switching off memory, IPC_HOST_BASE literal value should
be moved to register, in order to avoid accessing to disabled
memory.
Signed-off-by: Bartosz Kokoszko <bartoszx.kokoszko@linux.intel.com>
Before switching off memory, IPC_HOST_BASE literal value should
be moved to register, in order to avoid accessing to disabled
memory.
Signed-off-by: Bartosz Kokoszko <bartoszx.kokoszko@linux.intel.com>
Modified traces are quite verbose so should be done
with tr_dbg() function to reduce messaging noise in
non-verbose scenario.
Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
This fixes compilation with:
CFLAGS=-fno-common ./scripts/rebuild-testbench.sh
sof/tools/testbench/topology.c:24: multiple definition of `lib_table';
sof/tools/testbench/testbench.c:39: first defined here
This was detected by Gentoo 10 which uses -fno-common by default, thanks
Guennadi for the report and investigation.
Commit 03067c6c77 ("host: set up shared library table") introduced a
strange "lib_table" symbol that was apparently meant to be global but
was not really because of some confusion between arrays and pointers and
needed to be passed around and "initialized to itself" (!) at run time
as seen in the sample trace below:
topology.c
struct shared_lib_table *lib_table;
parse_topology(..., library_table,...)
{
printf("DEBUG1 ----- %p, %p, %p\n",
&lib_table, lib_table, library_table);
lib_table = library_table;
printf("DEBUG2 ----- %p, %p, %p\n",
&lib_table, lib_table, library_table);
}
Log:
DEBUG1 ----- 0x56298c954040, 0x56298c951183, 0x56298c954040
DEBUG2 ----- 0x56298c954040, 0x56298c954040, 0x56298c954040
Signed-off-by: Marc Herbert <marc.herbert@intel.com>
Used the similar parameter set as the DRC kernel in CRAS to generate ctrl
bytes for DRC component.
Plotted input-output dB response curve with the specific parameter set.
Signed-off-by: Pin-chih Lin <johnylin@google.com>
"make + make install" duplicates many steps, probably because of the
fatal combination of build timestamps + source hash, see PR #3353 for a
similar example.
A single, combined "make install" generates the exact same binary
outputs 30% faster and prints 30% shorter build logs.
Signed-off-by: Marc Herbert <marc.herbert@intel.com>
Assertions don't show proper location for functions implemented
in header file.
Before changes, example location of this assert was:
Location: src/audio/pipeline.c:303
Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
Included changes:
0d2af68a9e gitignore: Add checkpatch temporary file to gitignore
8249abfa11 toml: Keep available manifest parsers in list
c98a29da14 toml: Extract version parsing to separate function
b9cf1aeb3b pkcs1_5.c: don't pretend everything is fine when failing to sign
e87db0f080 pkcs1_5.c: intermediate named constants in ri_manifest_sign_v1_x()
86754c1389 hash: Assert memory overflow during hash calculation
37323face2 Merge pull request #28 from marc-hb/copy-sram-overflow
7322c02349 manifest.c: assert buffer overflow in man_copy_sram()
Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
After experiments I found that current SDMA watermark
causes SDMA to miss SAI DMA requests.
The empirical value was chosen so that watermark is a
divisor of min(bd_count, fifo watermark).
Of course this needs to be revisited, but for now "it just works" (tm).
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>