Audio driver only create single buffer but SOF requires
double buffer. Since obs should be equal to ibs, buffer
size will be set to obs * 2.
Signed-off-by: Rander Wang <rander.wang@intel.com>
Ipc4 stream have container size and valid sample size.
In windows system, container size is normally 32bit
and valid sample size is 16bit or 24bit rely on system
setting. Currently host and dai component are included
by copier module to manage gateway. These two components
don't support container size and all the code is designed
for the case that container size is always equal to valid
sample size.
To avoid affecting current IPC3, this patch adds endpoint
buffer to support host or dai in a way that endpoint buffer
uses the same container and valid size and copier will do
the conversion between endpoint buffer and ipc4 buffer since
copier also supports format conversion.
Signed-off-by: Rander Wang <rander.wang@intel.com>
Sample format is alway equal to container format for
ipc3 case but it is not true for ipc4, .e.g sample format
is S16_LE but container format will be S32_LE. This patch
adds container_fmt for ipc4 to do stream copy.
Signed-off-by: Rander Wang <rander.wang@intel.com>
When the string fields left empty, the alsa topology parser treats
SND_CONFIG_TYPE_STRING type config as -EINVAL, so set defauls values.
Signed-off-by: Yong Zhi <yong.zhi@intel.com>
Discovered the hard way that the Zephyr build assumes sof-logger is
always up to date when present. It's not clear from cmake's
ExternalProject documentation why that is the case. In any case
BUILD_ALWAYS fixes the issue and takes very little time because it does
not rebuild sof-logger from scratch. BUILD_ALWAYS is already used for
XTOS.
Fixes commit f6c71c21d0 ("zephyr/CMakeLists.txt: build smex and
sof-logger")
Signed-off-by: Marc Herbert <marc.herbert@intel.com>
Update rimage from bd51ec1 to 0f64a20.
0f64a20 manifest: fix buffer init in resign
3c23242 rimage: refactor and add openssl 3.0 support
Signed-off-by: Jaska Uimonen <jaska.uimonen@intel.com>
Rename asprintf and vasprintf into log_asprintf and log_vasprintf as the
names could clash with the standard libc ones. These functions are there
originally done because of windows compatibility, but the naming was not
thought through carefully.
Signed-off-by: Jaska Uimonen <jaska.uimonen@intel.com>
This code is used in non-HiFi3 platforms and in all gcc builds.
The inefficient audio_stream_read/write_frag_s16/s32() usage is
replaced by block processing with help of function
audio_stream_bytes_without_wrap(). The circular buffers pointers
checks and wraps are done only when necessary.
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
fix point math power function having negative and positive values
of base and exponent as function argument. power_int32() support
only integer base and exponential value and it does not support
fractional values for base and exponent.
fix point math base 2 logarithm function using a short lookup
tables
Signed-off-by: ShriramShastry <malladi.sastry@intel.com>
This fixes a problem with pipelines, connected over a demultiplexer.
In such cases one of pipelines keeps an inactive status and
terminates during the next scheduler run after a START or a RELEASE.
Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
There could be no more EDF task to be run if the last one in the list is
finished, we don't need to assert in this case.
If the next EDF task gonna be scheduled, interrupt will be generated
again by calling to schedule_edf() in schedule_edf_task(), so it should
be safe to remove the schedule_edf_task_running() in no pending task
scenarios.
Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
Host component stops copying bytes at element's end and resumes
copying the remaining bytes in the next round. This leads to jitter
between components of the same pipeline. Such jitter might cause
buffer overwrite for component which processes block by block.
Triggering extra DMA copy until all the copy_bytes are copied can
eliminate the jitter and hence no more buffer overwrite occurs.
Signed-off-by: fy.tsuo <fy.tsuo@intelli-go.com>
Sometimes multiple tasks must be scheduled on the same domain tick.
Use the reference task pointer for such cases.
Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Current logic in schedule_ll_domain_set() checks a newly submitted
periodic task if it has to be scheduled before an existing one.
However, when doing this the algorithm might schedule the new task a
whole period earlier than would normally be acceptable. Fix this by
adding the missing period delay.
Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Connected pipelines have to be scheduled in a specific order,
depending on the direction of the data flow. Use the new
schedule_task_before() / schedule_task_after() API for that.
Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Tasks currently have 9 states defined for them, but they all can be
divided into two groups: active and passive. We define all tasks on a
scheduler queue as active. All other tasks are passive.
Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
struct pipeline_task and pipeline_task_get() belong to the pipeline
API, not to the scheduler API. Move them to pipeline.h
Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Sometimes multiple tasks have to be scheduled together - one after
another and in a specific order. Add two order-enforcing functions
for that.
Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
schedule_task_cancel, schedule_task_free and schedule_task are
compulsory scheduler operations. Verify them once during scheduler
registration and don't check them afterwards when calling.
Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
When processing a PAUSE or a STOP trigger in the pipeline task, if
the pipeline aborts processing of the trigger, it has to proceed
executing the copy() flow instead of skipping the tick.
Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Currently when a multi-pipeline stream starts, the first scheduler
run will process the START trigger in the context of the first
pipeline, then the next pipeline task within the same scheduler run
will already attempt to copy data. This cannot work because the
first pipeline hasn't copied its data yet. Make sure to skip the
first scheduler run completely on all pipelines.
Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
The DW DMA driver misinterprets completely free output buffer as full
buffer and completely full input buffer as empty buffer. This is
indeed difficult to distinguish within the current driver flow. This
patch makes such detection more reliable.
Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Add support for four max98360a speaker amplifiers running in TDM mode
which format is 8 slots with 32 bit slot/sample width on ADL boards.
To implement the 2-way woofer/tweeter speaker function in SOF, there
is a demux to create 4-channel audio data with EQ on each channel for
band-split function.
Signed-off-by: Brent Lu <brent.lu@intel.com>
Topology file could use PIPELINE_FILTER1 macro to include a m4 file
with eq coefficient. If macro is not defined, eq_iir_coef_bandsplit.m4
will be included.
Signed-off-by: Brent Lu <brent.lu@intel.com>
Change the default slot mapping from L_lo-L_hi-R_lo-R_hi to
L_lo-R_lo-L_hi-R_hi so slot 0/1 is for woofer and slot 2/3 is for
tweeter.
Signed-off-by: Brent Lu <brent.lu@intel.com>
The demux routing matrix and config are removed for two reasons: 1.
the config 'demux_priv_1' is hardcoded for pipeline 1 only. 2. other
m4 file with demux compoenet like pipe-volume-demux-playback has the
matrix and config defined in the topology file.
The topology which implement this pipeline should define the routing
matrx and config named as 'demux_priv_<pipeline id>' before including
this m4 file.
Signed-off-by: Brent Lu <brent.lu@intel.com>
PPL_STATUS_PATH_STOP is not necessarily an indication of an xrun,
it can also be returned by pipeline_trigger_run() in other perfectly
normal cases. Remove the misleading left-over warning.
Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Safer and fixes the following GCC11 warning
In file included from /home/lrg/work/sof/sof/src/include/sof/string.h:11,
from /home/lrg/work/sof/sof/src/include/sof/debug/debug.h:17,
from /home/lrg/work/sof/sof/src/platform/baytrail/platform.c:9:
/home/lrg/work/sof/sof/src/platform/baytrail/platform.c: In function 'platform_init':
/home/lrg/work/sof/sof/src/arch/xtensa/include/arch/string.h:22:9: error: 'memset' offset [0, 4095] is out of the bounds [0, 0] [-Werror=array-bounds]
22 | memset(ptr, 0, size)
| ^~~~~~~~~~~~~~~~~~~~
/home/lrg/work/sof/sof/src/include/sof/lib/alloc.h:160:9: note: in expansion of macro 'arch_bzero'
160 | arch_bzero(ptr, size)
| ^~~~~~~~~~
/home/lrg/work/sof/sof/src/platform/baytrail/platform.c:198:9: note: in expansion of macro 'bzero'
198 | bzero((void *)MAILBOX_BASE, MAILBOX_SIZE);
| ^~~~~
Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Modify RTNR to work with KWD on TGL and ADL.
Remove unused RTNR 16kHz topology.
Add RTNR support to max98390 on ADL.
Signed-off-by: Ming Jen Tai <mingjen_tai@realtek.com>
This patch adds src/math/Kconfig with items CORDIC_TRIGONOMETRY_FIXED,
NUMBERS_GCD, NUMBERS_NORM, NUMBERS_VECTOR_FIND, MATH_DECIBELS, MATH_FFT,
MATH_FIR, and MATH_IIR_DF2T.
Configuration FIR and FFT were previously in src/audio/Kconfig but they
were moved to new math location for simplicity.
The build of trig.c was simplified by remove of unused UNIT_CORDIC_TEST
and CONFIG_CORDIC_TRIGONOMETRY_FIXED.
All but build details of numbers.c are handled by src/math/CMakeList.txt
if(CONFIG_X) additions. There was need to add "-DCONFIG_NUMBERS_x" into
target_compile_definitions() in test/cmocka/CMakeLists.txt because
the platforms those drop most features e.g. BYT would fail in test
case build.
Tone generator build is disabled for all platforms. It avoids select of
triginometric functions and saves RAM.
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
Recent commit b9fcc4156e ("xtensa-build-zephyr: fix incremental build,
pass CMAKE_ARGS only once") fixed incremental builds. For this it first
needs to guess whether the most recent CMake configuration step failed
or succeeded so it knows what is the current "checkpoint" and what is
the next west command to run. Merely testing whether the build directory
already exists is a very bad guess because that directory could have
been created by some other person or script, or - much worse - it could
have been created by a failed CMake configuration step!
The latter situation makes debugging CMake failures very tedious because
it requires manually deleting the build directory after each CMake
configuration failure.
Fix this by not merely looking for a build directory but by looking
whether there is either a build.ninja or a Makefile is found in that
directory. This is a much better indication that the CMake configuration
succeeded.
Signed-off-by: Marc Herbert <marc.herbert@intel.com>
Update rimage from 9a26e45 to bd51ec1bd51ec1 (HEAD, origin/main) rimage: add functionality to resign fw image
bcbcec7 cmake: drop binutils-specific '-Wl,-EL' option
ecb9212 cmake: drop '3' from -Wimplicit-fallthrough=3, it's the default value
0c66aa9 (origin/rimage_test) css.c: add __func__ to "completing manifest" log
c038d62 README.md: add warning that forks must be created using Github
8960097 Revert "ext_manifest: Fix incorrect signature"
0d7f2d4 Do not exit(0) on invalid options or parameters
6e22944 README.md: explain how to run SOF tests on new rimage code
a9faf85 remove '-x' option
241af31 ext_manifest: Fix incorrect signature
4823e87 pkcs: quote the name of key file when logging it
dcfcef8 config: Remove unused, platform specific, memory region definitions
fc4d7b8 rimage: Fix error message content after adsp malloc fail
3e20076 config: Return error value in parse_uint32_* functions when key is not found
ada30c1 config: Explicit state return value for error cases in parse_uint32_* functions
de9177b config: Adjust return type with function name
c4a7456 config: Remove machine_id field
916fc2c config: Remove unused adsp structs
9bf46d3 rimage: Add support for mt8195
aea1969 adsp_config: fix potential overflow in strtol()
9716e10 config: Add imx8ulp.toml
b28b993 fixing incorrect data offset in ri_manifest_sign_v1_5
d1553e9 config: add rn toml file to support renoir build
246ea64 config: skl: change image_size to the real SRAM size
9c9e07c config: kbl: change image_size to the real SRAM size
44b37d1 config: sue: change image_size to the real SRAM size
580e4d6 config: tgl-cavs: change image_size to the real SRAM size
Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Host driver checks llp register data in memory window 0
to update stream position to audio framework.
This patch update this memory location when dma channel
is allocated, released and dma copy is done.
Signed-off-by: Rander Wang <rander.wang@intel.com>
Add the passthrough and mixin-mixout versions for HDA topologies.
They can be built as follows:
For HDMI only passthrough topology:
alsatplg -p -c cavs-passthrough-hdmi.conf -o cavs-passthrough-hdmi.tplg
For passthrough HDA topology:
alsatplg -D HDA_CONFIG="passthrough" -p -c cavs-passthrough-hdmi.conf
-o cavs-passthrough-hda.tplg
For mixin-mixout HDA topology
alsatplg -D HDA_CONFIG="mix" -p -c cavs-passthrough-hdmi.conf
-o cavs-mixin-mixout-hda.tplg
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Add the route from the host copier to the mixin widget in the class
definition so it doesnt have to set in the top-level topology everytime.
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>