-
Notifications
You must be signed in to change notification settings - Fork 349
Introduction to Topology2.0 #3983
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
Closed
Closed
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
a9ff662
topology2: Introduction to Topology2.0
ranj063 64b39a6
topology2: Add DAI widget class
ranj063 fdf5d77
topology2: Add buffer class
ranj063 9a40029
topology2: Add pga class
ranj063 b94549c
topology2: Add mixer control class
ranj063 3c37882
topology2: pga: Add mixer controls
ranj063 3da75fe
topology2: Add class for DAPM route
ranj063 dca9f24
topology2: Add pipeline classes
ranj063 55405c5
topology2: Add SSP DAI class
ranj063 cee5d8b
topology2: Add PCM and PCM Caps classes
ranj063 11f33e1
topology2: add class definitions for data and manifest
ranj063 92a3205
topology2: Add the sof-cnl-nocodec machine topology
ranj063 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,31 @@ | ||
| # SPDX-License-Identifier: BSD-3-Clause | ||
|
|
||
| # Array of "input-file-name;output-file-name;" | ||
| set(TPLGS | ||
| "sof-cnl-nocodec\;sof-cnl-nocodec\;" | ||
| ) | ||
|
|
||
| add_custom_target(topology2 ALL) | ||
|
|
||
| foreach(tplg ${TPLGS}) | ||
| list(GET tplg 0 input) | ||
| list(GET tplg 1 output) | ||
|
|
||
| add_custom_command( | ||
| OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${output}.conf | ||
| COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/get_abi.sh ${SOF_ROOT_SOURCE_DIRECTORY} | ||
| ${CMAKE_CURRENT_SOURCE_DIR}/${input}.conf > ${CMAKE_CURRENT_BINARY_DIR}/${output}.conf | ||
| USES_TERMINAL | ||
| ) | ||
|
|
||
| # Note: this does NOT use VERBATIM, see explanation in ../topology/CMakeLists.txt | ||
| add_custom_command( | ||
| OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${output}.tplg | ||
| COMMAND alsatplg \$\${VERBOSE:+-v 1} -p -c ${CMAKE_CURRENT_BINARY_DIR}/${output}.conf -o ${output}.tplg | ||
| DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/${output}.conf | ||
| USES_TERMINAL | ||
| ) | ||
|
|
||
| add_custom_target(topology2_${output} DEPENDS ${output}.tplg) | ||
| add_dependencies(topology2 topology2_${output}) | ||
| endforeach() | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| #!/bin/bash | ||
| # SPDX-License-Identifier: BSD-3-Clause | ||
| # Copyright(c) 2019 Intel Corporation. All rights reserved. | ||
| set -e | ||
|
|
||
| ABI_MAJOR=$(awk '/^ *# *define *SOF_ABI_MAJOR / { print $3 }' $1/src/include/kernel/abi.h) | ||
| ABI_MINOR=$(awk '/^ *# *define *SOF_ABI_MINOR / { print $3 }' $1/src/include/kernel/abi.h) | ||
| ABI_PATCH=$(awk '/^ *# *define *SOF_ABI_PATCH / { print $3 }' $1/src/include/kernel/abi.h) | ||
|
|
||
| cat $2 | ||
| cat <<EOF_HEADER | ||
|
|
||
| Object.Base.manifest."sof_manifest" { | ||
| Object.Base.data."SOF ABI" { | ||
| EOF_HEADER | ||
| printf '\t\tbytes\t"0x%02x,' "$ABI_MAJOR" | ||
| printf "0x%02x," "$ABI_MINOR" | ||
| printf '0x%02x\"\n' "$ABI_PATCH" | ||
| printf "\t}\n" | ||
| printf "}" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| # Class definition for data object | ||
| # Data objects can be instantiated as: | ||
| # | ||
| # Object.Base.data."SOF ABI" { | ||
| # bytes "0x3, 0x12,0x1" | ||
| # } | ||
| # | ||
| Class.Base."data" { | ||
|
|
||
| DefineAttribute."name" { | ||
| type "string" | ||
| } | ||
|
|
||
| DefineAttribute."bytes" { | ||
| type "string" | ||
| } | ||
|
|
||
| attributes { | ||
| constructor [ | ||
| "name" | ||
| ] | ||
| # | ||
| # data objects instantiated within the same alsaconf node must have unique | ||
| # name attribute | ||
| # | ||
| unique "name" | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| # Class definition for data object | ||
| # FE DAI objects can be instantiated as | ||
| # Object.Base.fe_dai."Port 0" { | ||
| # id "0" | ||
| # } | ||
| Class.Base."fe_dai" { | ||
|
|
||
| DefineAttribute."name" { | ||
| type "string" | ||
| } | ||
|
|
||
| DefineAttribute."id" {} | ||
|
|
||
| attributes { | ||
| constructor [ | ||
| "name" | ||
| ] | ||
| mandatory [ | ||
| "id" | ||
| ] | ||
| # | ||
| # name attribute values for fe_dai objects must be unique in the same alsaconf | ||
| # node | ||
| # | ||
| unique "name" | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| # Class definition for manifest object | ||
| Class.Base."manifest" { | ||
| DefineAttribute."name" { | ||
| type "string" | ||
| } | ||
|
|
||
| attributes { | ||
| constructor [ | ||
| "name" | ||
| ] | ||
| # | ||
| # name attribute values for manifest objects must be unique in the same alsaconf | ||
| # node | ||
| # | ||
| unique "name" | ||
| } | ||
|
|
||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,54 @@ | ||
| # PCM Class definition. PCM object can be instantiated as: | ||
| # PCM | ||
| # Object.pcm."N" { | ||
| # pcm_name "Headset" | ||
| # direction "playback" | ||
| # id 2 | ||
| # } | ||
| # where N is the unique instance number for the PCM object within the same alsaconf node. | ||
| Class.PCM."pcm" { | ||
| # | ||
| # Argument used to construct PCM | ||
| # | ||
| DefineAttribute."name" {} | ||
|
|
||
| DefineAttribute."direction" { | ||
| constraints { | ||
| valid_values [ | ||
| playback | ||
| capture | ||
| duplex | ||
| ] | ||
| } | ||
| } | ||
|
|
||
| DefineAttribute."id" {} | ||
|
|
||
| DefineAttribute."compress" {} | ||
|
|
||
| DefineAttribute."playback_compatible_d0i3" { | ||
| # Token reference and type | ||
| token_ref "sof_tkn_stream.bool" | ||
| } | ||
|
|
||
| DefineAttribute."capture_compatible_d0i3" { | ||
| # Token reference and type | ||
| token_ref "sof_tkn_stream.bool" | ||
| } | ||
|
|
||
| attributes { | ||
| constructor [ | ||
| "name" | ||
| "id" | ||
| "direction" | ||
| ] | ||
| # | ||
| # pcm objects instantiated within the same alsaconf node must have unique | ||
| # id attribute | ||
| # | ||
| unique "id" | ||
| } | ||
|
|
||
| # Default values for PCM attributes | ||
| compress "false" | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,86 @@ | ||
| # PCM Capabilities Class definition. PCM object can be instantiated as: | ||
|
|
||
| # Object.pcm_caps."N" { | ||
| # name "Headset" | ||
| # capabilities "Headset Playback" | ||
| # direction "playback" | ||
| # formats "S32_LE,S24_LE,S16_LE" | ||
| # rate_min 48000 | ||
| # rate_max 48000 | ||
| # channels_min 2 | ||
| # channels_max 2 | ||
| # periods_min 2 | ||
| # } | ||
| # where N is the unique instance number for the pcm_caps object within the same alsaconf node. | ||
|
|
||
| Class.PCM."pcm_caps" { | ||
| # | ||
| # Argument used to construct PCM Capabilities | ||
| # | ||
| DefineAttribute."name" { | ||
| type "string" | ||
| } | ||
|
|
||
| DefineAttribute."direction" { | ||
| type "string" | ||
| valid_values [ | ||
| playback | ||
| capture | ||
| ] | ||
| } | ||
|
|
||
| DefineAttribute."formats" { | ||
| type "string" | ||
| } | ||
|
|
||
| DefineAttribute."rates" { | ||
| type "string" | ||
| } | ||
|
|
||
| DefineAttribute."sigbits" {} | ||
|
|
||
| DefineAttribute."rate_min" {} | ||
|
|
||
| DefineAttribute."rate_max" {} | ||
|
|
||
| DefineAttribute."channels_min" {} | ||
|
|
||
| DefineAttribute."channels_max" {} | ||
|
|
||
| DefineAttribute."periods_min" {} | ||
|
|
||
| DefineAttribute."periods_max" {} | ||
|
|
||
| DefineAttribute."period_size_min" {} | ||
|
|
||
| DefineAttribute."period_size_max" {} | ||
|
|
||
| DefineAttribute."buffer_size_min" {} | ||
|
|
||
| DefineAttribute."buffer_size_max" {} | ||
|
|
||
| attributes { | ||
| constructor [ | ||
| "name" | ||
| "direction" | ||
| ] | ||
| # | ||
| # pcm_caps objects instantiated within the same alsaconf node must have unique | ||
| # direction attribute | ||
| # | ||
| unique "direction" | ||
| } | ||
|
|
||
| # Default attribute values for PCM capabilities | ||
| formats "S32_LE,S24_LE,S16_LE" | ||
| rate_min 48000 | ||
| rate_max 48000 | ||
| channels_min 2 | ||
| channels_max 2 | ||
| periods_min 2 | ||
| periods_max 16 | ||
| period_size_min 192 | ||
| period_size_max 16384 | ||
| buffer_size_min 65536 | ||
| buffer_size_max 65536 | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,48 @@ | ||
| # Class definition for DAPM graph route objects | ||
| # These are instantiated as follows: | ||
| # Example: | ||
| # Object.Base.route."N" { | ||
| # source "Object.SSP.1.dai.capture" | ||
| # sink "Object.volume-playback.0.endpoint.0" | ||
| # } | ||
| # The above object specifies a DAPM graph route: | ||
| # "SSP.1 capture DAI -> volume-playback pipeline endpoint 0" | ||
| # The alsatplg compiler will look up the widget that the pipeline endpoint refers to. | ||
| # and N is the unique instance number for the route object within the same alsaconf node. | ||
| # | ||
| # | ||
| # | ||
| Class.Base."route" { | ||
|
|
||
|
|
||
| # control name for the route | ||
| DefineAttribute."control" {} | ||
|
|
||
| # source and sink attributes should refer an object of a certain class with a unique value | ||
| # in the parent object_list | ||
| DefineAttribute."sink" {} | ||
| DefineAttribute."source" {} | ||
|
|
||
| # | ||
| # Pipeline ID of the pipeline the route object belongs to | ||
| # | ||
| DefineAttribute."index" {} | ||
|
|
||
| DefineAttribute."instance" {} | ||
|
|
||
| attributes { | ||
| constructor [ | ||
| "instance" | ||
| ] | ||
| mandatory [ | ||
| "instance" | ||
| "source" | ||
| "sink" | ||
| ] | ||
| # | ||
| # route objects instantiated within the same alsaconf node must have unique | ||
| # index attribute | ||
| # | ||
| unique "instance" | ||
| } | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As mentioned on the chat, you can't have
${input}.conf==${output}.conf, no build system will support that.I suggest
sof-cnl-nocodec_output.confor something.