]> git.alsa-project.org Git - alsa-utils.git/commit
topology: pre-process-object: add data section for attributes with token reference
authorRanjani Sridharan <ranjani.sridharan@linux.intel.com>
Mon, 26 Apr 2021 18:30:07 +0000 (11:30 -0700)
committerJaroslav Kysela <perex@perex.cz>
Tue, 25 May 2021 16:26:51 +0000 (18:26 +0200)
commit571d1fe8718b4b08273d452ccca22415207b2879
treea2a273c62a2f737db45cb319fe7a3e143c1e4f43
parentd999c267d3acf08211e10416ee3dfcb66619304b
topology: pre-process-object: add data section for attributes with token reference

Objects that have attributes with token_ref need
to have separate SectionData and SectionVendorTuples
for each unique token_ref based on the attribute_sets
in the object's attribute_set_list.

Add the tplg_pp_add_object_data()
function to add the data[] refs in the object and also
the respective SectionData and SectionVendorTuples.

For example for the pga object:

Object.Widget.pga."0" {
pipeline_id 2
format s24le
type pga
no_pm 1
uuid    "7e:67:7e:b7:f4:5f:88:41:af:14:fb:a8:bd:bf:8"
period_sink_count 2
period_source_count 2
ramp_step_ms 250
        ramp_step_type "linear"
mixer.0 {
....
}
mixer.0.name "2 Master Playback Volume"
}

The following sections will be added:
SectionWidget.'pga.2.0' {
index 2
type pga
no_pm 1
mixer [
"2 Master Playback Volume"
]
bytes [
]
data [
"pga.2.0.sof_tkn_comp.word"
"pga.2.0.sof_tkn_comp.string"
"pga.2.0.sof_tkn_comp.uuid"
"pga.2.0.sof_tkn_volume.word"
]
}

SectionData."pga.2.0.sof_tkn_comp.word" {
tuples "pga.2.0.sof_tkn_comp.word"
}

SectionData."pga.2.0.sof_tkn_comp.string" {
tuples "pga.2.0.sof_tkn_comp.string"
}

SectionData."pga.2.0.sof_tkn_comp.uuid" {
tuples "pga.2.0.sof_tkn_comp.uuid"
}

SectionData."pga.2.0.sof_tkn_volume.word" {
tuples "pga.2.0.sof_tkn_volume.word"
}

SectionVendorTuples."pga.2.0.sof_tkn_comp.word" {
tokens "sof_tkn_comp"
tuples."word" {
period_source_count "2"
period_sink_count "2"
}
}

SectionVendorTuples."pga.2.0.sof_tkn_comp.string" {
tokens "sof_tkn_comp"
tuples."string" {
format "s24le"
}
}

SectionVendorTuples."pga.2.0.sof_tkn_comp.uuid" {
tokens "sof_tkn_comp"
tuples."uuid" {
uuid "7e:67:7e:b7:f4:5f:88:41:af:14:fb:a8:bd:bf:8"
}
}

SectionVendorTuples."pga.2.0.sof_tkn_volume.word" {
tokens "sof_tkn_volume"
tuples."word" {
ramp_step_ms "250"
ramp_step_type "0"
}
}

Note that the ramp_step_type of "linear" is converted
to the tuple value 0.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
topology/pre-process-object.c