Firstly, the value of mode is confirmed in SSD201HWChecklistV6.xlsx according to which group of GPIO is used for I2S.If group PAD_SD is selected, the mode value is 3;If group PAD_GPIO0-3 is selected, the mode value is 1:

Then change the value of DTS Sound node i2S-padmux (equal to the value of mode) :

        sound {
            compatible = "sstar,audio";
//          reg = <0x1F000000 0x1000000>;
            interrupts=<GIC_SPI INT_IRQ_BACH IRQ_TYPE_LEVEL_HIGH>;
            playback-volume-level=<64>;    //0~94
           // micin-pregain-level=<1>;    //0~3
            micin-pregain-level=<0>;    //0~3
            micin-gain-level=<3>;    //0~7
            linein-gain-level=<2>;  //0~7
            amp-gpio = <PAD_FUART_RX 1>;
            clocks = <&CLK_upll_384m>;
           // playback-dma-buffer=<98304>; //512(ms)*48(kHz)*2(ch)*2(16bits)
           // capture-dma-buffer=<122880>; //640(ms)*48(kHz)*2(ch)*2(16bits)
            digmic-padmux = <2>;
            i2s-padmux = <1>;
            keep-i2s-clk = <0>;
            status = "ok";

Then you need to configure this set of GPIOs to I2S mode:

    <PAD_GPIO0          PINMUX_FOR_I2s_MODE_1      MDRV_PUSE_I2s_WCK >,
    <PAD_GPIO1          PINMUX_FOR_I2s_MODE_1      MDRV_PUSE_I2s_BCK >,
    <PAD_GPIO2          PINMUX_FOR_I2s_MODE_1      MDRV_PUSE_I2s_SDI >,
    <PAD_GPIO3          PINMUX_FOR_I2s_MODE_1      MDRV_PUSE_I2s_SDO >,

After this configuration, as with AMIC/DMIC, use the audio_all_test_case program to test:

./audio_all_test_case -t 20 -I -o /tmp -d 2 -m 0 -c 2 -s 48000

Chn0_I2SRx_48K_16bit_MONO.wav and Chn1_I2SRx_48K_16bit_MONO.wav will be generated in the /tmp/ directory.If there is a LineOut interface, you can directly play the recording file and judge whether the recording is successful.

文档更新时间: 2021-03-18 10:57   作者:Aeeditor