-
Notifications
You must be signed in to change notification settings - Fork 349
Introduction to Topology 2.0 #3936
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
22f7589
topology2: Introduction to Topology2.0
ranj063 309ec68
topology2: Add DAI class
ranj063 3505483
topology2: Add buffer class
ranj063 8f86357
topology2: Add pga class
ranj063 4799431
topology2: Add mixer control class
ranj063 0b70cd9
topology2: pga: Add mixer controls
ranj063 14ad708
topology2: Add classes for DAPM routes
ranj063 ed44673
topology2: Add pipeline classes
ranj063 a95c791
topology2: Add SSP DAI class
ranj063 28a830b
topology2: Add PCM and PCM Caps classes
ranj063 4a66f77
topology2: add class definitions for data and manifest
ranj063 67b2868
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} -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,22 @@ | ||
| #!/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.manifest."0" { | ||
| name "sof_manifest" | ||
| Object.data."0" { | ||
| name "sof_manifest" | ||
| 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,54 @@ | ||
| # Class definition for DAPM graph connection objects | ||
| # These are instantiated as follows: | ||
| # Example: | ||
| # Object.connection."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 connection object within the same alsaconf node. | ||
| # | ||
| # Example: endpoint connection | ||
| # Object.connection."N" { | ||
| # source "Object.buffer.2" | ||
| # sink "Object.pga.2" | ||
| # } | ||
| # The above object specifies the route: "buffer.2 -> pga.2" where buffer.2 is the buffer object | ||
| # with index 2 and pga.2 refers to the PGA object with index 2 in the parent object. | ||
| # and N is the unique instance number for the connection object within the same alsaconf node. | ||
| # | ||
| # | ||
| Class.Base."connection" { | ||
| DefineArgument."index" {} | ||
|
|
||
| # 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" {} | ||
|
|
||
| # these attributes will be set by the alsatplg compiler after resolving the Object | ||
| # reference | ||
| DefineAttribute."source_widget" {} | ||
| DefineAttribute."sink_widget" {} | ||
|
|
||
| attributes { | ||
| mandatory [ | ||
| "source" | ||
| "sink" | ||
| ] | ||
| automatic [ | ||
| "source_widget" | ||
| "sink_widget" | ||
| ] | ||
| # | ||
| # index attribute values for connection objects must be unique in the same alsaconf | ||
| # node | ||
| # | ||
| unique "index" | ||
| } | ||
| } |
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 data object | ||
| Class.Base."data" { | ||
|
|
||
| DefineArgument."name" {} | ||
|
|
||
| DefineAttribute."bytes" {} | ||
|
|
||
| attributes { | ||
| mandatory [ | ||
| "name" | ||
| ] | ||
| # | ||
| # name attribute values for data 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,16 @@ | ||
| # Class definition for manifest object | ||
| Class.Base."manifest" { | ||
| DefineArgument."name" {} | ||
|
|
||
| attributes { | ||
| mandatory [ | ||
| "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,47 @@ | ||
| # PCM Class definition. PCM object can be instantiated as: | ||
| # PCM | ||
| # Object.pcm."N" { | ||
| # pcm_name "Headset" | ||
| # direction "playback" | ||
| # pcm_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 | ||
| # | ||
| DefineArgument."pcm_name" {} | ||
|
|
||
| DefineArgument."direction" {} | ||
|
|
||
| DefineArgument."pcm_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 { | ||
| mandatory [ | ||
| "compress" | ||
| "pcm_name" | ||
| "pcm_id" | ||
| "direction" | ||
| ] | ||
| # | ||
| # pcm_id attribute values for pcm objects must be unique in the same alsaconf | ||
| # node | ||
| # | ||
| unique "pcm_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,88 @@ | ||
| # PCM Capabilities Class definition. PCM object can be instantiated as: | ||
|
|
||
| # Object.pcm_caps."N" { | ||
| # pcm_name "Headset" | ||
| # direction "playback" | ||
| # pcm_id 2 | ||
| # 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 | ||
| # | ||
| DefineArgument."pcm_name" {} | ||
|
|
||
| DefineArgument."direction" {} | ||
|
|
||
| DefineArgument."pcm_id" {} | ||
|
|
||
| DefineAttribute."formats" {} | ||
|
|
||
| DefineAttribute."rates" {} | ||
|
|
||
| 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 { | ||
| mandatory [ | ||
| "pcm_name" | ||
| "pcm_id" | ||
| "direction" | ||
| "formats " | ||
| "rate_min" | ||
| "rate_max" | ||
| "channels_min" | ||
| "channels_max" | ||
| "periods_min" | ||
| "periods_max" | ||
| "period_size_min" | ||
| "period_size_max" | ||
| "buffer_size_min" | ||
| "buffer_size_max" | ||
| ] | ||
| # | ||
| # pcm_id attribute values for pcm_caps objects must be unique in the same alsaconf | ||
| # node | ||
| # | ||
| unique "pcm_id" | ||
| } | ||
|
|
||
| # 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,41 @@ | ||
| # Class definition for pipeline endpoint objects | ||
| # These are instantiated as follows: | ||
| # Object.endpoint."N" { | ||
| # widget "Object.buffer.0" | ||
| # } | ||
| # where N is the unique instance number for the endpoint object within the same alsaconf node. | ||
| # and widget refers to the buffer object with index 0 in the parent object that instantiates | ||
| # the endpoint. | ||
|
|
||
| Class.Base."endpoint" { | ||
| DefineArgument."pipeline_id" { | ||
| type "integer" | ||
| } | ||
|
|
||
| # unique identifier for endpoints in parent object | ||
| DefineArgument."index" { | ||
| type "integer" | ||
| } | ||
|
|
||
| # widget attribute should refer to an Object of a certain class with a unique value. | ||
| # in the parent object_list | ||
| DefineAttribute."widget" {} | ||
|
|
||
| # the widget_name will be set by the alsatplg compiler after resolving the object | ||
| # reference | ||
| DefineAttribute."widget_name" {} | ||
|
|
||
| attributes { | ||
| mandatory [ | ||
| "widget" | ||
| ] | ||
| automatic [ | ||
| "widget_name" | ||
| ] | ||
| # | ||
| # index attribute values for endpoint objects must be unique in the same alsaconf | ||
| # node | ||
| # | ||
| unique "index" | ||
| } | ||
| } |
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.
Please add. DONEset -ePlease move all the code to a
main "$@"function, see example inbuild-tools.shabove.Pros:
localvariables to avoid shadowingsourcefor interactive debug, just comment out the last lineCons: