getopt() returns an int, which in our implementation is assigned to a
char type var.
On some platforms char is unsigned thus making getopt() return value
always > 0.
Use int instead of char here to fix the stop condition for parameter
parsing.
This makes sof-ctl work on ARM platforms.
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
The source_format and sink_format variables are not needed in
component data. They can be local in prepare().
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
The source_format and sink_format variables do not need to be in
component data. Local variables in prepare() are sufficient.
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
-p is required when the real (not symbolic) directories are not nested
in one another.
The documentation gap was clearly demonstrated by me getting confused
even though _I_ implemented this logic some time back.
Signed-off-by: Marc Herbert <marc.herbert@intel.com>
Ipc4 error code will be used in ipc4 interface layer and
current sof error code in framework or components will be
translated to ipc4 error code in this layer.
Signed-off-by: Rander Wang <rander.wang@intel.com>
Base config defines input & output information of each ipc4
modules. The information includes audio stream format, input
& output buffer size.
Signed-off-by: Rander Wang <rander.wang@intel.com>
Added cordic based approximation of arcsine,arc cosine and
complex exponential function to math trigonometry.
Signed-off-by: ShriramShastry <malladi.sastry@intel.com>
The change for topology1 was missing from various tuning
and testing scripts those access binary blob data from
topology m4 directories.
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
Dai configuration is generated based on gateway config in copier module
Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Signed-off-by: Rander Wang <rander.wang@intel.com>
Stream id is included in ipc4 config and fw constructs
hw_params for alh based on this information.
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Ssp setting can be generated offline by tools and sent
to fw by driver in memory blob. Fw decodes this blob and
set hw registers accordring to blob configuration. This
patch add support to this type of ssp configuration.
Signed-off-by: Rander Wang <rander.wang@intel.com>
In ipc4 each module will be bound to its sink module by pipeline.
This patch add new ops bind & unbind to dispatch these events to
related modules.
Signed-off-by: Rander Wang <rander.wang@intel.com>
Fix xruns caused because of using the same flags for locking
both the sink and source buffer.
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Stop ignoring most comments in the trace.h file.
Confusingly, only comments in trace.c were considered because unlike
trace.h, trace.c is not turned off by the preprocessor but by CMake
instead.
Signed-off-by: Marc Herbert <marc.herbert@intel.com>
At first I assumed some refactorings forgot to update the comments to
match. Then I saw some of these could never had made sense ever.
This does not fix _all_ doxygen warnings, it only makes the remaining
warnings easy to grep -v. This is just good enough for me to test other
doxygen changes without being drown into warning noise.
C files are not parsed by the default doxygen configuration - "if it's
not tested then it does not work".
Signed-off-by: Marc Herbert <marc.herbert@intel.com>
Remove all the duplicate \file platform/lib/cpu.h. The \file parameter
is optional, the duplicates made these entire comments no-ops and spit a
lot of warnings.
Doxygen knows where the files are.
Removed the \file argument in other places as well which fixes a ton of
warnings like:
sof/src/audio/volume/volume_hifi3.c:7: warning: the name
'audio/volume_hifi3.c' supplied as the argument in the \file statement
is not an input file
Or:
sof/src/lib/pm_runtime.c:7: warning: the name 'lib/pm_runtime.c'
supplied as the argument in the \file statement matches the following
input files:
sof/src/lib/pm_runtime.c
sof/src/platform/intel/cavs/lib/pm_runtime.c
sof/src/platform/library/lib/pm_runtime.c
Please use a more specific name by including a (larger) part of the path!
Note these warnings are not seen in the default doxygen configuration
which ignores a lot of comments.
Signed-off-by: Marc Herbert <marc.herbert@intel.com>
pointers should have been clear on reset step which is called between
prepare and hd is allocated with rzalloc so its already 0 on first call.
Signed-off-by: Curtis Malainey <cujomalainey@chromium.org>
Reduce the system and system_runtime size, fine tune the size of runtime
and runtime_shared sections.
Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
Add ALH DAI class definition, ALH DAI objects can be
instantiated as:
Object.Dai.ALH."N" {
direction "capture" # playback or capture
dai_name "SDW0-Capture"
id 2
Object.hw_config."2" {
}
}
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
This patch adds to DMIC driver support for binary data based HW
registers setup. The driver mode is selected in Kconfig.
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
This patch replaces previous constant 400 ms ramp time with
sample rate dependent first order slope. The Slope coefficient -205
as Q15 and offset 500 as Q0 cause 400 ms ramp for 16 kHz and
200 ms ramp for 48 audio. The ramp min and max time are limited to
previously used check values. The default ramp is used when IPC does
not provide it from topology.
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
This patch moves the run-time decimation factors search and filter
coefficients scaling code to separate module as preparation to add
more functionality to the driver. There are no changes to
functionality.
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
In preparation for more functionality the module is moved
to own directory similarly as other DAI drivers.
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
Add support for reuse of sof-tgl-rt711-rt1308 on Google Volteer. This
is not intended for production but removes both hotwording and
smart-amp support - this simpler topology is intended for
SoundWire/DMIC tests only.
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
The topologies used for sof-tgl-rt711-rt1308 and
sof-tgl-max98357a-rt5682 are almost equivalent.
Conditionally add support for the amplifier reference dailink and BT
offload, so that this topology can be used as is on Google
Volteer. This will help root-cause suspend/resume issues we see only
on TGL_RVP_SDW
Related kernel PR: https://github.com/thesofproject/linux/pull/3006
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
This change avoids build error:
cc1: warnings being treated as errors
sof/test/cmocka/src/common_mocks.c: In function ‘__panic’:
sof/test/cmocka/src/common_mocks.c💯 warning: ‘noreturn’ function does return
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
This patch helps to avoid the build fail due to running out of .bss
section in Apollo Lake platforms.
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
This reverts commit 38f18bd082.
The above commit causes the issue "sof section `.bss'
will not fit in region `sof_fw'" on APL with xcc,
revert it.
Signed-off-by: Chao Song <chao.song@linux.intel.com>
This patch contains updates to add beam on/off and direction controls.
The common m4 tasks to add controls are placed to include files
tdfb_controls.m4, tdfb_defines.m4, tdfb_undefines.m4.
The single beam examples are replaced by blobs with 0, +/-30, and +/-90
degree angled beams. The Arrays are 50m, 68mm spaced for typical
notebook microphones. The 28mm example is for four microphones. A four
microphones for notebook with microphones at 0, 36, 146, and 182mm
line locations.
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
Topologies 1.0 location has been changed. This update allows the
tool to create the files into correct path.
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
The delay-and-sum beamformer has highest white noise gain (WNG)
performance. It's good id suppressing microphone self noise. The
beam is steered with pure delay adjust in the all-pass filter
bank. Default type is still super directive. Use DSB or SDB
as beamformer type to select.
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
Matlab does not support isfile(), so another command is used to
check if a file exists. The new way works both in Octave and Matlab.
The bf_defaults.m is fixed to properly initialize empty strings
to cell arrays. It's needed with minimal command like usage
as shown in SOF Docs examples.
In bf_design.m the num_filters determination is moved after array
helpers because other than line and circle do not use mic_n parameter.
The bug resulted to zero num_filters.
In bf_merge.m the unused bf3 and bf4 are removed.
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
This patch essentially adds support for steer_az/steer_el to be
vector instead of scalar. The beam off preset is added by default
automatically for N-channel in N-channel out configurations. Microphone
(x,y,z) coordinates are passed in to blob for direction of arrival
reporting.
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
This patch fixes the incorrect delaying of simulation input signal to
microphones. Instead of delaying the old code advanced the input the
more the larger the input is. E.g. It caused the tests for line arrays
to show a mirrored beam pattern.
The num_filters is replaced by mic_n (microphones count). It is the
correct count to use here though usually filters count is the same.
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
The plots help to understand beamformer channel filters characteristic.
Frequency response is usually all-pass type and group delays match
the delays need to time-align the waveforms from steer angle.
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
This patch improves the beamformer performance (vs. tap count) by
shifting the extract window location for IFFT output by mean of
all impulse responses center. Previously the first filter was centered
and other filters were more towards start or end of impulse response.
The change helps to cope with smaller filter length with larger size
arrays with steer angles those spread the impulse response further
away time-wise from each other.
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
This patch prevents topology parse failure when there are multiple
controls, e.g. enum controls.
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
This patch adds the enums set/get controls for beam direction
(azimuth). The switch control provides a beam-off bypass from the
configured microphones to channels. It is used when directional
capture is not desired.
The configuration blob is updated to pass filters settings for
multiple angles, a bypass coefficients set, and microphones (x, y, z)
coordinates for direction enum get (implemented later).
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
Fine tune the size of runtime and runtime_shared sections, use different
counts for different SRAM size scenarios, to make full use of all the
Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>