I2S INPUT on Khadas VIM2

Hi,

I use the Khadas VIM2 with both Buildroot Linux and Android.
Now I should implement I2S audio capture on VIM2.

I’ve found I2S_SDI, I2S_LRCK, I2S_MCLK and I2S_SCLK on gpio header which seems seems to be used for I2S INPUT.

So, I have some questions on the topic:

  1. Is I2S INPUT currently supported by VIM2 (i.e. with default DTS inside Buildroot/Android and drivers) or some additional modifications needed (if so can you please provide some info)?
  2. Is I2S INPUT (capture) supported by amlogic sound drivers?
  3. Is it possible (and how) to configure I2S INPUT either as slave or master?

Thanks in advance.

Hi, Manfred:
Yes, both VIMs support I2S input.

We have a project based on VIM1 with ALC5642 dual IIS, it works out, we haven’t tested on VIM2 but should be similar.

May I know your chipset model you choose?

Good day!

Hi, Gouwa.
It’s good to know that I2S is supported and works on VIMs.

We should implement I2S capture from Silabs DAB/FM receiver on VIM2 (we also have VIM1, so can test also there).
Is there any extension board based on ALC5642 available for VIM1? We can purchase it for evaluation.

Can you please also answer whether we need some modifications (inside DTS and/or drivers) to get I2S capture working?

Not yet, actually it’s a ODM project :slight_smile:

It’s Codec related source code, I think you should develop based on your codec.

It’s Codec related source code, I think you should develop based on your codec.

Our Silabs DAB/FM receiver I2S part is already implemented, i.e. we have I2S stream from it and can connect it to VIMs I2S pins.
The only thing I need is to activate I2S capture on VIM and capture audio via ALSA. So, seems, we need some dummy codec which only activates capture on amlogic (no need for communication with DAB/FM receiver, its already implemented).

So, the question is whether I2S audio capture possible with default DTS and drivers or some modifications needed for both?
Possibly you can share DTS part and/or some amlogic drivers patches needed to get I2S input working.

Thanks in advance.

@Terry please response

@Terry please response

Thanks.

Hi, mkotulla:
Sorry, we remembered it wrong, the ODM project with ALC5642 audo Codec, we didn’t use the I2S capture future, but now we already working on this, I think @Terry will update you some details in a few days.

have fun!

Hi guys.

Has anyone already reached some progress with I2S audio input on VIM2?

What pin can be used as I2S_IN_CH01?

Thanks.


You can use I2S_SDI(Pin33) as I2S_IN. And modify the dts file on source code. Have a try. Thanks.

diff --git a/arch/arm64/boot/dts/kvim2.dts b/arch/arm64/boot/dts/kvim2.dts
index 58f239c..0eab8dc 100644
--- a/arch/arm64/boot/dts/kvim2.dts
+++ b/arch/arm64/boot/dts/kvim2.dts
@@ -1200,8 +1200,9 @@
 &pinmux {
        audio_pins:audio_pin{
                amlogic,setmask=<6 0x7800000>;
-               amlogic,clrmask=<6 0x07e0000>;
-               amlogic,pins = "GPIOH_6","GPIOH_7","GPIOH_8","GPIOH_9";
+               amlogic,clrmask=<6 0x07e0000
+                               AO 0x50000>;
+               amlogic,pins = "GPIOH_6","GPIOH_7","GPIOH_8","GPIOH_9", "GPIOAO_6";
        };
 
        audio_spdif_pins:audio_pin1{

Hi.

Sorry, but how to set GPIOAO_6 pin (Pin33) as I2S_IN (i.e. to I2S_SDI function) ?

amlogic,clrmask=<6 0x07e0000
AO 0x50000>;

GPIOAO_6 comes as GPIO pin function by default.
And there is nothing for I2S_IN for that pin in datasheet (inside GPIO Bank AO Pin Multiplexing Table ).
There are only SPDIF_OUT (func3 - ao_reg[16]) and PWM_AO_B (func4 - ao_reg[18]) available.

So, are you sure that GPIOAO_6 becames I2S_IN (not a GPIO) when clrmask=AO 0x50000 (i.e. ao_reg[16] and ao_reg[18] are cleared) and nothing set?

You can have a try. I thinks GPIOAO_6 becames I2S_IN when clrmask=AO 0x50000.

Hi,

can this be enabled through an overlay or does it have to be configured at kernel compile time ?

Regards,

Hi,

i was working on using the same on the VIM1 given that the schematic shows GPIOAO_6 as I2S_IN but the S905X GPIO user guide does not show this functionnality on that pin. Is it a schematic error on Khadas side or in the Soc datasheet ?