Hello Fabio,
I did that test and unfortunately this is broken too.
I’m not 100% sure, but if I record with 8kHz and then playback on the same device, it seems that the quality is better.
Simple-Sound-Card setup:
First I had to patch the mxs-saif.c with this unapplied patch: https://marc.info/?l=linux-kernel&m=148242588200882&w=2
I had to make a little trick in the simple-sound-card.c, with 2 dai-links the linking failed because they hat the same name. Don’t now how to fix this properly but I added the field prefix to the dai-link-node.
asoc_simple_card_dai_link_of in simple-sound-card.c
int link_prefix = 0;
of_property_read_u32(node, "prefix", &link_prefix);
ret = asoc_simple_card_set_dailink_name(dev, dai_link,
"%s-%s%d",
dai_link->cpu_dai_name,
dai_link->codec_dai_name,
link_prefix);
Devicetree:
sound {
compatible = "simple-audio-card";
simple-audio-card,name = "mx28-sgtl5000";
simple-audio-card,mclk-fs = <512>;
simple-audio-card,widgets =
"Microphone", "Mic Jack",
"Line", "Line In",
"Line", "Line Out",
"Headphone", "Headphone Jack";
simple-audio-card,routing =
"MIC_IN", "Mic Jack",
"Mic Jack", "Mic Bias",
"Headphone Jack", "HP_OUT";
simple-audio-card,dai-link@0 {
format = "i2s";
bitclock-master = <&cpu_dai0>;
frame-master = <&cpu_dai0>;
prefix = <0>;
cpu_dai0: cpu {
sound-dai = <&saif0>;
};
codec_dai0: codec {
sound-dai = <&sgtl5000>;
clocks = <&saif0>;
};
};
simple-audio-card,dai-link@1 {
format = "i2s";
bitclock-master = <&cpu_dai0>;
frame-master = <&cpu_dai0>;
prefix = <1>;
cpu_dai1: cpu {
sound-dai = <&saif1>;
};
codec_dai1: codec {
sound-dai = <&sgtl5000>;
};
};
};
Codec:
sgtl5000: codec@a {
#sound-dai-cells = <0>;
compatible = "fsl,sgtl5000";
reg = <0x0a>;
clocks = <&saif0>;
VDDA-supply = <®_3p3v>;
VDDIO-supply = <®_3p3v>;
VDDD-supply = <®_sgtl5000_vddd>;
micbias-resistor-k-ohms = <2>;
micbias-voltage-m-volts = <2750>;
};
SAIF:
saif0: saif@80042000 {
pinctrl-names = "default";
pinctrl-0 = <&saif0_pins_a>;
assigned-clocks = <&clks 53>;
assigned-clock-rates = <24576000>;
status = "okay";
};
Which results in:
asoc-simple-card sound: mxs-saif : sysclk = 24572753, direction 0
asoc-simple-card sound: sgtl5000 : sysclk = 24572753, direction 0
asoc-simple-card sound: name : mxs-saif-sgtl5000-0
asoc-simple-card sound: link 1:
asoc-simple-card sound: format : 4001
asoc-simple-card sound: mxs-saif : sysclk = 7324, direction 0
asoc-simple-card sound: sgtl5000 : sysclk = 24572753, direction 0
asoc-simple-card sound: name : mxs-saif-sgtl5000-1
asoc-simple-card sound: Card Name: mx28-sgtl5000
asoc-simple-card sound: sgtl5000 <-> 80042000.saif mapping ok
asoc-simple-card sound: sgtl5000 <-> 80046000.saif mapping ok
Regards,
Christian