Skip to content
Closed
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
49 changes: 46 additions & 3 deletions tools/topology/topology2/cavs-nocodec.conf
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
<wov-detect.conf>
<host-copier-gain-mixin-playback.conf>
<mixout-gain-dai-copier-playback.conf>
<mixout-gain-smart-amp-dai-copier-playback.conf>
<dai-copier-gain-module-copier-capture.conf>
<gain-capture.conf>
<deepbuffer-playback.conf>
Expand All @@ -35,7 +36,9 @@
<host.conf>
<kpb.conf>
<src_pin_binding.conf>
<sink_pin_binding.conf>
<dmic-default.conf>
<smart_amp_test_feedback_2ch.conf>

Define {
MCLK 24576000
Expand Down Expand Up @@ -134,11 +137,12 @@ Object.Dai {
#
# Pipeline definitions
#
# PCM0 ---> gain ----> Mixin ----> Mixout ----> gain ----> SSP0
# PCM0 ---> gain ----> Mixin ----> Mixout ----> gain ----> smart_amp ----> SSP0
# PCM1 ---> gain ----> Mixin ----> Mixout ----> gain ----> SSP1
# PCM2 ---> gain ----> Mixin ----> Mixout ----> gain ----> SSP2
#
# SSP0 ----> PCM0
# SSP0 ----> smart_amp
# SSP1 ----> PCM1
# SSP2 ----> PCM2

Expand All @@ -161,7 +165,7 @@ Object.Pipeline {
}
}

mixout-gain-dai-copier-playback.1 {
mixout-gain-smart-amp-dai-copier-playback.1 {
index 2

Object.Widget.pipeline.1 {
Expand All @@ -181,6 +185,33 @@ Object.Pipeline {
name 'Main Playback Volume 2'
}
}

Object.Widget.smart_amp.1 {

uuid "1e:96:7a:16:e4:8a:ea:11:89:f1:00:0c:29:ce:16:35"

Object.Base.sink_pin_binding.1 {
sink_pin_binding_wname "gain.2.1"
}

Object.Base.sink_pin_binding.2 {
sink_pin_binding_wname "copier.SSP.8.1"
}

Object.Control.bytes."1" {
name smart_amp_init
access [
tlv_read
tlv_callback
]
Object.Base.extops."extctl" {
get 258
put 0
}
max 4096
Object.Base.data."smart_amp_init" {}
}
}
}

host-copier-gain-mixin-playback.2 {
Expand Down Expand Up @@ -307,6 +338,14 @@ Object.Pipeline {
out_valid_bit_depth 32
dma_buffer_size "$[$ibs * 2]"
}

Object.Base.src_pin_binding.1 {
src_pin_binding_wname "gain.8.1"
}

Object.Base.src_pin_binding.2 {
src_pin_binding_wname "smart_amp.2.1"
}
}

Object.Widget.copier."2" {
Expand Down Expand Up @@ -459,7 +498,7 @@ Object.PCM {

Object.Base {
route."1" {
source "gain.2.1"
source "smart_amp.2.1"
sink "copier.SSP.2.1"
}

Expand Down Expand Up @@ -511,4 +550,8 @@ Object.Base {
sink "copier.module.17.2"
}

route."12" {
source "copier.SSP.8.1"
sink "smart_amp.2.1"
}
}
6 changes: 3 additions & 3 deletions tools/topology/topology2/include/common/tokens.conf
Original file line number Diff line number Diff line change
Expand Up @@ -108,9 +108,9 @@ Object.Base.VendorToken {
}

"sof_tkn_process" {
# Token payload_with_output_fmt specifies whether there is
# output audio format in the init instance ipc4 message payload.
payload_with_output_fmt 901
# The token init_payload_format is used to describe the
# module instance initialization payload format
init_payload_format 901
}

"sof_tkn_stream" {
Expand Down
6 changes: 3 additions & 3 deletions tools/topology/topology2/include/components/micsel.conf
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,9 @@ Class.Widget."micsel" {
token_ref "sof_tkn_comp.uuid"
}

DefineAttribute."payload_with_output_fmt" {
DefineAttribute."init_payload_format" {
# Token set reference name and type
token_ref "sof_tkn_process.bool"
token_ref "sof_tkn_process.word"
}

attributes {
Expand Down Expand Up @@ -82,7 +82,7 @@ Class.Widget."micsel" {
# Default attributes for micsel
#
type "effect"
payload_with_output_fmt 1
init_payload_format 1

num_audio_formats 1
#UUID: 32FE92C1-1E17-4FC2-9758-C7F3542E980A
Expand Down
110 changes: 110 additions & 0 deletions tools/topology/topology2/include/components/smart_amp.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
#
# Common widget smart_amp
#
# A generic smart_amp widget. All attributes defined herein are namespaced
# by alsatplg to "Object.Widget.smart_amp.N.attribute_name"
#
# Usage: this component can be used by instantiating it in the parent object. i.e.
#
# Object.Widget.smart_amp."N" {
# index 1
# type "effect"
# }
#
# Where N is the unique instance number for the smart_amp object within the same alsaconf node.

Class.Widget."smart_amp" {
#
# Pipeline ID for the smart_amp widget object
#
DefineAttribute."index" {}

#
# smart_amp object instance
#
DefineAttribute."instance" {}

#include common component definition
<include/components/widget-common.conf>

DefineAttribute."num_audio_formats" {
# Token set reference name and type
token_ref "sof_tkn_comp.word"
}

#
# smart_amp widget UUID
#
DefineAttribute."uuid" {
type "string"
# Token set reference name and type
token_ref "sof_tkn_comp.uuid"
}

DefineAttribute."cpc" {
# Token set reference name and type
token_ref "sof_tkn_comp.word"
}

DefineAttribute."is_pages" {
# Token set reference name and type
token_ref "sof_tkn_comp.word"
}

DefineAttribute."init_payload_format" {
# Token set reference name and type
token_ref "sof_tkn_process.word"
}

# Attribute categories
attributes {
#
# The smart_amp widget name would be constructed using the index and instance attributes.
# For ex: "smart_amp.1.1" or "smart_amp.10.2" etc.
#
!constructor [
"index"
"instance"
]

#
# mandatory attributes that must be provided when the class is instantiated
#
!mandatory [
"no_pm"
"uuid"
]

#
# immutable attributes cannot be modified in the object instance
#
!immutable [
"type"
]

#
# deprecated attributes should not be added in the object instance
#
!deprecated [
"preload_count"
]

#
# smart_amp widget objects instantiated within the same alsaconf node must have unique
# instance attribute
#
unique "instance"
}

# Default attribute values for smart_amp widget

# smart amp module UUID is not unique, and should be assigned in the top-level conf
type "effect"
no_pm "true"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what is that?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know what is either but I know this would be much better to avoid double and triple negations:

Suggested change
no_pm "true"
pm "false"

(I hope the default value can be either "true" or "false")

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sorry this cannot be changed. no_pm is an existing terminology used by ALSA topology and must be set to true for all widgets

core_id 0
cpc 5000
is_pages 1
num_sink_pins 2
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

don't we need to specific which pin is used for what? I vaguely recall there was a special mapping needed

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

its added in the third patch at the top-level topology file

num_source_pins 1
init_payload_format 2
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# The kcontrol data for smart amp test module initialization
# feedback channel = 2
Object.Base.data."smart_amp_init" {
bytes "
0x53, 0x4f, 0x46, 0x34, 0x84, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x02, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x80, 0x01, 0x00, 0x00,
0x80, 0xbb, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00,
0x10, 0xff, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x02, 0x20, 0x00, 0x00,
0x01, 0x00, 0x00, 0x00, 0x80, 0x01, 0x00, 0x00,
0x80, 0xbb, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00,
0x10, 0xff, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x02, 0x20, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x80, 0x01, 0x00, 0x00,
0x80, 0xbb, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00,
0x10, 0xff, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x02, 0x20, 0x00, 0x00,
0x02, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff"
}
Loading