Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tools: Topology2: Add widget class IGO NR #8450

Merged
merged 2 commits into from
Dec 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions tools/topology/topology2/cavs-benchmark-hda.conf
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<include/components/dcblock.conf>
<include/components/rtnr.conf>
<include/components/igo_nr.conf>

Define {
ANALOG_PLAYBACK_PCM 'Analog Playback'
Expand Down Expand Up @@ -286,6 +287,22 @@ IncludeByKey.BENCH_CONFIG {
<include/bench/gain_s32.conf>
}

#
# IGO NR component
#

"igo_nr16" {
<include/bench/igo_nr_s16.conf>
}

"igo_nr24" {
<include/bench/igo_nr_s24.conf>
}

"igo_nr32" {
<include/bench/igo_nr_s32.conf>
}
btian1 marked this conversation as resolved.
Show resolved Hide resolved

#
# RTNR component
#
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ set(components
"eqiir"
"eqfir"
"gain"
"igo_nr"
"rtnr"
)

Expand All @@ -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"
)

Expand Down
Original file line number Diff line number Diff line change
@@ -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'
#}
}
Original file line number Diff line number Diff line change
@@ -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'
#}
}
19 changes: 19 additions & 0 deletions tools/topology/topology2/include/bench/igo_nr_hda_route.conf
Original file line number Diff line number Diff line change
@@ -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'
}
]
13 changes: 13 additions & 0 deletions tools/topology/topology2/include/bench/igo_nr_s16.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Created with script "./bench_comp_generate.sh igo_nr"
Object.Widget.igo_nr.1 {
index 1
<include/bench/one_input_output_format_s16.conf>
<include/bench/igo_nr_controls_playback.conf>
}
Object.Widget.igo_nr.2 {
index 3
<include/bench/one_input_output_format_s16.conf>
<include/bench/igo_nr_controls_capture.conf>
}
<include/bench/host_io_gateway_pipelines_s16.conf>
<include/bench/igo_nr_hda_route.conf>
13 changes: 13 additions & 0 deletions tools/topology/topology2/include/bench/igo_nr_s24.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Created with script "./bench_comp_generate.sh igo_nr"
Object.Widget.igo_nr.1 {
index 1
<include/bench/one_input_output_format_s24.conf>
<include/bench/igo_nr_controls_playback.conf>
}
Object.Widget.igo_nr.2 {
index 3
<include/bench/one_input_output_format_s24.conf>
<include/bench/igo_nr_controls_capture.conf>
}
<include/bench/host_io_gateway_pipelines_s24.conf>
<include/bench/igo_nr_hda_route.conf>
13 changes: 13 additions & 0 deletions tools/topology/topology2/include/bench/igo_nr_s32.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Created with script "./bench_comp_generate.sh igo_nr"
Object.Widget.igo_nr.1 {
index 1
<include/bench/one_input_output_format_s32.conf>
<include/bench/igo_nr_controls_playback.conf>
}
Object.Widget.igo_nr.2 {
index 3
<include/bench/one_input_output_format_s32.conf>
<include/bench/igo_nr_controls_capture.conf>
}
<include/bench/host_io_gateway_pipelines_s32.conf>
<include/bench/igo_nr_hda_route.conf>
100 changes: 100 additions & 0 deletions tools/topology/topology2/include/components/igo_nr.conf
Original file line number Diff line number Diff line change
@@ -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.

<include/controls/mixer.conf>

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
<include/components/widget-common.conf>

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
}
Loading