Skip to content

Commit

Permalink
Tools: Topology2: Add other rates support for HDA generic
Browse files Browse the repository at this point in the history
This patch modifies cavs-mixin-mixout-hda.conf with added input
and output format attributes for in_rate and out_rate. The bit_depth
attributes need to be added to as well to avoid corrupt audio.

The HDA_ANALOG_CAPTURE_RATE and HDA_ANALOG_PLAYBACK_RATE are by default
set to 48000. The topologies' characteristics are not changed with
this patch.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
  • Loading branch information
singalsu committed Apr 11, 2024
1 parent 442a006 commit d457f7f
Showing 1 changed file with 108 additions and 0 deletions.
108 changes: 108 additions & 0 deletions tools/topology/topology2/cavs-mixin-mixout-hda.conf
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ Define {
DEEP_BUFFER_PIPELINE_SRC 'mixin.15.1'
DEEP_BUFFER_PIPELINE_SINK 'mixout.2.1'
DEEP_BUFFER_PCM_NAME 'Deepbuffer HDA Analog'
HDA_ANALOG_CAPTURE_RATE 48000
HDA_ANALOG_PLAYBACK_RATE 48000
EFX_FIR_PARAMS 'passthrough'
EFX_IIR_PARAMS 'passthrough'
EFX_DRC_PARAMS 'passthrough'
Expand Down Expand Up @@ -40,11 +42,43 @@ Object.Pipeline {
stream_name $HDA_ANALOG_DAI_NAME
dai_type "HDA"
copier_type "HDA"
num_input_audio_formats 1
num_output_audio_formats 1
Object.Base.input_audio_format [
{
in_rate $HDA_ANALOG_PLAYBACK_RATE
in_bit_depth 32
in_valid_bit_depth 32
}
]
Object.Base.output_audio_format [
{
out_rate $HDA_ANALOG_PLAYBACK_RATE
out_bit_depth 32
out_valid_bit_depth 32
}
]
}
Object.Widget.gain.1 {
Object.Control.mixer.1 {
name 'Post Mixer $ANALOG_PLAYBACK_PCM Volume'
}
num_input_audio_formats 1
num_output_audio_formats 1
Object.Base.input_audio_format [
{
in_rate $HDA_ANALOG_PLAYBACK_RATE
in_bit_depth 32
in_valid_bit_depth 32
}
]
Object.Base.output_audio_format [
{
out_rate $HDA_ANALOG_PLAYBACK_RATE
out_bit_depth 32
out_valid_bit_depth 32
}
]
}
Object.Widget.eqiir.1 {
Object.Control.bytes."1" {
Expand Down Expand Up @@ -76,11 +110,53 @@ Object.Pipeline {
Object.Widget.host-copier.1 {
stream_name $ANALOG_PLAYBACK_PCM
pcm_id 0
num_input_audio_formats 3
num_output_audio_formats 1
Object.Base.input_audio_format [
{
in_rate $HDA_ANALOG_PLAYBACK_RATE
in_bit_depth 16
in_valid_bit_depth 16
}
{
in_rate $HDA_ANALOG_PLAYBACK_RATE
in_bit_depth 32
in_valid_bit_depth 24
}
{
in_rate $HDA_ANALOG_PLAYBACK_RATE
in_bit_depth 32
in_valid_bit_depth 32
}
]
Object.Base.output_audio_format [
{
out_rate $HDA_ANALOG_PLAYBACK_RATE
out_bit_depth 32
out_valid_bit_depth 32
}
]
}

Object.Widget.gain.1 {
Object.Control.mixer.1 {
name 'Pre Mixer $ANALOG_PLAYBACK_PCM Volume'
num_input_audio_formats 1
num_output_audio_formats 1
Object.Base.input_audio_format [
{
in_rate $HDA_ANALOG_PLAYBACK_RATE
in_bit_depth 32
in_valid_bit_depth 32
}
]
Object.Base.output_audio_format [
{
out_rate $HDA_ANALOG_PLAYBACK_RATE
out_bit_depth 32
out_valid_bit_depth 32
}
]
}
}
}
Expand All @@ -92,6 +168,32 @@ Object.Pipeline {
Object.Widget.host-copier.1 {
stream_name $ANALOG_CAPTURE_PCM
pcm_id 0
num_input_audio_formats 1
num_output_audio_formats 3
Object.Base.input_audio_format [
{
in_rate $HDA_ANALOG_CAPTURE_RATE
in_bit_depth 32
in_valid_bit_depth 32
}
]
Object.Base.output_audio_format [
{
out_rate $HDA_ANALOG_CAPTURE_RATE
out_bit_depth 16
out_valid_bit_depth 16
}
{
out_rate $HDA_ANALOG_CAPTURE_RATE
out_bit_depth 32
out_valid_bit_depth 24
}
{
out_rate $HDA_ANALOG_CAPTURE_RATE
out_bit_depth 32
out_valid_bit_depth 32
}
]
}
}
]
Expand All @@ -112,12 +214,14 @@ Object.Pipeline {
num_output_audio_formats 1
Object.Base.input_audio_format [
{
in_rate $HDA_ANALOG_CAPTURE_RATE
in_bit_depth 32
in_valid_bit_depth 32
}
]
Object.Base.output_audio_format [
{
out_rate $HDA_ANALOG_CAPTURE_RATE
out_bit_depth 32
out_valid_bit_depth 32
}
Expand All @@ -142,11 +246,15 @@ Object.PCM.pcm [
direction "playback"
name $ANALOG_PLAYBACK_PCM
formats 'S32_LE,S24_LE,S16_LE'
rate_min $HDA_ANALOG_PLAYBACK_RATE
rate_max $HDA_ANALOG_PLAYBACK_RATE
}
Object.PCM.pcm_caps.2 {
direction "capture"
name $ANALOG_CAPTURE_PCM
formats 'S32_LE,S24_LE,S16_LE'
rate_min $HDA_ANALOG_CAPTURE_RATE
rate_max $HDA_ANALOG_CAPTURE_RATE
}
direction duplex
}
Expand Down

0 comments on commit d457f7f

Please sign in to comment.