Skip to content

Commit

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

Signed-off-by: Bard Liao <[email protected]>
  • Loading branch information
bardliao committed Nov 6, 2024
1 parent 79ca991 commit 0179b81
Show file tree
Hide file tree
Showing 2 changed files with 80 additions and 3 deletions.
81 changes: 79 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,49 @@ 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.output_audio_format [
{
out_rate $JACK_RATE
out_bit_depth 32
out_valid_bit_depth 32
}
]
Object.Base.output_audio_format [
{
out_rate $JACK_RATE
out_bit_depth 32
out_valid_bit_depth 32
}
]
}
}
]
Expand All @@ -78,21 +117,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 All @@ -119,29 +162,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 +211,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 +260,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 +302,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 +311,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 +336,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 +373,14 @@ 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'
}
}
}
}
{
Expand All @@ -325,6 +394,14 @@ 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'
}
}
channels_min $SDW_JACK_CAPTURE_CH
channels_max $SDW_JACK_CAPTURE_CH
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ SDW_JACK_OUT_STREAM=Playback-SimpleJack,SDW_JACK_IN_STREAM=Capture-SimpleJack"

"cavs-sdw\;sof-lnl-rt712-rt1320x1\;PLATFORM=lnl,SDW_DMIC=1,NUM_SDW_AMP_LINKS=2,\
SDW_AMP_FEEDBACK=false,SDW_SPK_STREAM=Playback-SmartAmp,SDW_DMIC_STREAM=Capture-SmartMic,\
SDW_JACK_OUT_STREAM=Playback-SimpleJack,SDW_JACK_IN_STREAM=Capture-SimpleJack"
SDW_JACK_OUT_STREAM=Playback-SimpleJack,SDW_JACK_IN_STREAM=Capture-SimpleJack,JACK_RATE=48000"

"cavs-sdw\;sof-lnl-rt713-l0-rt1318-l1-2ch\;PLATFORM=lnl,NUM_SDW_AMP_LINKS=1,\
SDW_SPK_STREAM=SDW1-Playback,SDW_AMP_FEEDBACK=false,\
Expand Down

0 comments on commit 0179b81

Please sign in to comment.