-
Notifications
You must be signed in to change notification settings - Fork 351
topology2: add support form compressed playback #10547
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
Draft
ujfalusi
wants to merge
5
commits into
thesofproject:main
Choose a base branch
from
ujfalusi:peter/pr/ipc4_compr_topology
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
4d35369
topology2: include: components: Add a new decoder component
ranj063 09c6c55
topology2: include: components: Add a new encoder module
ranj063 c1be000
topology2: Add compress playback pipeline definition
ujfalusi 15ce05b
topology2: Add new sof-hda-generic-compr.tplg with compress support
ujfalusi 3a12716
topology2: Add compress playback support to cavs-sdw based topologies
ujfalusi 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
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,63 @@ | ||
| # | ||
| # Decoder widget component definition | ||
| # | ||
| # A generic decoder widget. All attributes defined herein are namespaced | ||
| # by alsatplg to "Object.Widget.decoder.N.attribute_name" | ||
| # | ||
| # Usage: this component can be used by declaring in a parent object. i.e. | ||
| # | ||
| # Object.Widget.decoder."N" { | ||
| # index 1 | ||
| # no_pm "true" | ||
| # } | ||
| # | ||
| # Where N is the unique instance number for decoder widget in the same alsaconf node. | ||
|
|
||
| Class.Widget."decoder" { | ||
| # | ||
| # Pipeline ID for the decoder widget object | ||
| # | ||
| DefineAttribute."index" {} | ||
|
|
||
| # | ||
| # decoder object instance | ||
| # | ||
| DefineAttribute."instance" {} | ||
|
|
||
| #include common component definition | ||
| <include/components/widget-common.conf> | ||
|
|
||
| # Attribute categories | ||
| attributes { | ||
| # | ||
| # The decoder widget name would be constructed using the index and instance attributes. | ||
| # For ex: "decoder.1.1" or "decoder.10.2" etc. | ||
| # | ||
| !constructor [ | ||
| "index" | ||
| "instance" | ||
| ] | ||
|
|
||
| # | ||
| # immutable attributes cannot be modified in the object instance | ||
| # | ||
| !immutable [ | ||
| "type" | ||
| ] | ||
|
|
||
| # | ||
| # decoder widget objects instantiated within the same alsaconf node must have unique | ||
| # instance attribute | ||
| # | ||
| unique "instance" | ||
| } | ||
|
|
||
| # Default attribute values for decoder widget | ||
| type "decoder" | ||
|
|
||
| # cadence codec UUID | ||
| uuid "43:84:21:d8:f3:5f:4c:4a:b3:88:6c:fe:07:b9:56:aa" | ||
| no_pm "true" | ||
| num_output_pins 1 | ||
| num_input_pins 1 | ||
| } |
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,63 @@ | ||
| # | ||
| # Encoder widget component definition | ||
| # | ||
| # A generic encoder widget. All attributes defined herein are namespaced | ||
| # by alsatplg to "Object.Widget.encoder.N.attribute_name" | ||
| # | ||
| # Usage: this component can be used by declaring in a parent object. i.e. | ||
| # | ||
| # Object.Widget.encoder."N" { | ||
| # index 1 | ||
| # no_pm "true" | ||
| # } | ||
| # | ||
| # Where N is the unique instance number for encoder widget in the same alsaconf node. | ||
|
|
||
| Class.Widget."encoder" { | ||
| # | ||
| # Pipeline ID for the encoder widget object | ||
| # | ||
| DefineAttribute."index" {} | ||
|
|
||
| # | ||
| # encoder object instance | ||
| # | ||
| DefineAttribute."instance" {} | ||
|
|
||
| #include common component definition | ||
| <include/components/widget-common.conf> | ||
|
|
||
| # Attribute categories | ||
| attributes { | ||
| # | ||
| # The encoder widget name would be constructed using the index and instance attributes. | ||
| # For ex: "encoder.1.1" or "encoder.10.2" etc. | ||
| # | ||
| !constructor [ | ||
| "index" | ||
| "instance" | ||
| ] | ||
|
|
||
| # | ||
| # immutable attributes cannot be modified in the object instance | ||
| # | ||
| !immutable [ | ||
| "type" | ||
| ] | ||
|
|
||
| # | ||
| # encoder widget objects instantiated within the same alsaconf node must have unique | ||
| # instance attribute | ||
| # | ||
| unique "instance" | ||
| } | ||
|
|
||
| # Default attribute values for encoder widget | ||
| type "encoder" | ||
|
|
||
| # cadence codec UUID | ||
| uuid "43:84:21:d8:f3:5f:4c:4a:b3:88:6c:fe:07:b9:56:aa" | ||
| no_pm "true" | ||
| num_output_pins 1 | ||
| num_input_pins 1 | ||
| } |
95 changes: 95 additions & 0 deletions
95
tools/topology/topology2/include/pipelines/cavs/compr-playback.conf
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,95 @@ | ||
| # | ||
| # FE playback pipeline: compr-playback | ||
| # | ||
| # All attributes defined herein are namespaced | ||
| # by alsatplg to "Object.Pipeline.compr-playback.N.attribute_name" | ||
| # | ||
| # Usage: compr-playback pipeline object can be instantiated as: | ||
| # | ||
| # Object.Pipeline.compr-playback."N" { | ||
| # period 1000 | ||
| # time_domain "timer" | ||
| # } | ||
| # | ||
| # Where N is the unique pipeline ID within the same alsaconf node. | ||
| # | ||
|
|
||
| <include/common/input_audio_format.conf> | ||
| <include/common/output_audio_format.conf> | ||
| <include/components/host-copier.conf> | ||
| <include/components/module-copier.conf> | ||
| <include/components/mixin.conf> | ||
| <include/components/pipeline.conf> | ||
| <include/components/gain.conf> | ||
| <include/components/decoder.conf> | ||
|
|
||
| Class.Pipeline."compr-playback" { | ||
|
|
||
| <include/pipelines/pipeline-common.conf> | ||
|
|
||
| attributes { | ||
| !constructor [ | ||
| "index" | ||
| ] | ||
|
|
||
| !immutable [ | ||
| "direction" | ||
| ] | ||
|
|
||
| # | ||
| # compr-playback objects instantiated within the same alsaconf node must have | ||
| # unique pipeline_id attribute | ||
| # | ||
| unique "instance" | ||
| } | ||
|
|
||
| Object.Widget { | ||
| host-copier."1" { | ||
| type "aif_in" | ||
| node_type $HDA_HOST_OUTPUT_CLASS | ||
| num_output_pins 1 | ||
| deep_buffer_dma_ms $COMPR_DEEPBUFFER_MS | ||
| } | ||
|
|
||
| decoder."1" { | ||
| scheduler_domain "DP" | ||
| } | ||
|
|
||
| module-copier."2" {} | ||
|
|
||
| src."1" {} | ||
|
|
||
| gain."1" {} | ||
|
|
||
| mixin."1" {} | ||
|
|
||
| pipeline."1" { | ||
| priority 0 | ||
| # enable lp mode | ||
| lp_mode 1 | ||
| } | ||
| } | ||
|
|
||
| Object.Base.route [ | ||
| { | ||
| source decoder.$index.1 | ||
| sink module-copier.$index.2 | ||
| } | ||
| { | ||
| source module-copier.$index.2 | ||
| sink src.$index.1 | ||
| } | ||
| { | ||
| source src.$index.1 | ||
| sink gain.$index.1 | ||
| } | ||
| { | ||
| source gain.$index.1 | ||
| sink mixin.$index.1 | ||
| } | ||
| ] | ||
|
|
||
| direction "playback" | ||
| dynamic_pipeline 1 | ||
| time_domain "timer" | ||
| } | ||
16 changes: 16 additions & 0 deletions
16
tools/topology/topology2/platform/intel/compr-default.conf
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 @@ | ||
| # default settings for Compressed Audio Playback | ||
| Define { | ||
| COMPRESSED false | ||
| COMPR_DEEPBUFFER_MS $DEEPBUFFER_FW_DMA_MS | ||
|
|
||
| COMPRESSED_1 true | ||
| COMPR_PCM_NAME 'Compress Playback' | ||
| COMPR_PCM_ID 50 | ||
| COMPR_PIPELINE_ID 90 | ||
|
|
||
|
|
||
| COMPRESSED_2 false | ||
| COMPR_2_PCM_NAME 'Compress Playback 2' | ||
| COMPR_2_PCM_ID 52 | ||
| COMPR_2_PIPELINE_ID 92 | ||
| } |
Oops, something went wrong.
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.
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.
With thesofproject/linux#5673 we can add
Or use a new define for compress deep buffer.
The host buffer would scale with the buffer configuration:
cplay -c0 -d52 -I MP3 /home/sof/work/samples/Echoplex-10s.mp3
host-copier.52.playback, dma buffer (using Deep Buffer): 4 ms (max: 100) / 1536 bytes, ALSA period: 5 / 2048
cplay -c0 -d52 -f4 -b 65536 -I MP3 /home/sof/work/samples/Echoplex-10s.mp3
host-copier.52.playback, dma buffer (using Deep Buffer): 32 ms (max: 100) / 12544 bytes, ALSA period: 42 / 16384
cplay -c0 -d52 -f4 -b 131072 -I MP3 /home/sof/work/samples/Echoplex-10s.mp3
host-copier.52.playback, dma buffer (using Deep Buffer): 75 ms (max: 100) / 28928 bytes, ALSA period: 85 / 32768
cplay -c0 -d52 -f4 -b 524288 -I MP3 /home/sof/work/samples/Echoplex-10s.mp3
host-copier.52.playback, dma buffer (using Deep Buffer): 100 ms (max: 100) / 38400 bytes, ALSA period: 341 / 131072
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.
@ujfalusi I assume this needs to merge first before kernel ? Although, I dont think anything would break today if other way around.
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.
With kernel support in, the compr will work, without it we will have the compr devices created, but they will fail when there is an attempt to use them.
Ideally we would need the kernel first then the topology, but other way around would not cause probe issues.