I2S output/input on VIM3L

Which Khadas SBC do you use?

VIM3L

Which system do you use? Android, Ubuntu, OOWOW or others?

Ubuntu

Which version of system do you use? Khadas official images, self built images, or others?

Built using Fenix

Please describe your issue below:

I’m trying to use i2s on the 40 pins GPIO headers to output/input digital sound to/from a codec. I’m running the mainline kernel and i saw in “arch/arm64/boot/dts/amlogic/meson-khadas-vim3.dtsi” that uncommenting a few lines in

&tdmif_b {
        // uncomment next block  enable I2S output to GPIO HEADERS
        //
        assigned-clocks = <&clkc_audio AUD_CLKID_TDM_SCLK_PAD1>,
                          <&clkc_audio AUD_CLKID_TDM_LRCLK_PAD1>;
        assigned-clock-parents = <&clkc_audio AUD_CLKID_MST_B_SCLK>,
                                 <&clkc_audio AUD_CLKID_MST_B_LRCLK>;
        assigned-clock-rates = <0>, <0>;
        pinctrl-0 = <&tdm_b_fs_pins>, <&tdm_b_dout0_pins>,
                    <&tdm_b_sclk_pins>, <&mclk0_a_pins>;
        pinctrl-names = "default";
        status = "okay";
};

should work. The issue is that after uncommenting the lines, nothing changes and i d’ont see any clock or data on the i2s pins. Anyone got i2s working in mainline kernel in the VIM3L ?

Thanks

this is not enough i believe - i2s pins are pin-muxed with pwm_f. which seems is on by default. You might need to disable pwm_f output in dts file for i2s to work. And as you didn’t mentioned if Ubuntu was build from latest GitHub with 5.17 (as it now have configfs=Y and supports DTS overlays) and what u-boot you’re using - you might be enabling it via overlays too (in case BSP uboot)

1 Like

The connector layout does don’t show pwm_f being shared with i2s but might be wrong on this. I see the overlays configured in env.txt but there are no overlays compiled by fenix.

My bad, pwm_f is pinmuxed with SPDIF-IN… sorry.
Stupid question - do you see tdm_b sound device in alsa mixer ? If so - have you tried to output sound via it ?