This is for generic hda machine driver. Dmic is
not included since it is been developing. The gain
module in ipc4 has the function of volume component
in ipc3 and we use it to control volume.
Signed-off-by: Rander Wang <rander.wang@intel.com>
Volume is supported by gain module in ipc4. We need
to set curve_type, curve_duration and init_val for
this module.
Signed-off-by: Rander Wang <rander.wang@intel.com>
Convert all playback pipelines to have a mixer so adding a deep-buffer
pipeline will be simpler.
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
This enables EQ component with IIR filter for i.MX8QM/i.MX8QXP/i.MX8MP
with wm8960 codec.
Users can try various configurations for EQ parameters using sof-ctl tool:
$ amixer -Dhw:1 controls | grep EQ
numid=44,iface=MIXER,name='EQIIR1.0 eqiir_coef_1'
$ ./sof-ctl -Dhw:1 -n 44 -s sof/tools/ctl/eq_iir_bassboost.txt
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
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 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>
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>
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 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>
Copier widget may be used as a dai component in ipc4 path,
so we need to add dai token in copier, including dai_index,
dai_type and direction. They are optional attributes and can
be set only for dai type. We don't reuse copier_type for dai
since copier type may be host or just copy module.
Signed-off-by: Rander Wang <rander.wang@intel.com>
Signed-off-by: Chao Song <chao.song@linux.intel.com>
Tested-by: Bard Liao <bard.liao@intel.com>
Add a deepbuffer pipelines connected to the the mixer-dai
pipeline for SSP0 and SSP2. The pipeline deadlines are left at
1ms for now and will be changed later after the mixer pipelines
are validated.
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Add class definition for cavs passthrough-capture
pipeline, and it can be instantiated as:
Object.Pipeline.passthrough-capture."N" {
format "s16le"
period 1000
time_domain "timer"
channels 2
rate 48000
}
Signed-off-by: Chao Song <chao.song@linux.intel.com>
Add class definition for cavs passthrough-playback
pipeline, and it can be instantiated as:
Object.Pipeline.passthrough-playback."N" {
format "s16le"
period 1000
time_domain "timer"
channels 2
rate 48000
}
Signed-off-by: Chao Song <chao.song@linux.intel.com>
Add class definition for HW Config, HW Config object
can be instantiated as:
Object.Base.hw_config."NAME" {
id 0
mclk_freq 24000000
bclk_freq 4800000
tdm_slot_width 25
}
where NAME is the unique instance name for the hw_config
object within the same alsaconf node, for example, SSP0.
Signed-off-by: Ranjani Sridharan <ranjani.sidharan@linux.intel.com>
Signed-off-by: Chao Song <chao.song@linux.intel.com>
Add class definition for manifest.
Signed-off-by: Ranjani Sridharan <ranjani.sidharan@linux.intel.com>
Signed-off-by: Chao Song <chao.song@linux.intel.com>
Add FE DAI class definition, the FE DAI object can be
instantiated as:
Object.Base.fe_dai."NAME" {
id 0
}
Signed-off-by: Ranjani Sridharan <ranjani.sidharan@linux.intel.com>
Signed-off-by: Chao Song <chao.song@linux.intel.com>
Add class definition for pcm, pcm object
can be instantiated as:
Object.PCM.pcm."N" {
id 2
pcm_name "Headset"
direction "playback"
}
Signed-off-by: Ranjani Sridharan <ranjani.sidharan@linux.intel.com>
Signed-off-by: Chao Song <chao.song@linux.intel.com>
Add class definition for copier widget, it can be
instantiated as:
Object.Widget.copier."N" {
copier_type "host"
cpc 100000
}
Signed-off-by: Chao Song <chao.song@linux.intel.com>
capture
S32_LE without PGA is not supported in alsabat, switch to use
pipe-volume-capture and unblock the CI alsabat test case.
Signed-off-by: Iris Wu <xiaoyun.wu@intel.com>
The use of s32le did not expose any problems on APL, but alsa-bat was
previously reported as failing on JSL. Now that this test was extended
to CML_NOCODEC, we see the same issue. Manual tests with s24le show no
issues.
Let's just use s24le across the board and move on.
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Enable the bclk clock control for SSP2.
Note that this impacts existing GLK-based chromebooks as well as newer
hardware.
Signed-off-by: Brent Lu <brent.lu@intel.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Set clks_control to (SOF_DAI_INTEL_SSP_CLKCTRL_MCLK_ES |
SOF_DAI_INTEL_SSP_CLKCTRL_BCLK_ES) to enable MCLK/BCLK early start
feature.
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Define the SSP_CC_MCLK/BCLK_ES bit to be used in SSP_CONFIG_DATA macro
to enable mclk/bclk on hw_params and disable malk/bclk on hw_free.
Signed-off-by: Brent Lu <brent.lu@intel.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
For some reason s32le does not work for DAI definitions on JSL-NOCODEC
platforms. alsa-bat tests fail, but they work fine on APL, CNL,
TGL. This is likely to be an ICL platform issue. The root cause is
still TBD
Use s24le for now to unlock Intel daily tests.
All other platforms remain with s32le.
BugLink: https://github.com/thesofproject/sof/issues/4427
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Buffer and params not initialised to zero like the other IPC structures
used by testbench. Fix this.
Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Move the existing sof-apl-nocodec to the development folder, in case
SOF CI still wants to use it.
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Not all devices have 4 cores, some only have 2 and even APL/GLK is
currently limited to a single core.
For now we still use a single core for all topologies, we will enable
multi-core in a follow-up patch.
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Prepare for reuse across all platforms. For now this still uses
single-core.
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
We first want to enable the simplified topologies, then multi-core
then dynamic pipelines. The latter two cases will be handled in
follow-up patches.
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
There is no rt1308 on the TGL-H-RVP platform, need to add a topology
file with only rt711 to enable soundwire on the TGL-H-RVP platform.
The patch of enable soundwire on the TGL-H-RVP platform has been
merged into the thesofproject/linux.
Signed-off-by: Gongjun Song <gongjun.song@intel.com>
Remove the addition of DAPM routes for virtual widgets.
These are not needed for suppressing errors with legacy
machine drivers. Just adding the virtual widget is enough.
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
The UpExtreme HAT connector with the SoundWire,
I2S, DMIC mixed mode exposes the following pins
DMIC_DATA0: input: HAT PIN 8
DMIC_CLK: output: HAT PIN 26
IS2_MCLK: output: HAT PIN 16
I2S1_SCLK: output: HAT PIN 32
I2S1_SFRM: output: HAT PIN 10
I2S1_TXD: output: HAT PIN 24
I2S1_RXD: input: HAT PIN 18
Let's use core3 for DMIC, core2 for SSP0, core1 for SSP1 and core0 for
SSP2.
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Add some pipeline classes for volume playback/capture, passthrough
capture and eq capture.
Each of these classes include the pipeline widget objects, connections
between pipeline widgets and pipeline attribute definitions
For ex: A volume playback pipeline can be instanted as follows:
Object.Pipeline.pipeline-volume-playback."2" {
channels 2
rate 48000
index 5
format "s32le"
}
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
In preparation for Topology2.0, move the current topology files
to the topology1 folder and once the 1.0 topologies are
built copy them to the /sof/tools/build-tools/topology folder.
When Topology2.0 topologies come along, they will be built into
the topology2 folder and the 2.0 binaries will be copied over
the 1.0 binaries.
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
For speaker pipeline, we want to deploy DRC/EQ for partial TGL device
like Eldrid. The definition flag DRC_EQ is added to make the choice of
adopting the playback pipeline with DRC/EQ.
Signed-off-by: Pin-chih Lin <johnylin@google.com>
Remove the duplicate SectionData when multiple EQ's use the
same filter coefficients. There is no change in the topology
binary generated with just one SectionData instead of multiple
ones.
But this will help clean up the conf file so that converting to
topology2.0 will become easier as the name tells me which
coefficients to include.
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
The pipeline widget can be instantiated within a pipeline class as:
Object.Widget.pipeline."N" {
index 1
time_domain "timer"
period 1000
}
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Add a route class that will be used for creating DAPM routes
between widgets. A route can be between 2 widgets or between a
widget and pipeline endpoint as follows:
Object.Base.route."N" {
source "dai.SSP.1.dai.capture"
sink "buffer.0.1"
}
Object.Base.route."N" {
source "buffer.2.1"
sink "pga.2.0"
}
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Add the volume and switch mixer control objects for the
PGA class. The mixers will be added to the PGA widget
if the pga widget is instantiated with names for each
of the mixers as follows:
Object.Widget.pga.0 {
Object.Control.mixer.1 {
name "1 Master Capture Volume"
}
Object.Control.mixer.2 {
name "Capture Switch"
}
}
If the name is only provided for one of the controls, only
that control will be added to the widget when building topology.
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Add the class definition for a mixer control.
A mixer control can be instantiated as follows:
Object.Control.mixer."0" {
Object.Base.channel."fr" {
shift 0
}
Object.Base.channel."fl" {}
Object.Base.tlv."vtlv_m64s2" {
Object.scale."0" {
mute 1
}
}
Object.ops."ctl" {
info "volsw"
get 256
put 256
}
}
Also add the other commonly used class definitions that
will be used to instantiate the mixer object such as,
channel, TLV, ops, scale etc.
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Add the class definition for ASRC widget, it can be
instantiated as follows:
Object.Widget.asrc."N" {
period_sink_count 2
period_source_count 2
format "s24le"
rate_out 48000
asynchronous_mode 1
operation_mode 0
}
Where N is the unique instance number for asrc widget
within the same alsaconf node.
Signed-off-by: Chao Song <chao.song@linux.intel.com>
Add the class definition for SRC widget, it can be
instantiated as follows:
Object.Widget.src."N" {
period_sink_count 2
period_source_count 2
format "s24le"
rate_out 48000
}
Where N is the unique instance number for src widget
within the same alsaconf node.
Signed-off-by: Chao Song <chao.song@linux.intel.com>
Add the class definition for PGA widget. It can be
instantiated as follows:
Object.Widget.pga."N" {
format s24le
index 0
period_sink_count 2
period_source_count 2
}
Where N is the unique instance number for pga widget in the same
alsaconf node.
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Add the definition for the buffer class. A buffer object
can be instantiated as follows:
Object.Widget.buffer."N" {
index 0
periods 2
caps "host"
}
where 'N' is a unique instance number for the buffer object within
the same alsaconf node.
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Add the class definition for DAI widgets. A DAI widget
can be instantiated as follows:
Object.Widget.dai."playback" {
type SSP
index "1"
period_sink_count "2"
period_source_count "0"
widget_type "dai_in"
}
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
About
-----
This is a high level keyword extension on top of the existing ALSA
conf topology format designed to:
1) Simplify the ALSA conf topology definitions by providing high level
"classes" so topology designers need to write less config for common
object definitions.
2) Allow simple reuse of objects. Define once and reuse (like M4) with
the ability to alter objects configuration attributes from defaults.
3) Allow data type and value verification. This is not done today and
frequently crops up in FW bug reports.
Common Topology Classes
-----------------------
Topology today has some common classes that are often reused throughout
with slightly altered configurations. i.e. widgets (components),
pipelines, dais and controls.
This PR introduces the high level concept of reusable "class" like
definition for a AIF_IN/AIF_OUT type object that can be used to create
topology objects.
Common Topology Attributes
--------------------------
Topology defines a lot of attributes per object with different types
and constraints. Today there is no easy way to validate type or
constraints and this can lead to many hard to find problems in FW at
runtime.
A new keyword "DefineAttribute" has been added to define attribute
type, size, min value, max value, enum_values. This then allows
alsatplg to validate each topology object attribute.
Topology Classes define the list of attributes that they use and
whether the attribute is mandatory, can be overridden by parent users
or is immutable. This also helps alsatplg emit the appropriate errors
for attribute misuse.
Common Topology Arguments
-------------------------
Arguments are used to pass essential data needed for instantiating an
object particularly needed for the object name. A new keyword
"DefineArgument" has been added to define the arguments. The order in
which the arguments are defined determines the name for the widget.
For example, in the case of the host widget, the name would be
constructed as "host.1.playback" where "1" is the pipeline_id argument
value and "playback" is the direction argument value.
Attribute Inheritance:
----------------------
One of the key features of Topology2.0 is howthe attribute values are
propagated from a parent object to a child object. This is accomplished
by adding attributes/arguments with the same name for a parent and an
object. By doing so, when creating a child object, the value for the
common attribute is populated from the parent. If the value is provided
in the child object instance, then it overrides the value coming from
the parent.
ALSA Conf Parser
----------------
All the changes being proposed and discussed here must be 100%
compliant with the ALSA conf parser. i.e. no syntax changes or
changes to semantics for any existing keyword.
It's intended that there will be NO changes to the ALSA conf parser
(unless new keywords require this ?) and all topology building
changes will be in the alsatplg compiler.
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.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>
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>
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>
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>