Fixes commit d09844ab98 ("zephyr/docker-build.sh: match UID with
'adduser' instead of 'chgrp -R'")
Also clarify comment and add reference to new sudo-cwd.sh script.
Signed-off-by: Marc Herbert <marc.herbert@intel.com>
Besides making things more obvious, the important functional change is
that the user switch is now performed for _every_ invoked, command, not
just for the build command.
Signed-off-by: Marc Herbert <marc.herbert@intel.com>
In tests with repeated IPCs that require handling in
the pipeline context (such as SET_PIPELINE_STATE), the delayed_reply
state sometimes goes out of sync.
When this happens, pipeline has processed the message and called
ipc_compound_msg_done(), but the next call to ipc_wait_for_compound_msg()
does not see the correct value, leading to a timeout.
Fix the problem by using atomic primitives to maintain the state.
Also make it explicit that the delayed_reply is a boolean
condition and in current code, having multiple IPC messages in
flight concurrently should never happen.
BugLink: https://github.com/thesofproject/sof/issues/6220
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Set the logging thread stack size explicitly for SOF builds
and use a safe default of 4096 bytes. Individual board overlays
can override this default to save stack space.
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Set CONFIG_LOG_BUFFER_SIZE=4096 for all SOF builds.
As SOF uses DEFERRED mode for logging, the frontend buffer for
logs must be large enough to cover all typical burts of messages.
Tests using CONFIG_LOG_MEM_UTILIZATION debugging infrastructure,
show that maximum buffer usage is over 2048 bytes in typical
sof-test run on a SOF nocodec topology, tested on Intel TGL
hardware.
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Logging output of SOF is sporadic in nature (unless debug configuration
is used) and it cannot be assumed that a steady flow of log messages
is output at all times. During stable state, there are either no or very
few messages output. When the DSP pipeline state is modified, there is
a flurry of event. Similarly upon errors, a burst of log messages is
output.
For better balance between delay in writing logs, and limiting overhead
of the logging thread, set new defaults to:
CONFIG_LOG_PROCESS_TRIGGER_THRESHOLD=5
CONFIG_LOG_PROCESS_THREAD_SLEEP_MS=100
The SLEEP_MS sets an upper bound how long a single log message can
stay in the log frontend buffer.
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Calls to log messages are done in many places in SOF code,
including latency sensitive low-latency code paths. To minimize
the cost to low-latency path, use CONFIG_LOG_MODE_DEFERRED=y
by default for all SOF Zephyr builds. This will offload log
processing and output to a separate low priority thread.
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
This commit lets user to set data blob from host.
For example:
$ amixer -Dhw:0 controls | grep RTNR
numid=47,iface=MIXER,name='RTNR10.0 rtnr_bytes_10'
numid=48,iface=MIXER,name='RTNR10.0 rtnr_data_10'
numid=49,iface=MIXER,name='RTNR10.0 rtnr_enable_10'
$ sof-ctl -Dhw:0 -n 48 -b -s ./preset.bin
A new empty data control added to the topology will be used to send the
blob.
Model handler is now used for transferring the blob data.
Signed-off-by: Ming Jen Tai <mingjen_tai@realtek.com>
Code Refine
Use switch-case instead of if-else, add a local variable for a
repeating pointer dereference and remove a resundant local variable.
Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
With IPC4 commands are sent to each pipeline individually, therefore
there is no need to propagate them to connected pipelines in the
firmware. We use IPC4_MOD_ID() to detect the IPC4 mode: it returns a
non-zero module ID under IPC4 and 0 under IPC3.
Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
The following race has been observed:
core 0 core 3
timer IRQ
spin_lock(&timeout_lock)
IPC IRQ
task remove
zephyr_domain_unregister()
spin_lock(&timeout_lock)
timer remove
spin_unlock(&timeout_lock)
k_timer_stop()
z_abort_timeout()
z_timer_expiration_handler()
z_add_timeout()
which leads to the LL domain timer being added needlessly and to a
later lock up and an IPC timeout on the host. Fix this by removing
the timer in such cases.
BugLink: https://github.com/thesofproject/sof/issues/6173
Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
This patch adds the SOF component for Mel Frequency Cepstral
Coefficients (MFCC) streaming to sink from source PCM stream.
The MFCC audio features are commonly used for neural network
based speech recognition services.
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
The increase of non-32bit aligned blob sizes needs to be removed
because it can cause mismatch of blob binary header vs. actual
size. Instead error if blob size is not multiple of four bytes.
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
This patch adds initial version of MFCC setup tool setup_mfcc.m. It
outputs a configuration topology macro file that matches the current
Matlab concept code. The configuration can be tested in testbench
with the supplied scripts run_mfcc.sh and decode_ceps.m.
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
This patch adds basic macros needed for MFCC in testbench and in
developmemnt topologies for hda-generic-2ch and up2. The
configuration blob in this matches the reference Matlab code
as configured to match Pytorch default MFCC.
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
This topology is used for i.MX8QXP/i.MX8QM with baseboard
to enable both cs42888 and wm8960 codecs.
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
This reverts commit e31c7abeeb.
This caused most tests to fail on sh-tglu-rvp-nocodec-ci-02
in daily run 15919, see some more errors in logs shared in
initial PR #6318 and new issue #6367
FW reported error: 113 - Invalid destination queue (pin) ID provided
ipc error for msg 0x45000004|0x6
sof_ipc4_route_setup: failed to bind modules copier.SSP.8.1 -> gain.7.1
I don't know why this failed and I did NOT test this revert, however:
- This topology change is apparently the only thing that changed
compared to the day before.
- The error message seems very much related.
- Other people seem to agree.
- According to Ranjani, this feature is not urgent.
Signed-off-by: Marc Herbert <marc.herbert@intel.com>
This time the target is to make the demuxer more modular so that it is
not coupled with file reading operations and it is easy to use
alsa-lib directly.
Signed-off-by: Jyri Sarha <jyri.sarha@intel.com>
As for our previous design, if we have parallel EQs like
filters bank, they get the same input and outputs are summed.
There is a mistake of the input assignment in our current code,
this commit will fix it.
Signed-off-by: Andrula Song <xiaoyuan.song@intel.com>
1. make two global variables static
2. rename a function to avoid a name conflict
3. fix a return code from ipc_wait_for_compound_msg()
4. add a comment
Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
This reverts commit 1044e004e4.
On i.MX platforms we noticed a bug were playback followed by
capture would cause capture to fail.
This issue was later fixed by:
commit b9889d52d0 ("module_adapter: Modify reset API")
so we can get rid of CONFIG_LEGACY_INTERFACE.
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
This updates documentation to reflect that now param id is only 2 bytes
followed by 2 bytes codec id.
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
We want to be able to play different compress stream types
using the same topology:
e.g
$ cplay -I MP3 -d 0 -c 0 sample.mp3
[ end of playback ]
$ cplay -I AAC -d 0 -c 0 sample.aac
Some static parameters for compress streams are set up in
topology bytes in the form:
[0:3]: param ID
[4:7]: size in bytes
[8:n-1]: data[]
We need now a way to specify codec ID, so we borrow 2 bytes from param
ID, like this:
[0:3]: (param ID, codec ID)
[4:7]: size in bytes
[8:n-1]: data[]
Using 0 for codec ID means 'dont care'. Topologies supporting just 1
codec are not affected and need not to be changed.
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
The allocated packet should accommodate the header, the data, and the
checksum. The header size was missing from the condition from the
beginning, even if its there in realloc parameter. The bug should be
harmless waste of cycles thou.
Signed-off-by: Jyri Sarha <jyri.sarha@intel.com>
The sync_word_at() only checks for two things, if the len parameter is
greater than sizeof(uint32_t) and if the memory pointed p parameter
holds PROBE_EXTRACT_SYNC_WORD value. Now that the available bytes is
checked just before sync_word_at() call, the whole function starts to
look a bit pointless.
Signed-off-by: Jyri Sarha <jyri.sarha@intel.com>
Drop IPC3 probe DMA framing and use IPC4 framing for IPC3 mode
too. This change simplifies the code quite a bit. After this change
both the SOF firmware and sof-probe demux tool should be updated at
the same time.
Signed-off-by: Jyri Sarha <jyri.sarha@intel.com>
Environment variables like XTENSA_SYSTEM are an absolute CMake
pain. Add a link to the CMake FAQ and a one-line description why.
Signed-off-by: Marc Herbert <marc.herbert@intel.com>
The next step is to find how to extract the (too many?) errors.
In the mean time this already makes sure the build process never bitrots
and that it will always possible to use sparse. It also "documents" how
to use sparse: just copy/paste the commands run by CI.
Signed-off-by: Marc Herbert <marc.herbert@intel.com>