Skip to content

Commit

Permalink
Topology2: add more rates support for SDW jack
Browse files Browse the repository at this point in the history
Add 96KHz/192KHz rates support for SoundWire jack device.

Signed-off-by: Bard Liao <[email protected]>
  • Loading branch information
bardliao committed Nov 7, 2024
1 parent 79ca991 commit c6a1494
Showing 1 changed file with 131 additions and 2 deletions.
133 changes: 131 additions & 2 deletions tools/topology/topology2/platform/intel/sdw-jack-generic.conf
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ IncludeByKey.PASSTHROUGH {
Define {
JACK_PLAYBACK_PCM_NAME "Jack Out"
JACK_CAPTURE_PCM_NAME "Jack In"
JACK_RATE 48000
}

#
Expand All @@ -22,7 +23,7 @@ Object.Dai.ALH [
direction "playback"
name $SDW_JACK_OUT_STREAM
default_hw_conf_id 0
rate 48000
rate $JACK_RATE
channels 2

Object.Base.hw_config.1 {
Expand All @@ -36,7 +37,7 @@ Object.Dai.ALH [
direction "capture"
name $SDW_JACK_IN_STREAM
default_hw_conf_id 0
rate 48000
rate $JACK_RATE
channels 2

Object.Base.hw_config.1 {
Expand All @@ -59,11 +60,65 @@ IncludeByKey.PASSTHROUGH {
Object.Widget.host-copier.1 {
stream_name "volume playback 0"
pcm_id 0
Object.Base.input_audio_format [
{
in_rate $JACK_RATE
in_bit_depth 16
in_valid_bit_depth 16
}
{
in_rate $JACK_RATE
in_bit_depth 32
in_valid_bit_depth 32
}
{
in_rate $JACK_RATE
in_bit_depth 32
in_valid_bit_depth 24
}
]
Object.Base.output_audio_format [
{
out_rate $JACK_RATE
out_bit_depth 32
out_valid_bit_depth 32
}
]
}
Object.Widget.gain.1 {
Object.Control.mixer.1 {
name 'Pre Mixer $JACK_PLAYBACK_PCM_NAME Playback Volume'
}
Object.Base.input_audio_format [
{
in_rate $JACK_RATE
in_bit_depth 32
in_valid_bit_depth 32
}
]
Object.Base.output_audio_format [
{
out_rate $JACK_RATE
out_bit_depth 32
out_valid_bit_depth 32
}
]
}
Object.Widget.mixin.1 {
Object.Base.input_audio_format [
{
in_rate $JACK_RATE
in_bit_depth 32
in_valid_bit_depth 32
}
]
Object.Base.output_audio_format [
{
out_rate $JACK_RATE
out_bit_depth 32
out_valid_bit_depth 32
}
]
}
}
]
Expand All @@ -72,27 +127,47 @@ IncludeByKey.PASSTHROUGH {
{
index 1

Object.Widget.mixout.1 {
Object.Base.input_audio_format [
{
in_rate $JACK_RATE
in_bit_depth 32
in_valid_bit_depth 32
}
]
Object.Base.output_audio_format [
{
out_rate $JACK_RATE
out_bit_depth 32
out_valid_bit_depth 32
}
]
}
Object.Widget.alh-copier.1 {
stream_name $SDW_JACK_OUT_STREAM
node_type $ALH_LINK_OUTPUT_CLASS
num_input_audio_formats 3
Object.Base.input_audio_format [
{
in_rate $JACK_RATE
in_bit_depth 16
in_valid_bit_depth 16
}
{
in_rate $JACK_RATE
in_bit_depth 32
in_valid_bit_depth 24
}
{
in_rate $JACK_RATE
in_bit_depth 32
in_valid_bit_depth 32
}
]
num_output_audio_formats 1
Object.Base.output_audio_format [
{
out_rate $JACK_RATE
out_bit_depth 32
out_valid_bit_depth $SDW_LINK_VALID_BITS
out_sample_type $SAMPLE_TYPE_MSB_INTEGER
Expand All @@ -104,6 +179,20 @@ IncludeByKey.PASSTHROUGH {
Object.Control.mixer.1 {
name 'Post Mixer $JACK_PLAYBACK_PCM_NAME Playback Volume'
}
Object.Base.input_audio_format [
{
in_rate $JACK_RATE
in_bit_depth 32
in_valid_bit_depth 32
}
]
Object.Base.output_audio_format [
{
out_rate $JACK_RATE
out_bit_depth 32
out_valid_bit_depth 32
}
]
}
}
]
Expand All @@ -119,29 +208,35 @@ IncludeByKey.PASSTHROUGH {
num_input_audio_formats 3
Object.Base.input_audio_format [
{
in_rate $JACK_RATE
in_bit_depth 16
in_valid_bit_depth 16
}
{
in_rate $JACK_RATE
in_bit_depth 32
in_valid_bit_depth 24
}
{
in_rate $JACK_RATE
in_bit_depth 32
in_valid_bit_depth 32
}
]
num_output_audio_formats 3
Object.Base.output_audio_format [
{
out_rate $JACK_RATE
out_bit_depth 16
out_valid_bit_depth 16
}
{
out_rate $JACK_RATE
out_bit_depth 32
out_valid_bit_depth 24
}
{
out_rate $JACK_RATE
out_bit_depth 32
out_valid_bit_depth 32
}
Expand All @@ -162,21 +257,25 @@ IncludeByKey.PASSTHROUGH {
num_input_audio_formats 3
Object.Base.input_audio_format [
{
in_rate $JACK_RATE
in_bit_depth 16
in_valid_bit_depth 16
}
{
in_rate $JACK_RATE
in_bit_depth 32
in_valid_bit_depth 24
}
{
in_rate $JACK_RATE
in_bit_depth 32
in_valid_bit_depth 32
}
]
num_output_audio_formats 1
Object.Base.output_audio_format [
{
out_rate $JACK_RATE
out_bit_depth 32
out_valid_bit_depth $SDW_LINK_VALID_BITS
out_sample_type $SAMPLE_TYPE_MSB_INTEGER
Expand Down Expand Up @@ -207,21 +306,25 @@ Object.Pipeline.host-gateway-capture [
num_input_audio_formats 1
Object.Base.input_audio_format [
{
in_rate $JACK_RATE
in_bit_depth 32
in_valid_bit_depth 32
}
]
num_output_audio_formats 3
Object.Base.output_audio_format [
{
out_rate $JACK_RATE
out_bit_depth 16
out_valid_bit_depth 16
}
{
out_rate $JACK_RATE
out_bit_depth 32
out_valid_bit_depth 24
}
{
out_rate $JACK_RATE
out_bit_depth 32
out_valid_bit_depth 32
}
Expand All @@ -245,6 +348,7 @@ Object.Widget {

Object.Base.input_audio_format [
{
in_rate $JACK_RATE
in_bit_depth 32
in_valid_bit_depth $SDW_LINK_VALID_BITS
in_sample_type $SAMPLE_TYPE_MSB_INTEGER
Expand All @@ -253,6 +357,7 @@ Object.Widget {
]
Object.Base.output_audio_format [
{
out_rate $JACK_RATE
out_bit_depth 32
out_valid_bit_depth 32
}
Expand All @@ -277,12 +382,14 @@ Object.Widget {
# the instance number is automatically generated as '0'
Object.Base.input_audio_format [
{
in_rate $JACK_RATE
in_bit_depth 32
in_valid_bit_depth 32
}
]
Object.Base.output_audio_format [
{
out_rate $JACK_RATE
out_bit_depth 32
out_valid_bit_depth 32
}
Expand Down Expand Up @@ -312,6 +419,17 @@ Object.PCM.pcm [
Object.PCM.pcm_caps.1 {
name "volume playback 0"
formats 'S16_LE,S24_LE,S32_LE'
IncludeByKey.JACK_RATE {
"48000" {
rates '48000'
}
"96000" {
rates '96000'
}
"192000" {
rates '192000'
}
}
}
}
{
Expand All @@ -325,6 +443,17 @@ Object.PCM.pcm [
Object.PCM.pcm_caps.1 {
name "Passthrough Capture 0"
formats 'S16_LE,S24_LE,S32_LE'
IncludeByKey.JACK_RATE {
"48000" {
rates '48000'
}
"96000" {
rates '96000'
}
"192000" {
rates '192000'
}
}
channels_min $SDW_JACK_CAPTURE_CH
channels_max $SDW_JACK_CAPTURE_CH
}
Expand Down

0 comments on commit c6a1494

Please sign in to comment.