Hi there,
We are using the MAX98090 audio codec on a custom i.MX8MP-based board. The issue we are facing is with headphone jack detection.
In the MAX98090 codec driver, jack detection appears to work correctly — I can see debug prints when the jack is plugged in or removed. However, when streaming audio using aplay, audio is coming from both the speaker and headphone simultaneously, which is not the desired behavior. Ideally, the speaker should automatically turn off when headphones are connected.
I am wondering if this could be related to ALSA or PulseAudio configuration, or if something is missing in the device tree or driver setup.
For reference, I am attaching the device tree snippet of the and the codec outputs of amixer -c 0 scontrols and pactl list cards command in the attached max-logs.txt file.
Any help would be appreciated!
DTS snippet:
sound-max98090 {
compatible = "simple-audio-card";
simple-audio-card,name = "max98090-audio";
simple-audio-card,format = "i2s";
simple-audio-card,frame-master = <&cpudai>;
simple-audio-card,bitclock-master = <&cpudai>;
simple-audio-card,bitclock-inversion;
simple-audio-card,widgets =
"Microphone", "Mic Jack",
"Speakers", "Speakers",
"Line", "Line In",
"Line", "Line Out",
"Headphone", "Headphone Jack";
simple-audio-card,routing =
"Headphone Jack", "HPL",
"Headphone Jack", "HPR",
"Line Out", "RCVL",
"Line Out", "RCVR",
/* Uncomment any of these below lines if the Line Input(s) is(are) used else leave it as such. */
"IN1","Line In",
"IN2","Line In",
"IN5", "Line In", /* IN1/IN2/IN3/IN4/IN6 (For single-ended input) */
"IN34", "Line In", /* IN34 (For differential inputs) */
"IN56", "Line In", /* IN34 (For differential inputs) */
"MIC1", "Mic Jack",
"MIC2", "Mic Jack",
"Mic Jack", "MICBIAS",
"IN1", "MICBIAS",
"MIC1","IN1",
"MIC2","IN1",
"Speakers", "SPKL",
"Speakers", "SPKR",
/* DMIC-3 Routings */
"DMICL", "DMIC Mux",
"DMIC Mux", "DMIC3",
"DMIC3", "DMIC3_ENA",
"DMIC3", "AHPF",
/* DMIC-4 Routings */
"DMICR", "DMIC Mux",
"DMIC Mux", "DMIC4",
"DMIC4", "DMIC4_ENA",
"DMIC3", "AHPF",
"DMIC4", "AHPF",
"HiFi Capture", "DMICL",
"HiFi Capture", "DMICR";
cpudai: simple-audio-card,cpu {
sound-dai = <&sai3>;
dai-tdm-slot-num = <2>;
};
simple-audio-card,codec {
sound-dai = <&max98090>;
clocks = <&audio_blk_ctrl IMX8MP_CLK_AUDIOMIX_SAI3_MCLK1>;
};
};
&i2c4 {
clock-frequency = <400000>;
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_i2c4>;
status = "okay";
max98090: max98090@10 {
#sound-dai-cells = <0>;
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_sai3>;
compatible = "maxim,max98091";
reg = <0x10>;
clocks = <&clk IMX8MP_CLK_SAI3_ROOT>;
interrupt-parent = <&gpio1>;
interrupts = <8 IRQ_TYPE_LEVEL_LOW>; /* NC from HW side */
clock-names = "mclk";
};
};
&sai3 {
#sound-dai-cells = <0>;
assigned-clocks = <&clk IMX8MP_AUDIO_PLL2_OUT>, <&clk IMX8MP_CLK_SAI3>;
assigned-clock-parents = <&clk IMX8MP_AUDIO_PLL2_OUT>, <&clk IMX8MP_AUDIO_PLL2_OUT>;
assigned-clock-rates = <361267200>,<11289600>;
fsl,sai-mclk-direction-output;
status = "okay";
};
Hello,
That must be a hardware issue since it works perfectly with EVK, however i noticed that you change the dtb, please check the dtb from the EVK and apply the changes accordingly .
Regards
Hi @Bio_TICFSL,
That must be a hardware issue since it works perfectly with EVK,
-- Can you please elaborate which EVK are you referring to? If its IMX8MP EVK then I believe it has a different audio codec.
however i noticed that you change the dtb, please check the dtb from the EVK and apply the changes accordingly .
-- Do i need to refer EVK for the codec routings? But both are different codecs and the MAX98090 does not have the hp-det-gpio pin like wm8960.
Hello,
My suggestion is to also take look into the codec drivers that are available within our Linux BSP: codecs\soc\sound - linux-imx - i.MX Linux kernel (both drivers for WM8960 and WM824 are included here). That would be a good starting point to look for different codec-driver examples that may also suit your needs. Also, one of colleagues posted a document his experience WM8960: WM8960 audio codec.It would also be convenient to check it out.
Regards