Skip to content
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

topology2: add be pipeline for sdw #5507

Merged
merged 1 commit into from
Mar 11, 2022
Merged
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
117 changes: 43 additions & 74 deletions tools/topology/topology2/cavs/cavs-sdw.conf
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
<virtual.conf>
<passthrough-playback.conf>
<passthrough-capture.conf>
<passthrough-be.conf>
<data.conf>
<pcm.conf>
<pcm_caps.conf>
Expand Down Expand Up @@ -41,38 +42,6 @@ Object.Dai {
Object.Base.hw_config."ALH2" {
id 0
}

# include DAI copier components
Object.Widget.copier."0" {
index 2
dai_index 2
type "dai_in"
dai_type "ALH"
copier_type "ALH"
direction "playback"
stream_name "SDW0-Playback"
period_sink_count 0
period_source_count 2
format s16le
node_type $ALH_LINK_OUTPUT_CLASS
num_audio_formats 2
# 16-bit 48KHz 2ch
Object.Base.audio_format.1 {
# 16 -> 32 bits conversion will be done in the copier,
# therefore the out_bit_depth is 32
out_bit_depth 32
# dma_buffer_size should be 2 * obs for playback
dma_buffer_size "$[$obs * 2]"
}
# 32-bit 48KHz 2ch
Object.Base.audio_format.2 {
in_bit_depth 32
in_valid_bit_depth 32
out_bit_depth 32
out_valid_bit_depth 32
dma_buffer_size "$[$obs * 2]"
}
}
}
ALH."3" {
id 1
Expand All @@ -85,38 +54,6 @@ Object.Dai {
Object.Base.hw_config."ALH3" {
id 1
}

Copy link
Member

Choose a reason for hiding this comment

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

line 50: why is the default_hw_confg_id '1'?

Copy link
Collaborator

Choose a reason for hiding this comment

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

because the're sonly one hw_config and its ID is 1 on line 55

Copy link
Member

@plbossart plbossart Mar 10, 2022

Choose a reason for hiding this comment

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

ok, but why is the hw_config numbering different for different dais? Is this not defined within the scope of each DAI, in other words we should start at zero.

I guess it's not broken but it looks inconsistent to me.

Copy link
Collaborator

Choose a reason for hiding this comment

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

@plbossart do you mean other topologies? We blindly set the hw_config ID to match the link ID in the machine driver for no good reason.

Copy link
Member

Choose a reason for hiding this comment

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

We should fix this and make it non ambiguous prior to roll out of topology2. If it not needed we can remove or we should start IDs at 0. We have time to align, @ranj063 are you OK to look at this when convenient ?

Object.Widget.copier."0" {
index 3
dai_index 3
type "dai_out"
dai_type "ALH"
copier_type "ALH"
direction "capture"
stream_name "SDW0-Capture"
period_sink_count 2
period_source_count 0
format s16le
node_type $ALH_LINK_INPUT_CLASS
num_audio_formats 2
# 16-bit 48KHz 2ch
Object.Base.audio_format.1 {
# 32 -> 16 bits conversion will be done in pipeline,
# so both in_bit_depth and out_bit_depth are still 32 here.
in_bit_depth 32
out_bit_depth 32
# dma_buffer_size should be 2 * ibs for capture
dma_buffer_size "$[$ibs * 2]"
}
# 32-bit 48KHz 2ch
Object.Base.audio_format.2 {
in_bit_depth 32
in_valid_bit_depth 32
out_bit_depth 32
out_valid_bit_depth 32
dma_buffer_size "$[$ibs * 2]"
}
}
}
}

Expand All @@ -126,19 +63,35 @@ Object.Dai {

# Pipeline ID:1 PCM ID: 0
Object.Pipeline {
passthrough-playback."2" {
passthrough-playback."1" {
format "s16le"
index 2
index 1

Object.Widget.pipeline.1.stream_name "copier.ALH.2.0"
Object.Widget.pipeline.1.stream_name "copier.ALH.2.1"

Object.Widget.copier.1.stream_name "Passthrough Playback 0"
}
passthrough-be.1 {
direction "playback"
index 2

passthrough-capture."3" {
Object.Widget.pipeline.1 {
stream_name 'copier.ALH.2.1'
}
Object.Widget.copier.1 {
stream_name 'SDW0-Playback'
dai_type "ALH"
copier_type "ALH"
type "dai_in"
node_type $ALH_LINK_OUTPUT_CLASS
}
format s16le
}

passthrough-capture."4" {
format "s16le"
index 3
Object.Widget.pipeline.1.stream_name "copier.ALH.3.0"
index 4
Object.Widget.pipeline.1.stream_name "copier.ALH.3.1"

Object.Widget.copier.1.stream_name "Passthrough Capture 0"
Object.Widget.copier.1.Object.Base.audio_format.1 {
Expand All @@ -147,6 +100,22 @@ Object.Pipeline {
in_bit_depth 32
}
}
passthrough-be.2 {
direction "capture"
index 3
copier_type "ALH"
Object.Widget.pipeline.1 {
stream_name 'copier.ALH.3.1'
}
Object.Widget.copier.1 {
stream_name 'SDW0-Capture'
dai_type "ALH"
copier_type "ALH"
type "dai_out"
node_type $ALH_LINK_INPUT_CLASS
}
format s16le
}
}

Object.PCM {
Expand Down Expand Up @@ -176,12 +145,12 @@ Object.PCM {

Object.Base {
route."0" {
source "copier.host.2.1"
sink "copier.ALH.2.0"
source "copier.host.1.1"
sink "copier.ALH.2.1"
}

route."1" {
source "copier.ALH.3.0"
sink "copier.host.3.1"
source "copier.ALH.3.1"
sink "copier.host.4.1"
}
}