From e6599246882be6466b38911422ce2504c1e816e2 Mon Sep 17 00:00:00 2001 From: Seppo Ingalsuo Date: Mon, 6 Nov 2023 17:41:28 +0200 Subject: [PATCH 1/2] Tools: Topology2: Add widget class IGO NR This patch allows to build topologies to use the IGO NR component. Signed-off-by: Seppo Ingalsuo --- .../topology2/include/components/igo_nr.conf | 100 ++++++++++++++++++ 1 file changed, 100 insertions(+) create mode 100644 tools/topology/topology2/include/components/igo_nr.conf diff --git a/tools/topology/topology2/include/components/igo_nr.conf b/tools/topology/topology2/include/components/igo_nr.conf new file mode 100644 index 000000000000..cd85ccb2a3d8 --- /dev/null +++ b/tools/topology/topology2/include/components/igo_nr.conf @@ -0,0 +1,100 @@ +# +# +# This widget class definition is for the Intelligo Noise Reduction +# component. It is a proprietary processing component by Intelligo +# Technology, Inc. Please find the LICENCE from the component source +# directory. The stub version of the library can be freely used to test +# basic functionality of the library with pass-through processing. +# +# All attributes defined herein are namespaced +# by alsatplg to "Object.Widget.igo_nr.attribute_name" +# +# Usage: this component can be used by declaring in the parent object. i.e. +# +# Object.Widget.igo_nr."N" { +# index 1 +# } +# } + +# +# Where M is pipeline ID and N is a unique integer in the parent object. + + + +Class.Widget."igo_nr" { + # + # Pipeline ID + # + DefineAttribute."index" { + type "integer" + } + + # + # Unique instance for IGO_NR widget + # + DefineAttribute."instance" { + type "integer" + } + + # Include common widget attributes definition + + + attributes { + !constructor [ + "index" + "instance" + ] + !mandatory [ + "num_input_pins" + "num_output_pins" + "num_input_audio_formats" + "num_output_audio_formats" + ] + + !immutable [ + "uuid" + "type" + ] + !deprecated [ + "preload_count" + ] + unique "instance" + } + + # + # IGO_NR widget switch control + # + Object.Control { + # Switch controls + mixer."1" { + Object.Base.channel.1 { + name "fl" + shift 0 + } + Object.Base.channel.2 { + name "fr" + } + # Operation volsw is used for single or double mixer + # control. See section control operations in + # https://www.alsa-project.org/alsa-doc/alsa-lib/group__topology.html + Object.Base.ops.1 { + name "ctl" + info "volsw" + #259 binds the mixer control to switch get/put handlers + get 259 + put 259 + } + max 1 + } + } + + # + # Default attributes for igo_nr + # + # 696ae2bc-2877-11eb-adc1-0242ac120002 + uuid "bc:e2:6a:69:77:28:eb:11:ad:c1:02:42:ac:12:00:02" + type "effect" + no_pm "true" + num_input_pins 1 + num_output_pins 1 +} From 2101f88655ec109eadc942fe5c9c49c4eae60759 Mon Sep 17 00:00:00 2001 From: Seppo Ingalsuo Date: Thu, 19 Oct 2023 18:40:14 +0300 Subject: [PATCH 2/2] Tools: Topology2: Add sof-hda-benchmark-rtnr16/24/32- This patch adds build of hda-generic development topologies to test IGO NR component with all s16/s24/s32 formats. Signed-off-by: Seppo Ingalsuo --- .../topology2/cavs-benchmark-hda.conf | 17 ++++++++ .../development/tplg-targets-bench.cmake | 2 + .../bench/igo_nr_controls_capture.conf | 43 +++++++++++++++++++ .../bench/igo_nr_controls_playback.conf | 43 +++++++++++++++++++ .../include/bench/igo_nr_hda_route.conf | 19 ++++++++ .../topology2/include/bench/igo_nr_s16.conf | 13 ++++++ .../topology2/include/bench/igo_nr_s24.conf | 13 ++++++ .../topology2/include/bench/igo_nr_s32.conf | 13 ++++++ 8 files changed, 163 insertions(+) create mode 100644 tools/topology/topology2/include/bench/igo_nr_controls_capture.conf create mode 100644 tools/topology/topology2/include/bench/igo_nr_controls_playback.conf create mode 100644 tools/topology/topology2/include/bench/igo_nr_hda_route.conf create mode 100644 tools/topology/topology2/include/bench/igo_nr_s16.conf create mode 100644 tools/topology/topology2/include/bench/igo_nr_s24.conf create mode 100644 tools/topology/topology2/include/bench/igo_nr_s32.conf diff --git a/tools/topology/topology2/cavs-benchmark-hda.conf b/tools/topology/topology2/cavs-benchmark-hda.conf index e532fce3088a..ded0067ad7f2 100644 --- a/tools/topology/topology2/cavs-benchmark-hda.conf +++ b/tools/topology/topology2/cavs-benchmark-hda.conf @@ -1,5 +1,6 @@ + Define { ANALOG_PLAYBACK_PCM 'Analog Playback' @@ -286,6 +287,22 @@ IncludeByKey.BENCH_CONFIG { } + # + # IGO NR component + # + + "igo_nr16" { + + } + + "igo_nr24" { + + } + + "igo_nr32" { + + } + # # RTNR component # diff --git a/tools/topology/topology2/development/tplg-targets-bench.cmake b/tools/topology/topology2/development/tplg-targets-bench.cmake index f430ff9e586a..bbc0c04bfdb5 100644 --- a/tools/topology/topology2/development/tplg-targets-bench.cmake +++ b/tools/topology/topology2/development/tplg-targets-bench.cmake @@ -15,6 +15,7 @@ set(components "eqiir" "eqfir" "gain" + "igo_nr" "rtnr" ) @@ -25,6 +26,7 @@ set(component_parameters "BENCH_EQIIR_PARAMS=highpass_50hz_0db_48khz" "BENCH_EQFIR_PARAMS=loudness" "BENCH_GAIN_PARAMS=default" + "BENCH_IGO_NR_PARAMS=default" "BENCH_RTNR_PARAMS=default" ) diff --git a/tools/topology/topology2/include/bench/igo_nr_controls_capture.conf b/tools/topology/topology2/include/bench/igo_nr_controls_capture.conf new file mode 100644 index 000000000000..a2006c17a9d7 --- /dev/null +++ b/tools/topology/topology2/include/bench/igo_nr_controls_capture.conf @@ -0,0 +1,43 @@ + # Created initially with script "./bench_comp_generate.sh igo_nr" + # may need edits to modify controls + Object.Control { + # Un-comment the supported controls in IGO_NR + bytes."1" { + name '$ANALOG_CAPTURE_PCM IGO_NR bytes' + Object.Base.data.1 { + # Data is ipc4 header modified copy from + # tools/topology/topology1/sof/pipe-igonr-capture.m4 + bytes "0x53,0x4f,0x46,0x34, + 0x00,0x00,0x00,0x00, + 0x44,0x00,0x00,0x00, + 0x00,0x00,0x00,0x03, + 0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00, + 0x00,0x20,0x00,0x00, + 0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00, + 0x01,0x00,0x00,0x00, + 0x01,0x00,0x00,0x00, + 0x01,0x00,0x00,0x00, + 0x01,0x00,0x00,0x00, + 0x02,0x00,0x00,0x00, + 0x02,0x00,0x00,0x00, + 0x02,0x00,0x00,0x00, + 0x01,0x00,0x00,0x00, + 0x3d,0x00,0x00,0x00, + 0x09,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00, + 0x00,0x20,0x00,0x00, + 0x34,0x03,0x00,0x00, + 0x00,0x00,0x00,0x00" + } + } + mixer."1" { + name '$ANALOG_CAPTURE_PCM IGO_NR enable' + } + #enum."1" { + # name '$ANALOG_CAPTURE_PCM IGO_NR enum' + #} + } diff --git a/tools/topology/topology2/include/bench/igo_nr_controls_playback.conf b/tools/topology/topology2/include/bench/igo_nr_controls_playback.conf new file mode 100644 index 000000000000..184593f8e5df --- /dev/null +++ b/tools/topology/topology2/include/bench/igo_nr_controls_playback.conf @@ -0,0 +1,43 @@ + # Created initially with script "./bench_comp_generate.sh igo_nr" + # may need edits to modify controls + Object.Control { + # Un-comment the supported controls in IGO_NR + bytes."1" { + name '$ANALOG_PLAYBACK_PCM IGO_NR bytes' + Object.Base.data.1 { + # Data is ipc4 header modified copy from + # tools/topology/topology1/sof/pipe-igonr-capture.m4 + bytes "0x53,0x4f,0x46,0x34, + 0x00,0x00,0x00,0x00, + 0x44,0x00,0x00,0x00, + 0x00,0x00,0x00,0x03, + 0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00, + 0x00,0x20,0x00,0x00, + 0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00, + 0x01,0x00,0x00,0x00, + 0x01,0x00,0x00,0x00, + 0x01,0x00,0x00,0x00, + 0x01,0x00,0x00,0x00, + 0x02,0x00,0x00,0x00, + 0x02,0x00,0x00,0x00, + 0x02,0x00,0x00,0x00, + 0x01,0x00,0x00,0x00, + 0x3d,0x00,0x00,0x00, + 0x09,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00, + 0x00,0x20,0x00,0x00, + 0x34,0x03,0x00,0x00, + 0x00,0x00,0x00,0x00" + } + } + mixer."1" { + name '$ANALOG_PLAYBACK_PCM IGO_NR enable' + } + #enum."1" { + # name '$ANALOG_PLAYBACK_PCM IGO_NR enum' + #} + } diff --git a/tools/topology/topology2/include/bench/igo_nr_hda_route.conf b/tools/topology/topology2/include/bench/igo_nr_hda_route.conf new file mode 100644 index 000000000000..a5d08cf3229f --- /dev/null +++ b/tools/topology/topology2/include/bench/igo_nr_hda_route.conf @@ -0,0 +1,19 @@ + # Created with script "./bench_comp_generate.sh igo_nr" + Object.Base.route [ + { + sink 'dai-copier.HDA.$HDA_ANALOG_DAI_NAME.playback' + source 'igo_nr.1.1' + } + { + sink 'igo_nr.1.1' + source 'host-copier.0.playback' + } + { + source 'dai-copier.HDA.$HDA_ANALOG_DAI_NAME.capture' + sink 'igo_nr.3.2' + } + { + source 'igo_nr.3.2' + sink 'host-copier.0.capture' + } + ] diff --git a/tools/topology/topology2/include/bench/igo_nr_s16.conf b/tools/topology/topology2/include/bench/igo_nr_s16.conf new file mode 100644 index 000000000000..944b905409ec --- /dev/null +++ b/tools/topology/topology2/include/bench/igo_nr_s16.conf @@ -0,0 +1,13 @@ + # Created with script "./bench_comp_generate.sh igo_nr" + Object.Widget.igo_nr.1 { + index 1 + + + } + Object.Widget.igo_nr.2 { + index 3 + + + } + + diff --git a/tools/topology/topology2/include/bench/igo_nr_s24.conf b/tools/topology/topology2/include/bench/igo_nr_s24.conf new file mode 100644 index 000000000000..40963c48b5eb --- /dev/null +++ b/tools/topology/topology2/include/bench/igo_nr_s24.conf @@ -0,0 +1,13 @@ + # Created with script "./bench_comp_generate.sh igo_nr" + Object.Widget.igo_nr.1 { + index 1 + + + } + Object.Widget.igo_nr.2 { + index 3 + + + } + + diff --git a/tools/topology/topology2/include/bench/igo_nr_s32.conf b/tools/topology/topology2/include/bench/igo_nr_s32.conf new file mode 100644 index 000000000000..ff81fe8e5ed8 --- /dev/null +++ b/tools/topology/topology2/include/bench/igo_nr_s32.conf @@ -0,0 +1,13 @@ + # Created with script "./bench_comp_generate.sh igo_nr" + Object.Widget.igo_nr.1 { + index 1 + + + } + Object.Widget.igo_nr.2 { + index 3 + + + } + +