The interface will be common for all processing modules not just the
codecs. So rename struct codec_interface to struct module_interface.
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
In 8186 mtk dsp (hifi5), we meet a system exception when irq is rasied.
The panic is LoadStoreAlignmentCause.
We found the problem is in int-xxx-dispatcher.S
mov a11, a1
addi a11, a11, UEXC_cp1
xchal_cp1_store a11, a12, a13, a14, a15
In xchal_cp1_store macro, ptr must a certain byte aligned address
In the 8186 mtk dsp Xtensa header, we have
/*
* Macro to store the state of TIE coprocessor AudioEngineLX.
* Required parameters:
* ptr Save area pointer address register (clobbered)
* (register must contain a 16 byte aligned address).
* at1..at4 Four temporary address registers (first XCHAL_CP1_NUM_ATMPS
* registers are clobbered, the remaining are unused).
* Optional parameters are the same as for xchal_ncp_store.
*/
.macro xchal_cp1_store ptr at1 at2 at3 at4 continue=0 ofs=-1 select=XTHAL_SAS_ALL alloc=0
In xtruntime-frames.h, the UEXC_cp1 macro is
STRUCT_AFIELD (long,4,UEXC_,cp1, XCHAL_CP1_SA_SIZE / 4)
I have checked history and found the original UEXC_cp1 define is using STRUCT_AFIELD.
(After 3e1eebe)
In 8186 mtk dsp, we need 16 aligned address in xchal_cp1_store using STRUCT_AFIELD_A
with XCHAL_TOTAL_SA_ALIGN.
It's super annoying and time-consuming to update the image and wonder
why the previous one is still used. Shortcuts are nice in interactive
use but pointless in scripts.
Signed-off-by: Marc Herbert <marc.herbert@intel.com>
There's frequent confusion between image ID and image digest: display
both.
Show both sof and thesofproject/sof.
Use set -x to display the full command that is run.
Signed-off-by: Marc Herbert <marc.herbert@intel.com>
Add build support for topology2. Topology2 will be built only if the
alsatplg version if 1.2.6 or greater.
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
The gdb script created by coredump-reader has a fixed reset
vector address. This address only works on a subset of supported
SOF platforms and for other platforms, user has to manually fix
the reset address in the gdb script before use.
Modify the script to emit breakpoint for "_MemErrorVector"
symbol. This is not the reset vector, but the simulation will
still be trapped early. The symbol is part of the firmware
binary, so its address can be looked up at runtime.
Also add a second breakpoint for "_MemoryExceptionVector_text_start".
This will cover SOF binaries built with Zephyr as the RTOS.
BugLink: https://github.com/thesofproject/sof/issues/5125
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Align with xtensa-build-all.sh and add a "-v" option to toggle
verbose build log ("west -v build").
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Introduce a new component to perform acoustic echo cancellation
on capture path using a buffer from the playback as a reference.
1. Put the google_rtc_audio_processing at
$SOF_REPO/third_party_libraries
- libgoogle_rtc_audio_processing.a
- libgoogle_rtc_audio_processing_tuning.a
- libc++.a (Corresponding stdlibc++)
- libc++abi.a
2. Put the header in $SOF_REPO/third_party_includes
- google_rtc_audio_processing.h
3. Build firmware and tool with xcc
4. To verify it works:
- aplay some speech
- At the same time arecord the mic which uses AEC
The mic signal should not exhibit any echo from the playback.
Signed-off-by: Lionel Koenig <lionelk@google.com>
Fixes new shellcheck 0.8.0 warning:
SC2268 (style): Avoid x-prefix in comparisons as it no longer serves a
purpose.
This script requires bash anyway.
Signed-off-by: Marc Herbert <marc.herbert@intel.com>
1. Default support 1ms period playback pipeline to update host position
more precisely.
2. Revise pcm node number description
Signed-off-by: YC Hung <yc.hung@mediatek.com>
When built with Zephyr, SOF ideally should be a fully platform-
agnostic application. All platform-specific code should reside in
Zephyr itself, including core architecture and platform
infrastructures and drivers. To prepare for this transition we add a
generic SOF-Zephyr platform. It is based on the current Tiger Lake
architecture and should be usable for cAVS 2.5 and newer systems.
Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Current cavs-nocodec support only 1 playback device
This is to support 2 playback/capture devices.
Due to this, DMIC is moved PCM from 1 to 3
Signed-off-by: Uday M Bhat <uday.m.bhat@intel.com>
Add support for four max98357a speaker amplifiers running in TDM mode
which format is 8 slots with 32 bit slot/sample width on ADL boards.
The only difference between this one and sof-adl-max98360a-rt5682-4ch
is the SSP port for speaker amplifiers; this one is using SSP2 while
max98360a's topology is using SSP1.
This topology implements a 4-channel pipeline directly to speaker
amplifiers so audio effects need to be done in user space.
Signed-off-by: Brent Lu <brent.lu@intel.com>
This reverts commit eb34437522.
Fixes#5113
The `alsatplg -o -` feature is incompatible with `-v` and basically
buggy because it happily sends .tplg output and debug statements to
the same place without a care. To reproduce the bug, simply run:
VERBOSE=1 ./scripts/build-tools.sh -T
... then observe .tplg output files like this:
B0x003d3b/015675 - pcm 'DMIC': write 912 bytes
B0x0040cb/016587 - pcm 'HDMI1': write 912 bytes
B0x00445b/017499 - pcm 'HDMI2': write 912 bytes
B0x0047eb/018411 - pcm 'HDMI3': write 912 bytes
B0x004b7b/019323 - pcm 'DMIC16kHz': write 912 bytes
B0x004f0b/020235 - block size for type be (11:10) is 0x2ad4/10964
B0x004f0b/020235 - header index 0CoSA^E^@^@^@^@^@^@^@^H^@^@^@$^@^@
^@^@^@^@^@s^@^@^@^@^@^@^@^A^@^@^@p^@^@^@ ^@^@^@.^@^@^@ ^@^@^@^F^@^
@^@^F^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^
@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^
@^@^@^@^@^@^@^@^@^...
Signed-off-by: Marc Herbert <marc.herbert@intel.com>
used only for rare cases where two pipelines are connected by a shared
buffer and 2 copiers, this will set source format only for shared buffers
for a short time when the second pipeline already started
and the first one is not ready yet along with sink buffers params
Signed-off-by: Adrian Bonislawski <adrian.bonislawski@intel.com>
The C header file malloc.h does not exist on
some Xtensa processor configurations or host OSes,
include stdlib.h instead because they both provide
the prototype for 'malloc' function.
Fixes: #5102
Signed-off-by: Chao Song <chao.song@linux.intel.com>
In a previous commit DTS changed the period of this topology to 1000 when `DTS` was defined. This
commit removes this behaviour as DTS codec now supports the original period for this topology
Signed-off-by: Mark Barton <mark.barton@xperi.com>
Fixes old (Aug 2020) and untested commit b2a325a3b7 ("cmake: Handle
empty SOF_SRC_HASH_LONG") which tried to use GIT_LOG_HASH as a fallback
for the SOF_SRC_HASH .ldc checksum but always fell back on "0" instead
because of a misunderstanding of cmake's surprisingly complex "if"
operator.
Before Zephyr this was not an issue in practice because GIT_LOG_HASH was
empty anyway when SOURCE_DIRECTORY/.git was missing, so there was
nothing to lose.
For the Zephyr builds this will now use the SOF SHA1 as the .ldc checksum
for now. Probably not ideal yet but far better than the current constant
"0" which means no check at all.
Also log the SOF_SRC_HASH fallback value now and change the second
fallback (when GIT_LOG_HASH is also missing) from "0" to the
searchable hexspeak "baadf00d".
Signed-off-by: Marc Herbert <marc.herbert@intel.com>
Implement set_freq callback function to set dsp clock, dsp clock source
can be 26M(13/26M) or ADSPPLL(370/540/720M) for different use cases,
default support is 720MHz.
Signed-off-by: YC Hung <yc.hung@mediatek.com>
scheduler_free_ll() function should invoke domain_unregister()
in case when SOF_SCHEDULER_FREE_IRQ_ONLY flag is used, because
in timer domain case, timer_domain_unregister() function
unregisters timer interrupts.
Signed-off-by: Bartosz Kokoszko <bartoszx.kokoszko@linux.intel.com>
The audio_stream_read/write_frag_s16/s32() functions usage and
sample-by-sample copying are replaced by more efficient block
memcpy() operations.
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
The audio_stream_read_frag_s16/s32() functions usage and
sample-by-sample copying are replaced by more efficient block
memcpy() operations.
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
The audio_stream_write_frag_s16/s32() functions usage and
sample-by-sample copying are replaced by block memcpy()
operations.
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
This patch moves functions audio_stream_copy(),
audio_stream_copy_from_linear(), and audio_stream_copy_to_linear()
into component.c. The functions are not changed.
There is no measurable code execution time
increase. In a test build this change saved about 800 bytes.
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
The changes are:
- Prevent the inner MIN() from being evaluated twice. Due to
macro implementation the inner MIN() is evaluated first in
comparison and second time if latter parameter for MIN() is
selected.
- memcpy() instead of memcpy_s() and no assert check is faster in
hot path. The MIN() operations before data copy ensure that
bytes_copied is within limits of sink. In a component copy speed
test this saved 1 MCPS.
- The void pointer type casts are avoided with uint8_t type. The
pointer arithmetic lines are also made more compact.
- The internal variables for byte size are changed to size_t for
similarity with other copy functions.
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
This patch adds inline functions audio_stream_copy_from_linear()
and audio_stream_copy_to_linear(). They are useful for fast
copy from SOF buffer to a linear memory region or vice versa.
Note: memcpy() is used instead of memcpy_s() because this is a
hot path.
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
Dma buffer size should align with 32bytes which can't be compatible
with current 45K adjustment. 48K is a suitable adjustment. Change
the function since we are really calculating the nearest period frames
Tested 44.1khz music on both Linux & windows
Signed-off-by: Rander Wang <rander.wang@intel.com>
Sample output:
logger ABI Version is 5:3:0
ldc_file ABI Version is 5:3:0
ldc_file src checksum 0x07d4f1ad
Loaded FW expects chksum 0x07d4f1ad <=== NEW!
Components uuid dictionary size: 2400 bytes
Components uuid base address: 0x1fffa000
...
Signed-off-by: Marc Herbert <marc.herbert@intel.com>
Since commit 901f991eee ("logger: Validate by src_hash instead of abi
version from fw_ready") the dictionary checksum has become the most
important information.
Signed-off-by: Marc Herbert <marc.herbert@intel.com>
Fixes commit 901f991eee ("logger: Validate by src_hash instead of abi
version from fw_ready") that changed the feature without updating the
name.
Signed-off-by: Marc Herbert <marc.herbert@intel.com>
All cAVS platforms use the same pm_runtime.c implementation, no need for
separate headers, repeating the same function declarations.
Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
In preparation for defining a generic module interface API that can
replace the existing codec_adapter interface and the comp_driver
interface, remove the init_process op from the codec interface.
The init_process operations will still be performed in the
codec-specific process op if the init_done flag is not set.
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
In preparation for defining a generic module interface API that can
replace the existing codec_adapter interface and the comp_driver
interface, remove the get_samples op from the codec interface.
The get_samples op is only defined for the cadence codecs at the moment,
so the check for free space in the local buffer in codec_adapter copy is
bogus for other codecs because it will be 0 anyway.
So move the check for free space to be performed during the first copy
after initialization in the codec-specific code.
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
rballoc() doesn't guarantee zero-initialised memory, besides it's
often enough called at run-time and for relatively large buffers, so
performance losses aren't negligible. Remove the bzero() call.
Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Fixes warnings:
sof/src/math/trig.c:42: warning: Found unknown command '\CORDIC'
sof/src/math/trig.c:103: warning: Found unknown command '\CORDIC'
sof/src/math/trig.c:183: warning: Found unknown command '\CORDIC'
sof/src/math/trig.c:42: warning: Found unknown command '\CORDIC'
sof/src/math/trig.c:103: warning: Found unknown command '\CORDIC'
sof/src/math/trig.c:183: warning: Found unknown command '\CORDIC'
etc.
Signed-off-by: Marc Herbert <marc.herbert@intel.com>
fix point math square function having positive number y as input and
return the positive number x multiplied by itself (squared)
Signed-off-by: Shriram Shastry <malladi.sastry@intel.com>
It is not intuitive for the end-ser to set linear values for
minimum gain. Set the dB gain min value to -90dB and steps to 2dB.
Also, modify the max to 45 to allow the volume gain range -90dB to 0dB.
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>