WM8960 codec on Vim


#1

Hello.

I have WM8960 codec connected to i2s (pins 29-33) and i2c (SCL-22, SDA-23).

I modify kvim_linux.dts, and add:

&i2c_a {
    status = "okay";
    wm8960: codec@1a {
    compatible = "wlf,wm8960";
            reg = <0x1a>;

            wlf,shared-lrclk;
    };

};

On boot in dmesg I have:
[ 4.514353] wm8960 1-001a: probe
[ 4.514479] i2c i2c-1: master_xfer[0] W, addr=0x1a, len=2
[ 4.514606] i2c i2c-1: master_xfer[0] W, addr=0x1a, len=2
[ 4.514719] i2c i2c-1: master_xfer[0] W, addr=0x1a, len=2
[ 4.514834] i2c i2c-1: master_xfer[0] W, addr=0x1a, len=2
[ 4.514949] i2c i2c-1: master_xfer[0] W, addr=0x1a, len=2
[ 4.515063] i2c i2c-1: master_xfer[0] W, addr=0x1a, len=2
[ 4.515177] i2c i2c-1: master_xfer[0] W, addr=0x1a, len=2
[ 4.515291] i2c i2c-1: master_xfer[0] W, addr=0x1a, len=2
[ 4.515405] i2c i2c-1: master_xfer[0] W, addr=0x1a, len=2
[ 4.515591] i2c i2c-1: master_xfer[0] W, addr=0x1a, len=2
[ 4.515706] i2c i2c-1: master_xfer[0] W, addr=0x1a, len=2
[ 4.515818] i2c i2c-1: master_xfer[0] W, addr=0x1a, len=2
[ 4.516005] i2c-core: driver [wm8960] registered

After record (arecord -D hw:0,0 test.wav) I don’t have sound.
I know, I must configure WM8960 (disable mute etc), but how do this? in /proc/asound/cards I only have AML-MESONAUDIO.
How add WM codec to alsa?


#2

No sound card for WM8960. Can you make sure your driver works? Maybe you can provide the dmesg log.


#3

https://pastebin.com/JYCTMnvs


#4

Hello jarbash,

You just defined the codec, you also need to define a new sound card.You can refer to


#5

Hello.

I add new sound card (asoc-simple-card).

880,914d879
       sound {
                 compatible = "simple-audio-card";
                 simple-audio-card,format = "i2s";
                 simple-audio-card,name = "wm8960-hifi";
                 status = "okay";
                 simple-audio-card,widgets =
                         "Microphone", "Mic Jack",
                         "Line", "Line In",
                         "Line", "Line Out",
                         "Speaker", "Speaker",
                         "Headphone", "Headphone Jack";
                 simple-audio-card,routing =
                         "Headphone Jack", "HP_L",
                         "Headphone Jack", "HP_R",
                         "Speaker", "SPK_LP",
                         "Speaker", "SPK_LN",
                         "LINPUT1", "Mic Jack",
                         "LINPUT3", "Mic Jack",
                         "RINPUT1", "Mic Jack",
                         "RINPUT2", "Mic Jack";

                 simple-audio-card,cpu {
                       sound-dai = <&i2s_dai>;
                 };
                 dailink0_slave: simple-audio-card,codec {
                       sound-dai = <&wm8960>;
                         clocks = <&wm8960_mclk>;
                         clock-names = "mclk";
                 };
         };
       wm8960_mclk: wm8960_mclk {
                 compatible = "fixed-clock";
                 #clock-cells = <0>;
                 clock-frequency = <12288000>;
         };
   1164,1170d1128
       wm8960: wm8960 {
               #sound-dai-cells = <0>;
               compatible = "wlf,wm8960";
               reg = <0x1a>;

               wlf,shared-lrclk;
       };

Now in dmesg I have:

asoc-simple-card sound: ASoC: platform (null) not registered

I found solution for this error - add this:

simple-audio-card,plat {
sound-dai = <???????>;
};

But what write in sound-dai = <???????> ?