I'm working on a custom board on IMX8MP, with STM32 I2S internal DAC as audio card (outsorced, so I can't do too much about how it works). For that purpose I've created simple-audio-card config based on the MAX98357a driver. It works, it's capable to sand audio over I2S to the recier at 48000Hz, stereo. here's my device tree config:
codec_ext: max98357a@0 {
compatible = "maxim,max98357a";
#sound-dai-cells = <0>;
};
sound {
compatible = "simple-audio-card";
status = "okay";
simple-audio-card,name = "Muminek";
simple-audio-card,format = "left_j";
simple-audio-card,bitclock-master = <&dailink_master_cpu>;
simple-audio-card,frame-master = <&dailink_master_cpu>;
simple-audio-card,convert-rate = <44100>;
simple-audio-card,convert-channels = <1>;
simple-audio-card,codec {
sound-dai = <&codec_ext>;
};
dailink_master_cpu: simple-audio-card,cpu {
sound-dai = <&sai3>;
};
};
pinctrl_sai3: sai3grp {
fsl,pins = <
MX8MP_IOMUXC_SAI3_TXFS__AUDIOMIX_SAI3_TX_SYNC 0xd6
MX8MP_IOMUXC_SAI3_TXC__AUDIOMIX_SAI3_TX_BCLK 0xd6
MX8MP_IOMUXC_SAI3_RXFS__AUDIOMIX_SAI3_RX_SYNC 0xd6
MX8MP_IOMUXC_SAI3_RXC__AUDIOMIX_SAI3_RX_BCLK 0xd6
MX8MP_IOMUXC_SAI3_RXD__AUDIOMIX_SAI3_RX_DATA00 0xd6
MX8MP_IOMUXC_SAI3_TXD__AUDIOMIX_SAI3_TX_DATA00 0xd6
MX8MP_IOMUXC_SAI3_MCLK__AUDIOMIX_SAI3_MCLK 0xd6
>;
};
&sai3 {
assigned-clocks = <&clk IMX8MP_CLK_SAI3>;
assigned-clock-parents = <&clk IMX8MP_AUDIO_PLL1_OUT>;
assigned-clock-rates = <24576000>;
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_sai3>;
fsl,sai-mclk-direction-output;
#sound-dai-cells = <0>;
status = "okay";
};
However, they want to get 44100Hz and mono in left channel. Currently if I play mono, it goes to right channel only (for "left_j" default mono channel is inverted).
I've been trying to use:
simple-audio-card,convert-rate = <44100>;
simple-audio-card,convert-channels = <1>;
But no luck.
I've got a feeling it's missing simple-audio-card,routing
or simple-audio-card,widgets
, but can't get any detailed info on how to configure those.
Any help would be highly appreciated.
Thanks in advance!