diff --git a/tools/topology/topology2/cavs-sdw.conf b/tools/topology/topology2/cavs-sdw.conf index 311e0376b333..1ea1283ba781 100644 --- a/tools/topology/topology2/cavs-sdw.conf +++ b/tools/topology/topology2/cavs-sdw.conf @@ -28,6 +28,7 @@ + @@ -98,6 +99,11 @@ Define { COMPR_2_PIPELINE_SINK 'mixout.21.1' COMPR_2_PCM_NAME 'Compress Speaker' + COMPR_SPEED_PIPELINE_SINK 'mixout.1.1' + COMPR_SPEED_PCM_NAME 'Compress Speed Jack Out' + COMPR_SPEED_2_PIPELINE_SINK 'mixout.21.1' + COMPR_SPEED_2_PCM_NAME 'Compress Speed Speaker' + SDW_JACK_OUT_STREAM 'SDW0-Playback' SDW_JACK_IN_STREAM 'SDW0-Capture' SDW_JACK_OUT_BE_ID 0 @@ -238,6 +244,7 @@ IncludeByKey.SDW_JACK { Define { # disable compressed audio for Jack COMPRESSED_1 false + COMPRESSED_SPEED_1 false } } } @@ -247,6 +254,7 @@ IncludeByKey.NUM_SDW_AMP_LINKS { Define { # Enable compressed audio for Speaker COMPRESSED_2 true + COMPRESSED_SPEED_2 true } } } @@ -287,3 +295,6 @@ IncludeByKey.SDW_DMIC_AUDIO_FEATURE_CAPTURE { IncludeByKey.SDW_DMIC_COMPR_AUDIO_FEATURE_CAPTURE { "true" "platform/intel/sdw-dmic-audio-feature-compress.conf" } +IncludeByKey.COMPRESSED_SPEED { + "true" "platform/intel/compr-speed.conf" +} diff --git a/tools/topology/topology2/development/tplg-targets.cmake b/tools/topology/topology2/development/tplg-targets.cmake index ab6a8b2976b5..8080dd76cc81 100644 --- a/tools/topology/topology2/development/tplg-targets.cmake +++ b/tools/topology/topology2/development/tplg-targets.cmake @@ -467,9 +467,17 @@ SDW_JACK_ECHO_REF=true,SDW_SPK_ECHO_REF=true,SDW_ECHO_REF_DAI=true" 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,COMPRESSED=true" +"cavs-sdw\;sof-arl-cs42l43-l0-compr-speed\;PLATFORM=mtl,NUM_SDW_AMP_LINKS=1,SDW_DMIC=1,\ +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,\ +COMPRESSED=true,COMPRESSED_SPEED=true" + "cavs-sdw\;sof-mtl-rt713-l0-rt1316-l12-compr\;PLATFORM=mtl,NUM_SDW_AMP_LINKS=2,\ HDMI1_ID=4,HDMI2_ID=5,HDMI3_ID=6,COMPRESSED=true" +"cavs-sdw\;sof-mtl-rt713-l0-rt1316-l12-compr-speed\;PLATFORM=mtl,NUM_SDW_AMP_LINKS=2,\ +HDMI1_ID=4,HDMI2_ID=5,HDMI3_ID=6,COMPRESSED=true,COMPRESSED_SPEED=true" + "cavs-sdw\;sof-ptl-rt721-compr\;PLATFORM=ptl,SDW_DMIC=1,NUM_SDW_AMP_LINKS=1,\ 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,COMPRESSED=true" diff --git a/tools/topology/topology2/include/components/phase_vocoder.conf b/tools/topology/topology2/include/components/phase_vocoder.conf index c0541c2ce69d..9c0ecbb5d25f 100644 --- a/tools/topology/topology2/include/components/phase_vocoder.conf +++ b/tools/topology/topology2/include/components/phase_vocoder.conf @@ -78,6 +78,10 @@ Class.Widget."phase_vocoder" { shift 0 } text.0 { + # Speeds over 1 are disabled for now to be able to operate + # Phase Vocoder Module without DP-DP bind need. The compress + # decoder must be DP, so the DP mode and more free PCM flow + # is not available for the Phase Vocoder. name "phase_vocoder_speed_enum" !values [ "0.5" @@ -86,16 +90,16 @@ Class.Widget."phase_vocoder" { "0.8" "0.9" "1.0" - "1.1" - "1.2" - "1.3" - "1.4" - "1.5" - "1.6" - "1.7" - "1.8" - "1.9" - "2.0" + #"1.1" + #"1.2" + #"1.3" + #"1.4" + #"1.5" + #"1.6" + #"1.7" + #"1.8" + #"1.9" + #"2.0" ] } ops.1 { diff --git a/tools/topology/topology2/include/formats/compr_input_audio_formats_pv.conf b/tools/topology/topology2/include/formats/compr_input_audio_formats_pv.conf new file mode 100644 index 000000000000..51e41ea42afa --- /dev/null +++ b/tools/topology/topology2/include/formats/compr_input_audio_formats_pv.conf @@ -0,0 +1,114 @@ + # Phase vocoder input formats: mono + stereo, all rates, + # 8/16/24/32-bit. ibs = frames * channels * bytes_per_sample + # (480 frames per DP period, matching current stereo values). + num_input_audio_formats 40 + CombineArrays.Object.Base.input_audio_format [ + # mono + { + in_channels [ 1 ] + in_rate [ + 8000 + 44100 + 48000 + 96000 + 192000 + ] + in_bit_depth [ 8 ] + in_valid_bit_depth [ 8 ] + in_sample_type [ $SAMPLE_TYPE_UNSIGNED_INTEGER ] + ibs [ 480 ] + } + { + in_channels [ 1 ] + in_rate [ + 8000 + 44100 + 48000 + 96000 + 192000 + ] + in_bit_depth [ 16 ] + in_valid_bit_depth [ 16 ] + ibs [ 960 ] + } + { + in_channels [ 1 ] + in_rate [ + 8000 + 44100 + 48000 + 96000 + 192000 + ] + in_bit_depth [ 32 ] + in_valid_bit_depth [ 24 ] + ibs [ 1920 ] + } + { + in_channels [ 1 ] + in_rate [ + 8000 + 44100 + 48000 + 96000 + 192000 + ] + in_bit_depth [ 32 ] + in_valid_bit_depth [ 32 ] + ibs [ 1920 ] + } + # stereo + { + in_channels [ 2 ] + in_rate [ + 8000 + 44100 + 48000 + 96000 + 192000 + ] + in_bit_depth [ 8 ] + in_valid_bit_depth [ 8 ] + in_sample_type [ $SAMPLE_TYPE_UNSIGNED_INTEGER ] + ibs [ 960 ] + } + { + in_channels [ 2 ] + in_rate [ + 8000 + 44100 + 48000 + 96000 + 192000 + ] + in_bit_depth [ 16 ] + in_valid_bit_depth [ 16 ] + ibs [ 1920 ] + } + { + in_channels [ 2 ] + in_rate [ + 8000 + 44100 + 48000 + 96000 + 192000 + ] + in_bit_depth [ 32 ] + in_valid_bit_depth [ 24 ] + ibs [ 3840 ] + } + { + in_channels [ 2 ] + in_rate [ + 8000 + 44100 + 48000 + 96000 + 192000 + ] + in_bit_depth [ 32 ] + in_valid_bit_depth [ 32 ] + ibs [ 3840 ] + } + ] diff --git a/tools/topology/topology2/include/formats/compr_output_audio_formats_pv.conf b/tools/topology/topology2/include/formats/compr_output_audio_formats_pv.conf new file mode 100644 index 000000000000..2972927c2f74 --- /dev/null +++ b/tools/topology/topology2/include/formats/compr_output_audio_formats_pv.conf @@ -0,0 +1,114 @@ + # Phase vocoder output formats: mono + stereo, all rates, + # 8/16/24/32-bit. obs = frames * channels * bytes_per_sample + # (240 frames per DP period, matching current stereo values). + num_output_audio_formats 40 + CombineArrays.Object.Base.output_audio_format [ + # mono + { + out_channels [ 1 ] + out_rate [ + 8000 + 44100 + 48000 + 96000 + 192000 + ] + out_bit_depth [ 8 ] + out_valid_bit_depth [ 8 ] + out_sample_type [ $SAMPLE_TYPE_UNSIGNED_INTEGER ] + obs [ 240 ] + } + { + out_channels [ 1 ] + out_rate [ + 8000 + 44100 + 48000 + 96000 + 192000 + ] + out_bit_depth [ 16 ] + out_valid_bit_depth [ 16 ] + obs [ 480 ] + } + { + out_channels [ 1 ] + out_rate [ + 8000 + 44100 + 48000 + 96000 + 192000 + ] + out_bit_depth [ 32 ] + out_valid_bit_depth [ 24 ] + obs [ 960 ] + } + { + out_channels [ 1 ] + out_rate [ + 8000 + 44100 + 48000 + 96000 + 192000 + ] + out_bit_depth [ 32 ] + out_valid_bit_depth [ 32 ] + obs [ 960 ] + } + # stereo + { + out_channels [ 2 ] + out_rate [ + 8000 + 44100 + 48000 + 96000 + 192000 + ] + out_bit_depth [ 8 ] + out_valid_bit_depth [ 8 ] + out_sample_type [ $SAMPLE_TYPE_UNSIGNED_INTEGER ] + obs [ 480 ] + } + { + out_channels [ 2 ] + out_rate [ + 8000 + 44100 + 48000 + 96000 + 192000 + ] + out_bit_depth [ 16 ] + out_valid_bit_depth [ 16 ] + obs [ 960 ] + } + { + out_channels [ 2 ] + out_rate [ + 8000 + 44100 + 48000 + 96000 + 192000 + ] + out_bit_depth [ 32 ] + out_valid_bit_depth [ 24 ] + obs [ 1920 ] + } + { + out_channels [ 2 ] + out_rate [ + 8000 + 44100 + 48000 + 96000 + 192000 + ] + out_bit_depth [ 32 ] + out_valid_bit_depth [ 32 ] + obs [ 1920 ] + } + ] diff --git a/tools/topology/topology2/include/pipelines/cavs/compr-speed-playback.conf b/tools/topology/topology2/include/pipelines/cavs/compr-speed-playback.conf new file mode 100644 index 000000000000..b08023a7f65d --- /dev/null +++ b/tools/topology/topology2/include/pipelines/cavs/compr-speed-playback.conf @@ -0,0 +1,113 @@ +# +# FE playback pipeline: compr-speed-playback +# +# All attributes defined herein are namespaced +# by alsatplg to "Object.Pipeline.compr-speed-playback.N.attribute_name" +# +# Usage: compr-speed-playback pipeline object can be instantiated as: +# +# Object.Pipeline.compr-speed-playback."N" { +# period 1000 +# time_domain "timer" +# } +# +# Where N is the unique pipeline ID within the same alsaconf node. +# + + + + + + + + + + + + +Class.Pipeline."compr-speed-playback" { + + + + attributes { + !constructor [ + "index" + ] + + !immutable [ + "direction" + ] + + # + # compr-speed-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 + } + + decoder."1" { + scheduler_domain "DP" + } + + phase_vocoder."1" { + # Commented out to avoid DP-DP bind limitation. This limits the + # Phase Vocodeer module to support only slow playback 0.5 - 1.0x + # with no speed up. + # scheduler_domain "DP" + } + + module-copier."2" {} + + src."1" {} + + micsel."1" {} + + gain."1" {} + + mixin."1" {} + + pipeline."1" { + priority 0 + # enable lp mode + lp_mode 1 + } + } + + Object.Base.route [ + { + source decoder.$index.1 + sink phase_vocoder.$index.1 + } + { + source phase_vocoder.$index.1 + sink module-copier.$index.2 + } + { + source module-copier.$index.2 + sink src.$index.1 + } + { + source src.$index.1 + sink micsel.$index.1 + } + { + source micsel.$index.1 + sink gain.$index.1 + } + { + source gain.$index.1 + sink mixin.$index.1 + } + ] + + direction "playback" + dynamic_pipeline 1 + time_domain "timer" +} diff --git a/tools/topology/topology2/platform/intel/compr-default.conf b/tools/topology/topology2/platform/intel/compr-default.conf index 12ab39185f5a..db45e7256836 100644 --- a/tools/topology/topology2/platform/intel/compr-default.conf +++ b/tools/topology/topology2/platform/intel/compr-default.conf @@ -2,15 +2,25 @@ Define { COMPRESSED false COMPR_DEEPBUFFER_MS 100 # 100 ms copier dma size + COMPRESSED_SPEED false 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 + + COMPRESSED_SPEED_1 true + COMPR_SPEED_PCM_NAME 'Compress Speed Playback' + COMPR_SPEED_PCM_ID 60 + COMPR_SPEED_PIPELINE_ID 95 + + COMPRESSED_SPEED_2 false + COMPR_SPEED_2_PCM_NAME 'Compress Speed Playback 2' + COMPR_SPEED_2_PCM_ID 62 + COMPR_SPEED_2_PIPELINE_ID 96 } diff --git a/tools/topology/topology2/platform/intel/compr-speed.conf b/tools/topology/topology2/platform/intel/compr-speed.conf new file mode 100644 index 000000000000..711b7872df15 --- /dev/null +++ b/tools/topology/topology2/platform/intel/compr-speed.conf @@ -0,0 +1,263 @@ + +IncludeByKey.COMPRESSED_SPEED_1 { +"true" { + Object.Pipeline.compr-speed-playback [ + { + index $COMPR_SPEED_PIPELINE_ID + + Object.Widget.host-copier.1 { + stream_name $COMPR_SPEED_PCM_NAME + pcm_id $COMPR_SPEED_PCM_ID + + + } + + Object.Widget.decoder.1 { + core_id 1 + + + } + + Object.Widget.phase_vocoder.1 { + + + Object.Control { + bytes."1" { + name '$COMPR_SPEED_PCM_NAME Phase Vocoder bytes' + + } + mixer."1" { + name '$COMPR_SPEED_PCM_NAME Phase Vocoder enable' + } + enum."1" { + name '$COMPR_SPEED_PCM_NAME Phase Vocoder speed' + } + } + } + + # converts the input to S32_LE + Object.Widget.module-copier.2 { + + + } + + # converts the input to 48KHz + # note: this is wrong for 96/192KHz HiRes audio!!!! + Object.Widget.src.1 { + rate_out 48000 + + } + + # converts the input to stereo + Object.Widget.micsel.1 { + Object.Control.bytes."1" { + name '$COMPR_SPEED_PCM_NAME selector bytes' + + } + + + } + + Object.Widget.gain.1 { + Object.Control.mixer.1 { + name 'Pre Mixer $COMPR_SPEED_PCM_NAME Volume' + } + num_input_audio_formats 1 + Object.Base.input_audio_format [ + { + in_rate 48000 + in_bit_depth 32 + in_valid_bit_depth 32 + } + ] + num_output_audio_formats 1 + Object.Base.output_audio_format [ + { + out_rate 48000 + out_bit_depth 32 + out_valid_bit_depth 32 + } + ] + } + Object.Widget.mixin.1 { + Object.Base.input_audio_format [ + { + in_rate 48000 + in_bit_depth 32 + in_valid_bit_depth 32 + } + ] + Object.Base.output_audio_format [ + { + out_rate 48000 + out_bit_depth 32 + out_valid_bit_depth 32 + } + ] + } + } + ] + + Object.PCM.pcm [ + { + name $COMPR_SPEED_PCM_NAME + id $COMPR_SPEED_PCM_ID + direction playback + compress "true" + + Object.Base.fe_dai.1 { + name "$COMPR_SPEED_PCM_NAME" + } + + Object.PCM.pcm_caps.1 { + name $COMPR_SPEED_PCM_NAME + formats 'S32_LE' + rates '8000' + } + } + ] + + Object.Base.route [ + { + source mixin.$COMPR_SPEED_PIPELINE_ID.1 + sink $COMPR_SPEED_PIPELINE_SINK + } + { + source host-copier.$COMPR_SPEED_PCM_ID.playback + sink decoder.$COMPR_SPEED_PIPELINE_ID.1 + } + ] +} +} + +# Spawn another instance for speaker +IncludeByKey.COMPRESSED_SPEED_2 { +"true" { + Object.Pipeline.compr-speed-playback [ + { + index $COMPR_SPEED_2_PIPELINE_ID + + Object.Widget.host-copier.1 { + stream_name $COMPR_SPEED_2_PCM_NAME + pcm_id $COMPR_SPEED_2_PCM_ID + + + } + + Object.Widget.decoder.1 { + core_id 1 + + + } + + Object.Widget.phase_vocoder.1 { + + + Object.Control { + bytes."1" { + name '$COMPR_SPEED_2_PCM_NAME Phase Vocoder bytes' + + } + mixer."1" { + name '$COMPR_SPEED_2_PCM_NAME Phase Vocoder enable' + } + enum."1" { + name '$COMPR_SPEED_2_PCM_NAME Phase Vocoder speed' + } + } + } + + # converts the input to S32_LE + Object.Widget.module-copier.2 { + + + } + + # converts the input to 48KHz + # note: this is wrong for 96/192KHz HiRes audio!!!! + Object.Widget.src.1 { + rate_out 48000 + + } + + # converts the input to stereo + Object.Widget.micsel.1 { + Object.Control.bytes."1" { + name '$COMPR_SPEED_2_PCM_NAME selector bytes' + + } + + + } + + Object.Widget.gain.1 { + Object.Control.mixer.1 { + name 'Pre Mixer $COMPR_SPEED_2_PCM_NAME Volume' + } + num_input_audio_formats 1 + Object.Base.input_audio_format [ + { + in_rate 48000 + in_bit_depth 32 + in_valid_bit_depth 32 + } + ] + num_output_audio_formats 1 + Object.Base.output_audio_format [ + { + out_rate 48000 + out_bit_depth 32 + out_valid_bit_depth 32 + } + ] + } + Object.Widget.mixin.1 { + Object.Base.input_audio_format [ + { + in_rate 48000 + in_bit_depth 32 + in_valid_bit_depth 32 + } + ] + Object.Base.output_audio_format [ + { + out_rate 48000 + out_bit_depth 32 + out_valid_bit_depth 32 + } + ] + } + } + ] + + Object.PCM.pcm [ + { + name $COMPR_SPEED_2_PCM_NAME + id $COMPR_SPEED_2_PCM_ID + direction playback + compress "true" + + Object.Base.fe_dai.1 { + name "$COMPR_SPEED_2_PCM_NAME" + } + + Object.PCM.pcm_caps.1 { + name $COMPR_SPEED_2_PCM_NAME + formats 'S32_LE' + rates '8000' + } + } + ] + + Object.Base.route [ + { + source mixin.$COMPR_SPEED_2_PIPELINE_ID.1 + sink $COMPR_SPEED_2_PIPELINE_SINK + } + { + source host-copier.$COMPR_SPEED_2_PCM_ID.playback + sink decoder.$COMPR_SPEED_2_PIPELINE_ID.1 + } + ] +} +}