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
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 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>
With the release of RTNR version 20220728, period for capturing pipeline requires at least 5ms.
Periods setting for 16KHz capturing pipeline is also removed since RTNR is currently running in 48KHz capturing pipeline only.
Signed-off-by: Ming Jen Tai <mingjen_tai@realtek.com>
Remove mt8186 unused topologies.
We use sof-mt8186 on our demo board, sof-mt8186-mt6366-rt1019-rt5682s
and sof-mt8186-mt6366-da7219-max98357 will no be used anymore.
Signed-off-by: Chunxu Li <chunxu.li@mediatek.com>
We add a new i.MX8MP topology which will use the compress API for PCM
capture. This topology is mainly used for testing.
Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
We add a new i.MX8MP topology which will use the compress API for PCM
playback. This topology is mainly used for testing.
Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
We add a new i.MX8Q(M/XP) topology which will use the compress API for
PCM capture. This topology is mainly used for testing.
Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
We add a new i.MX8Q(M/XP) topology which will use the compress API for
PCM playback. This topology is mainly used for testing.
Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
We want to be able to create topologies for the case of
compress capture. This change will enable us to do so.
Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
This change will allow us to prepare for adding a new macro
for the case of compress capture.
Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
After commit:
5763c74bf4 ("codec_adapter: Remove setup config from module data")
we no longer setup config bytes in codec adapter control bytes.
So, we need to remove ca_config bytes and fix payload size. This
didn't introduce any bug because this is the default
CA_SETUP_CONTROLBYTES. Each topology uses a custom control bytes
which overrides this default values.
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
This patch allows to test SRC with all 16/24/32 bit formats
in UP-squared device. Without this patch only 16 bit is
supported.
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
setup config data was removed with commit
5763c74bf4 ("codec_adapter: Remove setup config from module data")
update documentation to reflect this.
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
We apparently missed quite a few platforms with SSP1, and SSP5 is also
needed for APL/GLK.
One day we'll have a better way to add topologies, but so far it's
brute-force combinatorial addition. Oh well.
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
For some reason we added DMIC-based topologies for all platforms
except GLK and APL.
This should be back-ported to 2.2 stable.
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
In the earliest design, mclk is turned on in set_config() and never
turned off. The behavior is modified in this commit:
d5840a9200 ("ssp: move mclk request/release to pre_start and post_stop")
Now the mclk is enabled only during audio streaming so some codec may
pop. This commit adds the always-on behavior back as an new feature.
Signed-off-by: Brent Lu <brent.lu@intel.com>
RT1316 is exposed by the machine driver as having an echo reference,
so the indices are different from the regular ones.
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Somehow we assumed that all ADL platforms support BT_OFFLOAD. Wrong,
this is only valid for Chromebooks and needs to be set externally in
the CMakeFiles definitions.
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
HP Omen 16 devices have an amplifier on link3, add the required
configuration macro.
BugLink: https://github.com/thesofproject/linux/issues/3727
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Generate 2 files for 1 and 2ch cases.
These topologies can be used by setting
options snd-sof-pci tplg_filename=<file>
in /etc/modprobe.d/alsa-base.conf
BugLink: https://github.com/thesofproject/sof/issues/5989
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
There are multiple cases where we cannot detect that PDM1 is used
instead of the default PDM0.
BugLink: https://github.com/thesofproject/sof/issues/5989
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Introduce a new component to perform configurable audio post processing
on playback path before smart amplifier.
1. Put google_audio_post_processing libs at $SOF_REPO/third_party/lib
- libgoogle_audio_post_processing.a
- libc++.a
- libc++abi.a
2. Enable google_audio_post_processing in config override
$SOF_REPO/src/arch/xtensa/configs/override
CONFIG_COMP_GOOGLE_AUDIO_POST_PROCESSING=y
3. Build the firmware and tool with xcc
4. To verify it works:
- aplay some audio
- amixer and grep GAPP
- sof-ctl to get/set control
Signed-off-by: Kehuang Li <kehuangli@google.com>
Due to security requirement, the config bytes control is set to read-only
for RTNR with hard-coded the config blob in the topology.
It's WA until the security approval is obtained.
Signed-off-by: Pin-chih Lin <johnylin@google.com>
Remove the setup config info from all initial config data in the
codec_adapter kcontrol's. This is no longer needed.
Fixes: bfd5e61768 ("topology1: remove setup config info from all codec_adapter topologies")
Fixes: 692299f2a6 ("codec_adapter: Remove setup config from module data")
Signed-off-by: Paul Olaru <paul.olaru@nxp.com>
We've never enabled dynamic pipelines for SoundWire CI, it's high time
we did so.
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Pipeline macro pipe-eq-iir-volume-capture-16khz.m4 misses an
update done to other pipelines. The macro COMP_PERIOD_FRAMES()
gives the correct buffer size in other pipelines.
Without this patch change of pipeline scheduling to 10 ms
from default 1 ms causes pipeline fail to buffer size check.
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
with changes we have - 3.072MHz bclk, 32-bit slot-width,
24-bit data-width.
rt1019 in auto mode is compatible with rt1015p driver.
By keeping the SSP configuration same as rt1015 will have fewer
configuration.
Signed-off-by: Vamshi Krishna <vamshi.krishna.gopal@intel.com>
This PR is based on https://github.com/thesofproject/sof/pull/5616
It decouples the switch-typed control for enabling/disabling from the
control bytes.
Previously, control blobs should be sent from userspace to to toggle
RTNR on/off.
With this PR, RTNR can be toggled by setting the UCM switch value.
cset "name='RTNR10.0 rtnr_enable_10' off"
cset "name='RTNR10.0 rtnr_enable_10' on"
or from command line
amixer -c0 cset name='RTNR10.0 rtnr_enable_10' 1
amixer -c0 cget name='RTNR10.0 rtnr_enable_10' 0
Signed-off-by: Pin-chih Lin <johnylin@google.com>
Signed-off-by: Ming Jen Tai <mingjen_tai@realtek.com>
merge copy_func
The order of BE DAI Link in topology must match the order in machine
driver. Create this include file to organize the definition of BE DAI
Link ID.
Signed-off-by: Brent Lu <brent.lu@intel.com>
Add a topology sof-adl-cs35l41 which supports four Cirrus Logic
CS35L41/CS35L53 speaker amplifiers running in TDM mode without
headphone codec on ADL platform.
Two compile options are added to support the board configuration:
'NO_HEADPHONE' removes headphone pipelines from the topology while
'SSP_AMP_LINK_ORDER' uses the DAI Link order in sof_ssp_amp.c machine
driver instead of sof_rt5682.c.
Signed-off-by: Brent Lu <brent.lu@intel.com>
This patch duplicates the configuration at the higher level and adds
the "HEADSET_DEEP_BUFFER" definition.
This is not very elegant and will require changes in two places, but I
don't see a better solution with M4.
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
We don't want to release these topologies to world+dog due to
dependencies on kernel version, so let's make the deep-buffer
optional. The next patch will enable these topologies in the
development/ directory.
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Before we enable the headset deep-buffer solution, we want to extract
the NOJACK topologies where the headset deep-buffer would be an
oxymoron.
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
For some reason the topologies are in separate blocks, regroup them.
No functionality change.
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
This patch duplicates the configuration at the higher level and adds
the "DEEP_BUFFER" definition. The topologies are generated in the
kernel_dependent/v5.19 directory and shall only be used by
distro/users when their kernel is based on 5.19-rc1 or later. If these
topologies are used with an older kernel, the ASoC DPCM state machine
issues will result in broken audio. We have no ability to detect a
dependency on kernel to load a topology.
This is not very elegant and will require changes in two places, but I
don't see a better solution with M4.
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
We don't want to release these topologies to world+dog due to
dependencies on kernel version, so let's make the deep-buffer
optional. The next patch will enable these topologies in the
development/ directory.
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
We don't support this topology in production and it's not clear if
it's even maintained, move to development.
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
This patch enables testing of DRC in HDA generic devices by adding
it to headset/speaker pipeline after mixer.
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
STOP copying all files
from dir: sof/tools/build_tools/topology/topology2/cavs/
to dir: sof/tools/build_tools/topology/
The original plan discussed in the reviews of commit c0bee428ae
("topology: prepare for Topology2.0") and commit 308a24a92b
("topology2: Add build support") and more recently
mentioned in #4611 was to overwrite in place some v1 topologies with
newer v2 topologies in order to "force" users to upgrade without them
realizing it. This original plan is now being abandoned. v2 topologies
will never overwrite v1 topologies and if ever then certainly not "en
masse". Moreover, v2 topologies will be placed in a new /lib/firmware/
subdirectory. So, partial revert the aforementioned commits. More
specifically. stop installing v2 topologies into the same directory as
v1 topologies.
Note there had never been any actual overwrite of any v1 topology yet
because there had never been any v2 topology of the same name.
At this point in time this gets rid of the following copies:
tools/build_tools/topology: abi.conf
tools/build_tools/topology: cavs-mixin-mixout-hda-2ch-cnl.conf
tools/build_tools/topology: cavs-mixin-mixout-hda-2ch-cnl.tplg
tools/build_tools/topology: cavs-mixin-mixout-hda-2ch-tgl.conf
tools/build_tools/topology: cavs-mixin-mixout-hda-2ch-tgl.tplg
tools/build_tools/topology: cavs-mixin-mixout-hda-4ch-cnl.conf
tools/build_tools/topology: cavs-mixin-mixout-hda-4ch-cnl.tplg
tools/build_tools/topology: cavs-mixin-mixout-hda-4ch-tgl.conf
tools/build_tools/topology: cavs-mixin-mixout-hda-4ch-tgl.tplg
tools/build_tools/topology: cavs-mixin-mixout-hda.conf
tools/build_tools/topology: cavs-mixin-mixout-hda.tplg
tools/build_tools/topology: cavs-passthrough-hdmi.conf
tools/build_tools/topology: cavs-passthrough-hdmi.tplg
tools/build_tools/topology: cavs-sdw.conf
tools/build_tools/topology: cavs-sdw.tplg
tools/build_tools/topology: cavs-tgl-nocodec.conf
tools/build_tools/topology: cavs-tgl-nocodec.tplg
tools/build_tools/topology: nhlt-ace-mtl-nocodec.bin
tools/build_tools/topology: nhlt.bin
tools/build_tools/topology: nhlt-cavs-tgl-nocodec.bin
tools/build_tools/topology: sof-mtl-nocodec.conf
tools/build_tools/topology: sof-mtl-nocodec.tplg
From an "installer/" and sof-bin release perspective, this removes the
following topology that was just added by commit
ba26eeff9d ("topology2: cavs-nocodec: Add support for MTL nocodec
topology"). Installing v2 topologies into a new /lib/firmware/
subdirectory has not been implemented yet.
No other change besides dropping these copies, everything else is the
same.
Signed-off-by: Marc Herbert <marc.herbert@intel.com>
These paths are not well supported on all devices and lead to errors such as
17:06:06 kernel: HDA Digital: ASoC: dpcm_be_dai_startup() failed at Digital Playback and Capture (-22)
17:06:06 kernel: Digital Playback and Capture: __soc_pcm_open() failed (-22)
17:06:06 kernel: snd_hda_codec_conexant ehdaudio0D0: ASoC: error at snd_soc_dai_startup on Digital Codec DAI: -22
17:06:06 kernel: snd_hda_codec_conexant ehdaudio0D0: ASoC: error at snd_soc_dai_startup on Digital Codec DAI: -22
17:06:06 kernel: snd_hda_codec_conexant ehdaudio0D0: didn't find PCM for DAI Digital Codec DAI
We've already removed this digital path for IPC4/topology2, let's also remove this for topology1.
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.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>
The correct frame length should be calculated by
FRAME_LEN = SAMPLING_RATE * PERIODS / 1000000
The macro COMP_PERIOD_FRAMES does the thing.
Signed-off-by: Curtis Malainey <cujomalainey@chromium.org>
Signed-off-by: Ming Jen Tai <mingjen_tai@realtek.com>
The DTS Codec can be conditionally added to the sof-adl-nau8825 topology
on those pipelines intended for headphone and speaker output.
Signed-off-by: Joe.Cheng <joe.cheng@xperi.com>
For builds with no Hotword on DSP, generic dmic m4 is used.
RTNR is running on DMIC CORE ID 1. Hence adding the flag.
Signed-off-by: Jairaj Arava <jairaj.arava@intel.com>
NO_AGGREGATION is never used now. Let's remove it.
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Libin Yang <libin.yang@intel.com>
This patch adds build of topologies sof-hda-generic-multiband-drc.tplg
and sof-hda-generic-2ch-multiband-drc.tplg. The processing happens in
pipeline part after mixer. Volume is controlled in PGA before mixer.
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
Due to m4 peculiarities it is require to escape the content of an
ifdef. I forgot to add those escaping for around the `SPK_MIC_PERIOD_US`
definition leading to erroneous value if GOOGLE_RTC_AUDIO_PROCESSING was
defined.
Signed-off-by: Lionel Koenig <lionelk@google.com>
This is a temporary work-around to enable CI tests while performance
is being optimized.
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
This should make sure to surface pipeline period and microphone
processing in the top topology file so incoherence are easier to spot
and correct.
I compared topology1/production/*.conf outputs prior and after the
change: except some new line and comment change introduced by the
simplification, there are no changes.
Signed-off-by: Lionel Koenig <lionelk@google.com>
When host is more heavy loading(e.g. camera recoding case),
the size of dai buffer is 4ms and not enough. Increase 2ms
period capture pipeline to buffer more data to avoid overrun.
Signed-off-by: YC Hung <yc.hung@mediatek.com>
It's not clear why the initial contribution used mclk ID1, mclk ID0 is
used by 99% of devices - and a manual inspection of NHLT supports that
claim. We will have to deal with the MCLK ID1 case with quirks.
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Some builds require more memory, hotword can be handled by CRAS so lets
add the ability to drop it. The 16kHz dmic is not needed either so lets
drop that too.
Signed-off-by: Curtis Malainey <cujomalainey@chromium.org>
The explanation takes sof-adl-max98357a-rt5682 as an example:
During pipeline_complete(), we search for the source widget
for a pipeline from a list and the ipc_get_ppl_comp() returns
the first widget from the list of source widgets for a pipeline.
With SSP2.IN on pipeline 1, which is the same pipeline ID as the
ECHO_REF playback pipeline for PCM0P, pipeline_complete() for
pipeline 1 ends up not walking the rest of widgets in pipeline 1.
This Echo Ref feature works in chrome kernel today by accident,
because we set up the widgets in the reverse order after resuming
from runtime suspend and the source widget happens to be PCM0P.
To fix this, create a new pipeline for the capture dai widget SSP2.IN,
so that it doesn't pollute the widget list for pipeline 1.
Fixes: #5395
Signed-off-by: Chao Song <chao.song@linux.intel.com>
This reverts commit f50b6fe0ad.
I discovered the hard way that this change causes alsatplg version
1.2.2 (the default version in the current LTS Ubuntu) to corrupt just
a few bytes in .tplg output in an incredibly discrete and
time-consuming way: no error message at build time and same file size.
See example at https://github.com/thesofproject/sof/pull/5162.
We could/should just require a minimum alsatplg version at the CMake
level but at this moment we don't even know which minimum version is
needed and we would also need to take some time to test a few alsatplg
versions. If version 1.2.2 would just fail with an decent error
message that can be searched and discussed then everything would be
fine but silent corruption is really not OK.
So users of recent versions will unfortunately have to live with the
huge number of warnings for now.
Signed-off-by: Marc Herbert <marc.herbert@intel.com>
The codec adapter component only uses a single config now. So remove the
runtime config kcontrol as the same kcontrol can be used for runtime
config as well.
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
The topology is useful for testing long binary control IPC and to
test equalization of headset and speaker in sof-hda-generic devices.
It adds a flat IIR and a generic FIR that creates a mild loudness
effect.
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
The previous patch increased the FIR length but it also triggered
a numerical issue in FIR design with long minimum phase filters. The
filter became essentially a band-stop filter and causes difficulties
in test of EQ component. Also the equalizer sounds subjectively
bad. The fix is to change the design to linear phase that always
converges.
Fixes: 0d296ce7d1
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
The topologies sof-hda-generic were earlier fixed to use short
20 ms ramp because of nearly inaudible UI blip tones with 250 us
ramp. Some changes to topologies build m4 macros have brought
back the long ramp.
This patch fixes the playback ramps to use 20 ms long transitions.
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
This patch avoids the issue that topology .conf file after m4
processing can contain multiple same name objects playback_pga_conf
for volume component tokens with possibly different settings. Alsatplg
does not error from such input and it's not defined which impacs
topology binary.
The new naming is pga_conf_X and and_pga_tokens_X where X is the
pipeline number.
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>