Fix capture issue on windows and linux. In original code
if the source is in another pipeline line and is inactive
, ENODATA is returned. If current pipeline has higher
priority than the source pipeline, then the source pipeline
may be not started, so we return error only when source
pipeline has higher priority.
Signed-off-by: Rander Wang <rander.wang@intel.com>
This Patch to help easily understand available heap from the trace dump.
Current dump:
src/lib/alloc.c:567 heap: 0xbe206000 size 12288 blocks 3 caps 0x65
src/lib/alloc.c:569 used 448 free 11840
src/lib/alloc.c:577 block 0 base 0xbe206000 size 64
src/lib/alloc.c:580 count 64 free 57
Dump with this patch:
src/lib/alloc.c:567 INFO heap: 0xbe206000 size 12288 blocks 3 caps 0x65
src/lib/alloc.c:569 INFO (In Bytes) used 0 free 12288
src/lib/alloc.c:576 INFO 64 Bytes blocks ID:0 base 0xbe206000
src/lib/alloc.c:580 INFO Number of Blocks: total 64 used 0 free 64
Signed-off-by: Sathyanarayana Nujella <sathyanarayana.nujella@intel.com>
Signed-off-by: Jairaj Arava <jairaj.arava@intel.com>
Add the audio formats for 4ch in passthrough-be and passthrough-capture
pipelines.
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
When SetDx message shut down primary core, response to this IPC will be
send during power down procedure. It's done to minimize the chances of
the host shutting down power before the core is ready.
Signed-off-by: Tomasz Leman <tomasz.m.leman@intel.com>
This reduces the number of warnings from about 600 to a more manageable
350.
Disable W0312 because the entire file uses tabs.
Disable C0103 because we have higher priority than naming conventions.
Disable C0116 because the script is small enough, shouldn't require
pydoc everywhere.
Signed-off-by: Marc Herbert <marc.herbert@intel.com>
Sometimes we want to load a binary block of data without letting
userspace interact with the underlying control. An RO control will do
this exactly by loading the data and providing no write access.
Signed-off-by: Curtis Malainey <cujomalainey@chromium.org>
All TGL-based ADSPs are multicore, but it should also be possible to
build SOF with CONFIG_CORE_COUNT=1.
Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
The log buffer status notifications are triggered too frequently on
small buffer chunks causing an unnecessary overhead on dma transfer.
In order to make the dma transport more effective this change
triggers the ipc4 dma transport only when half of the available buffer
is filled with log entries. The ipc3 transport is always triggered.
Signed-off-by: Rafal Redzimski <rafal.f.redzimski@intel.com>
Use the size which is already initialized in posn.rhdr.hdr instead of
using sizeof(posn) which is incompatible with ipc4.
Signed-off-by: Rafal Redzimski <rafal.f.redzimski@intel.com>
Initialize the header and size of the ipc4 log buffer status
notification to correct values.
Signed-off-by: Rafal Redzimski <rafal.f.redzimski@intel.com>
In ipc4 path there is no ipc param message from host and
each module needs to build param from module config.
It does not affect ipc3 since the function does nothing
in ipc3 path.
Signed-off-by: Rander Wang <rander.wang@intel.com>
CPC is for pipeline schedule not for dev->frames and its
value is more than 1000 which is not fir for frames.
Dev->frame is assigned in src_verify_params and we don't
need to set it here.
Signed-off-by: Rander Wang <rander.wang@intel.com>
Currently we stop preparing when a component in another
pipeline only for some conditions. In ipc4 passthrough pipeline
host & dai are in different pipelines, these conditions can't
cover it. Actually we should only prepare component in its
parent pipeline, not in other pipeline.
This patch make sure that component is prepared in its own pipeline.
Signed-off-by: Rander Wang <rander.wang@intel.com>
When two modules in different pipeline are unbind, the buffer used
by them is free. The buffer is not free if they are in the same
pipeline. So we need to free buffer when pipeline is free
Signed-off-by: Rander Wang <rander.wang@intel.com>
In a topology where mixer is connected to multiple source pipelines, the
mixer<->DAI downstream pipeline for playback is kept running when
sources are put to PAUSED state.
This design means that mixer_copy() needs to continue to produce output
samples as the DAI is kept running as well. There is existing code to
generate silence when all sources are PAUSED.
A problem remains in the sequence when sources are RELEASED. On the
first iteration after RELEASE, the source state can be changed (so mixer
sees non-zero num_mix_sources). But the sources may not have any data
available on the first cycle. This can lead to XRUNs observed at the DAI
as the mixer is not continuously producing data in ACTIVE state.
Address this issue by adding a "sources_inactive" state to mixer. When
all sources are inactive, mixer enters this state. When sources are
resumed, mixer will note this state, and continue to generate silence
(on its output) until at least one source starts generating audio data.
This ensures continuous audio output to the mixer downstream pipeline.
The change is not sufficient on its own, but is part of the fixes
to address: https://github.com/thesofproject/sof/issues/5469
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
`_end` and `_heap_sentry` linker symbols are used to infer heap size. In
Zephyr, `_end` is referenced as `char []` while in SOF as `uint8_t`.
This may "conflicting types", should those declarations be built
together.
This patch changes the Zephyr wrapper to also use `char []`, thus
avoiding this issue.
Signed-off-by: Ederson de Souza <ederson.desouza@intel.com>
The copier component receiving data from the host has an empty
bsource_list. The copier_params function references the first item in the
list without checking its size. In some cases, this leads to memory
corruption.
Signed-off-by: Adrian Warecki <adrianx.warecki@intel.com>
gcc implements COMPILER_FALLTHROUGH with an __attribute__ so there
must be a semicolon after it. Also remove unused variables.
Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Obviously this is a bug, but it works now because parameters are known
before prepare is done.
We will be introducing dynamic codec id set at prepare time, so there
will be a problem if apply config is called before codec is prepared.
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
Move cadence_codec_resolve_api to cadence_codec_post_init function.
We need this because later the entire cadence_codec_post_init function
will be called later then init.
At init we do not know yet the codec id.
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
Separate code that finds and assigns API function given an codec_id
into a function.
This makes code cleaner and helps us move finding the api id in another
part of the code.
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
This new function encapsulates all Cadence API calls at init time. We
introduce this new function because the init API calls need to be
done after we figure out cadence codec api id.
Right now cadence codec api id is hardcoded to DEFAULT_CODEC_ID but
later it will be needed to be determined dyncamically at runtime.
It will be sent from host via sof_ipc_stream_params.
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
We often need to include interface files from other projects. When the
projects are dual licensed we always go for the more permissive license.
Suggested-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
This file is copied 'as is' from the Linux kernel repo
and will be used to have a common interface for passing
compressed stream params.
Notice that Doxygen doesn't recognize markup style for structure
commenting so we had to escape @ symbols.
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
Base FW is lacking implementation for large config set. Returning 0 is
hiding the existing problem and will lead to false success reports. Tests
using this functionality will fail in later steps, making it difficult to
debug.
However, IPC4_FW_CONFIG have to be exception. All existing tests used by
FW team are using this IPC. Its required to maintain unity of tests for
all platforms.
Signed-off-by: Tomasz Leman <tomasz.m.leman@intel.com>
Multiple use of static inline functions that call Zephyr logging
API across different C files will result in same symbol names
defined in all of the corresponding object files with XCC,
because XCC compiler emits the same symbol names based on the
source file for those static variables inside functions.
If Zephyr logging is used in SOF, we will have log context
redefinition issue with XCC due to above reason.
This patch workarounds the issue by removing the log calls
in static inline functions that are used across multiple C
files if Zephyr is used.
BugLink: https://github.com/zephyrproject-rtos/zephyr/issues/43786
Signed-off-by: Chao Song <chao.song@linux.intel.com>
When pipeline reset was called from paused state, it was not stopped
beforehand. This resulted in improper device turn-off sequence.
Signed-off-by: Krzysztof Frydryk <krzysztofx.frydryk@intel.com>
Add AFE driver for memif/sinegen
Add afe-dai.c/afe-drv.c/afe-memif.c for AFE common driver
AFE: Audio Front End
The audio front-end essentially consists of voice and audio data paths.
frontend (memory interface):
UL (uplink for capture)
DL (downlink for playback)
backend:
I2S In/Out etc
interconn:
inter-connection, connect frontends and backends as DSP path
Note:
TEST_SGEN macro define is just for test
Signed-off-by: Chunxu Li <chunxu.li@mediatek.com>
Add memif data for AFE
Add common and regs header for AFE
Add AFE platform for mt8186 audio/dsp
AFE: the abbreviation for Audio Front End
Signed-off-by: Chunxu Li <chunxu.li@mediatek.com>
The single blob mode keeps only one configuration blob available at
one time and saves the memory otherwise consumed by the second
blob. The down side of this behaviour is that the audio pipeline must
be stopped for the configuration to be updated.
Signed-off-by: Jyri Sarha <jyri.sarha@intel.com>
The data blob handler functionality is quite independent from the rest
of the generic component code. The component.c and component.h are
already too big so it is better to split the data blob handler
functionality out before adding more features to it.
Signed-off-by: Jyri Sarha <jyri.sarha@intel.com>
Building in parallel is much faster but it makes logs unreadable and
build failures impossible to understand. This is especially true when
building with recent ALSA that produces of deprecation warnings.
To show what actually fails, try to build again with a single thread.
Signed-off-by: Marc Herbert <marc.herbert@intel.com>
Building in parallel is much faster but it makes logs unreadable and
build failures impossible to understand. This is especially true when
building with recent ALSA that produces of deprecation warnings, see
examples below. For test topologies the problem is even worse: its
XARGS parallel build provides no log at all.
To find what actually fails, it is required to fall back on a single
threaded and verbose build and this is achieved with the variables
USE_XARGS, NO_PROCESSORS and VERBOSE. Pass these through docker-run.sh
and CMake.
Examples from #5608https://github.com/thesofproject/sof/runs/5717553555?check_suite_focus=truehttps://sof-ci.01.org/sofpr/PR5608/build12556/build/tools.txt
ALSA pcm.c:1523:(parse_hw_config) deprecated fsync value 'codec_slave',...
ALSA pcm.c:1471:(parse_hw_config) deprecated bclk value 'codec_slave',...
ALSA pcm.c:1523:(parse_hw_config) deprecated fsync value 'codec_slave',...
ALSA pcm.c:1471:(parse_hw_config) deprecated bclk value 'codec_slave',...
ALSA pcm.c:1523:(parse_hw_config) deprecated fsync value 'codec_slave',...
Signed-off-by: Marc Herbert <marc.herbert@intel.com>
The major/minor/patch values are represented with u16 in the FW. So,
change the numbers of bytes to match that of the FW when adding the
ABI to the topology manifest for IPC4. For IPC3, we still only use 3
bytes as there's no clean way to increase the number of bytes without
breaking backwards compatibility with the older kernel. There are no
topologies using topology2 for IPC3 today but it is possible in the
future.
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>