Johny is working a lot with google processing modules, add him as an
owner over all the modules google has contributed.
Signed-off-by: Curtis Malainey <cujomalainey@google.com>
The CRC calculation of the language model (~64kB) takes
a long time (~475k platform timer ticks). For comparison:
GoogleHotwordDspInit takes 1.2k ticks.
GoogleHotwordDspProcess takes ~11k ticks for 320 samples.
The CRC calculation is causing XRUN on other tasks so
it's not suitable in the copy callback. Remove the CRC
for now until there is support for running it in low
priority background task.
Signed-off-by: Ben Zhang <benzh@chromium.org>
Signed-off-by: Curtis Malainey <cujomalainey@google.com>
Add a new component that uses the Google hotword library
to do keyword detection. The language model needs to be
set using the byte control from userspace before running
the detector.
1. Put the hotword library at $SOF_REPO/third_party_libraries/
hotword_dsp_api.h
libhifi3_google_hotword_dsp_api.a (TGL)
libcometlake_google_hotword_dsp_api.a (CML)
2. Build SOF fw and tools with xcc
3. Set language model on DUT:
amixer -c 0 contents | grep Model
numid=73,iface=MIXER,name='GHD9.0 Hotword Model'
./sof-ctl -n 73 -t 0 -b -r -s x_google/en_all.mmap
4. Open the WoV pcm device
arecord -Dhw:0,8 -M -N -r 16000 -c2 -f s16_le --buffer-size=67200 -vvv
/tmp/wov.wav
5. Say "OK Google" and verify wov.wav
Signed-off-by: Ben Zhang <benzh@chromium.org>
Signed-off-by: Curtis Malainey <cujomalainey@google.com>
Move to dbg since having zero bytes to produce/consume is not
necessarily a problem.
Fixes: https://github.com/thesofproject/sof/issues/3308
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
If source channels != sink channels, simply reject the parameter to avoid
potential bug due to channel mismatch.
Signed-off-by: fy.tsuo <fy.tsuo@intelli-go.com>
The component handled the first channel and ignored others previously.
Now it processes the first channel and pass though all the others.
Signed-off-by: fy.tsuo <fy.tsuo@intelli-go.com>
Add support to send IPC4 boot message and boot data by providing
a new API to get this data from ABI specific code.
Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
This patch allows the doorbell headers to be abstracted by ABI and
support the IPC4 doorbell compact messages on CAVS platforms.
Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Avoids crashes when trying to use put_header() early. Learned the hard
way because put_header() has also a timestamp argument.
Signed-off-by: Marc Herbert <marc.herbert@intel.com>
The DMA trace is optional, the mailbox is not. This lets use the mailbox
when initializing the DMA trace.
Signed-off-by: Marc Herbert <marc.herbert@intel.com>
Pure rename, zero functional change.
The very poorly named trace_flush() function sounds like earlier
scheduling of something that would the same later anyway but that's
absolutely not what it does. Instead it copies pending DMA traces to the
shared mailbox.
As an example, in June 2020, PR #3195 commit 6c14e76c0d ("trace: Log
FW ABI and hash numbers") added a tr_info() "banner" immediately after
to make sure tracing works. That included a likely misunderstood
trace_flush() call immediately after the tr_info().
Signed-off-by: Marc Herbert <marc.herbert@intel.com>
Fixes commit 6c14e76c0d ("trace: Log FW ABI and hash numbers").
In June 2020, PR #3195 added a tr_info() "banner" immediately after to
make sure tracing works.
That commit included a likely misunderstood trace_flush() call
immediately after the tr_info(). The very poorly named trace_flush()
function sounds like earlier scheduling of something that would the same
later anyway but that's absolutely not what it does. Instead it copies
pending DMA traces to the shared mailbox.
This was most likely why the FW ABI banner is randomly duplicated in the
etrace from time to time, see for instance:
https://sof-ci.01.org/linuxpr/PR2954/build5823/devicetest/?model=BYT_MB_NOCODEC&testcase=test-speakerhttps://sof-ci.01.org/softestpr/PR666/build721/devicetest/?model=TGLH_RVP_HDA&testcase=check-sof-logger
Note this test failure is unrelated. For now this CI does not read
etrace unless there's a failure.
In August 2020, commit 67a0a6937c ("trace: Trace initial message as
error logs") upgraded this banner from tr_info() to tr_err(). That made
sure it gets to both the mailbox and the DMA trace but it didn't remove
the trace_flush(). Remove it now.
Signed-off-by: Marc Herbert <marc.herbert@intel.com>
Zephyr's incremental build works and saves time. I have been using it
with SOF for a long time. Slowly rebuilding from scratch is as simple as
deleting the build-$platform/ build directory. Quickly building not from
scratch is not possible without this commit.
Signed-off-by: Marc Herbert <marc.herbert@intel.com>
Zero functional change.
Makes the code and the build logs clearer, especially for SOF people new
to west. Short options are for saving repetitive typing; no reason to
use them in a script.
Also show the real /bin/pwd which can help when west gets lost in
complex symbolic link situations.
https://github.com/zephyrproject-rtos/west/issues/419
Signed-off-by: Marc Herbert <marc.herbert@intel.com>
Because it's not a documented feature.
"Fixes" commit 9235eb8360 ("kconfig: move BUILD_VM_ROM
Kconfig.xtos-build") / PR #4201
Signed-off-by: Marc Herbert <marc.herbert@intel.com>
Dynamic pipelines will fail with the sof-apl-nocodec topology
due to issues with the memory allocator. Revert back to
use static pipelines until we have a more flexible memory
allocatory available with Zephyr.
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Correct the wrong PCM name and pipeline number.
Fixes: 7c62a65ac6 ("topology: sof-tgl-nocodec-ci: add dmic16k coverage")
Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
cpu_get_id() forces a read from a DSP special register. When its
value is reused it's better to force such a read only once.
Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
When all tasks in a domain terminate, the domain has to be
unregistered. This is done when the last LL task in a domain is
cancelled, but it isn't done when such a task completes. This almost
never occurs in practice, because LL tasks usually don't complete,
they are always cancelled. The only case when they complete is in
case of an xrun. Fix handling of such cases.
Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
The .registered_cores field in struct ll_schedule_domain is never
used, remove it.
Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
This patch adds comments to code parts about spinlocks applied
elsewhere to avoid confusion.
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
This patch fixes an FW panic that could be triggered by multiple
DMIC DAI capture when pausing, stopping, and resuming. A sequence like
this crashed in last operation
start capture on dmic0, dmic1
pause 0
stop 1
resume 0
It was caused by dmic_remove() for dmic1 that issued pm_runtime_put_sync()
for DMIC clock and power, and freed the dmic_prm[] that resume for 0
needed.
commit 282fe224d8 ("dmic: fix pause/release error leading to invalid
dmic_active_fifos") solved the panic but left the HW start/stop sequence
details incorrect.
commit 73e6a6fab1 ("Driver: Intel: DMIC: Remove state check from
active FIFO mask update") re-introduced the FW panic issue in multiple
DAI capture.
This should be a proper quick fix for pause handling. A successive
patch will clean up the DMIC component data and do this in a nicer
looking way.
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
This patch does not change any functionality. The mask is no more
signed value and cache_to_uncache() needs a multiple of 32 bit type.
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
Add dmic16k to run on Core 0, this will help to cover DMIC dais on
multi-core scenario (dmic 48k on core 2, dmic 16k on core 0).
Also correct the comment w.r.t. DSP cores.
Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
Cleanup to trigger() since the parameter is not needed to protect from
errors with bit mask active FIFOs tracking.
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
The mask does not over/undercount events so no need to protect
from multiple start() or stop() calls.
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
The counter dmic_active_fifos has been a source of many issues. The
use of bits to track active FIFOs is simpler and avoids the risk
of counting to negative or over the actual FIFOs count in various
control scenarios. The incorrect counter value has caused resources
allocate and free and start/stop sequences fails.
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
When the dmic driver is instantiated multiple times (e.g. for fifo-A and
fifo-B), the interrupt gets registered also twice.
While supported usage of interrupt interface, there is no guarantee that
the interrupt context data is for the expected dai instance. It is thus
not safe to modify the dai state directly or call dai_stop().
Modify the interrupt handler not to make any assumptions on which dai
instance is passed as 'data' matches a specific fifo instance.
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
The 'in_active' parameter of dmic_stop() is used to control whether
the fifo should be released or not. In case of COMP_TRIGGER_PAUSE,
this should be false and the 'dmic_active_fifos' count should not
be modified.
Without this fix:
PAUSED -> RELEASE -> dmic_start() -> no change on dmic_active_fifos
ACTIVE -> PAUSE -> dmic_stop() -> dmic_active_fifos--
If a test case repeatedly pauses and releases, 'dmic_active_fifos'
will go out-of-sync.
Fix the issue that dmic_stop for PAUSE does not release the fifo
reference.
Fixes: 22731744cb ("dmic: don't decrement active FIFO count below 0")
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
In other words:
├── intel-signed
│ ├── sof-cfl.ri -> sof-cnl.ri
│ ├── sof-cml.ri -> sof-cnl.ri
│ ├── sof-glk.ri -> sof-apl.ri
Doing this manually is time-consuming and error-prone.
Not for ehl because it has a different key.
Signed-off-by: Marc Herbert <marc.herbert@intel.com>
Makes even CONFIG_DEBUG builds (locally) deterministic by
default: (re)building twice produces the same binaries. Also a partial
fix for incremental builds: running "make" twice in a row now recompiles
fewer files because version.h does not keep changing.
Also makes sure non-debug builds can't use uninitialized strings in some
future security accident.
Fixes:
./scripts/checkpatch.pl -g 'aa85e2c0e956c'
ERROR: Use of the '__DATE__' macro makes the build non-deterministic
+ .date = __DATE__,
ERROR: Use of the '__TIME__' macro makes the build non-deterministic
+ .time = __TIME__,
The previous behavior can be restored using any standard CMake
configuration method, example:
./scripts/xtensa-build-all.sh apl
cmake -B build_apl_gcc/ -DBUILD_COUNTERS=1
make -C build_apl_gcc
https://reproducible-builds.org/
Signed-off-by: Marc Herbert <marc.herbert@intel.com>
Pipelines can be shared between multiple PCM's. For example,
in the case of the sof-apl-nocodec, a part of pipeline 1
(mixer1.0 ->BUF1.2 ->PGA1.1-> BUF1.3 -> SSP0.OUT)
is shared between PCM0 and PCM7. Setting the source_comp for
pipeline 1 to NULL when PCM0 is stopped results in a panic.
So, hold off resetting the pipeline until the scheduler widget
is freed.
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
you need to use a temp var always with realloc, otherwise you through
away your pointer to your memory (which is still valid) in the event of
realloc failing.
Signed-off-by: Curtis Malainey <cujomalainey@chromium.org>
following commit fixes a bug but to do the fix we need to allow
ourselves more room to add ifs, so lets pull out this function
Signed-off-by: Curtis Malainey <cujomalainey@chromium.org>
The pipeline was limited to 48 kHz min and max that is not
useful for running and testing SRC component.
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
The Zephyr scheduling domain is triggered by a periodic timer, which
is started when the first task in the domain is scheduled and
stopped when the domain is unregistered. Since the timer period is
anyway fixed, it's even easier to just start the timer when the
domain is registered. This eliminates the need for the .domain_set()
method completely.
Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>