‎2021-11-09 11:46 PM
sound {
compatible = "audio-graph-card";
label = "STM32MP15-DK"; /* Sound card identified as STM32MP15DK in ALSA */
routing =
"Playback" , "MCLK",
"Capture" , "MCLK",
"MICL" , "Mic Bias";
dais = <&sai2a_port &sai2b_port &i2s2_port>;
status = "okay";
};
​
​
Hi!! Is this correct. Can you please help me to understanding what does the source and sink means in this. How to make a routing.
Solved! Go to Solution.
‎2021-11-16 01:45 AM
The DAPM concept is not a basic concept. To understand the routing you need to understand the DAPM concept.
The DAPM widgets are kind of node of a audio routing graph, powered up when you start a playback or a record and power down 5 second after the audio stream is closed.
DAPM widgets can be defined in :
you can list the DAPM widgets in board console:
root@stm32mp1:~# ls /sys/kernel/debug/asoc/STM32MP15-DK/*/dapm
/sys/kernel/debug/asoc/STM32MP15-DK/4000b000.audio-controller/dapm:
bias_level capture playback
/sys/kernel/debug/asoc/STM32MP15-DK/4400b004.audio-controller/dapm:
bias_level
/sys/kernel/debug/asoc/STM32MP15-DK/4400b024.audio-controller/dapm:
bias_level
/sys/kernel/debug/asoc/STM32MP15-DK/cs42l51.0-004a/dapm:
AIN1L AIN2L Capture HPL Left ADC Left PGA MICL Mic Bias Mic Preamp Right PGA-ADC Mux Right Right ADC Right PGA
AIN1R AIN2R DAC Mux HPR Left DAC MCLK MICR Mic Preamp Left PGA-ADC Mux Left Playback Right DAC bias_level
/sys/kernel/debug/asoc/STM32MP15-DK/dma:4000b000.audio-controller/dapm:
bias_level
/sys/kernel/debug/asoc/STM32MP15-DK/dma:4400b004.audio-controller/dapm:
bias_level
/sys/kernel/debug/asoc/STM32MP15-DK/dma:4400b024.audio-controller/dapm:
bias_level
/sys/kernel/debug/asoc/STM32MP15-DK/hdmi-audio-codec.1.auto/dapm:
I2S Playback TX bias_level
The routing consists in interconecting the widget to create a route to enable everything needed for the playback or record
routing =
"Playback" , "MCLK", /* connect the cs42l51 "MCLK" widget to the 4400b004.audio-controller "playback" widget to enable MCLK on playback */
"Capture" , "MCLK", /* connect the cs42l51 "MCLK" widget to the 4400b004.audio-controller "playback" widget to enable MCLK on record */
"MICL" , "Mic Bias"; /* connect the cs42l51 "Mic Bias" widget to the cs42l51 "MICL" widget to enable micbias when microphone input is active */
Extra documentation on DAPM: https://events.static.linuxfound.org/sites/events/files/slides/dapm.pdf ( there is video associated, but seems no more available)
‎2021-11-15 04:52 AM
Hello,
The routing is linked to the ASoC DAPM concept.
‎2021-11-15 11:36 PM
OK, thank you for your answer, but this part still doesn't tell me where ST gets "playback", "MCLK".And the attribute "widgets" mentioned in it does not appear in the file of ST.
‎2021-11-16 01:45 AM
The DAPM concept is not a basic concept. To understand the routing you need to understand the DAPM concept.
The DAPM widgets are kind of node of a audio routing graph, powered up when you start a playback or a record and power down 5 second after the audio stream is closed.
DAPM widgets can be defined in :
you can list the DAPM widgets in board console:
root@stm32mp1:~# ls /sys/kernel/debug/asoc/STM32MP15-DK/*/dapm
/sys/kernel/debug/asoc/STM32MP15-DK/4000b000.audio-controller/dapm:
bias_level capture playback
/sys/kernel/debug/asoc/STM32MP15-DK/4400b004.audio-controller/dapm:
bias_level
/sys/kernel/debug/asoc/STM32MP15-DK/4400b024.audio-controller/dapm:
bias_level
/sys/kernel/debug/asoc/STM32MP15-DK/cs42l51.0-004a/dapm:
AIN1L AIN2L Capture HPL Left ADC Left PGA MICL Mic Bias Mic Preamp Right PGA-ADC Mux Right Right ADC Right PGA
AIN1R AIN2R DAC Mux HPR Left DAC MCLK MICR Mic Preamp Left PGA-ADC Mux Left Playback Right DAC bias_level
/sys/kernel/debug/asoc/STM32MP15-DK/dma:4000b000.audio-controller/dapm:
bias_level
/sys/kernel/debug/asoc/STM32MP15-DK/dma:4400b004.audio-controller/dapm:
bias_level
/sys/kernel/debug/asoc/STM32MP15-DK/dma:4400b024.audio-controller/dapm:
bias_level
/sys/kernel/debug/asoc/STM32MP15-DK/hdmi-audio-codec.1.auto/dapm:
I2S Playback TX bias_level
The routing consists in interconecting the widget to create a route to enable everything needed for the playback or record
routing =
"Playback" , "MCLK", /* connect the cs42l51 "MCLK" widget to the 4400b004.audio-controller "playback" widget to enable MCLK on playback */
"Capture" , "MCLK", /* connect the cs42l51 "MCLK" widget to the 4400b004.audio-controller "playback" widget to enable MCLK on record */
"MICL" , "Mic Bias"; /* connect the cs42l51 "Mic Bias" widget to the cs42l51 "MICL" widget to enable micbias when microphone input is active */
Extra documentation on DAPM: https://events.static.linuxfound.org/sites/events/files/slides/dapm.pdf ( there is video associated, but seems no more available)
‎2021-11-17 05:05 PM
Thank you very much for your reply. These materials are very helpful for me to understand the functions of this part, but I still have a question. This part of the "routing" attribute is prepared for cs42151, but there is also an HDMI audio in the node. How does it work? I don't see the "routing" attribute in the sii9022 document. This node just shows there, but there is nothing except configured I2s.Which makes me very confused.
‎2021-11-18 12:16 AM
As mentioned a part of the route is done in the codec driver. This is the case for the HDMI.
https://elixir.bootlin.com/linux/v5.10.79/source/sound/soc/codecs/hdmi-codec.c#L663
to observe connections you can print the content of the DAPM degub files, before and during playback.
root@stm32mp1:~# cat /sys/kernel/debug/asoc/STM32MP15-DK/hdmi-audio-codec.1.auto/dapm/I2S\ Playback
I2S Playback: Off in 0 out 1
stream I2S Playback inactive
out "static" "TX"
in "static" "playback"
root@stm32mp1:~# cat /sys/kernel/debug/asoc/STM32MP15-DK/hdmi-audio-codec.1.auto/dapm/TX
TX: Off in 0 out 1
in "static" "I2S Playback"
‎2021-11-22 10:31 PM
Thank you again for your help, which is very helpful for me to understand the audio part.😀