PaulCreaser / rpi-i2s-audio

31 stars 68 forks source link

Modifying the overlay for I2S slave mode #3

Closed 98Matthias closed 2 weeks ago

98Matthias commented 4 months ago

By using the overlay I finally could use the RPi 5 as I2S master.

But I'm desperate about changing the overlay that the Pi acts as I2S slave. After every modification the driver is not loaded anymore.

98Matthias commented 2 weeks ago

Found the solution by myself. For this purpose the overlay must look like this:

// Definitions for the ugreen dabboard I2S /dts-v1/; /plugin/;

/ { compatible = "brcm,bcm2835";

fragment@0 {
    target = <&i2s_clk_consumer>;
    __overlay__ {
        status = "okay";
    };
};

fragment@1 {
    target-path = "/";
    __overlay__ {
        dmic_codec: dmic-codec {
            #sound-dai-cells = <0>;
            compatible = "dmic-codec";
            status = "okay";
        };
    };
};

fragment@2 {
    target = <&sound>;
    sound_overlay: __overlay__ {
        compatible = "simple-audio-card";
        simple-audio-card,format = "i2s";
        simple-audio-card,name = "mic";
        simple-audio-card,bitclock-master = <&dailink0_slave>;
        simple-audio-card,frame-master = <&dailink0_slave>;
        simple-audio-card,widgets = "Microphone", "Microphone Jack";
        status = "okay";
        simple-audio-card,cpu {
            sound-dai = <&i2s_clk_consumer>;
                        dai-tdm-slot-width = <32>;
                        dai-tdm-slot-num   = <2>;
        };
        dailink0_slave: simple-audio-card,codec {
            #sound-dai-cells = <0>;
            sound-dai = <&dmic_codec>;
        };

    };
};

__overrides__ {
    card-name = <&sound_overlay>,"simple-audio-card,name";
};

};