It's possible to reach dma_trace_on() from IPC handlers based on host
state before DMA trace has been initialized (found this via fuzzing,
so the precise circumstances are a little opaque). When that happens,
the schedule_task() call ends up putting a delayed work queue item
into the Zephyr queue which has a NULL callback. This eventually
blows up later when the timeout expires.
Check for initialization state before doing anything.
Signed-off-by: Andy Ross <andyross@google.com>
Command format errors during fuzzing are reported for virtually all
commands, and the resulting flood of logging becomes a severe
performance penalty (i.e. we get a lot less fuzzing done per CPU
cycle).
Signed-off-by: Andy Ross <andyross@google.com>
This extends the ideas in CONFIG_LIBRARY=y to implement SOF as an
application for the Zephyr native_posix architecture. These are host
x86 or x86_64 binaries that include a full OS build, which can be used
(via mocked drivers) for testing against host validation environments
like ASAN/MSAN.
The mechanism uses the existing "host" architecture used by
CONFIG_LIBRARY, but adds a new platform layer named "posix", populated
entirely with stubs.
No driver integration is provided in this patch. The resulting
executable builds correctly, but has no devices and won't do anything.
Signed-off-by: Andy Ross <andyross@google.com>
This file needs the clk.h APIs, so include the header. Don't include
the Xtensa cache.h, as it's unused (and not supposed to be, zephyr.c
is portable code). Use the proper interrupt en/disable APIs instead
of the SOC-level calls they wrap.
Signed-off-by: Andy Ross <andyross@google.com>
The timer.h header references k_cycle_get_64(), which is defined in
kernel.h. Was previously hidden by a transitive include somewhere.
Signed-off-by: Andy Ross <andyross@google.com>
This was calling clk APIs without the header. Discovered when
native_posix exposed a previous transitive include.
Signed-off-by: Andy Ross <andyross@google.com>
This saves a couple seconds when building from scratch on Linux.
On Linux the default CMake generator is "Makefiles" which is _not_
parallel by default.
Thanks to the previous commit it's still possible to manually switch to
"Makefiles" if desired.
Signed-off-by: Marc Herbert <marc.herbert@intel.com>
It's pointless and hardcodes the CMake generator.
Also remove wrong comment added in commit
6cba64d2cb ("xtensa-build-zephyr.py: fix a few minor pylint warnings")
The rimage part of the comment was flat out wrong.
The smex part of the comment is correct but in the wrong place.
Signed-off-by: Marc Herbert <marc.herbert@intel.com>
Adopt module interface for src component.
IPC3 has compatibility issues, it continues to use comp_driver.
Convert to module adapter only for IPC4.
Signed-off-by: Gongjun Song <gongjun.song@intel.com>
The commit that caused this bug is 1ec9fc1fbf. Added the sink_c
parameter, but did not set sink_c in src.c.
This commit will set sink_c to solve the issue of wrong sink rate.
Signed-off-by: Gongjun Song <gongjun.song@intel.com>
1. Add a free memory function to support PR#6230 and PR#6331,
the latest prepare/reset API flow update of module_adapter.
2. This requires DTS library v1.0.7 to support this change.
Signed-off-by: Joe.Cheng <joe.cheng@xperi.com>
This should get rid of most warnings in daily tests
```
Node.js 12 actions are deprecated. For more information see:
https://github.blog/changelog/
2022-09-22-github-actions-all-actions-will-begin-running-on-node16...
Please update the following actions to use Node.js 16: actions/checkout@v2
```
Example at
https://github.com/thesofproject/sof/actions/runs/3597808171
v3 seems backward compatible. Upgrade only the most used instances for
now (most used because of the `matrix` of platforms), upgrade everything
in a few days if no issue is spotted.
Signed-off-by: Marc Herbert <marc.herbert@intel.com>
Clear general purpose pending interrupt
before enabling interrupts between host and DSP.
The GIPn bit, from MU Status Register is cleared
by writing it as “1” in order to de-assert the
interrupt request source at the interrupt controller.
This fixes a fw loading failure after a soft reboot
caused by GIP bit that was 1.
The problem was the MU which triggered endless interrupts
causing timeout on Kernel side, which was waiting for
FW_READY message.
Signed-off-by: Iuliana Prodan <iuliana.prodan@nxp.com>
Update READY_IPC value based on changes regarding MU reset.
READY_IPC value comes from:
- clear GP pending interrupt #0 and #1 from MU's xSR register;
- enable GP #0 and #1 for Host -> DSP and DSP -> Host
message notification from MU's xCR register;
- now interrupt host to tell it we are done booting
by setting GIRn bit in MU's xCR register.
So, "00 00 00 c0 00 00 04 c0" is the MU's xSR and xCR registers:
xSR: c0000000 and xCR: c0040000
Signed-off-by: Iuliana Prodan <iuliana.prodan@nxp.com>
DIV_ROUND_UP is a common macro exposed in public headers without
namespacing. Change the name to SOF_DIV_ROUND_UP to avoid collisions
with other systems/libraries.
Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
If the rates are an empty vector [] the default rates are used. This
allows test command "src_test(32, 32, [], [], 0, 0);" to do a quick
test without plots with default 8 - 192 kHz in/out matrix.
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
Octave errors if plot handle is empty, Matlab doesn't. This can
happen if frequency response test data read fails. In that case
an empty plot window is stored as indication of error.
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
This speeds up src_test.m with no plot window opening for rate
that is not supported in the conversions matrix. No output file
returns failure -1.
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
These prints are normally not useful and slow down test with a
lot of scrolled text output.
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
This prevents testbench run freeze from src_test.m. Function
test_run_src() passes to testbench option -C that limits the number
iterations to 300k that corresponds to 5 min of audio.
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
This patch adds the missing saturation to rounding in function
src_polyphase_stage_cir_s16(). The error was caught with
"src_test(16, 16, [176400 192000], 8000)" where both conversions
made an overflow in chirp test.
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
This patch increases the buffer between stage 1 and stage 2 by
factor 1/8. It prevents a freeze that happens with conversion
from 11025 to 8000 Hz.
Also the SRC is let run if stage 1 can consume samples or stage 2
can produce samples. There is no need to prevent run if both can't
happen.
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
The ace_v1x-regs.h Zephyr header file should be removed.
This patch removes dependency on this header in SOF code.
Signed-off-by: Jaroslaw Stelter <Jaroslaw.Stelter@intel.com>
This patch compacts the FIR code a bit per discussion in other SRC
refine patch review where the current pointer arithmetic and code
style was not liked. There is no measurable MCPS impact in the 2ch
and Nch versions of core. It's not slower than original, but possibly
one perf comp_copy trace unit faster (0.03%).
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
Legacy platforms not meant to work with Zephyr were added
in commit ".github: compile-test multiple zephyr revisions + IPC4"
(8543f5c889).
Removed them from CI as they never should be built in the first place.
Signed-off-by: Andrey Borisovich <andrey.borisovich@intel.com>
This patch adds to sof-hda-generic.m4 macros HSSFX, HSSFX_FILTER1,
and HSSFX_FILTER2 those can be used to customize stream effect
for PCM 30. The macro defaults to volume so the default topology
build is not impacted.
The CMakeLists.txt in development is updated to build topologies
sof-hda-generic-src.tplg, sof-hda-generic-2ch-src.tplg, and
sof-hda-generic-4ch-src.tplg. The stream effect is set with HSSFX
to src-volume.
The pipeline pipe-host-src-volume-playback.m4 is added. It is similar
as pipe-host-volume-playback.m4 but a sample rate converter (SRC)
is added after PCM, before volume. The PCM capability is changed to
min 8000, max 192000 Hz.
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
Disable interrupts until the intermediate buffer is connected to both
the source and the sink components during module binding. This is needed
to prevent IPC timeouts caused due to the IPC task getting preempted
when the buffer is only connected to the source and the sink has not
been connected yet. Disabling interrupts is good enough because at the
moment SOF only supports running all connected pipelines on the same
core.
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Unbind both source and sink components and free the buffer even in case
of errors to prevent memory leaks.
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>